🚀 TeluguSBERT
このモデルは、NLIデータセットで学習されたTeluguBERTモデル(l3cube - pune/telugu - bert)です。
プロジェクトMahaNLPの一部として公開されています: https://github.com/l3cube - pune/MarathiNLP
主要なインド言語をサポートし、クロスリンガル機能を持つこのモデルの多言語バージョンはこちらで共有されています indic - sentence - bert - nli
より良い文類似度モデル(このモデルのファインチューニング版)はこちらで共有されています: https://huggingface.co/l3cube - pune/telugu - sentence - similarity - sbert
データセット、モデル、およびベースライン結果の詳細は、当社の[論文] (https://arxiv.org/abs/2304.11434) で確認できます。
🚀 クイックスタート
このモデルを使用するには、次の手順に従ってください。
インストール
sentence - transformers をインストールすると、このモデルの使用が簡単になります。
pip install -U sentence-transformers
使用方法
💻 使用例
基本的な使用法
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('{MODEL_NAME}')
embeddings = model.encode(sentences)
print(embeddings)
高度な使用法
sentence - transformers を使用せずに、このモデルを使用することもできます。まず、入力をTransformerモデルに通し、その後、文脈化された単語埋め込みに適切なプーリング操作を適用する必要があります。
from transformers import AutoTokenizer, AutoModel
import torch
def cls_pooling(model_output, attention_mask):
return model_output[0][:,0]
sentences = ['This is an example sentence', 'Each sentence is converted']
tokenizer = AutoTokenizer.from_pretrained('{MODEL_NAME}')
model = AutoModel.from_pretrained('{MODEL_NAME}')
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
with torch.no_grad():
model_output = model(**encoded_input)
sentence_embeddings = cls_pooling(model_output, encoded_input['attention_mask'])
print("Sentence embeddings:")
print(sentence_embeddings)
📄 ライセンス
このモデルは、cc - by - 4.0ライセンスの下で公開されています。
引用
@article{deode2023l3cube,
title={L3Cube-IndicSBERT: A simple approach for learning cross-lingual sentence representations using multilingual BERT},
author={Deode, Samruddhi and Gadre, Janhavi and Kajale, Aditi and Joshi, Ananya and Joshi, Raviraj},
journal={arXiv preprint arXiv:2304.11434},
year={2023}
}
@article{joshi2022l3cubemahasbert,
title={L3Cube-MahaSBERT and HindSBERT: Sentence BERT Models and Benchmarking BERT Sentence Representations for Hindi and Marathi},
author={Joshi, Ananya and Kajale, Aditi and Gadre, Janhavi and Deode, Samruddhi and Joshi, Raviraj},
journal={arXiv preprint arXiv:2211.11187},
year={2022}
}
関連リンク
その他の単言語Indic文BERTモデル
その他の単言語類似度モデル