Spaces:
Runtime error
Runtime error
import gradio as gr | |
from sentiment import vectr, clf | |
def predict(text): | |
senti = clf.predict(vectr.transform([text])) | |
if (int(senti)): | |
text_sent = "Positive Sentiment Detected😊" | |
else: | |
text_sent = "Negative Sentiment Detected😟" | |
return text_sent | |
demo = gr.Interface(fn=predict, inputs="text", outputs="text") | |
demo.launch() |