Spaces:
Sleeping
Sleeping
Shweta0801
commited on
Commit
•
7f8bcc6
1
Parent(s):
a6cfff2
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
ner = pipeline("ner", grouped_entities=True)
|
4 |
+
ner("My name is Sylvain and I work at Hugging Face in Brooklyn.")
|
5 |
+
Copied
|
6 |
+
[{'entity_group': 'PER', 'score': 0.99816, 'word': 'Sylvain', 'start': 11, 'end': 18},
|
7 |
+
{'entity_group': 'ORG', 'score': 0.97960, 'word': 'Hugging Face', 'start': 33, 'end': 45},
|
8 |
+
{'entity_group': 'LOC', 'score': 0.99321, 'word': 'Brooklyn', 'start': 49, 'end': 57}
|
9 |
+
]
|