antimoda1 commited on
Commit ·
e43669b
1
Parent(s): 7a668f2
hotfix
Browse files- _1_get_documents.py +1 -2
_1_get_documents.py
CHANGED
|
@@ -13,7 +13,7 @@ def process_file(file_path):
|
|
| 13 |
with open(file_path, 'r', encoding='utf-8-sig') as f:
|
| 14 |
text = f.read()
|
| 15 |
assert text
|
| 16 |
-
return str(file_path).split('.')[-1]
|
| 17 |
|
| 18 |
def process_folder_recursive(folder_path):
|
| 19 |
all_messages = []
|
|
@@ -28,5 +28,4 @@ def process_folder_recursive(folder_path):
|
|
| 28 |
def load_and_process_data() -> list[dict]:
|
| 29 |
"""Загрузка и предобработка данных из JSON файлов"""
|
| 30 |
all_messages = process_folder_recursive('texts')
|
| 31 |
-
|
| 32 |
return [x[0] for x in all_messages], [x[1][:-3] for x in all_messages] # возвращаем расширения и тексты документов
|
|
|
|
| 13 |
with open(file_path, 'r', encoding='utf-8-sig') as f:
|
| 14 |
text = f.read()
|
| 15 |
assert text
|
| 16 |
+
return text, str(file_path).split('.')[-1]
|
| 17 |
|
| 18 |
def process_folder_recursive(folder_path):
|
| 19 |
all_messages = []
|
|
|
|
| 28 |
def load_and_process_data() -> list[dict]:
|
| 29 |
"""Загрузка и предобработка данных из JSON файлов"""
|
| 30 |
all_messages = process_folder_recursive('texts')
|
|
|
|
| 31 |
return [x[0] for x in all_messages], [x[1][:-3] for x in all_messages] # возвращаем расширения и тексты документов
|