google / electra-small-discriminator

huggingface.co
Total runs: 222.9K
24-hour runs: 0
7-day runs: -13.9K
30-day runs: 22.4K
Model's Last Updated: February 29 2024

Introduction of electra-small-discriminator

Model Details of electra-small-discriminator

ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators

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 . 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 dataset.

For a detailed description and experimental results, please refer to our paper ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators .

This 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 ), QA tasks (e.g., SQuAD ), and sequence tagging tasks (e.g., text chunking ).

How to use the discriminator in transformers
from transformers import ElectraForPreTraining, ElectraTokenizerFast
import torch

discriminator = ElectraForPreTraining.from_pretrained("google/electra-small-discriminator")
tokenizer = ElectraTokenizerFast.from_pretrained("google/electra-small-discriminator")

sentence = "The quick brown fox jumps over the lazy dog"
fake_sentence = "The quick brown fox fake over the lazy dog"

fake_tokens = tokenizer.tokenize(fake_sentence)
fake_inputs = tokenizer.encode(fake_sentence, return_tensors="pt")
discriminator_outputs = discriminator(fake_inputs)
predictions = torch.round((torch.sign(discriminator_outputs[0]) + 1) / 2)

[print("%7s" % token, end="") for token in fake_tokens]

[print("%7s" % int(prediction), end="") for prediction in predictions.squeeze().tolist()]

Runs of google electra-small-discriminator on huggingface.co

222.9K
Total runs
0
24-hour runs
-1.3K
3-day runs
-13.9K
7-day runs
22.4K
30-day runs

More Information About electra-small-discriminator huggingface.co Model

More electra-small-discriminator license Visit here:

https://choosealicense.com/licenses/apache-2.0

electra-small-discriminator huggingface.co

electra-small-discriminator huggingface.co is an AI model on huggingface.co that provides electra-small-discriminator's model effect (), which can be used instantly with this google electra-small-discriminator model. huggingface.co supports a free trial of the electra-small-discriminator model, and also provides paid use of the electra-small-discriminator. Support call electra-small-discriminator model through api, including Node.js, Python, http.

electra-small-discriminator huggingface.co Url

https://huggingface.co/google/electra-small-discriminator

google electra-small-discriminator online free

electra-small-discriminator huggingface.co is an online trial and call api platform, which integrates electra-small-discriminator's modeling effects, including api services, and provides a free online trial of electra-small-discriminator, you can try electra-small-discriminator online for free by clicking the link below.

google electra-small-discriminator online free url in huggingface.co:

https://huggingface.co/google/electra-small-discriminator

electra-small-discriminator install

electra-small-discriminator is an open source model from GitHub that offers a free installation service, and any user can find electra-small-discriminator on GitHub to install. At the same time, huggingface.co provides the effect of electra-small-discriminator install, users can directly use electra-small-discriminator installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

electra-small-discriminator install url in huggingface.co:

https://huggingface.co/google/electra-small-discriminator

Url of electra-small-discriminator

electra-small-discriminator huggingface.co Url

Provider of electra-small-discriminator huggingface.co

google
ORGANIZATIONS

Other API from google

huggingface.co

Total runs: 9.9M
Run Growth: -2.2M
Growth Rate: -22.30%
Updated:July 21 2026
huggingface.co

Total runs: 5.1M
Run Growth: 1.3M
Growth Rate: 24.04%
Updated:April 04 2025
huggingface.co

Total runs: 4.9M
Run Growth: -793.2K
Growth Rate: -15.92%
Updated:July 21 2026
huggingface.co

Total runs: 1.9M
Run Growth: -522.6K
Growth Rate: -24.43%
Updated:August 14 2025
huggingface.co

Total runs: 1.7M
Run Growth: -39.0K
Growth Rate: -2.32%
Updated:July 17 2023
huggingface.co

Total runs: 1.4M
Run Growth: -883.6K
Growth Rate: -60.87%
Updated:March 22 2025
huggingface.co

Total runs: 1.2M
Run Growth: -152.6K
Growth Rate: -12.62%
Updated:March 22 2025
huggingface.co

Total runs: 845.8K
Run Growth: -8.8K
Growth Rate: -1.04%
Updated:March 22 2025
huggingface.co

Total runs: 694.4K
Run Growth: -119.7K
Growth Rate: -17.15%
Updated:July 16 2026
huggingface.co

Total runs: 670.0K
Run Growth: 81.5K
Growth Rate: 12.38%
Updated:August 28 2024
huggingface.co

Total runs: 585.4K
Run Growth: -291.4K
Growth Rate: -46.83%
Updated:October 11 2023
huggingface.co

Total runs: 566.5K
Run Growth: -464.3K
Growth Rate: -78.12%
Updated:July 16 2026
huggingface.co

Total runs: 557.9K
Run Growth: -375.5K
Growth Rate: -66.83%
Updated:February 29 2024
huggingface.co

Total runs: 484.4K
Run Growth: -15.8K
Growth Rate: -3.25%
Updated:July 17 2023
huggingface.co

Total runs: 430.9K
Run Growth: 139.1K
Growth Rate: 32.41%
Updated:August 28 2024
huggingface.co

Total runs: 330.5K
Run Growth: 24.5K
Growth Rate: 7.78%
Updated:September 18 2023
huggingface.co

Total runs: 319.7K
Run Growth: 14.4K
Growth Rate: 4.38%
Updated:January 25 2023
huggingface.co

Total runs: 313.5K
Run Growth: 18.5K
Growth Rate: 6.10%
Updated:October 29 2025
huggingface.co

Total runs: 278.4K
Run Growth: -197.5K
Growth Rate: -73.67%
Updated:July 16 2026
huggingface.co

Total runs: 262.1K
Run Growth: -29.8K
Growth Rate: -11.21%
Updated:August 08 2024
huggingface.co

Total runs: 233.3K
Run Growth: 61.9K
Growth Rate: 26.02%
Updated:November 27 2023
huggingface.co

Total runs: 229.8K
Run Growth: -422.1K
Growth Rate: -196.72%
Updated:April 29 2024
huggingface.co

Total runs: 228.5K
Run Growth: -87.8K
Growth Rate: -38.41%
Updated:January 25 2023
huggingface.co

Total runs: 223.6K
Run Growth: -966.6K
Growth Rate: -378.30%
Updated:August 14 2025
huggingface.co

Total runs: 216.2K
Run Growth: 9.9K
Growth Rate: 4.41%
Updated:May 27 2026
huggingface.co

Total runs: 178.0K
Run Growth: 21.5K
Growth Rate: 12.35%
Updated:July 03 2023
huggingface.co

Total runs: 164.0K
Run Growth: 143.5K
Growth Rate: 87.50%
Updated:July 28 2026
huggingface.co

Total runs: 158.6K
Run Growth: -59.0K
Growth Rate: -37.20%
Updated:January 25 2023
huggingface.co

Total runs: 148.0K
Run Growth: -16.4K
Growth Rate: -10.83%
Updated:November 28 2023
huggingface.co

Total runs: 115.3K
Run Growth: -109.5K
Growth Rate: -89.65%
Updated:January 25 2023
huggingface.co

Total runs: 112.5K
Run Growth: 53.6K
Growth Rate: 47.01%
Updated:August 28 2024
huggingface.co

Total runs: 101.5K
Run Growth: -201.3K
Growth Rate: -194.34%
Updated:July 16 2026
huggingface.co

Total runs: 100.7K
Run Growth: 22.0K
Growth Rate: 21.82%
Updated:September 27 2024
huggingface.co

Total runs: 96.8K
Run Growth: -9.7K
Growth Rate: -10.14%
Updated:September 27 2024
huggingface.co

Total runs: 92.9K
Run Growth: -256.6K
Growth Rate: -323.49%
Updated:July 10 2025
huggingface.co

Total runs: 84.9K
Run Growth: -17.9K
Growth Rate: -21.16%
Updated:May 27 2022
huggingface.co

Total runs: 81.1K
Run Growth: -31.2K
Growth Rate: -39.03%
Updated:July 16 2026
huggingface.co

Total runs: 78.4K
Run Growth: -811
Growth Rate: -1.02%
Updated:August 08 2024