Update app.py
Browse files
app.py
CHANGED
|
@@ -72,7 +72,7 @@ frame_categories = {
|
|
| 72 |
"Human Rights Advocacy": ["human rights", "violations", "honor killing", "workplace discrimination", "law reform"]
|
| 73 |
}
|
| 74 |
|
| 75 |
-
def extract_keywords(text
|
| 76 |
# Initialize RAKE with default NLTK stopwords
|
| 77 |
r = Rake()
|
| 78 |
# Extract keywords from the text
|
|
@@ -80,7 +80,7 @@ def extract_keywords(text, num_keywords=5):
|
|
| 80 |
# Get ranked phrases (highest ranking first)
|
| 81 |
ranked_phrases = r.get_ranked_phrases()
|
| 82 |
# Return only the top N keywords
|
| 83 |
-
return ranked_phrases
|
| 84 |
|
| 85 |
# Detect language
|
| 86 |
def detect_language(text):
|
|
|
|
| 72 |
"Human Rights Advocacy": ["human rights", "violations", "honor killing", "workplace discrimination", "law reform"]
|
| 73 |
}
|
| 74 |
|
| 75 |
+
def extract_keywords(text):
|
| 76 |
# Initialize RAKE with default NLTK stopwords
|
| 77 |
r = Rake()
|
| 78 |
# Extract keywords from the text
|
|
|
|
| 80 |
# Get ranked phrases (highest ranking first)
|
| 81 |
ranked_phrases = r.get_ranked_phrases()
|
| 82 |
# Return only the top N keywords
|
| 83 |
+
return ranked_phrases
|
| 84 |
|
| 85 |
# Detect language
|
| 86 |
def detect_language(text):
|