Spaces:
Build error
Build error
Update app.py
Browse files
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]
|
| 362 |
-
|
|
|
|
| 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()
|