Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,9 @@ def preprocess_text(text):
|
|
15 |
text = text.lower()
|
16 |
text = re.sub('[^A-Za-z0-9]+', ' ', text)
|
17 |
return text
|
18 |
-
|
19 |
def get_most_frequent_words(text, n):
|
20 |
-
words =
|
21 |
word_count = Counter(words)
|
22 |
most_common_words = word_count.most_common(n)
|
23 |
return most_common_words
|
|
|
15 |
text = text.lower()
|
16 |
text = re.sub('[^A-Za-z0-9]+', ' ', text)
|
17 |
return text
|
18 |
+
|
19 |
def get_most_frequent_words(text, n):
|
20 |
+
words = re.findall(r'\b\w{4,}\b', text)
|
21 |
word_count = Counter(words)
|
22 |
most_common_words = word_count.most_common(n)
|
23 |
return most_common_words
|