ecroatt's picture
Update app.py
979657c verified
raw
history blame contribute delete
430 Bytes
import gradio as gr
from inference import predict
def classify(review):
prob = predict(review)
label = "πŸ‘ Positive" if prob >= 0.5 else "πŸ‘Ž Negative"
return f"{label} ({prob:.2f})"
demo = gr.Interface(
fn=classify,
inputs=gr.Textbox(lines=4, placeholder="Paste a movie review"),
outputs="text",
title="IMDB Sentiment β€” Bi-LSTM")
if __name__ == "__main__":
demo.launch()