Spaces:
Sleeping
Sleeping
File size: 554 Bytes
aa71662 d7ba81d aa71662 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import fastai
import skimage
from fastai.vision.all import *
learn=load_learner('model.pkl')
categories=('negative','positive')
def classify(img):
pred,idx,probs=learn.predict(img)
return dict(zip(categories, map(float,probs)))
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)
intf.launch(inline=False) |