EE21 commited on
Commit
8dcb3a7
1 Parent(s): 13e8889

Update keyphrase_extraction.py

Browse files
Files changed (1) hide show
  1. keyphrase_extraction.py +14 -3
keyphrase_extraction.py CHANGED
@@ -2,9 +2,20 @@ from rake_nltk import Rake
2
  import re
3
 
4
  # Define a list of obligation words
5
- obligation_words = ["must", "will", "use", "may", "provides", 'is obliged to',
6
- 'has to', 'needs to', 'is required to',
7
- "shall", "should", "ought to", "required", "obligated", "duty"]
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  def extract_sentences_with_obligations(text):
10
  # Initialize Rake with stopwords set to None (to keep all words)
 
2
  import re
3
 
4
  # Define a list of obligation words
5
+ obligation_words = [
6
+ # English words
7
+ "must", "will", "use", "may", "provides", 'is obliged to',
8
+ 'has to', 'needs to', 'is required to', "shall",
9
+ "should", "ought to", "required", "obligated", "duty",
10
+ "agrees to", "has a duty to", "is expected to", "commits to",
11
+
12
+ # German words
13
+ "muss", "wird", "nutzen", "darf", "stellt bereit", "ist verpflichtet",
14
+ "muss", "muss", "muss", "ist erforderlich", "soll",
15
+ "sollte", "sollte", "erforderlich", "verpflichtet", "Pflicht",
16
+ "stimmt zu", "hat die Pflicht", "wird erwartet", "verpflichtet sich"
17
+ ]
18
+
19
 
20
  def extract_sentences_with_obligations(text):
21
  # Initialize Rake with stopwords set to None (to keep all words)