awacke1 commited on
Commit
ee0a867
·
1 Parent(s): 5cfa291

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = text.split()
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