Spaces:
Build error
Build error
Update pages/2_π_Daily Narrative.py
Browse files- pages/2_π_Daily Narrative.py +10 -10
pages/2_π_Daily Narrative.py
CHANGED
@@ -160,15 +160,15 @@ def run_model(input_text):
|
|
160 |
col1, col2 = st.columns([1,1])
|
161 |
|
162 |
with col1:
|
163 |
-
st.button('Summarize')
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
with col2:
|
168 |
-
st.button('NER')
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
|
|
|
160 |
col1, col2 = st.columns([1,1])
|
161 |
|
162 |
with col1:
|
163 |
+
if st.button('Summarize')
|
164 |
+
run_model(runtext)
|
165 |
+
sentences=runtext.split('.')
|
166 |
+
st.text_area('Reference text', str(reference_text))#,label_visibility="hidden")
|
167 |
with col2:
|
168 |
+
if st.button('NER')
|
169 |
+
doc = nlp(str(original_text2))
|
170 |
+
colors = { "DISEASE": "pink","CHEMICAL": "orange"}
|
171 |
+
options = {"ents": [ "DISEASE", "CHEMICAL"],"colors": colors}
|
172 |
+
ent_html = displacy.render(doc, style="ent", options=options)
|
173 |
+
st.markdown(ent_html, unsafe_allow_html=True)
|
174 |
|