loubnabnl HF Staff commited on
Commit
efd78f7
·
1 Parent(s): b179f66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,14 +14,13 @@ st.markdown("This demo allows the visualization of personal information anonymiz
14
  This is just an illustration of BigCode's PII pipeline and the examples and secrets are synthetic.")
15
 
16
  @st.cache()
17
- def load_data(language="python"):
18
  # load dataset with modified files with: content, references and language columns
19
  dataset = load_dataset("data", split="train")
20
  return dataset
21
 
22
 
23
  def get_samples_tag(dataset, tag):
24
- # get samples with tag
25
  # add column id to be able to retrieve the sample
26
  tmp = dataset.add_column("index", range(len(dataset)))
27
  samples = tmp.filter(lambda x: "PI:" + tag.upper() in x['references'])
@@ -30,6 +29,7 @@ def get_samples_tag(dataset, tag):
30
 
31
  col1, col2 = st.columns([2, 4])
32
  with col1:
 
33
  lang = st.selectbox("Select a programming language", ["Python"])
34
 
35
  samples = load_data(language=lang.lower())
 
14
  This is just an illustration of BigCode's PII pipeline and the examples and secrets are synthetic.")
15
 
16
  @st.cache()
17
+ def load_data():
18
  # load dataset with modified files with: content, references and language columns
19
  dataset = load_dataset("data", split="train")
20
  return dataset
21
 
22
 
23
  def get_samples_tag(dataset, tag):
 
24
  # add column id to be able to retrieve the sample
25
  tmp = dataset.add_column("index", range(len(dataset)))
26
  samples = tmp.filter(lambda x: "PI:" + tag.upper() in x['references'])
 
29
 
30
  col1, col2 = st.columns([2, 4])
31
  with col1:
32
+ #TODO add examples in more languages
33
  lang = st.selectbox("Select a programming language", ["Python"])
34
 
35
  samples = load_data(language=lang.lower())