Views
No views yet
| 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 |
1from transformers import DistilBertTokenizer, DistilBertForTokenClassification
2
3# Load tokenizer and model
4tokenizer = DistilBertTokenizer.from_pretrained("AbhishekBhavnani/Restaurant-Token-Classifier")
5model = DistilBertForTokenClassification.from_pretrained("AbhishekBhavnani/Restaurant-Token-Classifier")
6
7# Example input
8inputs = tokenizer("Find The Best Place To Eat Pizza in Ahmedabad", return_tensors="pt")
9outputs = model(**inputs)
10
11# Get predictions
12predictions = outputs.logits.argmax(dim=-1)
13print(predictions)