josep-empathy commited on
Commit
f08caea
·
verified ·
1 Parent(s): aa50b8c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -1
README.md CHANGED
@@ -57,11 +57,28 @@ from gliner import GLiNER
57
  # Load model
58
  model = GLiNER.from_pretrained("empathyai/grocery-ner-model")
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  # Example text
61
  text = "I need to buy milk, bread, and fresh apples"
62
 
63
  # Get predictions
64
- predictions = model.predict(text)
65
  print(predictions)
66
  ```
67
 
 
57
  # Load model
58
  model = GLiNER.from_pretrained("empathyai/grocery-ner-model")
59
 
60
+ labels = [
61
+ "Fruits Vegetables",
62
+ "Lactose, Diary, Eggs, Cheese, Yoghurt",
63
+ "Meat, Fish, Seafood",
64
+ "Frozen, Prepared Meals",
65
+ "Baking, Cooking",
66
+ "Cereals, Grains, Canned, Seeds",
67
+ "Breads",
68
+ "Snacks, Pastries, Treats",
69
+ "Frozen Desserts",
70
+ "Hot Drinks, Chilled Drinks",
71
+ "Alcoholic Drinks",
72
+ "Spices, Sauces",
73
+ "World Foods",
74
+ "Dietary Restrictions, Health, Allergens, Lifestyle"
75
+ ]
76
+
77
  # Example text
78
  text = "I need to buy milk, bread, and fresh apples"
79
 
80
  # Get predictions
81
+ predictions = model.predict(text, labels=self.LABELS)
82
  print(predictions)
83
  ```
84