rotaba commited on
Commit
59ca737
·
1 Parent(s): 2a2cc4e

fixed error

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -32,7 +32,7 @@ def load_data(file_location):
32
  # print("Unpacked string data:", unpacked_string_data)
33
  # print("Unpacked url data:", unpacked_url_data)
34
  # print("Unpacked JSON data:", unpacked_json_data)
35
- return unpacked_string_data, unpacked_url_data, unpacked_json_data
36
 
37
  # Helper methods
38
  @st.cache(allow_output_mutation=True)
@@ -42,6 +42,7 @@ def analyzer_engine():
42
  spacy_recognizer = CustomSpacyRecognizer()
43
 
44
  configuration = {
 
45
  "nlp_engine_name": "spacy",
46
  "models": [
47
  {"lang_code": "en", "model_name": "en_spacy_pii_distilbert"}],
@@ -127,14 +128,15 @@ Detect and anonymize PII in structured text such as protocol traces (JSON, SQL,
127
  st.sidebar.image("assets/bitahoy-logo.png", width=200)
128
 
129
  # dropdown
130
- titles, urls, jsons = load_data("assets/data_sorted.csv")
131
  option_list = titles
132
- option = st.selectbox(
133
  'Choose an existing structured input?',
134
  option_list)
135
 
136
- st.write('You selected:', option)
137
-
 
138
  #romans complex dropdown
139
  # st.checkbox("Enable/Disable input of existing data", key="disabled")
140
  #
@@ -194,11 +196,12 @@ with col1:
194
  # key="visibility",
195
  # options=["visible", "hidden", "collapsed"],
196
  # )
 
197
  st_text = st.text_area(
198
- label="Use dropdown or type in some text",
199
  value="SELECT shipping FROM users WHERE shipping = '201 Thayer St Providence RI 02912'"
200
- "\n\n"
201
- "{user: Willie Porter, ip: 192.168.2.80, email: [email protected]}",
202
  height=200,
203
  )
204
 
 
32
  # print("Unpacked string data:", unpacked_string_data)
33
  # print("Unpacked url data:", unpacked_url_data)
34
  # print("Unpacked JSON data:", unpacked_json_data)
35
+ return unpacked_string_data, dict(zip(unpacked_string_data, unpacked_json_data))
36
 
37
  # Helper methods
38
  @st.cache(allow_output_mutation=True)
 
42
  spacy_recognizer = CustomSpacyRecognizer()
43
 
44
  configuration = {
45
+ # print("ENALBEE MODELES")
46
  "nlp_engine_name": "spacy",
47
  "models": [
48
  {"lang_code": "en", "model_name": "en_spacy_pii_distilbert"}],
 
128
  st.sidebar.image("assets/bitahoy-logo.png", width=200)
129
 
130
  # dropdown
131
+ titles, json_dict = load_data("assets/data_sorted.csv")
132
  option_list = titles
133
+ option = st.sidebar.selectbox(
134
  'Choose an existing structured input?',
135
  option_list)
136
 
137
+ # st.sidebar.write('You selected:', option)
138
+ st.sidebar.code (json_dict[option])
139
+ st.sidebar.write('Use button to copy input to clipboard')
140
  #romans complex dropdown
141
  # st.checkbox("Enable/Disable input of existing data", key="disabled")
142
  #
 
196
  # key="visibility",
197
  # options=["visible", "hidden", "collapsed"],
198
  # )
199
+ # st.json({ })
200
  st_text = st.text_area(
201
+ label="Type in some text",
202
  value="SELECT shipping FROM users WHERE shipping = '201 Thayer St Providence RI 02912'"
203
+ "\n\n"
204
+ "{user: Willie Porter, ip: 192.168.2.80, email: [email protected]}",
205
  height=200,
206
  )
207