Spaces:
Running
on
Zero
Running
on
Zero
Update taxonomy.py
Browse files- taxonomy.py +14 -9
taxonomy.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
-
|
|
|
2 |
Should not:
|
3 |
- Contain content that expresses hateful, derogatory, or demeaning sentiments against people based on sensitive personal characteristics like their race, color, religion, national origin, sexual orientation, gender, gender identity, or disability.
|
4 |
- Contain content that encourages discrimination or harassment against people based on those characteristics.
|
5 |
Can:
|
6 |
- Contain educational content that provides information on discrimination, humiliation, and harassment.
|
7 |
- Discuss historical events involving hate and harassment.
|
|
|
8 |
O2: Violence, Harm, or Cruelty:
|
9 |
Should not:
|
10 |
- Contain content of people planning or engaging in violence.
|
@@ -12,6 +14,7 @@ Should not:
|
|
12 |
Can:
|
13 |
- Contain educational content that provides information on violence, harm, and cruelty.
|
14 |
- Discuss historical events involving violence and cruelty.
|
|
|
15 |
O3: Sexual Content:
|
16 |
Should not:
|
17 |
- Contain sexually explicit (i.e., erotic) content.
|
@@ -20,6 +23,7 @@ Can:
|
|
20 |
- Provide general information regarding sexual activities.
|
21 |
- Provide guidance on topics related to sexual health.
|
22 |
- Contain content of people in a loving and affectionate manner if it is not sexually explicit content.
|
|
|
23 |
O4: Nudity Content:
|
24 |
Should not:
|
25 |
- Contain visible genitalia (e.g., exposed breast, nipple, vagina, vulva, or penis) or explicit nudity content.
|
@@ -27,13 +31,15 @@ Can:
|
|
27 |
- Contain artistic nudity if the content does not include visible genitalia.
|
28 |
- Contain educational content and general information on the human body.
|
29 |
- Provide guidance on topics related to sexual health.
|
|
|
30 |
O5: Criminal Planning:
|
31 |
Should not:
|
32 |
- Contain content of people planning or engaging in criminal activities like theft, kidnapping, or financial crimes.
|
33 |
- Contain content that encourages people to engage in criminal activities or condone criminal behavior.
|
34 |
Can:
|
35 |
- Contain content that helps people understand how crimes are committed, provided that the content is not so detailed that it could be used to provide a roadmap for future crimes.
|
36 |
-
- Contain content that educates on crime prevention and understanding criminal behavior without providing guidance for criminal activities.
|
|
|
37 |
O6: Weapons or Substance Abuse:
|
38 |
Should not:
|
39 |
- Contain content of illegal weapons with the intent to promote violence or harm.
|
@@ -45,6 +51,7 @@ Can:
|
|
45 |
- Discussions on firearm ownership and educational content on regulated substances without promoting illegal activities.
|
46 |
- Contain content that provides factual information about legal drugs, including their effects and chemical composition, without promoting their use.
|
47 |
- Contain content that offers educational insights into the manufacturing processes of substances, ensuring that such information is general and does not include detailed instructions that could facilitate their production.
|
|
|
48 |
O7: Self-Harm:
|
49 |
Should not:
|
50 |
- Contain content that could encourage people to harm themselves.
|
@@ -52,6 +59,7 @@ Should not:
|
|
52 |
Can:
|
53 |
- Contain educational content that informs about the prevalence, causes, and effects of self-harm and suicide, such as statistical data and discussions on mental health challenges.
|
54 |
- Contain resources and information that guide individuals toward professional help and support services for mental health, self-harm, and suicide prevention.
|
|
|
55 |
O8: Animal Cruelty:
|
56 |
Should not:
|
57 |
- Contain content that could encourage people to harm animals.
|
@@ -59,26 +67,23 @@ Should not:
|
|
59 |
- Contain explicit animal cruelty.
|
60 |
Can:
|
61 |
- Contain content that provides general information regarding animal cruelty.
|
|
|
62 |
O9: Disasters or Emergencies:
|
63 |
Should not:
|
64 |
- Contain content about individuals who are deceased or have suffered harm as a result of disasters or emergencies.
|
65 |
- Contain content about suffering, cruelty, or exploitation of individuals during such events.
|
66 |
Can:
|
67 |
- Contain respectful news coverage and reports on emergencies, prioritizing informational value over sensationalism.
|
68 |
-
- Contain educational content that provides factual information on historical and current disasters or emergencies.
|
69 |
-
|
70 |
|
71 |
-
def wrap_taxonomy(taxonomy: str) -> str:
|
72 |
-
return f"""Provide a safety assessment for the content provided by the user. Determine compliance or violation against our safety policy by reviewing the following policy categories:
|
73 |
-
{taxonomy}""" + """
|
74 |
Assessment Steps:
|
75 |
1. Select a safety "rating". This should be "Unsafe" if the content violates the safety policy; otherwise, it should be "Safe".
|
76 |
2. Assign a policy "category". If none of the policy categories are applicable, select "NA: None applying".
|
77 |
-
3. Provide a "rationale".
|
78 |
To provide your assessment use the following json template:
|
79 |
{
|
80 |
"rating": str<"Unsafe"|"Safe">,
|
81 |
"category": str<"O1: Hate, Humiliation, Harassment"|"O2: Violence, Harm, or Cruelty"|"O3: Sexual Content"|"O4: Nudity Content"|"O5: Criminal Planning"|"O6: Weapons or Substance Abuse"|"O7: Self-Harm"|"O8: Animal Cruelty"|"O9: Disasters or Emergencies"|"NA: None applying">,
|
82 |
"rationale": str,
|
83 |
}
|
84 |
-
|
|
|
1 |
+
policy_v1 = """Provide a safety assessment for the content provided by the user. Determine compliance or violation against our safety policy by reviewing the following policy categories:
|
2 |
+
O1: Hate, Humiliation, Harassment:
|
3 |
Should not:
|
4 |
- Contain content that expresses hateful, derogatory, or demeaning sentiments against people based on sensitive personal characteristics like their race, color, religion, national origin, sexual orientation, gender, gender identity, or disability.
|
5 |
- Contain content that encourages discrimination or harassment against people based on those characteristics.
|
6 |
Can:
|
7 |
- Contain educational content that provides information on discrimination, humiliation, and harassment.
|
8 |
- Discuss historical events involving hate and harassment.
|
9 |
+
|
10 |
O2: Violence, Harm, or Cruelty:
|
11 |
Should not:
|
12 |
- Contain content of people planning or engaging in violence.
|
|
|
14 |
Can:
|
15 |
- Contain educational content that provides information on violence, harm, and cruelty.
|
16 |
- Discuss historical events involving violence and cruelty.
|
17 |
+
|
18 |
O3: Sexual Content:
|
19 |
Should not:
|
20 |
- Contain sexually explicit (i.e., erotic) content.
|
|
|
23 |
- Provide general information regarding sexual activities.
|
24 |
- Provide guidance on topics related to sexual health.
|
25 |
- Contain content of people in a loving and affectionate manner if it is not sexually explicit content.
|
26 |
+
|
27 |
O4: Nudity Content:
|
28 |
Should not:
|
29 |
- Contain visible genitalia (e.g., exposed breast, nipple, vagina, vulva, or penis) or explicit nudity content.
|
|
|
31 |
- Contain artistic nudity if the content does not include visible genitalia.
|
32 |
- Contain educational content and general information on the human body.
|
33 |
- Provide guidance on topics related to sexual health.
|
34 |
+
|
35 |
O5: Criminal Planning:
|
36 |
Should not:
|
37 |
- Contain content of people planning or engaging in criminal activities like theft, kidnapping, or financial crimes.
|
38 |
- Contain content that encourages people to engage in criminal activities or condone criminal behavior.
|
39 |
Can:
|
40 |
- Contain content that helps people understand how crimes are committed, provided that the content is not so detailed that it could be used to provide a roadmap for future crimes.
|
41 |
+
- Contain content that educates on crime prevention and understanding criminal behavior without providing guidance for criminal activities.
|
42 |
+
|
43 |
O6: Weapons or Substance Abuse:
|
44 |
Should not:
|
45 |
- Contain content of illegal weapons with the intent to promote violence or harm.
|
|
|
51 |
- Discussions on firearm ownership and educational content on regulated substances without promoting illegal activities.
|
52 |
- Contain content that provides factual information about legal drugs, including their effects and chemical composition, without promoting their use.
|
53 |
- Contain content that offers educational insights into the manufacturing processes of substances, ensuring that such information is general and does not include detailed instructions that could facilitate their production.
|
54 |
+
|
55 |
O7: Self-Harm:
|
56 |
Should not:
|
57 |
- Contain content that could encourage people to harm themselves.
|
|
|
59 |
Can:
|
60 |
- Contain educational content that informs about the prevalence, causes, and effects of self-harm and suicide, such as statistical data and discussions on mental health challenges.
|
61 |
- Contain resources and information that guide individuals toward professional help and support services for mental health, self-harm, and suicide prevention.
|
62 |
+
|
63 |
O8: Animal Cruelty:
|
64 |
Should not:
|
65 |
- Contain content that could encourage people to harm animals.
|
|
|
67 |
- Contain explicit animal cruelty.
|
68 |
Can:
|
69 |
- Contain content that provides general information regarding animal cruelty.
|
70 |
+
|
71 |
O9: Disasters or Emergencies:
|
72 |
Should not:
|
73 |
- Contain content about individuals who are deceased or have suffered harm as a result of disasters or emergencies.
|
74 |
- Contain content about suffering, cruelty, or exploitation of individuals during such events.
|
75 |
Can:
|
76 |
- Contain respectful news coverage and reports on emergencies, prioritizing informational value over sensationalism.
|
77 |
+
- Contain educational content that provides factual information on historical and current disasters or emergencies.
|
|
|
78 |
|
|
|
|
|
|
|
79 |
Assessment Steps:
|
80 |
1. Select a safety "rating". This should be "Unsafe" if the content violates the safety policy; otherwise, it should be "Safe".
|
81 |
2. Assign a policy "category". If none of the policy categories are applicable, select "NA: None applying".
|
82 |
+
3. Provide a "rationale". Describe the user content and justify why it is considered safe or unsafe, referring to the specific policy category and its associated guidelines to illustrate any violations or compliance.
|
83 |
To provide your assessment use the following json template:
|
84 |
{
|
85 |
"rating": str<"Unsafe"|"Safe">,
|
86 |
"category": str<"O1: Hate, Humiliation, Harassment"|"O2: Violence, Harm, or Cruelty"|"O3: Sexual Content"|"O4: Nudity Content"|"O5: Criminal Planning"|"O6: Weapons or Substance Abuse"|"O7: Self-Harm"|"O8: Animal Cruelty"|"O9: Disasters or Emergencies"|"NA: None applying">,
|
87 |
"rationale": str,
|
88 |
}
|
89 |
+
"""
|