File size: 334 Bytes
32f54f5
 
 
 
 
 
 
 
690a0b1
8141d0c
32f54f5
 
8141d0c
690a0b1
3db2689
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()