AhmedTaha012 commited on
Commit
f4946a4
1 Parent(s): e3f78a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -220,8 +220,11 @@ if st.button("Analyze"):
220
  if len(ents[idxx]["word"].split())==2:
221
  ner_result.append({ents[idxx]["entity_group"]:ents[idxx]["word"]})
222
  else:
223
- ner_result.append({ents[idxx]["entity_group"]:ents[idxx]["word"]+ents[idxx+1]["word"]+ents[idxx+2]["word"]})
224
- idxx=idxx+2
 
 
 
225
  idxx=idxx+1
226
  idx=idx+1
227
  profits=[x["profit"] for x in ner_result if "profit" in x]
 
220
  if len(ents[idxx]["word"].split())==2:
221
  ner_result.append({ents[idxx]["entity_group"]:ents[idxx]["word"]})
222
  else:
223
+ try:
224
+ ner_result.append({ents[idxx]["entity_group"]:ents[idxx]["word"]+ents[idxx+1]["word"]+ents[idxx+2]["word"]})
225
+ idxx=idxx+2
226
+ except:
227
+ pass
228
  idxx=idxx+1
229
  idx=idx+1
230
  profits=[x["profit"] for x in ner_result if "profit" in x]