Update app.py
Browse files
app.py
CHANGED
|
@@ -7,12 +7,13 @@ from transformers import AutoModelForSequenceClassification
|
|
| 7 |
|
| 8 |
#####################
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
model=model_id)
|
| 16 |
|
| 17 |
#####################
|
| 18 |
|
|
@@ -21,6 +22,8 @@ st.title('Diagn贸stico de Trastornos Mentales')
|
|
| 21 |
sintomas = st.text_input(label = 'Introduce s铆ntomas',
|
| 22 |
value = 'Nadie me quiere')
|
| 23 |
|
| 24 |
-
|
|
|
|
| 25 |
|
| 26 |
-
st.markdown(
|
|
|
|
|
|
| 7 |
|
| 8 |
#####################
|
| 9 |
|
| 10 |
+
model_berto='hackathon-somos-nlp-2023/DiagTrast-Berto'
|
| 11 |
+
tokenizer_berto = AutoTokenizer.from_pretrained(model_berto)
|
| 12 |
+
classifier_berto = pipeline("text-classification", model=model_berto)
|
| 13 |
|
| 14 |
+
model_xml='hackathon-somos-nlp-2023/DiagTrast-Berto'
|
| 15 |
+
tokenizer_xml = AutoTokenizer.from_pretrained(model_xml)
|
| 16 |
+
classifier_xml = pipeline("text-classification", model=model_xml)
|
|
|
|
| 17 |
|
| 18 |
#####################
|
| 19 |
|
|
|
|
| 22 |
sintomas = st.text_input(label = 'Introduce s铆ntomas',
|
| 23 |
value = 'Nadie me quiere')
|
| 24 |
|
| 25 |
+
pred_berto = classifier_berto(utils.clean_text(sintomas))
|
| 26 |
+
pred_xml = classifier_xml(utils.clean_text(sintomas))
|
| 27 |
|
| 28 |
+
st.markdown('Predicci贸n BERTO: 'pred_berto[0]['label'])
|
| 29 |
+
st.markdown('Predicci贸n xml: 'pred_xml[0]['label'])
|