Downloads · 30 days
6
33% of all-time downloads
linhtran222/lifelog_reranking_modernbert
lifelog_reranking_modernbert is a machine learning model from linhtran222. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
--- language: en tags: - reranking - information-retrieval - lifelog - transformers - modernbert license: apache-2.0 datasets: - private basemodel: answerdotai/ModernBERT-base pipelinetag: text-classification libraryn…
Downloads · 30 days
6
33% of all-time downloads
All-time downloads
18
Public
Parameters
150M
598 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors598 MB · 99%
From the Hugging Face model README
language: en tags:
This model is a reranker built on top of ModernBERT-base, fine-tuned to re-rank candidate passages for lifelog retrieval tasks.
(query, candidate_document) joined with [SEP]The model is designed for reranking lifelog retrieval results, but can also be adapted to other query-document ranking tasks.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "linhtran222/lifelog_reranking_modernbert"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
query = "What did I eat for lunch yesterday?"
doc = "You ate sushi and miso soup at a Japanese restaurant."
inputs = tokenizer(f"{query} [SEP] {doc}", return_tensors="pt")
with torch.no_grad():
score = model(**inputs).logits.squeeze().item()
print("Relevance score:", score)