Spaces:
Build error
Build error
jishnuprakash
commited on
Commit
•
11dfa1d
1
Parent(s):
74b1387
display entities
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ import pandas as pd
|
|
16 |
import numpy as np
|
17 |
import matplotlib.pyplot as plt
|
18 |
import seaborn as sns
|
|
|
19 |
from nltk import word_tokenize
|
20 |
from nltk.probability import FreqDist
|
21 |
from matplotlib import pyplot as plt
|
@@ -100,6 +101,12 @@ with st.form('model_prediction'):
|
|
100 |
date = "None found" if len(date)<1 else date
|
101 |
st.write("Location entities: " + loc)
|
102 |
st.write("Date entities: " + date)
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
st.header("Predict on test data")
|
105 |
with st.form('model_test_prediction'):
|
|
|
16 |
import numpy as np
|
17 |
import matplotlib.pyplot as plt
|
18 |
import seaborn as sns
|
19 |
+
from spacy import displacy
|
20 |
from nltk import word_tokenize
|
21 |
from nltk.probability import FreqDist
|
22 |
from matplotlib import pyplot as plt
|
|
|
101 |
date = "None found" if len(date)<1 else date
|
102 |
st.write("Location entities: " + loc)
|
103 |
st.write("Date entities: " + date)
|
104 |
+
|
105 |
+
#Display entities
|
106 |
+
st.write("All Entities-")
|
107 |
+
ent_html = displacy.render(n_text, style="ent", jupyter=False)
|
108 |
+
# Display the entity visualization in the browser:
|
109 |
+
st.markdown(ent_html, unsafe_allow_html=True)
|
110 |
|
111 |
st.header("Predict on test data")
|
112 |
with st.form('model_test_prediction'):
|