Spaces:
Sleeping
Sleeping
import gradio as gr | |
import joblib | |
def predict_sentiment(text): | |
model = joblib.load("pipeline_model.joblib") | |
prediction = model.predict([text]) | |
if prediction[0] == 1: | |
return "This sounds negative." | |
else: | |
return "This sounds positive." | |
#return prediction | |
iface = gr.Interface( | |
fn=predict_sentiment, | |
inputs=gr.Textbox(placeholder="Enter text here", label="A demonstration model for akshar. Write a negative or positive paragraph below."), # Text input box | |
outputs=gr.Textbox(), | |
live=True | |
) | |
iface.launch(share = True) | |