File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ RUN pip install --no-cache-dir --upgrade pip \
1818# 4. NLTK
1919RUN python -m nltk.downloader punkt stopwords
2020
21+ RUN python -m nltk.downloader punkt
22+
2123# 5. Copy local model
2224COPY rut5-base/ /app/rut5-base/
2325
Original file line number Diff line number Diff line change 77- ` hf download cointegrated/rut5-base-multitask --local-dir rut5-base `
88## Выбор файла ВКР
99- заменить в ` run.py ` в функции ` main ` путь для файла ВКР
10- ## Запуск
10+ ## Запуск (после любых изменений)
1111- ` docker build -t vkr-generator . `
1212- ` docker run -it --rm vkr-generator `
Original file line number Diff line number Diff line change 33import sys
44import os
55from docx import Document
6+ import nltk
67
78
89def load_vkr_text (path : str ) -> str :
@@ -19,6 +20,12 @@ def load_vkr_text(path: str) -> str:
1920
2021
2122def main ():
23+ try :
24+ nltk .data .find ('tokenizers/punkt_tab/english' )
25+ except LookupError :
26+ print ("Загрузка необходимых данных NLTK..." )
27+ nltk .download ('punkt_tab' )
28+
2229 print ("=== Загрузка текста ВКР ===" )
2330 text = load_vkr_text ("vkr_examples/VKR1.docx" )
2431
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ def __init__(self, vkr_text: str):
1717 vkr_text: Полный текст ВКР
1818 """
1919 self .vkr_text = vkr_text .lower ()
20- self .keywords = self ._extract_keywords ()
2120 self .stopwords = set (stopwords .words ('russian' ))
21+ self .keywords = self ._extract_keywords ()
2222
2323 def _extract_keywords (self ) -> Dict [str , Set [str ]]:
2424 """
You can’t perform that action at this time.
0 commit comments