Ft Ms Marco MiniLM L12 V2 Claims Reranker V2
这是一个基于cross-encoder/ms-marco-MiniLM-L12-v2微调的交叉编码器模型,用于文本重排序和语义搜索。
下载量 769
发布时间 : 5/16/2025
模型简介
该模型计算文本对的分数,可用于文本重排序和语义搜索任务。
模型特点
高效文本重排序
能够高效地对文本对进行评分和重排序,适用于语义搜索场景。
高精度性能
在主张证据开发集上表现出色,平均精度达到0.9904。
基于MiniLM架构
基于高效的MiniLM架构,平衡了性能和计算资源需求。
模型能力
文本对评分
语义搜索
文本重排序
使用案例
信息检索
主张证据匹配
用于匹配主张和相关的证据文本
在前5命中率达到1.0
搜索引擎重排序
对搜索引擎初步结果进行重排序以提高相关性
🚀 基于 cross-encoder/ms-marco-MiniLM-L12-v2 的交叉编码器
这是一个基于 sentence-transformers 库,从 cross-encoder/ms-marco-MiniLM-L12-v2 微调而来的 交叉编码器 模型。它可以计算文本对的得分,可用于文本重排序和语义搜索。
🚀 快速开始
本模型可用于计算文本对的得分,进而实现文本重排序和语义搜索。下面将详细介绍使用方法。
✨ 主要特性
- 基于
cross-encoder/ms-marco-MiniLM-L12-v2
微调,能够精准计算文本对得分。 - 可用于文本重排序和语义搜索任务。
📦 安装指南
首先,你需要安装 sentence-transformers
库:
pip install -U sentence-transformers
💻 使用示例
基础用法
from sentence_transformers import CrossEncoder
# 从 🤗 Hub 下载模型
model = CrossEncoder("Davidsamuel101/ft-ms-marco-MiniLM-L12-v2-claims-reranker-v2")
# 获取文本对的得分
pairs = [
['Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.', 'At very high concentrations (100 times atmospheric concentration, or greater), carbon dioxide can be toxic to animal life, so raising the concentration to 10,000 ppm (1%) or higher for several hours will eliminate pests such as whiteflies and spider mites in a greenhouse.'],
['Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.', 'Plants can grow as much as 50 percent faster in concentrations of 1,000 ppm CO 2 when compared with ambient conditions, though this assumes no change in climate and no limitation on other nutrients.'],
['Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.', 'Higher carbon dioxide concentrations will favourably affect plant growth and demand for water.'],
['Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.', "Carbon dioxide in the Earth's atmosphere is essential to life and to most of the planetary biosphere."],
['Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.', 'Rennie 2009: "Claim 1: Anthropogenic CO2 can\'t be changing climate, because CO2 is only a trace gas in the atmosphere and the amount produced by humans is dwarfed by the amount from volcanoes and other natural sources.'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5,)
# 或者根据与单个文本的相似度对不同文本进行排序
ranks = model.rank(
'Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.',
[
'At very high concentrations (100 times atmospheric concentration, or greater), carbon dioxide can be toxic to animal life, so raising the concentration to 10,000 ppm (1%) or higher for several hours will eliminate pests such as whiteflies and spider mites in a greenhouse.',
'Plants can grow as much as 50 percent faster in concentrations of 1,000 ppm CO 2 when compared with ambient conditions, though this assumes no change in climate and no limitation on other nutrients.',
'Higher carbon dioxide concentrations will favourably affect plant growth and demand for water.',
"Carbon dioxide in the Earth's atmosphere is essential to life and to most of the planetary biosphere.",
'Rennie 2009: "Claim 1: Anthropogenic CO2 can\'t be changing climate, because CO2 is only a trace gas in the atmosphere and the amount produced by humans is dwarfed by the amount from volcanoes and other natural sources.',
]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
📚 详细文档
模型详情
模型描述
属性 | 详情 |
---|---|
模型类型 | 交叉编码器 |
基础模型 | cross-encoder/ms-marco-MiniLM-L12-v2 |
最大序列长度 | 512 个词元 |
输出标签数量 | 1 个标签 |
模型来源
- 文档:Sentence Transformers 文档
- 文档:Cross Encoder 文档
- 仓库:GitHub 上的 Sentence Transformers
- Hugging Face:Hugging Face 上的 Cross Encoders
评估
指标
交叉编码器重排序
- 数据集:
claims-evidence-dev
- 使用
CrossEncoderRerankingEvaluator
进行评估,参数如下:{ "at_k": 5, "always_rerank_positives": true }
指标 | 值 |
---|---|
map | 0.9904 (-0.0096) |
mrr@5 | 1.0000 (+0.0000) |
ndcg@5 | 0.9882 (-0.0118) |
训练详情
训练数据集
未命名数据集
- 大小:23,770 个训练样本
- 列:
text1
、text2
和label
- 基于前 1000 个样本的近似统计信息:
text1 text2 label 类型 字符串 字符串 整数 详情 - 最小:38 个字符
- 平均:118.57 个字符
- 最大:226 个字符
- 最小:14 个字符
- 平均:144.96 个字符
- 最大:1176 个字符
- 0:~83.70%
- 1:~16.30%
- 样本:
text1 text2 label Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.
At very high concentrations (100 times atmospheric concentration, or greater), carbon dioxide can be toxic to animal life, so raising the concentration to 10,000 ppm (1%) or higher for several hours will eliminate pests such as whiteflies and spider mites in a greenhouse.
1
Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.
Plants can grow as much as 50 percent faster in concentrations of 1,000 ppm CO 2 when compared with ambient conditions, though this assumes no change in climate and no limitation on other nutrients.
1
Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life.
Higher carbon dioxide concentrations will favourably affect plant growth and demand for water.
1
- 损失函数:
MultipleNegativesRankingLoss
,参数如下:{ "scale": 10.0, "num_negatives": 4, "activation_fn": "torch.nn.modules.activation.Sigmoid" }
训练超参数
非默认超参数
eval_strategy
:stepsper_device_train_batch_size
:16learning_rate
:3e-06num_train_epochs
:5bf16
:Trueload_best_model_at_end
:True
所有超参数
点击展开
overwrite_output_dir
:Falsedo_predict
:Falseeval_strategy
:stepsprediction_loss_only
:Trueper_device_train_batch_size
:16per_device_eval_batch_size
:8per_gpu_train_batch_size
:Noneper_gpu_eval_batch_size
:Nonegradient_accumulation_steps
:1eval_accumulation_steps
:Nonetorch_empty_cache_steps
:Nonelearning_rate
:3e-06weight_decay
:0.0adam_beta1
:0.9adam_beta2
:0.999adam_epsilon
:1e-08max_grad_norm
:1.0num_train_epochs
:5max_steps
:-1lr_scheduler_type
:linearlr_scheduler_kwargs
:{}warmup_ratio
:0.0warmup_steps
:0log_level
:passivelog_level_replica
:warninglog_on_each_node
:Truelogging_nan_inf_filter
:Truesave_safetensors
:Truesave_on_each_node
:Falsesave_only_model
:Falserestore_callback_states_from_checkpoint
:Falseno_cuda
:Falseuse_cpu
:Falseuse_mps_device
:Falseseed
:42data_seed
:Nonejit_mode_eval
:Falseuse_ipex
:Falsebf16
:Truefp16
:Falsefp16_opt_level
:O1half_precision_backend
:autobf16_full_eval
:Falsefp16_full_eval
:Falsetf32
:Nonelocal_rank
:0ddp_backend
:Nonetpu_num_cores
:Nonetpu_metrics_debug
:Falsedebug
:[]dataloader_drop_last
:Falsedataloader_num_workers
:0dataloader_prefetch_factor
:Nonepast_index
:-1disable_tqdm
:Falseremove_unused_columns
:Truelabel_names
:Noneload_best_model_at_end
:Trueignore_data_skip
:Falsefsdp
:[]fsdp_min_num_params
:0fsdp_config
:{'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}tp_size
:0fsdp_transformer_layer_cls_to_wrap
:Noneaccelerator_config
:{'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed
:Nonelabel_smoothing_factor
:0.0optim
:adamw_torchoptim_args
:Noneadafactor
:Falsegroup_by_length
:Falselength_column_name
:lengthddp_find_unused_parameters
:Noneddp_bucket_cap_mb
:Noneddp_broadcast_buffers
:Falsedataloader_pin_memory
:Truedataloader_persistent_workers
:Falseskip_memory_metrics
:Trueuse_legacy_prediction_loop
:Falsepush_to_hub
:Falseresume_from_checkpoint
:Nonehub_model_id
:Nonehub_strategy
:every_savehub_private_repo
:Nonehub_always_push
:Falsegradient_checkpointing
:Falsegradient_checkpointing_kwargs
:Noneinclude_inputs_for_metrics
:Falseinclude_for_metrics
:[]eval_do_concat_batches
:Truefp16_backend
:autopush_to_hub_model_id
:Nonepush_to_hub_organization
:Nonemp_parameters
:auto_find_batch_size
:Falsefull_determinism
:Falsetorchdynamo
:Noneray_scope
:lastddp_timeout
:1800torch_compile
:Falsetorch_compile_backend
:Nonetorch_compile_mode
:Noneinclude_tokens_per_second
:Falseinclude_num_input_tokens_seen
:Falseneftune_noise_alpha
:Noneoptim_target_modules
:Nonebatch_eval_metrics
:Falseeval_on_start
:Falseuse_liger_kernel
:Falseeval_use_gather_object
:Falseaverage_tokens_across_devices
:Falseprompts
:Nonebatch_sampler
:batch_samplermulti_dataset_batch_sampler
:proportional
训练日志
点击展开
轮次 | 步数 | 训练损失 | claims-evidence-dev_ndcg@5 |
---|---|---|---|
0.0336 | 50 | 1.2496 | - |
0.0673 | 100 | 1.2605 | 0.9523 (-0.0477) |
0.1009 | 150 | 1.1969 | - |
0.1346 | 200 | 1.2353 | 0.9529 (-0.0471) |
0.1682 | 250 | 1.2114 | - |
0.2019 | 300 | 1.1438 | 0.9551 (-0.0449) |
0.2355 | 350 | 1.2062 | - |
0.2692 | 400 | 1.1631 | 0.9568 (-0.0432) |
0.3028 | 450 | 1.115 | - |
0.3365 | 500 | 1.2029 | 0.9582 (-0.0418) |
0.3701 | 550 | 1.0615 | - |
0.4038 | 600 | 1.185 | 0.9649 (-0.0351) |
0.4374 | 650 | 1.0651 | - |
0.4711 | 700 | 1.0951 | 0.9682 (-0.0318) |
0.5047 | 750 | 1.1267 | - |
0.5384 | 800 | 1.0822 | 0.9727 (-0.0273) |
0.5720 | 850 | 1.0658 | - |
0.6057 | 900 | 1.0113 | 0.9785 (-0.0215) |
0.6393 | 950 | 1.0578 | - |
0.6729 | 1000 | 1.074 | 0.9829 (-0.0171) |
0.7066 | 1050 | 1.0287 | - |
0.7402 | 1100 | 0.9337 | 0.9873 (-0.0127) |
0.7739 | 1150 | 0.9798 | - |
0.8075 | 1200 | 0.9697 | 0.9899 (-0.0101) |
0.8412 | 1250 | 0.984 | - |
0.8748 | 1300 | 0.9913 | 0.9898 (-0.0102) |
0.9085 | 1350 | 1.0126 | - |
0.9421 | 1400 | 0.9458 | 0.9897 (-0.0103) |
0.9758 | 1450 | 0.9594 | - |
1.0094 | 1500 | 0.9798 | 0.9896 (-0.0104) |
1.0431 | 1550 | 0.9599 | - |
1.0767 | 1600 | 0.9485 | 0.9887 (-0.0113) |
1.1104 | 1650 | 0.9021 | - |
1.1440 | 1700 | 0.9778 | 0.9887 (-0.0113) |
1.1777 | 1750 | 0.9836 | - |
1.2113 | 1800 | 0.939 | 0.9912 (-0.0088) |
1.2450 | 1850 | 0.9476 | - |
1.2786 | 1900 | 0.964 | 0.9914 (-0.0086) |
1.3122 | 1950 | 0.9238 | - |
1.3459 | 2000 | 0.9811 | 0.9895 (-0.0105) |
1.3795 | 2050 | 0.905 | - |
1.4132 | 2100 | 0.8979 | 0.9896 (-0.0104) |
1.4468 | 2150 | 0.8998 | - |
1.4805 | 2200 | 0.9016 | 0.9896 (-0.0104) |
1.5141 | 2250 | 0.9183 | - |
1.5478 | 2300 | 0.8805 | 0.9896 (-0.0104) |
1.5814 | 2350 | 0.8672 | - |
1.6151 | 2400 | 0.8822 | 0.9896 (-0.0104) |
1.6487 | 2450 | 0.8724 | - |
1.6824 | 2500 | 0.9397 | 0.9883 (-0.0117) |
1.7160 | 2550 | 0.8903 | - |
1.7497 | 2600 | 0.9305 | 0.9882 (-0.0118) |
1.7833 | 2650 | 0.8741 | - |
1.8170 | 2700 | 0.8951 | 0.9874 (-0.0126) |
1.8506 | 2750 | 0.8958 | - |
1.8843 | 2800 | 0.8529 | 0.9873 (-0.0127) |
1.9179 | 2850 | 0.9468 | - |
1.9515 | 2900 | 0.8683 | 0.9882 (-0.0118) |
1.9852 | 2950 | 0.9145 | - |
2.0188 | 3000 | 0.9137 | 0.9883 (-0.0117) |
2.0525 | 3050 | 0.8175 | - |
2.0861 | 3100 | 0.911 | 0.9883 (-0.0117) |
2.1198 | 3150 | 0.8749 | - |
2.1534 | 3200 | 0.8491 | 0.9883 (-0.0117) |
2.1871 | 3250 | 0.9057 | - |
2.2207 | 3300 | 0.9034 | 0.9882 (-0.0118) |
2.2544 | 3350 | 0.8505 | - |
2.2880 | 3400 | 0.8762 | 0.9883 (-0.0117) |
2.3217 | 3450 | 0.8974 | - |
2.3553 | 3500 | 0.8832 | 0.9884 (-0.0116) |
2.3890 | 3550 | 0.851 | - |
2.4226 | 3600 | 0.8584 | 0.9890 (-0.0110) |
2.4563 | 3650 | 0.9032 | - |
2.4899 | 3700 | 0.8963 | 0.9893 (-0.0107) |
2.5236 | 3750 | 0.8756 | - |
2.5572 | 3800 | 0.843 | 0.9882 (-0.0118) |
2.5908 | 3850 | 0.8778 | - |
2.6245 | 3900 | 0.8434 | 0.9882 (-0.0118) |
2.6581 | 3950 | 0.9193 | - |
2.6918 | 4000 | 0.8724 | 0.9875 (-0.0125) |
2.7254 | 4050 | 0.9062 | - |
2.7591 | 4100 | 0.8807 | 0.9875 (-0.0125) |
2.7927 | 4150 | 0.8252 | - |
2.8264 | 4200 | 0.8725 | 0.9875 (-0.0125) |
2.8600 | 4250 | 0.9094 | - |
2.8937 | 4300 | 0.8589 | 0.9874 (-0.0126) |
2.9273 | 4350 | 0.8625 | - |
2.9610 | 4400 | 0.8138 | 0.9874 (-0.0126) |
2.9946 | 4450 | 0.9217 | - |
3.0283 | 4500 | 0.8871 | 0.9872 (-0.0128) |
3.0619 | 4550 | 0.8504 | - |
3.0956 | 4600 | 0.944 | 0.9873 (-0.0127) |
3.1292 | 4650 | 0.8258 | - |
3.1629 | 4700 | 0.9054 | 0.9874 (-0.0126) |
3.1965 | 4750 | 0.8297 | - |
3.2301 | 4800 | 0.8483 | 0.9875 (-0.0125) |
3.2638 | 4850 | 0.909 | - |
3.2974 | 4900 | 0.8486 | 0.9892 (-0.0108) |
3.3311 | 4950 | 0.8937 | - |
3.3647 | 5000 | 0.8821 | 0.9874 (-0.0126) |
3.3984 | 5050 | 0.873 | - |
3.4320 | 5100 | 0.8773 | 0.9874 (-0.0126) |
3.4657 | 5150 | 0.8592 | - |
3.4993 | 5200 | 0.8449 | 0.9882 (-0.0118) |
3.5330 | 5250 | 0.8651 | - |
3.5666 | 5300 | 0.8943 | 0.9882 (-0.0118) |
3.6003 | 5350 | 0.8535 | - |
3.6339 | 5400 | 0.8687 | 0.9882 (-0.0118) |
3.6676 | 5450 | 0.9213 | - |
3.7012 | 5500 | 0.887 | 0.9882 (-0.0118) |
3.7349 | 5550 | 0.8787 | - |
3.7685 | 5600 | 0.8466 | 0.9882 (-0.0118) |
3.8022 | 5650 | 0.8517 | - |
3.8358 | 5700 | 0.8349 | 0.9883 (-0.0117) |
3.8694 | 5750 | 0.8647 | - |
3.9031 | 5800 | 0.8406 | 0.9882 (-0.0118) |
3.9367 | 5850 | 0.8385 | - |
3.9704 | 5900 | 0.8631 | 0.9882 (-0.0118) |
4.0040 | 5950 | 0.823 | - |
4.0377 | 6000 | 0.9163 | 0.9881 (-0.0119) |
4.0713 | 6050 | 0.8373 | - |
4.1050 | 6100 | 0.892 | 0.9882 (-0.0118) |
4.1386 | 6150 | 0.8666 | - |
4.1723 | 6200 | 0.8536 | 0.9882 (-0.0118) |
4.2059 | 6250 | 0.8784 | - |
4.2396 | 6300 | 0.9616 | 0.9882 (-0.0118) |
4.2732 | 6350 | 0.8464 | - |
4.3069 | 6400 | 0.865 | 0.9882 (-0.0118) |
4.3405 | 6450 | 0.8411 | - |
4.3742 | 6500 | 0.8943 | 0.9882 (-0.0118) |
4.4078 | 6550 | 0.8577 | - |
4.4415 | 6600 | 0.8683 | 0.9882 (-0.0118) |
4.4751 | 6650 | 0.8706 | - |
4.5087 | 6700 | 0.8645 | 0.9882 (-0.0118) |
4.5424 | 6750 | 0.8899 | - |
4.5760 | 6800 | 0.8593 | 0.9882 (-0.0118) |
4.6097 | 6850 | 0.8838 | - |
4.6433 | 6900 | 0.8379 | 0.9882 (-0.0118) |
4.6770 | 6950 | 0.8759 | - |
4.7106 | 7000 | 0.8608 | 0.9882 (-0.0118) |
4.7443 | 7050 | 0.8858 | - |
4.7779 | 7100 | 0.8594 | 0.9882 (-0.0118) |
4.8116 | 7150 | 0.8403 | - |
4.8452 | 7200 | 0.8898 | 0.9882 (-0.0118) |
4.8789 | 7250 | 0.8382 | - |
4.9125 | 7300 | 0.8307 | 0.9882 (-0.0118) |
4.9462 | 7350 | 0.8601 | - |
4.9798 | 7400 | 0.8076 | 0.9882 (-0.0118) |
- 加粗行表示保存的检查点。
框架版本
- Python:3.13.2
- Sentence Transformers:4.1.0
- Transformers:4.51.3
- PyTorch:2.7.0+cu128
- Accelerate:1.6.0
- Datasets:3.6.0
- Tokenizers:0.21.1
📄 引用
BibTeX
Sentence Transformers
@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 = "https://arxiv.org/abs/1908.10084",
}
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架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98