Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ import math
|
|
| 15 |
|
| 16 |
from collections import Counter
|
| 17 |
import nltk
|
|
|
|
| 18 |
from nltk.corpus import stopwords
|
| 19 |
|
| 20 |
|
|
@@ -135,9 +136,7 @@ def highlight_pdf(file_path, text_to_highlight, page_numbers):
|
|
| 135 |
|
| 136 |
# Tokenize the text into words
|
| 137 |
words = text_to_highlight.split()
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
# Remove stopwords
|
| 142 |
stop_words = set(stopwords.words("english"))
|
| 143 |
words = [word for word in words if word.lower() not in stop_words]
|
|
|
|
| 15 |
|
| 16 |
from collections import Counter
|
| 17 |
import nltk
|
| 18 |
+
nltk.download('stopwords')
|
| 19 |
from nltk.corpus import stopwords
|
| 20 |
|
| 21 |
|
|
|
|
| 136 |
|
| 137 |
# Tokenize the text into words
|
| 138 |
words = text_to_highlight.split()
|
| 139 |
+
|
|
|
|
|
|
|
| 140 |
# Remove stopwords
|
| 141 |
stop_words = set(stopwords.words("english"))
|
| 142 |
words = [word for word in words if word.lower() not in stop_words]
|