rdose commited on
Commit
beb4702
·
1 Parent(s): b1a1abe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -301,10 +301,12 @@ def inference(input_batch,isurl,use_archive,limit_companies=10):
301
  print("[i] Pandas output shape:",df.shape)
302
 
303
  #[[], [('Nvidia', 'Information Technology')], [('Twitter', 'Communication Services'), ('Apple', 'Information Technology')], [], [], [], [], [], []]
 
 
304
  for idx in range(len(df.index)):
305
  if ner_labels[idx]: #not empty
306
  for ner in ner_labels[idx]:
307
- df = pd.concat(df,df.loc[[idx]].assign(company=ner[0], sector=ner[1]), axis=0, join='outer', ignore_index=True)
308
 
309
  return df #ner_labels, {'E':float(prob_outs[0]),"S":float(prob_outs[1]),"G":float(prob_outs[2])},{sentiment['label']:float(sentiment['score'])},"**Summary:**\n\n" + summary
310
 
 
301
  print("[i] Pandas output shape:",df.shape)
302
 
303
  #[[], [('Nvidia', 'Information Technology')], [('Twitter', 'Communication Services'), ('Apple', 'Information Technology')], [], [], [], [], [], []]
304
+ df["company"] = np.nan
305
+ df["sector"] = np.nan
306
  for idx in range(len(df.index)):
307
  if ner_labels[idx]: #not empty
308
  for ner in ner_labels[idx]:
309
+ df = pd.concat([df,df.loc[[idx]].assign(company=ner[0], sector=ner[1])], axis=0, join='outer', ignore_index=True)
310
 
311
  return df #ner_labels, {'E':float(prob_outs[0]),"S":float(prob_outs[1]),"G":float(prob_outs[2])},{sentiment['label']:float(sentiment['score'])},"**Summary:**\n\n" + summary
312