File size: 961 Bytes
ad75dbd
3be88b5
ad75dbd
3be88b5
 
 
a460ebb
3be88b5
a460ebb
2919eda
 
 
3be88b5
2919eda
 
 
3be88b5
 
 
 
 
 
d75b708
3be88b5
2919eda
 
5ec754d
2919eda
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import streamlit as st
import utils

from transformers import pipeline
from transformers import AutoTokenizer
from transformers import AutoModelForSequenceClassification

#####################

model_berto='hackathon-somos-nlp-2023/DiagTrast-Berto'
tokenizer_berto = AutoTokenizer.from_pretrained(model_berto)
classifier_berto = pipeline("text-classification", model=model_berto)

model_xml='hackathon-somos-nlp-2023/DiagTrast-Berto'
tokenizer_xml = AutoTokenizer.from_pretrained(model_xml)
classifier_xml = pipeline("text-classification", model=model_xml)

#####################

st.title('Diagn贸stico de Trastornos Mentales')

sintomas = st.text_input(label = 'Introduce s铆ntomas',
                         value = 'Nadie me quiere')

pred_berto = classifier_berto(utils.clean_text(sintomas))
pred_xml = classifier_xml(utils.clean_text(sintomas))

st.markdown('Predicci贸n BERTO: 'pred_berto[0]['label'])
st.markdown('Predicci贸n xml: 'pred_xml[0]['label'])