INNER CODE UNIT · Python
_generate_stop_words
vgrabovets/multi_rake · multi_rake/algorithm.py:102
def _generate_stop_words(self, text):
stop_words = set()
text = keep_only_letters(text)
if not text:
return stop_words
text = text.split()
word_counts = Counter(text).most_common()
counts_sample = [word_count[1] for word_count in word_counts]
upper_bound = np.percentile(
counts_sample,
self.generated_stopwords_percentile,
)