Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,21 @@ sentiment_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncas
|
|
| 7 |
ner_pipeline = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english", aggregation_strategy="simple")
|
| 8 |
|
| 9 |
moderation_guidelines = """
|
| 10 |
-
- Allow positive messages
|
| 11 |
-
- Block cuss words
|
| 12 |
-
- Allow negative comments about individuals but block negative comments against a community
|
| 13 |
-
- Block personal names
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
default_cuss_words = {"damn", "hell", "shit", "fuck", "ass", "bastard", "bitch", "bollocks", "bugger",
|
|
@@ -76,4 +87,4 @@ with gr.Blocks() as demo:
|
|
| 76 |
|
| 77 |
moderate_btn.click(moderate_message, inputs=[msg_input, guidelines_input], outputs=[msg_output])
|
| 78 |
|
| 79 |
-
demo.launch()
|
|
|
|
| 7 |
ner_pipeline = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english", aggregation_strategy="simple")
|
| 8 |
|
| 9 |
moderation_guidelines = """
|
| 10 |
+
- Allow positive messages.
|
| 11 |
+
- Block cuss words.
|
| 12 |
+
- Allow negative comments about individuals but block negative comments against a community.
|
| 13 |
+
- Block personal names.
|
| 14 |
+
- Block hate speech or offensive language.
|
| 15 |
+
- Block messages containing threats, violence, or self-harm.
|
| 16 |
+
- Block excessive use of capital letters (potential shouting).
|
| 17 |
+
- Block messages with spam, links, or promotional content.
|
| 18 |
+
- Block messages with excessive special characters (potential spam).
|
| 19 |
+
- Allow constructive criticism but block harassment and bullying.
|
| 20 |
+
- Allow neutral discussions about sensitive topics but block inciting hate.
|
| 21 |
+
- Block messages with misleading or false information.
|
| 22 |
+
- Block messages containing phone numbers or personal addresses.
|
| 23 |
+
- Block messages with excessive repetition of words (spam behavior).
|
| 24 |
+
|
| 25 |
"""
|
| 26 |
|
| 27 |
default_cuss_words = {"damn", "hell", "shit", "fuck", "ass", "bastard", "bitch", "bollocks", "bugger",
|
|
|
|
| 87 |
|
| 88 |
moderate_btn.click(moderate_message, inputs=[msg_input, guidelines_input], outputs=[msg_output])
|
| 89 |
|
| 90 |
+
demo.launch(share=True)
|