CoolFace
Modelpublic

google/electra-large-generator

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
9likes855downloads
README.md32 linesDownload Raw Back to root
1---2language: en3thumbnail: https://huggingface.co/front/thumbnails/google.png4 5license: apache-2.06---7 8## ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators9 10**ELECTRA** is a new method for self-supervised language representation learning. It can be used to pre-train transformer networks using relatively little compute. ELECTRA models are trained to distinguish "real" input tokens vs "fake" input tokens generated by another neural network, similar to the discriminator of a [GAN](https://arxiv.org/pdf/1406.2661.pdf). At small scale, ELECTRA achieves strong results even when trained on a single GPU. At large scale, ELECTRA achieves state-of-the-art results on the [SQuAD 2.0](https://rajpurkar.github.io/SQuAD-explorer/) dataset.11 12For a detailed description and experimental results, please refer to our paper [ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators](https://openreview.net/pdf?id=r1xMH1BtvB).13 14This repository contains code to pre-train ELECTRA, including small ELECTRA models on a single GPU. It also supports fine-tuning ELECTRA on downstream tasks including classification tasks (e.g,. [GLUE](https://gluebenchmark.com/)), QA tasks (e.g., [SQuAD](https://rajpurkar.github.io/SQuAD-explorer/)), and sequence tagging tasks (e.g., [text chunking](https://www.clips.uantwerpen.be/conll2000/chunking/)).15 16## How to use the generator in `transformers`17 18```python19from transformers import pipeline20 21fill_mask = pipeline(22	"fill-mask",23	model="google/electra-large-generator",24	tokenizer="google/electra-large-generator"25)26 27print(28	fill_mask(f"HuggingFace is creating a {nlp.tokenizer.mask_token} that the community uses to solve NLP tasks.")29)30 31```32