petrsovadina commited on
Commit
7a4486e
1 Parent(s): 10ab3e3

Update presidio_streamlit.py

Browse files
Files changed (1) hide show
  1. presidio_streamlit.py +4 -9
presidio_streamlit.py CHANGED
@@ -49,7 +49,7 @@ model_help_text = """
49
  st_ta_key = st_ta_endpoint = ""
50
 
51
  model_list = [
52
- "spaCy/cs_core_news_sm",
53
  "iiiorg/piiranha-v1-detect-personal-information",
54
  "FacebookAI/xlm-roberta-large-finetuned-conll03-english",
55
  ]
@@ -69,13 +69,13 @@ st_model_package = st_model.split("/")[0]
69
  # Odstranění prefixu balíčku (pokud je potřeba)
70
  st_model = (
71
  st_model
72
- if st_model_package.lower() not in ("spacy", "piiiranha")
73
  else "/".join(st_model.split("/")[1:])
74
  )
75
 
76
  if st_model == "Other":
77
  st_model_package = st.sidebar.selectbox(
78
- "NER model OSS balíček", options=["spacy", "piiiranha"]
79
  )
80
  st_model = st.sidebar.text_input(f"Název NER modelu", value="")
81
 
@@ -338,12 +338,7 @@ try:
338
  },
339
  axis=1,
340
  )
341
- df_subset["Text"] = [st_text[res.start : res.end] for res in st_analyze_results]
342
- if st_return_decision_process:
343
- analysis_explanation_df = pd.DataFrame.from_records(
344
- [r.analysis_explanation.to_dict() for r in st_analyze_results]
345
- )
346
- df_subset = pd.concat([df_subset, analysis_explanation_df], axis=1)
347
  st.dataframe(df_subset.reset_index(drop=True), use_container_width=True)
348
  else:
349
  st.text("Žádné nálezy")
 
49
  st_ta_key = st_ta_endpoint = ""
50
 
51
  model_list = [
52
+ "spacy/en_core_web_sm",
53
  "iiiorg/piiranha-v1-detect-personal-information",
54
  "FacebookAI/xlm-roberta-large-finetuned-conll03-english",
55
  ]
 
69
  # Odstranění prefixu balíčku (pokud je potřeba)
70
  st_model = (
71
  st_model
72
+ if st_model_package.lower() not in ("spacy", "iiiorg")
73
  else "/".join(st_model.split("/")[1:])
74
  )
75
 
76
  if st_model == "Other":
77
  st_model_package = st.sidebar.selectbox(
78
+ "NER model OSS balíček", options=["spacy", "iiiorg"]
79
  )
80
  st_model = st.sidebar.text_input(f"Název NER modelu", value="")
81
 
 
338
  },
339
  axis=1,
340
  )
341
+ df_subset = pd.concat([df_subset, analysis_explanation_df], axis=1)
 
 
 
 
 
342
  st.dataframe(df_subset.reset_index(drop=True), use_container_width=True)
343
  else:
344
  st.text("Žádné nálezy")