ai-forever / ruElectra-medium

huggingface.co
Total runs: 159
24-hour runs: 0
7-day runs: -15
30-day runs: 92
Model's Last Updated: November 03 2023

Introduction of ruElectra-medium

Model Details of ruElectra-medium

RU-ELECTRA medium model for Embeddings in Russian language.

The model architecture design, pretraining, and evaluation are documented in our preprint: A Family of Pretrained Transformer Language Models for Russian .

For better quality, use mean token embeddings.

Usage (HuggingFace Models Repository)

You can use the model directly from the model repository to compute sentence embeddings:

from transformers import AutoTokenizer, AutoModel
import torch
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] #First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    sum_embeddings = torch.sum(token_embeddings * input_mask_expanded, 1)
    sum_mask = torch.clamp(input_mask_expanded.sum(1), min=1e-10)
    return sum_embeddings / sum_mask
#Sentences we want sentence embeddings for
sentences = ['Привет! Как твои дела?',
             'А правда, что 42 твое любимое число?']
#Load AutoModel from huggingface model repository
tokenizer = AutoTokenizer.from_pretrained("sberbank-ai/ruElectra-medium")
model = AutoModel.from_pretrained("sberbank-ai/ruElectra-medium")
#Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, max_length=24, return_tensors='pt')
#Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)
#Perform pooling. In this case, mean pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])

Authors

Cite us

@misc{zmitrovich2023family,
      title={A Family of Pretrained Transformer Language Models for Russian}, 
      author={Dmitry Zmitrovich and Alexander Abramov and Andrey Kalmykov and Maria Tikhonova and Ekaterina Taktasheva and Danil Astafurov and Mark Baushenko and Artem Snegirev and Tatiana Shavrina and Sergey Markov and Vladislav Mikhailov and Alena Fenogenova},
      year={2023},
      eprint={2309.10931},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Runs of ai-forever ruElectra-medium on huggingface.co

159
Total runs
0
24-hour runs
-22
3-day runs
-15
7-day runs
92
30-day runs

More Information About ruElectra-medium huggingface.co Model

More ruElectra-medium license Visit here:

https://choosealicense.com/licenses/mit

ruElectra-medium huggingface.co

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

ruElectra-medium huggingface.co Url

https://huggingface.co/ai-forever/ruElectra-medium

ai-forever ruElectra-medium online free

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

ai-forever ruElectra-medium online free url in huggingface.co:

https://huggingface.co/ai-forever/ruElectra-medium

ruElectra-medium install

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

ruElectra-medium install url in huggingface.co:

https://huggingface.co/ai-forever/ruElectra-medium

Url of ruElectra-medium

ruElectra-medium huggingface.co Url

Provider of ruElectra-medium huggingface.co

ai-forever
ORGANIZATIONS

Other API from ai-forever

huggingface.co

Total runs: 87.0K
Run Growth: -24.8K
Growth Rate: -30.82%
Updated:August 12 2026
huggingface.co

Total runs: 5.4K
Run Growth: -7.1K
Growth Rate: -132.43%
Updated:December 05 2023
huggingface.co

Total runs: 3.8K
Run Growth: 2.0K
Growth Rate: 51.65%
Updated:December 12 2023
huggingface.co

Total runs: 1.4K
Run Growth: 797
Growth Rate: 56.73%
Updated:December 28 2023
huggingface.co

Total runs: 830
Run Growth: 625
Growth Rate: 75.30%
Updated:January 26 2023
huggingface.co

Total runs: 783
Run Growth: 347
Growth Rate: 44.32%
Updated:December 05 2023
huggingface.co

Total runs: 372
Run Growth: 364
Growth Rate: 99.18%
Updated:September 18 2026
huggingface.co

Total runs: 321
Run Growth: 314
Growth Rate: 99.37%
Updated:September 18 2026
huggingface.co

Total runs: 320
Run Growth: 313
Growth Rate: 100.00%
Updated:September 18 2026
huggingface.co

Total runs: 88
Run Growth: 84
Growth Rate: 100.00%
Updated:September 17 2026