Spaces:
Build error
Build error
File size: 329 Bytes
163ca3c 661ff60 36a334c f2fdc64 163ca3c 661ff60 |
1 2 3 4 5 6 7 8 9 10 11 12 |
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() |