import gradio as gr | |
from transformers import pipeline | |
analyzer = pipeline("sentiment-analysis") | |
def greet(name): | |
#return "Hello " + name | |
return (analyzer(name)) | |
# We instantiate the Textbox class | |
textbox = gr.Textbox(label="Please fill in something words:",placeholder="happy", lines=2) | |
#textbox = gr.Textbox(label="Type your name here:", placeholder="John Doe", lines=2) | |
gr.Interface(fn=greet, inputs=textbox, outputs="text").launch(share=True) |