Loading...
HF多模态

cointegrated/LaBSE-en-ru

LaBSE for English and Russi...

标签:


LaBSE for English and Russian

This is a truncated version of sentence-transformers/LaBSE, which is, in turn, a port of LaBSE by Google.

The current model has only English and Russian tokens left in the vocabulary.
Thus, the vocabulary is 10% of the original, and number of parameters in the whole model is 27% of the original, without any loss in the quality of English and Russian embeddings.

To get the sentence embeddings, you can use the following code:

import torch
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("cointegrated/LaBSE-en-ru")
model = AutoModel.from_pretrained("cointegrated/LaBSE-en-ru")
sentences = ["Hello World", "Привет Мир"]
encoded_input = tokenizer(sentences, padding=True, truncation=True, max_length=64, return_tensors='pt')
with torch.no_grad():
    model_output = model(**encoded_input)
embeddings = model_output.pooler_output
embeddings = torch.nn.functional.normalize(embeddings)
print(embeddings)

The model has been truncated in this notebook.
You can adapt it for other languages (like EIStakovskii/LaBSE-fr-de), models or datasets.


Reference:

Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Narveen Ari, Wei Wang. Language-agnostic BERT Sentence Embedding. July 2020

License: https://tfhub.dev/google/LaBSE/1

数据统计

数据评估

cointegrated/LaBSE-en-ru浏览人数已经达到244,如你需要查询该站的相关权重信息,可以点击"5118数据""爱站数据""Chinaz数据"进入;以目前的网站数据参考,建议大家请以爱站数据为准,更多网站价值评估因素如:cointegrated/LaBSE-en-ru的访问速度、搜索引擎收录以及索引量、用户体验等;当然要评估一个站的价值,最主要还是需要根据您自身的需求以及需要,一些确切的数据则需要找cointegrated/LaBSE-en-ru的站长进行洽谈提供。如该站的IP、PV、跳出率等!

关于cointegrated/LaBSE-en-ru特别声明

本站Ai导航提供的cointegrated/LaBSE-en-ru都来源于网络,不保证外部链接的准确性和完整性,同时,对于该外部链接的指向,不由Ai导航实际控制,在2023年5月9日 下午7:11收录时,该网页上的内容,都属于合规合法,后期网页的内容如出现违规,可以直接联系网站管理员进行删除,Ai导航不承担任何责任。

相关导航

暂无评论

暂无评论...