File size: 968 Bytes
176fea5
797da9c
543da94
 
8927ddf
02db558
543da94
2a450ee
ed7b2a1
79e71b7
797da9c
ed7b2a1
 
 
 
 
77d24d0
8927ddf
4d8977a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr

import os

HF_TOKEN = os.getenv("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")
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN,dataset_name="flagged_data")

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 "
title = "Cyber Bullying Sentiment Classifier"
examples = [["lets have a coffee later on"],["go to hell Muslims "],["I respect your work ethics"]]
            
gr.Interface.load("models/Amitesh007/tw-sentiment-finetuned",
                 description = description,
                 title = title,
                 examples = examples,
                 allow_flagging="manual",
                 flagging_options=["incorrect", "ambiguous"],
                 flagging_callback = hf_writer
                 ).launch()