Update app.py
Browse files
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/
|
36 |
trainer = Trainer(model=model)
|
37 |
|
38 |
-
tokenizer = AutoTokenizer.from_pretrained("vonewman/
|
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),
|
|
|
94 |
with c2:
|
95 |
#textbutton = download_button(results, "results.txt", "π₯ Download .txt")
|
96 |
-
textbutton = st.download_button(label="π₯ Download .txt", data=convert_df(results),
|
|
|
97 |
with c3:
|
98 |
#jsonbutton = download_button(results, "results.json", "π₯ Download .json")
|
99 |
-
jsonbutton = st.download_button(label="π₯ Download .json", data=convert_json(results),
|
|
|
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
|
118 |
-
- The available entitites are: *corporation*, *
|
119 |
-
- The app uses the [
|
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 |
)
|