MiniCPM-Reranker-Light
is a bilingual & cross-lingual text re-ranking model developed by ModelBest Inc. , THUNLP and NEUIR , featuring:
Exceptional Chinese and English re-ranking capabilities.
Outstanding cross-lingual re-ranking capabilities between Chinese and English.
Long-text support (up to 8192 tokens).
MiniCPM-Reranker-Light is trained based on
MiniCPM-1B-sft-bf16
and incorporates bidirectional attention in its architecture. The model underwent multi-stage training using approximately 6 million training examples, including open-source, synthetic, and proprietary data.
We also invite you to explore the UltraRAG series:
<s>Instruction: Given a claim about climate change, retrieve documents that support or refute the claim. Query: However the warming trend is slower than most climate models have forecast.</s>(document omitted)
也可以不提供指令,即采取如下格式:
MiniCPM-Reranker-Light also works in instruction-free mode in the following format:
from FlagEmbedding import FlagReranker
model_name = "OpenBMB/MiniCPM-Reranker-Light"
model = FlagReranker(model_name, use_fp16=True, query_instruction_for_rerank="Query: ", trust_remote_code=True)
# You can hack the __init__() method of the FlagEmbedding BaseReranker class to use flash_attention_2 for faster inference# self.model = AutoModelForSequenceClassification.from_pretrained(# model_name_or_path,# trust_remote_code=trust_remote_code,# cache_dir=cache_dir,# # torch_dtype=torch.float16, # we need to add this line to use fp16# # attn_implementation="flash_attention_2", # we need to add this line to use flash_attention_2# )
model.tokenizer.padding_side = "right"
query = "中国的首都是哪里?"# "Where is the capital of China?"
passages = ["beijing", "shanghai"] # 北京,上海
sentence_pairs = [[query, doc] for doc in passages]
scores = model.compute_score(sentence_pairs,normalize=True)
print(scores) # [0.01791734476747132, 0.0002472934613244585]
The models and weights of MiniCPM-Reranker-Light are completely free for academic research. After filling out a
"questionnaire"
for registration, MiniCPM-Reranker-Light weights are also available for free commercial use.
Runs of openbmb MiniCPM-Reranker-Light on huggingface.co
213
Total runs
0
24-hour runs
0
3-day runs
16
7-day runs
189
30-day runs
More Information About MiniCPM-Reranker-Light huggingface.co Model
MiniCPM-Reranker-Light huggingface.co
MiniCPM-Reranker-Light huggingface.co is an AI model on huggingface.co that provides MiniCPM-Reranker-Light's model effect (), which can be used instantly with this openbmb MiniCPM-Reranker-Light model. huggingface.co supports a free trial of the MiniCPM-Reranker-Light model, and also provides paid use of the MiniCPM-Reranker-Light. Support call MiniCPM-Reranker-Light model through api, including Node.js, Python, http.
MiniCPM-Reranker-Light huggingface.co is an online trial and call api platform, which integrates MiniCPM-Reranker-Light's modeling effects, including api services, and provides a free online trial of MiniCPM-Reranker-Light, you can try MiniCPM-Reranker-Light online for free by clicking the link below.
openbmb MiniCPM-Reranker-Light online free url in huggingface.co:
MiniCPM-Reranker-Light is an open source model from GitHub that offers a free installation service, and any user can find MiniCPM-Reranker-Light on GitHub to install. At the same time, huggingface.co provides the effect of MiniCPM-Reranker-Light install, users can directly use MiniCPM-Reranker-Light installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
MiniCPM-Reranker-Light install url in huggingface.co: