nlp_sentiment / app.py
amaldevc's picture
Update app.py
e278f34 verified
raw
history blame
338 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline(task="sentiment-analysis", model="amaldevc/nlp_sentiment")
def predict(review):
pred = pipe.predict(review)
return pred
#return pred["label"] + " with score " + pred["score"]
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
iface.launch()