Commit
·
d68ebfc
1
Parent(s):
56db43e
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,8 @@ def do_action(text):
|
|
| 8 |
candidate_labels = ['gun control', 'abortion', 'gender transition', 'freedom of speech', 'immigration', 'taxes']
|
| 9 |
result = classifier(text, candidate_labels)
|
| 10 |
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
iface = gr.Interface(fn=do_action, inputs="text", outputs="text")
|
| 14 |
iface.launch()
|
|
|
|
| 8 |
candidate_labels = ['gun control', 'abortion', 'gender transition', 'freedom of speech', 'immigration', 'taxes']
|
| 9 |
result = classifier(text, candidate_labels)
|
| 10 |
|
| 11 |
+
sentence = f"{result['labels'][0]} with a score of {result['scores'][0]}"
|
| 12 |
+
return sentence
|
| 13 |
|
| 14 |
iface = gr.Interface(fn=do_action, inputs="text", outputs="text")
|
| 15 |
iface.launch()
|