Downloads · 30 days
15
6% of all-time downloads
jonny9f/food_reranker4
food_reranker4 is a text classification model from jonny9f. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This is a fine-tuned BGE (BAAI General Embedding) model trained for binary classification of food description pairs. The model determines whether two food descriptions refer to the same item, enabling accurate re-rank…
Downloads · 30 days
15
6% of all-time downloads
All-time downloads
240
Public
Parameters
109M
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.6 GB · 60%
From the Hugging Face model README
This is a fine-tuned BGE (BAAI General Embedding) model trained for binary classification of food description pairs. The model determines whether two food descriptions refer to the same item, enabling accurate re-ranking of search results.
The model uses the BGE architecture with the following specifications:
Key evaluation metrics on the test set:
Designed for improving food search accuracy by re-ranking initial search results, this model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load model
tokenizer = AutoTokenizer.from_pretrained("jonny9f/food_reranker2")
model = AutoModelForSequenceClassification.from_pretrained("jonny9f/food_reranker2")
# Prepare input
query = "chicken breast"
candidate = "grilled chicken breast"
inputs = tokenizer(query, candidate, padding=True, truncation=True, return_tensors="pt")
# Get prediction
outputs = model(**inputs)
score = outputs.logits.softmax(dim=1)[0][1].item() # Score for positive class