Update app.py
Browse files
app.py
CHANGED
@@ -544,16 +544,16 @@ from nltk.corpus import stopwords
|
|
544 |
from nltk.tokenize import word_tokenize
|
545 |
import string
|
546 |
|
547 |
-
# اگر برای اولین بار از nltk استفاده میکنید، باید اینها را دانلود کنید
|
548 |
-
nltk.download('punkt')
|
549 |
-
nltk.download('stopwords')
|
550 |
|
551 |
# تابع برای استخراج کلمات کلیدی از سوال
|
552 |
def extract_keywords(query):
|
553 |
# حذف علامتهای نگارشی از جمله
|
554 |
query = query.translate(str.maketrans('', '', string.punctuation))
|
555 |
|
556 |
-
#
|
|
|
|
|
|
|
557 |
words = word_tokenize(query)
|
558 |
|
559 |
# حذف کلمات بیمحتوا (Stopwords)
|
|
|
544 |
from nltk.tokenize import word_tokenize
|
545 |
import string
|
546 |
|
|
|
|
|
|
|
547 |
|
548 |
# تابع برای استخراج کلمات کلیدی از سوال
|
549 |
def extract_keywords(query):
|
550 |
# حذف علامتهای نگارشی از جمله
|
551 |
query = query.translate(str.maketrans('', '', string.punctuation))
|
552 |
|
553 |
+
# اگر برای اولین بار از nltk استفاده میکنید، باید اینها را دانلود کنید
|
554 |
+
nltk.download('punkt')
|
555 |
+
nltk.download('stopwords')
|
556 |
+
|
557 |
words = word_tokenize(query)
|
558 |
|
559 |
# حذف کلمات بیمحتوا (Stopwords)
|