georad commited on
Commit
75c696f
·
verified ·
1 Parent(s): e78bd69

Update pages/type_text.py

Browse files
Files changed (1) hide show
  1. pages/type_text.py +4 -4
pages/type_text.py CHANGED
@@ -97,7 +97,7 @@ INTdesc_input = st.text_input("Type internal description", key="user_input")
97
 
98
  placeholder, right_column = st.columns(2)
99
  #placeholder_clicked = placeholder.button("Perform some action", key="user_placeholder")
100
- right_column.button("Reset", on_click=on_click)
101
 
102
  numMAPPINGS_input = 5
103
  #numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
@@ -133,7 +133,7 @@ def load_model():
133
  model = load_model()
134
 
135
 
136
- mapSBS_button = st.button("Map to SBS codes")
137
 
138
 
139
  INTdesc_embedding = model.encode(INTdesc_input)
@@ -157,7 +157,7 @@ rs_models = {
157
  }
158
 
159
  ## Create the select box
160
- selected_rs_model = st.selectbox('Choose a Reasoning model:', list(st_models.keys()))
161
  st.write("Current selection:", selected_rs_model)
162
 
163
  ## Get the selected model
@@ -174,7 +174,7 @@ pipe = load_pipe()
174
  dictA = {"Score": [], "SBS Code": [], "SBS Description V2.0": []}
175
  dfALL = pd.DataFrame.from_dict(dictA)
176
 
177
- if INTdesc_input is not None and createSBScodes_clicked == True:
178
  for i, result in enumerate(HF_model_results_displayed):
179
  dictA.update({"Score": "%.4f" % result[0]["score"], "SBS Code": df_SBS.loc[df_SBS["Long_Description"] == SBScorpus[result[0]["corpus_id"]],"SBS_Code_Hyphenated"].values[0], "SBS Description V2.0": SBScorpus[result[0]["corpus_id"]]})
180
  dfALL = pd.concat([dfALL, pd.DataFrame([dictA])], ignore_index=True)
 
97
 
98
  placeholder, right_column = st.columns(2)
99
  #placeholder_clicked = placeholder.button("Perform some action", key="user_placeholder")
100
+ right_column.button("Reset description", on_click=on_click)
101
 
102
  numMAPPINGS_input = 5
103
  #numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
 
133
  model = load_model()
134
 
135
 
136
+ mapSBS_button = st.button("Map to SBS codes", on_click=on_click, key="user_clickedSBS")
137
 
138
 
139
  INTdesc_embedding = model.encode(INTdesc_input)
 
157
  }
158
 
159
  ## Create the select box
160
+ selected_rs_model = st.selectbox('Choose a Reasoning model:', list(rs_models.keys()))
161
  st.write("Current selection:", selected_rs_model)
162
 
163
  ## Get the selected model
 
174
  dictA = {"Score": [], "SBS Code": [], "SBS Description V2.0": []}
175
  dfALL = pd.DataFrame.from_dict(dictA)
176
 
177
+ if INTdesc_input is not None and mapSBS_button == True:
178
  for i, result in enumerate(HF_model_results_displayed):
179
  dictA.update({"Score": "%.4f" % result[0]["score"], "SBS Code": df_SBS.loc[df_SBS["Long_Description"] == SBScorpus[result[0]["corpus_id"]],"SBS_Code_Hyphenated"].values[0], "SBS Description V2.0": SBScorpus[result[0]["corpus_id"]]})
180
  dfALL = pd.concat([dfALL, pd.DataFrame([dictA])], ignore_index=True)