vonewman commited on
Commit
a055f19
Β·
1 Parent(s): e7cf3ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -32,10 +32,10 @@ st.title("πŸ“˜Named Entity Recognition Tagger")
32
  @st.cache(allow_output_mutation=True)
33
  def load_model():
34
 
35
- model = AutoModelForTokenClassification.from_pretrained("vonewman/xlm-roberta-base-finetuned-wolof")
36
  trainer = Trainer(model=model)
37
 
38
- tokenizer = AutoTokenizer.from_pretrained("vonewman/xlm-roberta-base-finetuned-wolof")
39
 
40
  return trainer, model, tokenizer
41
 
@@ -90,13 +90,16 @@ if submit_button:
90
 
91
  with c1:
92
  #csvbutton = download_button(results, "results.csv", "πŸ“₯ Download .csv")
93
- csvbutton = st.download_button(label="πŸ“₯ Download .csv", data=convert_df(results), file_name= "results.csv", mime='text/csv', key='csv')
 
94
  with c2:
95
  #textbutton = download_button(results, "results.txt", "πŸ“₯ Download .txt")
96
- textbutton = st.download_button(label="πŸ“₯ Download .txt", data=convert_df(results), file_name= "results.text", mime='text/plain', key='text')
 
97
  with c3:
98
  #jsonbutton = download_button(results, "results.json", "πŸ“₯ Download .json")
99
- jsonbutton = st.download_button(label="πŸ“₯ Download .json", data=convert_json(results), file_name= "results.json", mime='application/json', key='json')
 
100
 
101
  st.header("")
102
 
@@ -114,10 +117,9 @@ with st.expander("ℹ️ - About this app", expanded=True):
114
 
115
  st.write(
116
  """
117
- - The **Named Entity Recognition Tagger** app is a tool that performs named entity recognition.
118
- - The available entitites are: *corporation*, *creative-work*, *group*, *location*, *person* and *product*.
119
- - The app uses the [RoBERTa model](https://huggingface.co/roberta-large), fine-tuned on the [wnut](https://huggingface.co/datasets/wnut_17) dataset.
120
- - The model uses the **byte-level BPE tokenizer**. Each sentece is first tokenized.
121
- - For more info regarding the data science part, check this [post](https://towardsdatascience.com/named-entity-recognition-with-deep-learning-bert-the-essential-guide-274c6965e2d?sk=c3c3699e329e45a8ed93d286ae04ef10).
122
  """
123
  )
 
32
  @st.cache(allow_output_mutation=True)
33
  def load_model():
34
 
35
+ model = AutoModelForTokenClassification.from_pretrained("vonewman/wolof-finetuned-ner")
36
  trainer = Trainer(model=model)
37
 
38
+ tokenizer = AutoTokenizer.from_pretrained("vonewman/wolof-finetuned-ner")
39
 
40
  return trainer, model, tokenizer
41
 
 
90
 
91
  with c1:
92
  #csvbutton = download_button(results, "results.csv", "πŸ“₯ Download .csv")
93
+ csvbutton = st.download_button(label="πŸ“₯ Download .csv", data=convert_df(results),
94
+ file_name= "results.csv", mime='text/csv', key='csv')
95
  with c2:
96
  #textbutton = download_button(results, "results.txt", "πŸ“₯ Download .txt")
97
+ textbutton = st.download_button(label="πŸ“₯ Download .txt", data=convert_df(results),
98
+ file_name= "results.text", mime='text/plain', key='text')
99
  with c3:
100
  #jsonbutton = download_button(results, "results.json", "πŸ“₯ Download .json")
101
+ jsonbutton = st.download_button(label="πŸ“₯ Download .json", data=convert_json(results),
102
+ file_name= "results.json", mime='application/json', key='json')
103
 
104
  st.header("")
105
 
 
117
 
118
  st.write(
119
  """
120
+ - The **Named Entity Recognition Wolof** app is a tool that performs named entity recognition in Wolof.
121
+ - The available entitites are: *corporation*, *location*, *person* and *date*.
122
+ - The app uses the [XLMRoberta model](https://huggingface.co/xlm-roberta-base), fine-tuned on the [wnut](https://huggingface.co/datasets/masakhane/masakhaner2) dataset.
123
+ - The model uses the **byte-level BPE tokenizer**. Each sentece is first tokenized.
 
124
  """
125
  )