Spaces:
Runtime error
Runtime error
Commit
•
543da94
1
Parent(s):
c535553
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio import CSVLogger
|
|
|
|
|
|
|
|
|
|
|
3 |
description = "Get sentiment if a comment is 'no cyber bullying' or 'cyber bullying'.The predicted outputs refer to 'cyber bullying' for racism and sexism comments and 'no cyber bullying' for others comments.please do flag if you feel that the required output isn't desired output "
|
4 |
title = "Cyber Bullying Sentiment Classifier"
|
5 |
examples = [["lets have a coffee later on"],["go to hell Muslims "],["I respect your work ethics"]]
|
@@ -10,5 +15,5 @@ gr.Interface.load("models/Amitesh007/tw-sentiment-finetuned",
|
|
10 |
examples = examples,
|
11 |
allow_flagging="manual",
|
12 |
flagging_options=["incorrect", "ambiguous"],
|
13 |
-
flagging_callback =
|
14 |
).launch()
|
|
|
1 |
import gradio as gr
|
2 |
from gradio import CSVLogger
|
3 |
+
import os
|
4 |
+
|
5 |
+
HF_TOKEN = os.getenv('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')
|
6 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "tw-sentiment-flagged_data")
|
7 |
+
|
8 |
description = "Get sentiment if a comment is 'no cyber bullying' or 'cyber bullying'.The predicted outputs refer to 'cyber bullying' for racism and sexism comments and 'no cyber bullying' for others comments.please do flag if you feel that the required output isn't desired output "
|
9 |
title = "Cyber Bullying Sentiment Classifier"
|
10 |
examples = [["lets have a coffee later on"],["go to hell Muslims "],["I respect your work ethics"]]
|
|
|
15 |
examples = examples,
|
16 |
allow_flagging="manual",
|
17 |
flagging_options=["incorrect", "ambiguous"],
|
18 |
+
flagging_callback = hf_writter
|
19 |
).launch()
|