File size: 1,034 Bytes
ad75dbd 3be88b5 ad75dbd 3be88b5 a460ebb 3be88b5 a460ebb 2919eda 3be88b5 2919eda 3be88b5 603a2e2 3be88b5 2919eda 5ec754d 4269d86 603a2e2 |
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 30 31 |
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 y presiona Enter',
value = 'La gente cuando me ve por la calle me mira y halagan mi belleza')
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'])
|