elshehawy commited on
Commit
ef55574
β€’
1 Parent(s): 953205d

update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -106,24 +106,24 @@ def find_orgs(uploaded_file):
106
  uploaded_data = json.loads(uploaded_file)
107
 
108
 
109
- all_metrics = {}
110
- all_metrics['trf'] = get_metrics_trf(uploaded_data)
111
 
112
- store_sample_data(uploaded_data)
113
- with open('./data/sample_data.json', 'r') as f:
114
- sample_data = json.load(f)
115
 
116
- gpt_orgs, true_orgs = [], []
117
 
118
- for sent in sample_data:
119
- gpt_orgs.append(find_orgs_gpt(sent['text']))
120
- true_orgs.append(sent['orgs'])
121
 
122
 
123
  # sim_model = SimCSE('sentence-transformers/all-MiniLM-L6-v2')
124
  # all_metrics['gpt'] = calc_metrics(true_orgs, gpt_orgs, sim_model)
125
 
126
- return
127
  # radio_btn = gr.Radio(choices=['GPT', 'iSemantics'], value='iSemantics', label='Available models', show_label=True)
128
  # textbox = gr.Textbox(label="Enter your text", placeholder=str(all_metrics), lines=8)
129
  upload_btn = gr.UploadButton(label='Upload a json file.', type='binary')
 
106
  uploaded_data = json.loads(uploaded_file)
107
 
108
 
109
+ # all_metrics = {}
110
+ # all_metrics['trf'] = get_metrics_trf(uploaded_data)
111
 
112
+ # store_sample_data(uploaded_data)
113
+ # with open('./data/sample_data.json', 'r') as f:
114
+ # sample_data = json.load(f)
115
 
116
+ # gpt_orgs, true_orgs = [], []
117
 
118
+ # for sent in sample_data:
119
+ # gpt_orgs.append(find_orgs_gpt(sent['text']))
120
+ # true_orgs.append(sent['orgs'])
121
 
122
 
123
  # sim_model = SimCSE('sentence-transformers/all-MiniLM-L6-v2')
124
  # all_metrics['gpt'] = calc_metrics(true_orgs, gpt_orgs, sim_model)
125
 
126
+ return get_metrics_trf(uploaded_data)
127
  # radio_btn = gr.Radio(choices=['GPT', 'iSemantics'], value='iSemantics', label='Available models', show_label=True)
128
  # textbox = gr.Textbox(label="Enter your text", placeholder=str(all_metrics), lines=8)
129
  upload_btn = gr.UploadButton(label='Upload a json file.', type='binary')