The model can be used for Information Retrieval: Given a query, encode the query will all possible passages (e.g. retrieved with ElasticSearch). Then sort the passages in a decreasing order. See
SBERT.net Retrieve & Re-rank
for more details. The training code is available here:
SBERT.net Training MS Marco
Usage with Transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained('model_name')
tokenizer = AutoTokenizer.from_pretrained('model_name')
features = tokenizer(['How many people live in Berlin?', 'How many people live in Berlin?'], ['Berlin has a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.', 'New York City is famous for the Metropolitan Museum of Art.'], padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
print(scores)
Usage with SentenceTransformers
The usage becomes easier when you have
SentenceTransformers
installed. Then, you can use the pre-trained models like this:
from sentence_transformers import CrossEncoder
model = CrossEncoder('model_name', max_length=512)
scores = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
ms-marco-TinyBERT-L-6 huggingface.co is an AI model on huggingface.co that provides ms-marco-TinyBERT-L-6's model effect (), which can be used instantly with this cross-encoder ms-marco-TinyBERT-L-6 model. huggingface.co supports a free trial of the ms-marco-TinyBERT-L-6 model, and also provides paid use of the ms-marco-TinyBERT-L-6. Support call ms-marco-TinyBERT-L-6 model through api, including Node.js, Python, http.
ms-marco-TinyBERT-L-6 huggingface.co is an online trial and call api platform, which integrates ms-marco-TinyBERT-L-6's modeling effects, including api services, and provides a free online trial of ms-marco-TinyBERT-L-6, you can try ms-marco-TinyBERT-L-6 online for free by clicking the link below.
cross-encoder ms-marco-TinyBERT-L-6 online free url in huggingface.co:
ms-marco-TinyBERT-L-6 is an open source model from GitHub that offers a free installation service, and any user can find ms-marco-TinyBERT-L-6 on GitHub to install. At the same time, huggingface.co provides the effect of ms-marco-TinyBERT-L-6 install, users can directly use ms-marco-TinyBERT-L-6 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ms-marco-TinyBERT-L-6 install url in huggingface.co: