csponchiado commited on
Commit
9033b75
·
verified ·
1 Parent(s): 28748d8

Updating code for predict entities

Browse files
Files changed (1) hide show
  1. README.md +4 -2
README.md CHANGED
@@ -52,10 +52,12 @@ This model is fine-tuned on the grocery-ner-dataset to identify 14 different cat
52
  ## Usage Example
53
 
54
  ```python
 
 
55
  from gliner import GLiNER
56
 
57
  # Load model
58
- model = GLiNER.from_pretrained("empathyai/grocery-ner-model")
59
 
60
  labels = [
61
  "Fruits Vegetables",
@@ -78,7 +80,7 @@ labels = [
78
  text = "I need to buy milk, bread, and fresh apples"
79
 
80
  # Get predictions
81
- predictions = model.predict(text, labels=labels)
82
  print(predictions)
83
  ```
84
 
 
52
  ## Usage Example
53
 
54
  ```python
55
+ !pip install gliner
56
+
57
  from gliner import GLiNER
58
 
59
  # Load model
60
+ model = GLiNER.from_pretrained("empathyai/gliner_large-v2.5-groceries")
61
 
62
  labels = [
63
  "Fruits Vegetables",
 
80
  text = "I need to buy milk, bread, and fresh apples"
81
 
82
  # Get predictions
83
+ predictions = model.predict_entities(text, labels=labels)
84
  print(predictions)
85
  ```
86