ahm14 commited on
Commit
b5ee7e5
·
verified ·
1 Parent(s): d89fbaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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, num_keywords=5):
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[:num_keywords]
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):