File size: 636 Bytes
ad75dbd
3be88b5
ad75dbd
3be88b5
 
 
a460ebb
3be88b5
a460ebb
3be88b5
 
 
 
 
 
 
 
 
 
 
 
d75b708
3be88b5
5ec754d
 
 
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
import streamlit as st
import utils

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

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

model_id='hackathon-somos-nlp-2023/DiagTrast'

tokenizer = AutoTokenizer.from_pretrained(model_id)

classifier = pipeline("text-classification", 
                      model=model_id)

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

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

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

pred = classifier(utils.clean_text(sintomas))

st.markdown(pred[0]['label'])