Update README.md
#4
by
haidequanbu
- opened
README.md
CHANGED
|
@@ -45,7 +45,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 45 |
)
|
| 46 |
def extract_label_and_categories(content):
|
| 47 |
safe_pattern = r"Safety: (Safe|Unsafe|Controversial)"
|
| 48 |
-
category_pattern = r"(Violent|Non-violent Illegal Acts|Sexual Content or Sexual Acts|Suicide & Self-Harm|Unethical Acts|Politically Sensitive Topics|Copyright Violation|Jailbreak|None)"
|
| 49 |
safe_label_match = re.search(safe_pattern, content)
|
| 50 |
label = safe_label_match.group(1) if safe_label_match else None
|
| 51 |
categories = re.findall(category_pattern, content)
|
|
@@ -97,7 +97,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 97 |
)
|
| 98 |
def extract_label_categories_refusal(content):
|
| 99 |
safe_pattern = r"Safety: (Safe|Unsafe|Controversial)"
|
| 100 |
-
category_pattern = r"(Violent|Non-violent Illegal Acts|Sexual Content or Sexual Acts|Suicide & Self-Harm|Unethical Acts|Politically Sensitive Topics|Copyright Violation|None)"
|
| 101 |
refusal_pattern = r"Refusal: (Yes|No)"
|
| 102 |
safe_label_match = re.search(safe_pattern, content)
|
| 103 |
refusal_label_match = re.search(refusal_pattern, content)
|
|
|
|
| 45 |
)
|
| 46 |
def extract_label_and_categories(content):
|
| 47 |
safe_pattern = r"Safety: (Safe|Unsafe|Controversial)"
|
| 48 |
+
category_pattern = r"(Violent|Non-violent Illegal Acts|Sexual Content or Sexual Acts|PII|Suicide & Self-Harm|Unethical Acts|Politically Sensitive Topics|Copyright Violation|Jailbreak|None)"
|
| 49 |
safe_label_match = re.search(safe_pattern, content)
|
| 50 |
label = safe_label_match.group(1) if safe_label_match else None
|
| 51 |
categories = re.findall(category_pattern, content)
|
|
|
|
| 97 |
)
|
| 98 |
def extract_label_categories_refusal(content):
|
| 99 |
safe_pattern = r"Safety: (Safe|Unsafe|Controversial)"
|
| 100 |
+
category_pattern = r"(Violent|Non-violent Illegal Acts|Sexual Content or Sexual Acts|PII|Suicide & Self-Harm|Unethical Acts|Politically Sensitive Topics|Copyright Violation|None)"
|
| 101 |
refusal_pattern = r"Refusal: (Yes|No)"
|
| 102 |
safe_label_match = re.search(safe_pattern, content)
|
| 103 |
refusal_label_match = re.search(refusal_pattern, content)
|