🚀 MahaSBERT
MahaSBERTは、NLIデータセットで学習されたMahaBERTモデル(l3cube - pune/marathi - bert - v2)です。
これは、MahaNLPプロジェクトの一部として公開されています: https://github.com/l3cube - pune/MarathiNLP
主要なインド諸言語をサポートし、クロス言語機能を持つこのモデルの多言語バージョンはこちらに公開されています indic - sentence - bert - nli
より良い文の類似性モデル(このモデルのファインチューニング版)はこちらに公開されています: https://huggingface.co/l3cube - pune/marathi - sentence - similarity - sbert
データセット、モデル、およびベースラインの結果に関する詳細は、当社の[論文] (https://arxiv.org/abs/2211.11187) で確認できます。
@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}
}
単言語インドSBERT論文
多言語インドSBERT論文
他の単言語インド文BERTモデルは以下の通りです:
マラーティ語SBERT
ヒンディー語SBERT
カンナダ語SBERT
テルグ語SBERT
マラヤーラム語SBERT
タミル語SBERT
グジャラート語SBERT
オリヤー語SBERT
ベンガル語SBERT
パンジャブ語SBERT
インド語SBERT(多言語)
他の単言語類似性モデルは以下の通りです:
マラーティ語類似性
ヒンディー語類似性
カンナダ語類似性
テルグ語類似性
マラヤーラム語類似性
タミル語類似性
グジャラート語類似性
オリヤー語類似性
ベンガル語類似性
パンジャブ語類似性
インド語類似性(多言語)
これはsentence - transformersモデルです。文や段落を768次元の密ベクトル空間にマッピングし、クラスタリングや意味検索などのタスクに使用できます。
🚀 クイックスタート
このモデルは、文や段落を768次元の密ベクトル空間にマッピングし、クラスタリングや意味検索などのタスクに使用できます。以下に、このモデルの使用方法を紹介します。
✨ 主な機能
- NLIデータセットで学習されたMahaBERTモデル。
- 文や段落を768次元の密ベクトル空間にマッピング。
- クラスタリングや意味検索などのタスクに使用可能。
- 多言語バージョンも提供されている。
📦 インストール
sentence - transformersをインストールすることで、このモデルを簡単に使用できます。
pip install -U sentence-transformers
💻 使用例
基本的な使用法
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ライセンスの下で公開されています。