elshehawy commited on
Commit
0734055
·
1 Parent(s): a6669f5

update the example, and organize the ouput

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -46,14 +46,18 @@ def find_orgs(sentence, choice):
46
  return get_completion(prompt)
47
  else:
48
  message = 'Organizations are:'
 
49
  for ent in pipe(sentence):
50
- if ent['entity_group'] == 'ORG':
51
  message += f'\n- {ent["word"]}'
 
52
  return message
53
 
54
 
55
  example = """
56
  My latest exclusive for The Hill : Conservative frustration over Republican efforts to force a House vote on reauthorizing the Export - Import Bank boiled over Wednesday during a contentious GOP meeting.
 
 
57
  """
58
  radio_btn = gr.Radio(choices=['GPT', 'iSemantics'], value='iSemantics', label='Available models')
59
  textbox = gr.Textbox(label="Enter your text", placeholder="", lines=4)
 
46
  return get_completion(prompt)
47
  else:
48
  message = 'Organizations are:'
49
+ org_list = []
50
  for ent in pipe(sentence):
51
+ if ent['entity_group'] == 'ORG' and ent['word'] not in org_list:
52
  message += f'\n- {ent["word"]}'
53
+ org_list.append(ent['word'])
54
  return message
55
 
56
 
57
  example = """
58
  My latest exclusive for The Hill : Conservative frustration over Republican efforts to force a House vote on reauthorizing the Export - Import Bank boiled over Wednesday during a contentious GOP meeting.
59
+
60
+ Apple, Microsoft, and Google are big tech companies.
61
  """
62
  radio_btn = gr.Radio(choices=['GPT', 'iSemantics'], value='iSemantics', label='Available models')
63
  textbox = gr.Textbox(label="Enter your text", placeholder="", lines=4)