Spaces:
Runtime error
Runtime error
| 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() | |