Instructions to use brutusxu/distilbert-base-cross-encoder-first-p with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brutusxu/distilbert-base-cross-encoder-first-p with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="brutusxu/distilbert-base-cross-encoder-first-p")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("brutusxu/distilbert-base-cross-encoder-first-p") model = AutoModelForSequenceClassification.from_pretrained("brutusxu/distilbert-base-cross-encoder-first-p") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
distilbert-base-uncased trained on MSMARCO Document Reranking task,
usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained('brutusxu/distilbert-base-cross-encoder-first-p')
model = AutoModelForSequenceClassification.from_pretrained('brutusxu/distilbert-base-cross-encoder-first-p')
query = 'I love New York'
document = 'I like New York'
input = '<P>' + query + tokenizer.sep_token + '<Q>' + document
tokenized_input = tokenizer(input, return_tensors='pt')
ranking_score = model(**tokenized_input)
performance
on MSMARCO Document Reranking w. top-100 documents from BM25
MRR@10: 0.373
MRR@100: 0.381
nDCG@10: 0.442
nDCG@10: 0.475
- Downloads last month
- 5