Elpapudex elisabetconese commited on
Commit
e79fa5e
·
1 Parent(s): 8f80237

Update README.md (#1)

Browse files

- Update README.md (08985f1094654a64a0842c896a7164d614112f97)


Co-authored-by: Elisabet Sulú <elisabetconese@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +22 -0
README.md CHANGED
@@ -38,6 +38,28 @@ language:
38
 
39
  **Headline Metric:** Entity-level F1 = **0.9315**
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  ## Limitations
42
 
43
  * English-only.
 
38
 
39
  **Headline Metric:** Entity-level F1 = **0.9315**
40
 
41
+ ## Exaple Usage
42
+ ```python
43
+ from transformers import pipeline
44
+
45
+ # 1. Initialize the NER pipeline
46
+ ner = pipeline(
47
+ task="token-classification",
48
+ model="Elpapudex/Ner-full",
49
+ aggregation_strategy="simple" # Groups sub-tokens into complete entity names
50
+ )
51
+
52
+ # 2. Text to test
53
+ text = "Sundar Pichai announced that Google is opening a new AI hub in London next October."
54
+
55
+ # 3. Run inference
56
+ results = ner(text)
57
+
58
+ # 4. Display detected entities
59
+ for entity in results:
60
+ print(f"Entity: {entity['word']} | Label: {entity['entity_group']} | Confidence: {entity['score']:.2%}")
61
+ ```
62
+
63
  ## Limitations
64
 
65
  * English-only.