Downloads · 30 days
5
20% of all-time downloads
AbhishekBhavnani/Restaurant-Token-Classifier
Restaurant-Token-Classifier is a token classification model from AbhishekBhavnani. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
This model is a fine-tuned version of DistilBERT for token classification on restaurant-related data. It is capable of recognizing various entities such as:
Downloads · 30 days
5
20% of all-time downloads
All-time downloads
25
Public
Repo size
531 MB
Likes
0
Public
Click a slice to open those files.
.bin266 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of DistilBERT for token classification on restaurant-related data. It is capable of recognizing various entities such as:
The model supports the following 17 token classification labels:
| ID | Label |
|---|---|
| 0 | O |
| 1 | B-Amenity |
| 2 | I-Amenity |
| 3 | B-Dish |
| 4 | I-Dish |
| 5 | B-Rating |
| 6 | I-Rating |
| 7 | B-Restaurant_Name |
| 8 | I-Restaurant_Name |
| 9 | B-Hours |
| 10 | I-Hours |
| 11 | B-Location |
| 12 | I-Location |
| 13 | B-Price |
| 14 | I-Price |
| 15 | B-Cuisine |
| 16 | I-Cuisine |
from transformers import DistilBertTokenizer, DistilBertForTokenClassification
# Load tokenizer and model
tokenizer = DistilBertTokenizer.from_pretrained("AbhishekBhavnani/Restaurant-Token-Classifier")
model = DistilBertForTokenClassification.from_pretrained("AbhishekBhavnani/Restaurant-Token-Classifier")
# Example input
inputs = tokenizer("Find The Best Place To Eat Pizza in Ahmedabad", return_tensors="pt")
outputs = model(**inputs)
# Get predictions
predictions = outputs.logits.argmax(dim=-1)
print(predictions)