dev_NLP / app.py
ahmadouna's picture
Update app.py
a964948
raw
history blame
563 Bytes
import streamlit as st
from transformers import pipeline
""""
pipe = pipeline('sentiment-analysis')
st.title("Analyse de sentiment")
#Textbox for text user is entering
out = pipe(text)
st.write("Sentiment du text: ")
st.write(out)
"""
classifier = pipeline("zero-shot-classification",
model="morit/french_xlm_xnli")
text = st.text_input('Entrer le texte a analyser')
andidate_labels = ["politique", "sport"]
hypothesis_template = "Cet example est {}"
st.write(classifier(text, candidate_labels, hypothesis_template=hypothesis_template))