Spaces:
Running
Running
Update motif_tagging.py
Browse files- motif_tagging.py +16 -15
motif_tagging.py
CHANGED
@@ -4,24 +4,25 @@ import re
|
|
4 |
|
5 |
MOTIF_PATTERNS = {
|
6 |
"physical_threat": [
|
7 |
-
r"\b(i
|
8 |
-
r"\bsay goodbye to (
|
9 |
-
r"\
|
10 |
-
r"\
|
11 |
-
r"\
|
12 |
-
|
13 |
"extreme_control": [
|
14 |
-
r"\
|
15 |
-
r"\
|
16 |
-
r"\byou don
|
17 |
r"\bi own you\b",
|
18 |
-
|
|
|
19 |
"suicidal_threat": [
|
20 |
-
r"\
|
21 |
-
r"\bi don’t want to live if you leave\b",
|
22 |
-
r"\
|
23 |
-
r"\byou’ll regret it when i’m gone\b",
|
24 |
-
|
25 |
}
|
26 |
|
27 |
def tag_motifs(text):
|
|
|
4 |
|
5 |
MOTIF_PATTERNS = {
|
6 |
"physical_threat": [
|
7 |
+
r"\b(i am going to|i'll) (hurt|kill|break|end|ruin|destroy) you\b",
|
8 |
+
r"\bsay goodbye to (you|those)? (kneecaps|teeth|face)\b",
|
9 |
+
r"\b(i'll|i will) put you in a (grave|hole|rose garden)\b",
|
10 |
+
r"\bsleep with one eye open( you'll see what happens)?\b",
|
11 |
+
r"\b(i'll|i will) make you disappear\b",
|
12 |
+
],
|
13 |
"extreme_control": [
|
14 |
+
r"\b(i decide|i control) who you (see|talk to|text|spend time with)\b",
|
15 |
+
r"\b(you('re| are) not allowed to)\b",
|
16 |
+
r"\byou (don't|do not) get to (leave|say no|argue)\b",
|
17 |
r"\bi own you\b",
|
18 |
+
],
|
19 |
+
|
20 |
"suicidal_threat": [
|
21 |
+
r"\b(i'll|i will) kill myself\b",
|
22 |
+
r"\bi (don’t|do not) want to live if you leave\b",
|
23 |
+
r"\b(i’ll|i will) die without you\b",
|
24 |
+
r"\byou(’ll|'ll) regret it when i(’m|'m) gone\b",
|
25 |
+
],
|
26 |
}
|
27 |
|
28 |
def tag_motifs(text):
|