Longformer Base 4096 Sentence Transformers All Nli Stsb Quora Nq
これは、allenai/longformer-base-4096を微調整したsentence-transformersモデルで、文章や段落の768次元の密集ベクトル表現を生成するために使用され、意味的テキスト類似度、意味的検索などのタスクに適しています。
ダウンロード数 45
リリース時間 : 4/25/2025
モデル概要
このモデルは、文章や段落を768次元の密集ベクトル空間にマッピングし、意味的テキスト類似度、意味的検索、复述マイニング、テキスト分類、クラスタリングなどのタスクに使用できます。
モデル特徴
長文処理能力
Longformerアーキテクチャに基づいており、最大4098トークンのシーケンス長をサポートし、長い文書や段落の処理に適しています。
多タスク訓練
複数のデータセット(all-nli、stsb、quora、natural-questions)で連合訓練を行い、モデルの汎化能力を強化しました。
多損失関数最適化
MultipleNegativesRankingLoss、SoftmaxLoss、CoSENTLossなどの複数の損失関数を使用して最適化を行い、異なるタスクでの性能を向上させます。
モデル能力
意味的テキスト類似度計算
意味的検索
复述マイニング
テキスト分類
テキストクラスタリング
特徴抽出
使用事例
情報検索
類似質問のマッチング
質問応答システムで、ユーザーの質問と意味的に類似した質問を検索する
Quoraなどのプラットフォーム上の重複質問を正確にマッチングできます。
コンテンツ推薦
関連コンテンツの推薦
コンテンツの類似度に基づいて記事や製品を推薦する
ユーザーの関与度と転換率を向上させることができます。
テキスト分析
テキストクラスタリング
大量の文書を意味的類似度に基づいてグループ化する
トピックモデリングや文書組織化に使用できます。
🚀 allenai/longformer-base-4096に基づくSentenceTransformer
このモデルは、allenai/longformer-base-4096 を all-nli-pair、all-nli-pair-class、all-nli-pair-score、all-nli-triplet、stsb、quora、natural-questions のデータセットでファインチューニングした sentence-transformers モデルです。文章や段落を768次元の密ベクトル空間にマッピングし、意味的な文章の類似性、意味的な検索、言い換えのマイニング、文章分類、クラスタリングなどに使用できます。
📚 ドキュメント
モデルの詳細
モデルの説明
属性 | 詳情 |
---|---|
モデルタイプ | Sentence Transformer |
ベースモデル | allenai/longformer-base-4096 |
最大シーケンス長 | 4098トークン |
出力次元数 | 768トークン |
類似度関数 | コサイン類似度 |
学習データセット | all-nli-pair、all-nli-pair-class、all-nli-pair-score、all-nli-triplet、stsb、quora、natural-questions |
言語 | en |
モデルのソース
- ドキュメント:Sentence Transformers Documentation
- リポジトリ:Sentence Transformers on GitHub
- Hugging Face:Sentence Transformers on Hugging Face
完全なモデルアーキテクチャ
SentenceTransformer(
(0): Transformer({'max_seq_length': 4098, 'do_lower_case': False}) with Transformer model: LongformerModel
(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, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
💻 使用例
基本的な使用法
まず、Sentence Transformersライブラリをインストールします。
pip install -U sentence-transformers
次に、このモデルをロードして推論を実行できます。
from sentence_transformers import SentenceTransformer
# 🤗 Hubからダウンロード
model = SentenceTransformer("Leo1212/longformer-base-4096-sentence-transformers-all-nli-stsb-quora-nq")
# 推論を実行
sentences = [
'How do I attract a girl?',
'How can I attract girls?',
"Why isn't my iPhone 5 charging?",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# 埋め込みベクトルの類似度スコアを取得
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
🔧 技術詳細
学習データセット
all-nli-pair
- データセット:all-nli-pair at d482672
- サイズ:10,000個の学習サンプル
- 列:
anchor
とpositive
- 最初の1000サンプルに基づく近似統計:
| | anchor | positive |
|---------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| タイプ | string | string |
| 詳細 |
- 最小: 5トークン
- 平均: 17.06トークン
- 最大: 64トークン
- 最小: 5トークン
- 平均: 9.64トークン
- 最大: 31トークン
- サンプル:
| anchor | positive |
|----------------------------------------------------------------------------|--------------------------------------------------|
|
A person on a horse jumps over a broken down airplane.
|A person is outdoors, on a horse.
| |Children smiling and waving at camera
|There are children present
| |A boy is jumping on skateboard in the middle of a red bridge.
|The boy does a skateboarding trick.
| - 損失関数:
MultipleNegativesRankingLoss
パラメータは以下の通り:
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
all-nli-pair-class
- データセット:all-nli-pair-class at d482672
- サイズ:10,000個の学習サンプル
- 列:
premise
、hypothesis
、およびlabel
- 最初の1000サンプルに基づく近似統計:
| | premise | hypothesis | label |
|---------|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|--------------------------------------------------------------------|
| タイプ | string | string | int |
| 詳細 |
- 最小: 6トークン
- 平均: 17.4トークン
- 最大: 50トークン
- 最小: 5トークン
- 平均: 10.69トークン
- 最大: 31トークン
- 0: ~33.40%
- 1: ~33.30%
- 2: ~33.30%
- サンプル:
| premise | hypothesis | label |
|---------------------------------------------------------------------|----------------------------------------------------------------|----------------|
|
A person on a horse jumps over a broken down airplane.
|A person is training his horse for a competition.
|1
| |A person on a horse jumps over a broken down airplane.
|A person is at a diner, ordering an omelette.
|2
| |A person on a horse jumps over a broken down airplane.
|A person is outdoors, on a horse.
|0
| - 損失関数:
SoftmaxLoss
all-nli-pair-score
- データセット:all-nli-pair-score at d482672
- サイズ:10,000個の学習サンプル
- 列:
sentence1
、sentence2
、およびscore
- 最初の1000サンプルに基づく近似統計:
| | sentence1 | sentence2 | score |
|---------|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------|
| タイプ | string | string | float |
| 詳細 |
- 最小: 6トークン
- 平均: 17.4トークン
- 最大: 50トークン
- 最小: 5トークン
- 平均: 10.69トークン
- 最大: 31トークン
- 最小: 0.0
- 平均: 0.5
- 最大: 1.0
- サンプル:
| sentence1 | sentence2 | score |
|---------------------------------------------------------------------|---------------------------------------------------------------|------------------|
|
A person on a horse jumps over a broken down airplane.
|A person is training his horse for a competition.
|0.5
| |A person on a horse jumps over a broken down airplane.
|A person is at a diner, ordering an omelette.
|0.0
| |A person on a horse jumps over a broken down airplane.
|A person is outdoors, on a horse.
|1.0
| - 損失関数:
CoSENTLoss
パラメータは以下の通り:
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
all-nli-triplet
- データセット:all-nli-triplet at d482672
- サイズ:10,000個の学習サンプル
- 列:
anchor
、positive
、およびnegative
- 最初の1000サンプルに基づく近似統計:
| | anchor | positive | negative |
|---------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| タイプ | string | string | string |
| 詳細 |
- 最小: 7トークン
- 平均: 10.38トークン
- 最大: 45トークン
- 最小: 6トークン
- 平均: 12.8トークン
- 最大: 39トークン
- 最小: 6トークン
- 平均: 13.4トークン
- 最大: 50トークン
- サンプル:
| anchor | positive | negative |
|----------------------------------------------------------------------------|--------------------------------------------------|------------------------------------------------------------|
|
A person on a horse jumps over a broken down airplane.
|A person is outdoors, on a horse.
|A person is at a diner, ordering an omelette.
| |Children smiling and waving at camera
|There are children present
|The kids are frowning
| |A boy is jumping on skateboard in the middle of a red bridge.
|The boy does a skateboarding trick.
|The boy skates down the sidewalk.
| - 損失関数:
MultipleNegativesRankingLoss
パラメータは以下の通り:
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
stsb
- データセット:stsb at ab7a5ac
- サイズ:5,749個の学習サンプル
- 列:
sentence1
、sentence2
、およびscore
- 最初の1000サンプルに基づく近似統計:
| | sentence1 | sentence2 | score |
|---------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|----------------------------------------------------------------|
| タイプ | string | string | float |
| 詳細 |
- 最小: 6トークン
- 平均: 10.02トークン
- 最大: 28トークン
- 最小: 6トークン
- 平均: 9.96トークン
- 最大: 25トークン
- 最小: 0.0
- 平均: 0.54
- 最大: 1.0
- サンプル:
| sentence1 | sentence2 | score |
|------------------------------------------------------------|-----------------------------------------------------------------------|-------------------|
|
A plane is taking off.
|An air plane is taking off.
|1.0
| |A man is playing a large flute.
|A man is playing a flute.
|0.76
| |A man is spreading shreded cheese on a pizza.
|A man is spreading shredded cheese on an uncooked pizza.
|0.76
| - 損失関数:
CoSENTLoss
パラメータは以下の通り:
{
"scale": 20.0,
"similarity_fct": "pairwise_cos_sim"
}
quora
- データセット:quora at 451a485
- サイズ:10,000個の学習サンプル
- 列:
anchor
とpositive
- 最初の1000サンプルに基づく近似統計:
| | anchor | positive |
|---------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| タイプ | string | string |
| 詳細 |
- 最小: 6トークン
- 平均: 13.74トークン
- 最大: 43トークン
- 最小: 6トークン
- 平均: 13.91トークン
- 最大: 44トークン
- サンプル:
| anchor | positive |
|-----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
Astrology: I am a Capricorn Sun Cap moon and cap rising...what does that say about me?
|I'm a triple Capricorn (Sun, Moon and ascendant in Capricorn) What does this say about me?
| |How can I be a good geologist?
|What should I do to be a great geologist?
| |How do I read and find my YouTube comments?
| (原文で未完了だったため、そのまま) |
Jina Embeddings V3
Jina Embeddings V3 は100以上の言語をサポートする多言語文埋め込みモデルで、文の類似度と特徴抽出タスクに特化しています。
テキスト埋め込み
Transformers 複数言語対応

J
jinaai
3.7M
911
Ms Marco MiniLM L6 V2
Apache-2.0
MS Marcoパッセージランキングタスクで訓練されたクロスエンコーダモデル、情報検索におけるクエリ-パッセージ関連性スコアリング用
テキスト埋め込み 英語
M
cross-encoder
2.5M
86
Opensearch Neural Sparse Encoding Doc V2 Distill
Apache-2.0
蒸留技術に基づくスパース検索モデルで、OpenSearch向けに最適化されており、推論不要のドキュメントエンコーディングをサポートし、検索関連性と効率性においてV1版を上回ります
テキスト埋め込み
Transformers 英語

O
opensearch-project
1.8M
7
Sapbert From PubMedBERT Fulltext
Apache-2.0
PubMedBERTに基づく生物医学エンティティ表現モデルで、自己アライメント事前学習により意味関係の捕捉を最適化します。
テキスト埋め込み 英語
S
cambridgeltl
1.7M
49
Gte Large
MIT
GTE-Largeは強力なセンテンストランスフォーマーモデルで、文の類似度とテキスト埋め込みタスクに特化しており、複数のベンチマークテストで優れた性能を発揮します。
テキスト埋め込み 英語
G
thenlper
1.5M
278
Gte Base En V1.5
Apache-2.0
GTE-base-en-v1.5 は英語の文章変換モデルで、文章類似度タスクに特化しており、複数のテキスト埋め込みベンチマークで優れた性能を発揮します。
テキスト埋め込み
Transformers 複数言語対応

G
Alibaba-NLP
1.5M
63
Gte Multilingual Base
Apache-2.0
GTE Multilingual Base は50以上の言語をサポートする多言語文埋め込みモデルで、文類似度計算などのタスクに適しています。
テキスト埋め込み
Transformers 複数言語対応

G
Alibaba-NLP
1.2M
246
Polybert
polyBERTは、完全に機械駆動の超高速ポリマー情報学を実現するための化学言語モデルです。PSMILES文字列を600次元の密なフィンガープリントにマッピングし、ポリマー化学構造を数値形式で表現します。
テキスト埋め込み
Transformers

P
kuelumbus
1.0M
5
Bert Base Turkish Cased Mean Nli Stsb Tr
Apache-2.0
トルコ語BERTベースの文埋め込みモデルで、意味的類似性タスクに最適化
テキスト埋め込み
Transformers その他

B
emrecan
1.0M
40
GIST Small Embedding V0
MIT
BAAI/bge-small-en-v1.5モデルを微調整したテキスト埋め込みモデルで、MEDIデータセットとMTEB分類タスクデータセットで訓練され、検索タスクのクエリエンコーディング能力を最適化しました。
テキスト埋め込み
Safetensors 英語
G
avsolatorio
945.68k
29
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98