🚀 distiluse-base-multilingual-cased-v2のONNX変換
sentence-transformers/distiluse-base-multilingual-cased-v2 モデルをONNX形式に変換したものです。文章や段落を512次元の密ベクトル空間にマッピングし、クラスタリングや意味検索などのタスクに使用できます。
🚀 クイックスタート
このモデルは、文章や段落を512次元の密ベクトル空間にマッピングし、クラスタリングや意味検索などのタスクに使用できます。このカスタムモデルは、元の sentence-transformer の実装と同様に last_hidden_state
を出力します。
✨ 主な機能
- 文章や段落を512次元の密ベクトル空間にマッピングします。
- クラスタリングや意味検索などのタスクに使用できます。
- カスタムモデルは、元の sentence-transformer の実装と同様に
last_hidden_state
を出力します。
📦 インストール
optimum をインストールすると、このモデルを簡単に使用できます。
python -m pip install optimum
以下のパッケージも必要になる場合があります。
python -m pip install onnxruntime
python -m pip install onnx
💻 使用例
基本的な使用法
from optimum.onnxruntime.modeling_ort import ORTModelForCustomTasks
model = ORTModelForCustomTasks.from_pretrained("lorenpe2/distiluse-base-multilingual-cased-v2")
tokenizer = AutoTokenizer.from_pretrained("lorenpe2/distiluse-base-multilingual-cased-v2")
inputs = tokenizer("I love burritos!", return_tensors="pt")
pred = model(**inputs)
高度な使用法
from transformers import pipeline
onnx_extractor = pipeline("feature-extraction", model=model, tokenizer=tokenizer)
text = "I love burritos!"
pred = onnx_extractor(text)
📚 ドキュメント
評価結果
このモデルの自動評価については、Sentence Embeddings Benchmark を参照してください: https://seb.sbert.net
モデルの全アーキテクチャ
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: DistilBertModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
(2): Dense({'in_features': 768, 'out_features': 512, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
)
引用と著者
このモデルは sentence-transformers によって学習されました。
このモデルが役に立った場合は、以下の論文を引用してください Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks:
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "http://arxiv.org/abs/1908.10084",
}
📄 ライセンス
このモデルは Apache-2.0 ライセンスの下で提供されています。
属性 |
详情 |
パイプラインタグ |
文章の類似度 |
言語 |
多言語 |
ライセンス |
Apache-2.0 |
タグ |
sentence-transformers、feature-extraction、sentence-similarity、transformers |