Spaces:
Sleeping
Sleeping
Commit ·
14b7f46
1
Parent(s): d7ba81d
added example
Browse files
app.py
CHANGED
|
@@ -11,11 +11,11 @@ def classify(img):
|
|
| 11 |
pred,idx,probs=learn.predict(img)
|
| 12 |
return dict(zip(categories, map(float,probs)))
|
| 13 |
|
| 14 |
-
|
| 15 |
title = "Text sentiment classifier"
|
| 16 |
description = "This model classifies a sentence of text as having a positive or negative setiment"
|
| 17 |
text = gr.Textbox()
|
| 18 |
label= gr.Label()
|
| 19 |
|
| 20 |
-
intf=gr.Interface(fn=classify,inputs=text,outputs=label,title=title, description=description)
|
| 21 |
intf.launch(inline=False)
|
|
|
|
| 11 |
pred,idx,probs=learn.predict(img)
|
| 12 |
return dict(zip(categories, map(float,probs)))
|
| 13 |
|
| 14 |
+
examples=['This was a very though provoking movie and very well written']
|
| 15 |
title = "Text sentiment classifier"
|
| 16 |
description = "This model classifies a sentence of text as having a positive or negative setiment"
|
| 17 |
text = gr.Textbox()
|
| 18 |
label= gr.Label()
|
| 19 |
|
| 20 |
+
intf=gr.Interface(fn=classify,inputs=text,outputs=label,title=title, description=description, examples=examples)
|
| 21 |
intf.launch(inline=False)
|