Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import fastai | |
| import skimage | |
| from fastai.vision.all import * | |
| learn=load_learner('model.pkl') | |
| categories=('negative','positive') | |
| def classify(text): | |
| pred,idx,probs=learn.predict(text) | |
| return dict(zip(categories, map(float,probs))) | |
| examples=['This was a very though provoking movie and very well written'] | |
| title = "Text sentiment classifier" | |
| description = "This model classifies a sentence of text as having a positive or negative setiment" | |
| text = gr.Textbox() | |
| label= gr.Label() | |
| intf=gr.Interface(fn=classify,inputs=text,outputs=label,title=title, description=description, examples=examples) | |
| intf.launch(inline=False) |