Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,6 +41,22 @@ def remove_stopwords(text, language='english'):
|
|
| 41 |
Returns:
|
| 42 |
filtered_text (str): Text without stopwords.
|
| 43 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
words = text.split()
|
| 45 |
filtered_words = [word for word in words if word.lower() not in stop_words]
|
| 46 |
filtered_text = ' '.join(filtered_words)
|
|
|
|
| 41 |
Returns:
|
| 42 |
filtered_text (str): Text without stopwords.
|
| 43 |
"""
|
| 44 |
+
stop_words = set([
|
| 45 |
+
"i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your",
|
| 46 |
+
"yours", "yourself", "yourselves", "he", "him", "his", "himself", "she",
|
| 47 |
+
"her", "hers", "herself", "it", "its", "itself", "they", "them", "their",
|
| 48 |
+
"theirs", "themselves", "what", "which", "who", "whom", "this", "that",
|
| 49 |
+
"these", "those", "am", "is", "are", "was", "were", "be", "been", "being",
|
| 50 |
+
"have", "has", "had", "having", "do", "does", "did", "doing", "a", "an",
|
| 51 |
+
"the", "and", "but", "if", "or", "because", "as", "until", "while", "of",
|
| 52 |
+
"at", "by", "for", "with", "about", "against", "between", "into", "through",
|
| 53 |
+
"during", "before", "after", "above", "below", "to", "from", "up", "down",
|
| 54 |
+
"in", "out", "on", "off", "over", "under", "again", "further", "then",
|
| 55 |
+
"once", "here", "there", "when", "where", "why", "how", "all", "any",
|
| 56 |
+
"both", "each", "few", "more", "most", "other", "some", "such", "no",
|
| 57 |
+
"nor", "not", "only", "own", "same", "so", "than", "too", "very", "s",
|
| 58 |
+
"t", "can", "will", "just", "don", "should", "now"
|
| 59 |
+
])
|
| 60 |
words = text.split()
|
| 61 |
filtered_words = [word for word in words if word.lower() not in stop_words]
|
| 62 |
filtered_text = ' '.join(filtered_words)
|