demo_DiagTrast / app.py
Stremie's picture
Update app.py
5ec754d
raw
history blame
636 Bytes
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'])