Debatenet 2 Cat
これはsentence-transformersに基づく文の類似度モデルで、移民関連の要求や主張の文に特化して最適化されています。
ダウンロード数 25
リリース時間 : 2/8/2023
モデル概要
このモデルは、文や段落を768次元の密集ベクトル空間にマッピングでき、主に移民関連の内容を含む文間の意味類似度を計算するために使用されます。
モデル特徴
移民内容の最適化
移民関連のテキストに特化して微調整され、この分野でより良い意味理解能力を持っています。
多言語対応
ドイツ語や英語を含む複数の言語の処理をサポートします。
高次元ベクトル空間
テキストを768次元の密集ベクトル空間にマッピングし、豊富な意味情報を保持します。
モデル能力
文の類似度計算
意味特徴抽出
テキストクラスタリング
意味検索
使用事例
移民政策分析
移民主張の類似度分析
異なる移民政策の主張間の意味類似度を分析します。
政策主張間の類似性と相違点を識別できます。
政策立場の分類
意味類似度に基づいて移民政策の立場を分類します。
研究者が政策立場を迅速に分類するのに役立ちます。
社会科学研究
政治言説分析
政治討論における移民トピックの意味構造を分析します。
討論の主要な見解と立場を明らかにします。
🚀 nblokker/debatenet-2-cat
このモデルはsentence-transformersモデルです。文章や段落を768次元の密ベクトル空間にマッピングし、クラスタリングや意味検索などのタスクに使用できます。
このモデルは、移民関連の要求や提案を含む文章間の類似度を推定するために使用できます。詳細と潜在的な使用例については、このブログ記事を参照してください。
🚀 クイックスタート
このモデルは、sentence-transformersをインストールすることで簡単に使用できます。
pip install -U sentence-transformers
その後、以下のようにモデルを使用できます。
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('nblokker/debatenet-2-cat')
embeddings = model.encode(sentences)
print(embeddings)
✨ 主な機能
- 文章や段落を768次元の密ベクトル空間にマッピングする。
- クラスタリングや意味検索などのタスクに使用できる。
- 移民関連の要求や提案を含む文章間の類似度を推定できる。
📦 インストール
sentence-transformersを使用する場合
pip install -U sentence-transformers
sentence-transformersを使用しない場合
from transformers import AutoTokenizer, AutoModel
import torch
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']
# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('nblokker/debatenet-2-cat')
model = AutoModel.from_pretrained('nblokker/debatenet-2-cat')
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling. In this case, mean pooling.
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
print("Sentence embeddings:")
print(sentence_embeddings)
💻 使用例
基本的な使用法
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('nblokker/debatenet-2-cat')
embeddings = model.encode(sentences)
print(embeddings)
高度な使用法
from transformers import AutoTokenizer, AutoModel
import torch
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']
# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('nblokker/debatenet-2-cat')
model = AutoModel.from_pretrained('nblokker/debatenet-2-cat')
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling. In this case, mean pooling.
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
print("Sentence embeddings:")
print(sentence_embeddings)
📚 ドキュメント
評価結果
このモデルの自動評価については、Sentence Embeddings Benchmarkを参照してください。https://seb.sbert.net
学習
このモデルは以下のパラメータで学習されました。
DataLoader:
{'batch_size': 32, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
Loss:
sentence_transformers.losses.BatchHardSoftMarginTripletLoss.BatchHardSoftMarginTripletLoss
fit()
メソッドのパラメータ:
{
"epochs": 15,
"evaluation_steps": 120.5,
"evaluator": "sentence_transformers.evaluation.BinaryClassificationEvaluator.BinaryClassificationEvaluator",
"max_grad_norm": 1,
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
"optimizer_params": {
"lr": 2e-05
},
"scheduler": "WarmupLinear",
"steps_per_epoch": null,
"warmup_steps": 120.5,
"weight_decay": 0.01
}
モデルの完全なアーキテクチャ
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(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})
)
引用と著者
@preprint{blokker2023,
author = {Blokker, Nico and Blessing, Andre and Dayanik, Erenay and Kuhn, Jonas and Padó, Sebastian and Lapesa, Gabriella},
note = {To appear in \textit{Language Resources and Evaluation}},
title = {Between welcome culture and border fence: The {E}uropean refugee crisis in {G}erman newspaper reports},
url = {https://arxiv.org/abs/2111.10142},
year = 2023
}
@inproceedings{lapesa2020,
abstract = {DEbateNet-migr15 is a manually annotated dataset for German which covers the public debate on immigration in 2015. The building block of our annotation is the political science notion of a claim, i.e., a statement made by a political actor (a politician, a party, or a group of citizens) that a specific action should be taken (e.g., vacant flats should be assigned to refugees). We identify claims in newspaper articles, assign them to actors and fine-grained categories and annotate their polarity and date. The aim of this paper is two-fold: first, we release the full DEbateNet-mig15 corpus and document it by means of a quantitative and qualitative analysis; second, we demonstrate its application in a discourse network analysis framework, which enables us to capture the temporal dynamics of the political debate.},
address = {Online},
author = {Lapesa, Gabriella and Blessing, Andre and Blokker, Nico and Dayanik, Erenay and Haunss, Sebastian and Kuhn, Jonas and Padó, Sebastian},
booktitle = {Proceedings of LREC},
pages = {919--927},
title = {{DEbateNet-mig15}: {T}racing the 2015 Immigration Debate in {G}ermany Over Time},
url = {https://www.aclweb.org/anthology/2020.lrec-1.115},
year = 2020
}
謝辞
このモデルは、sentence-transformers/paraphrase-multilingual-mpnet-base-v2
モデルをベースにしています。
@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",
}
- オリジナルモデルのURL: https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2
- ライセンス: Apache 2.0
📄 ライセンス
このモデルの微調整部分はMITライセンスの下で公開されています。詳細については、LICENSEファイルを参照してください。オリジナルのsentence-transformers/paraphrase-multilingual-mpnet-base-v2
モデルは、元のApache 2.0ライセンスのままです。
情報テーブル
属性 | 详情 |
---|---|
パイプラインタグ | 文章類似度 |
タグ | sentence-transformers、特徴抽出、文章類似度、transformers |
ライセンス | MIT、Apache-2.0 |
言語 | 多言語、ドイツ語、英語 |
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