模型:
deepset/all-mpnet-base-v2-table
这是一个 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('deepset/all-mpnet-base-v2-table') embeddings = model.encode(sentences) print(embeddings)
对于对该模型的自动化评估,请参阅句子嵌入基准(Sentence Embeddings Benchmark): https://seb.sbert.net
模型使用以下参数进行训练:
DataLoader:
torch.utils.data.dataloader.DataLoader长度为5010,参数如下:
{'batch_size': 24, 'sampler': 'torch.utils.data.sampler.SequentialSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
损失函数:
sentence_transformers.losses.MultipleNegativesRankingLoss.MultipleNegativesRankingLoss,参数如下:
{'scale': 20.0, 'similarity_fct': 'cos_sim'}
fit() 方法的参数:
{ "epochs": 1, "evaluation_steps": 0, "evaluator": "NoneType", "max_grad_norm": 1, "optimizer_class": "<class 'transformers.optimization.AdamW'>", "optimizer_params": { "lr": 2e-05 }, "scheduler": "WarmupLinear", "steps_per_epoch": null, "warmup_steps": 10000, "weight_decay": 0.01 }
SentenceTransformer( (0): Transformer({'max_seq_length': 384, 'do_lower_case': False}) with Transformer model: MPNetModel (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): Normalize() )