WhiteAngels
commited on
Commit
•
fe59bf9
1
Parent(s):
9ab5aa1
Update app.py
Browse files
app.py
CHANGED
@@ -20,23 +20,18 @@ st.title("NLP Toolkit")
|
|
20 |
task_list = ['Metin Sınıflandırma', 'Metin Analizi', 'Duygu Analizi', 'Metin Oluşturma']
|
21 |
task = st.sidebar.selectbox("Görev Seç", task_list)
|
22 |
|
23 |
-
# Model listesi
|
24 |
-
|
25 |
-
'akdeniz27/bert-base-turkish-cased-ner',
|
26 |
-
'akdeniz27/convbert-base-turkish-cased-ner',
|
27 |
-
'akdeniz27/xlm-roberta-base-turkish-ner',
|
28 |
-
'xlm-roberta-large-finetuned-conll03-english'
|
29 |
-
|
30 |
-
]
|
31 |
|
32 |
-
|
33 |
-
model_checkpoint = st.sidebar.radio("", model_list)
|
34 |
|
35 |
# Aggregation Strategy
|
36 |
-
if model_checkpoint in ["akdeniz27/xlm-roberta-base-turkish-ner", "xlm-roberta-large-finetuned-conll03-english", "asahi417/tner-xlm-roberta-base-ontonotes5"]
|
37 |
-
aggregation = "simple"
|
38 |
-
else:
|
39 |
-
aggregation = "first"
|
40 |
|
41 |
st.sidebar.write("For details of models: 'https://huggingface.co/WhiteAngelss/")
|
42 |
st.sidebar.write("")
|
|
|
20 |
task_list = ['Metin Sınıflandırma', 'Metin Analizi', 'Duygu Analizi', 'Metin Oluşturma']
|
21 |
task = st.sidebar.selectbox("Görev Seç", task_list)
|
22 |
|
23 |
+
# Model listesi ve model seçimi
|
24 |
+
model_mapping = {
|
25 |
+
'Metin Sınıflandırma': 'akdeniz27/bert-base-turkish-cased-ner',
|
26 |
+
'Metin Analizi': 'akdeniz27/convbert-base-turkish-cased-ner',
|
27 |
+
'Duygu Analizi': 'akdeniz27/xlm-roberta-base-turkish-ner',
|
28 |
+
'Metin Oluşturma': 'xlm-roberta-large-finetuned-conll03-english'
|
29 |
+
}
|
|
|
30 |
|
31 |
+
model_checkpoint = model_mapping.get(task, 'akdeniz27/xlm-roberta-base-turkish-ner')
|
|
|
32 |
|
33 |
# Aggregation Strategy
|
34 |
+
aggregation = "simple" if model_checkpoint in ["akdeniz27/xlm-roberta-base-turkish-ner", "xlm-roberta-large-finetuned-conll03-english", "asahi417/tner-xlm-roberta-base-ontonotes5"] else "first"
|
|
|
|
|
|
|
35 |
|
36 |
st.sidebar.write("For details of models: 'https://huggingface.co/WhiteAngelss/")
|
37 |
st.sidebar.write("")
|