SamanthaStorm commited on
Commit
f37af67
·
verified ·
1 Parent(s): 688cd9f

Update motif_tagging.py

Browse files
Files changed (1) hide show
  1. 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'?ll|i am going to) (hurt|kill|break|end|ruin|destroy) you\b",
8
- r"\bsay goodbye to (your|those)? (kneecaps|teeth|face)\b",
9
- r"\bi'?ll put you in a (grave|hole|rose garden)\b",
10
- r"\b(sleep with one eye open|youll see what happens)\b",
11
- r"\bi'?ll make you disappear\b",
12
- ],
13
  "extreme_control": [
14
- r"\bi decide who you (see|talk to|text|spend time with)\b",
15
- r"\byou’re not allowed to\b",
16
- r"\byou dont get to (leave|say no|argue)\b",
17
  r"\bi own you\b",
18
- ],
 
19
  "suicidal_threat": [
20
- r"\bi'?ll kill myself\b",
21
- r"\bi don’t want to live if you leave\b",
22
- r"\bi’ll die without you\b",
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):