ai-forever / sbert_large_nlu_ru

huggingface.co
Total runs: 1.4M
24-hour runs: 0
7-day runs: 4.0K
30-day runs: 436.8K
Model's Last Updated: Outubro 07 2024
feature-extraction

Introduction of sbert_large_nlu_ru

Model Details of sbert_large_nlu_ru

BERT large model (uncased) for Sentence Embeddings in Russian language.

The model is described in this article
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-9)
    return sum_embeddings / sum_mask



#Sentences we want sentence embeddings for
sentences = ['Привет! Как твои дела?',
             'А правда, что 42 твое любимое число?']

#Load AutoModel from huggingface model repository
tokenizer = AutoTokenizer.from_pretrained("ai-forever/sbert_large_nlu_ru")
model = AutoModel.from_pretrained("ai-forever/sbert_large_nlu_ru")

#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

Runs of ai-forever sbert_large_nlu_ru on huggingface.co

1.4M
Total runs
0
24-hour runs
12.5K
3-day runs
4.0K
7-day runs
436.8K
30-day runs

More Information About sbert_large_nlu_ru huggingface.co Model

sbert_large_nlu_ru huggingface.co

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

sbert_large_nlu_ru huggingface.co Url

https://huggingface.co/ai-forever/sbert_large_nlu_ru

ai-forever sbert_large_nlu_ru online free

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

ai-forever sbert_large_nlu_ru online free url in huggingface.co:

https://huggingface.co/ai-forever/sbert_large_nlu_ru

sbert_large_nlu_ru install

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

sbert_large_nlu_ru install url in huggingface.co:

https://huggingface.co/ai-forever/sbert_large_nlu_ru

Url of sbert_large_nlu_ru

sbert_large_nlu_ru huggingface.co Url

Provider of sbert_large_nlu_ru huggingface.co

ai-forever
ORGANIZATIONS

Other API from ai-forever

huggingface.co

Total runs: 525.5K
Run Growth: 507.4K
Growth Rate: 96.56%
Updated: Novembro 03 2023
huggingface.co

Total runs: 10.6K
Run Growth: 1.5K
Growth Rate: 13.75%
Updated: Dezembro 05 2023
huggingface.co

Total runs: 8.2K
Run Growth: 5.1K
Growth Rate: 59.45%
Updated: Dezembro 29 2024
huggingface.co

Total runs: 5.9K
Run Growth: 3.5K
Growth Rate: 60.26%
Updated: Dezembro 11 2023
huggingface.co

Total runs: 2.3K
Run Growth: -408
Growth Rate: -17.86%
Updated: Dezembro 05 2023
huggingface.co

Total runs: 1.3K
Run Growth: -6.3K
Growth Rate: -493.39%
Updated: Dezembro 05 2023
huggingface.co

Total runs: 315
Run Growth: 158
Growth Rate: 50.16%
Updated: Janeiro 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: Dezembro 24 2021
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: Junho 08 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: Setembro 21 2021