jishnuprakash commited on
Commit
d1e00d8
1 Parent(s): 0b9a94b

final changes

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -55,6 +55,7 @@ trained_model, tokenizer, test, NER = load_model()
55
  st.header("Try out a text!")
56
  with st.form('model_prediction'):
57
  text = st.text_area("Input Text", test.iloc[0]['text'][20])
 
58
  n1, n2, n3 = st.columns((0.2,0.4,0.4))
59
  ner_check = n1.checkbox("Extract Location and Date", value=True)
60
  predict = n2.form_submit_button("Predict")
@@ -91,8 +92,8 @@ with st.form('model_prediction'):
91
  loc.append(word.text)
92
  loc = list(set(loc))
93
  date = list(set(date))
94
- loc = "None found" if len(loc)==0 else loc
95
- date = "None found" if len(date)==0 else date
96
  st.write("Location entities: " + ",".join(loc))
97
  st.write("Date entities: " + ",".join(date))
98
 
 
55
  st.header("Try out a text!")
56
  with st.form('model_prediction'):
57
  text = st.text_area("Input Text", test.iloc[0]['text'][20])
58
+ text = text[:2000]
59
  n1, n2, n3 = st.columns((0.2,0.4,0.4))
60
  ner_check = n1.checkbox("Extract Location and Date", value=True)
61
  predict = n2.form_submit_button("Predict")
 
92
  loc.append(word.text)
93
  loc = list(set(loc))
94
  date = list(set(date))
95
+ loc = ["None found"] if len(loc)==0 else loc
96
+ date = ["None found"] if len(date)==0 else date
97
  st.write("Location entities: " + ",".join(loc))
98
  st.write("Date entities: " + ",".join(date))
99