text_tagging / app.py
seemapatil's picture
Update app.py
32f54f5
raw
history blame contribute delete
334 Bytes
import streamlit as st
import gradio as gr
from transformers import pipeline
pipe = pipeline ('sentiment-analysis')
text = st.text_area('enter some text!')
def predict_sentiment(text):
result = pipe(text)[0]
return result['label']
iface = gr.Interface(fn=predict_sentiment, inputs="text", outputs="text")
iface.launch()