This model has been first pretrained on the BEIR corpus and fine-tuned on MS MARCO dataset following the approach described in the paper
COCO-DR: Combating Distribution Shifts in Zero-Shot Dense Retrieval with Contrastive and Distributionally Robust Learning
. The associated GitHub repository is available here
https://github.com/OpenMatch/COCO-DR
.
This model is trained with BERT-base as the backbone with 110M hyperparameters. See the paper
https://arxiv.org/abs/2210.15212
for details.
Usage
Pre-trained models can be loaded through the HuggingFace transformers library:
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("OpenMatch/cocodr-base-msmarco")
tokenizer = AutoTokenizer.from_pretrained("OpenMatch/cocodr-base-msmarco")
Then embeddings for different sentences can be obtained by doing the following:
sentences = [
"Where was Marie Curie born?",
"Maria Sklodowska, later known as Marie Curie, was born on November 7, 1867.",
"Born in Paris on 15 May 1859, Pierre Curie was the son of Eugène Curie, a doctor of French Catholic origin from Alsace."
]
inputs = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")
embeddings = model(**inputs, output_hidden_states=True, return_dict=True).hidden_states[-1][:, :1].squeeze(1) # the embedding of the [CLS] token after the final layer
Then similarity scores between the different sentences are obtained with a dot product between the embeddings:
cocodr-base-msmarco huggingface.co is an AI model on huggingface.co that provides cocodr-base-msmarco's model effect (), which can be used instantly with this OpenMatch cocodr-base-msmarco model. huggingface.co supports a free trial of the cocodr-base-msmarco model, and also provides paid use of the cocodr-base-msmarco. Support call cocodr-base-msmarco model through api, including Node.js, Python, http.
cocodr-base-msmarco huggingface.co is an online trial and call api platform, which integrates cocodr-base-msmarco's modeling effects, including api services, and provides a free online trial of cocodr-base-msmarco, you can try cocodr-base-msmarco online for free by clicking the link below.
OpenMatch cocodr-base-msmarco online free url in huggingface.co:
cocodr-base-msmarco is an open source model from GitHub that offers a free installation service, and any user can find cocodr-base-msmarco on GitHub to install. At the same time, huggingface.co provides the effect of cocodr-base-msmarco install, users can directly use cocodr-base-msmarco installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
cocodr-base-msmarco install url in huggingface.co: