rdose commited on
Commit
7d9504d
·
1 Parent(s): f606246

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -358,8 +358,9 @@ def inference(input_batch,isurl,use_archive,filt_companies_topic,limit_companies
358
  if ner_labels[idx]: #not empty
359
  for ner in ner_labels[idx]:
360
  if filt_companies_topic:
361
- if news_sectors[idx][0] not in ner[1]:
362
- continue
 
363
  dfo = pd.concat( [dfo, df.loc[[idx]].assign(company=ner[0], sector=ner[1], symbol=ner[2])], join='outer', ignore_index=True) #axis=0
364
  print("[i] Pandas output shape:",dfo.shape)
365
  return dfo.drop_duplicates()
 
358
  if ner_labels[idx]: #not empty
359
  for ner in ner_labels[idx]:
360
  if filt_companies_topic:
361
+ if news_sectors[idx]: #not empty
362
+ if news_sectors[idx][0] not in ner[1]:
363
+ continue
364
  dfo = pd.concat( [dfo, df.loc[[idx]].assign(company=ner[0], sector=ner[1], symbol=ner[2])], join='outer', ignore_index=True) #axis=0
365
  print("[i] Pandas output shape:",dfo.shape)
366
  return dfo.drop_duplicates()