Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@
|
|
| 9 |
# if text:
|
| 10 |
# out = pipe(text)
|
| 11 |
# st.json(out)
|
|
|
|
| 12 |
from transformers import pipeline
|
| 13 |
|
| 14 |
# Load the model from the Hugging Face Hub
|
|
@@ -19,5 +20,5 @@ text = "Hugging Face Inc. is based in New York City, and its CEO is Clement Dela
|
|
| 19 |
results = ner_pipeline(text)
|
| 20 |
|
| 21 |
for entity in results:
|
| 22 |
-
|
| 23 |
st.json(entity)
|
|
|
|
| 9 |
# if text:
|
| 10 |
# out = pipe(text)
|
| 11 |
# st.json(out)
|
| 12 |
+
import streamlit as st
|
| 13 |
from transformers import pipeline
|
| 14 |
|
| 15 |
# Load the model from the Hugging Face Hub
|
|
|
|
| 20 |
results = ner_pipeline(text)
|
| 21 |
|
| 22 |
for entity in results:
|
| 23 |
+
print(f"Entity: {entity['word']}, Label: {entity['entity']}, Score: {entity['score']:.4f}")
|
| 24 |
st.json(entity)
|