/
githubmirror
/
UFO
Обзор
Документация
Войти
/
githubmirror
/
UFO
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v2.0.0
learner/basic.py
35 строк
1 KB
vyokky
optimize learner
01 мар 2025, 07:01
01 мар 2025, 07:01
ab713a9
Код
Авторство
О чём код?
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from learner import utils from abc import ABC, abstractmethod class BasicDocumentLoader(ABC): """ A class to load documents from a list of files with a given extension list. """ def __init__(self, extensions: str = None, directory: str = None): """ Create a new BasicDocumentLoader. :param extensions: The extensions to load. """ self.extensions = extensions self.directory = directory def load_file_name(self): """ Load the documents from the given directory. :param directory: The directory to load from. :return: The list of loaded documents. """ return utils.find_files_with_extension(self.directory, self.extensions) @abstractmethod def construct_document(self): """ Load the documents from the given directory. :param directory: The directory to load from. :return: The list of loaded documents. """ pass