gllm-docproc-binary 0.7.26__cp311-cp311-macosx_13_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gllm-docproc-binary might be problematic. Click here for more details.
- gllm_docproc/__init__.pyi +0 -0
- gllm_docproc/chunker/__init__.pyi +3 -0
- gllm_docproc/chunker/base_chunker.pyi +28 -0
- gllm_docproc/chunker/structured_element/__init__.pyi +3 -0
- gllm_docproc/chunker/structured_element/chunk_enricher.pyi +43 -0
- gllm_docproc/chunker/structured_element/structured_element_chunker.pyi +80 -0
- gllm_docproc/chunker/table/__init__.pyi +3 -0
- gllm_docproc/chunker/table/table_chunker.pyi +45 -0
- gllm_docproc/converter/__init__.pyi +3 -0
- gllm_docproc/converter/base_converter.pyi +15 -0
- gllm_docproc/data_generator/__init__.pyi +5 -0
- gllm_docproc/data_generator/base_data_generator.pyi +18 -0
- gllm_docproc/data_generator/image_data_generator/__init__.pyi +4 -0
- gllm_docproc/data_generator/image_data_generator/image_caption_data_generator.pyi +40 -0
- gllm_docproc/data_generator/image_data_generator/multi_model_image_caption_data_generator.pyi +51 -0
- gllm_docproc/data_generator/pii_data_generator/__init__.pyi +1 -0
- gllm_docproc/downloader/__init__.pyi +5 -0
- gllm_docproc/downloader/base_downloader.pyi +19 -0
- gllm_docproc/downloader/direct_file_url_downloader.pyi +40 -0
- gllm_docproc/downloader/google_drive_downloader.pyi +36 -0
- gllm_docproc/downloader/html/__init__.pyi +7 -0
- gllm_docproc/downloader/html/exception/__init__.pyi +4 -0
- gllm_docproc/downloader/html/exception/item_scrape_failed_exception.pyi +16 -0
- gllm_docproc/downloader/html/exception/zyte_api_key_not_provided_exception.pyi +15 -0
- gllm_docproc/downloader/html/firecrawl_downloader.pyi +49 -0
- gllm_docproc/downloader/html/html_downloader.pyi +114 -0
- gllm_docproc/downloader/html/playwright_downloader.pyi +60 -0
- gllm_docproc/downloader/html/requests_downloader.pyi +46 -0
- gllm_docproc/downloader/html/scraper/__init__.pyi +0 -0
- gllm_docproc/downloader/html/scraper/scraper/__init__.pyi +0 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/__init__.pyi +9 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/crawl_pdf_spider.pyi +27 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/crawl_sitemap_link_spider.pyi +28 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/crawl_sitemap_spider.pyi +61 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/crawl_spider.pyi +66 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/playwright_scrape_spider.pyi +22 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/scrape_spider.pyi +57 -0
- gllm_docproc/downloader/html/scraper/scraper/spiders/zyte_scrape_spider.pyi +51 -0
- gllm_docproc/downloader/html/scraper/web_scraper_executor.pyi +43 -0
- gllm_docproc/downloader/html/utils/__init__.pyi +3 -0
- gllm_docproc/downloader/html/utils/web_utils.pyi +39 -0
- gllm_docproc/dpo_router/__init__.pyi +5 -0
- gllm_docproc/dpo_router/base_dpo_router.pyi +16 -0
- gllm_docproc/dpo_router/loader_router.pyi +52 -0
- gllm_docproc/dpo_router/parser_router.pyi +42 -0
- gllm_docproc/housekeeping/__init__.pyi +3 -0
- gllm_docproc/housekeeping/base_housekeeping.pyi +14 -0
- gllm_docproc/indexer/__init__.pyi +3 -0
- gllm_docproc/indexer/base_indexer.pyi +30 -0
- gllm_docproc/indexer/graph/__init__.pyi +4 -0
- gllm_docproc/indexer/graph/graph_rag_indexer.pyi +11 -0
- gllm_docproc/indexer/graph/light_rag_graph_rag_indexer.pyi +97 -0
- gllm_docproc/indexer/graph/llama_index_graph_rag_indexer.pyi +79 -0
- gllm_docproc/indexer/vector/__init__.pyi +3 -0
- gllm_docproc/indexer/vector/vector_db_indexer.pyi +53 -0
- gllm_docproc/loader/__init__.pyi +4 -0
- gllm_docproc/loader/audio/__init__.pyi +3 -0
- gllm_docproc/loader/audio/audio_loader.pyi +45 -0
- gllm_docproc/loader/base_loader.pyi +30 -0
- gllm_docproc/loader/csv/__init__.pyi +3 -0
- gllm_docproc/loader/csv/pandas_loader.pyi +53 -0
- gllm_docproc/loader/docx/__init__.pyi +5 -0
- gllm_docproc/loader/docx/docx2python_loader.pyi +46 -0
- gllm_docproc/loader/docx/python_docx_loader.pyi +35 -0
- gllm_docproc/loader/docx/python_docx_table_loader.pyi +35 -0
- gllm_docproc/loader/exception/__init__.pyi +4 -0
- gllm_docproc/loader/exception/unsupported_file_extension_error.pyi +7 -0
- gllm_docproc/loader/exception/video_conversion_error.pyi +12 -0
- gllm_docproc/loader/html/__init__.pyi +5 -0
- gllm_docproc/loader/html/exception/__init__.pyi +3 -0
- gllm_docproc/loader/html/exception/html_load_exception.pyi +7 -0
- gllm_docproc/loader/html/flat/__init__.pyi +3 -0
- gllm_docproc/loader/html/flat/html_flat_base_handler.pyi +66 -0
- gllm_docproc/loader/html/flat/html_flat_loader.pyi +30 -0
- gllm_docproc/loader/html/flat/html_flat_merger.pyi +23 -0
- gllm_docproc/loader/html/html_base_loader.pyi +25 -0
- gllm_docproc/loader/html/nested/__init__.pyi +3 -0
- gllm_docproc/loader/html/nested/dictionary_utils.pyi +40 -0
- gllm_docproc/loader/html/nested/html_nested_base_handler.pyi +128 -0
- gllm_docproc/loader/html/nested/html_nested_element_handler.pyi +24 -0
- gllm_docproc/loader/html/nested/html_nested_loader.pyi +15 -0
- gllm_docproc/loader/html/utils/__init__.pyi +0 -0
- gllm_docproc/loader/html/utils/flat_table_utils.pyi +44 -0
- gllm_docproc/loader/html/utils/html_utils.pyi +59 -0
- gllm_docproc/loader/html/utils/removed_components.pyi +53 -0
- gllm_docproc/loader/html/utils/string_utils.pyi +33 -0
- gllm_docproc/loader/html/utils/table_utils.pyi +78 -0
- gllm_docproc/loader/image/__init__.pyi +3 -0
- gllm_docproc/loader/image/image_loader.pyi +54 -0
- gllm_docproc/loader/json/__init__.pyi +3 -0
- gllm_docproc/loader/json/json_elements_loader.pyi +35 -0
- gllm_docproc/loader/loader_utils.pyi +43 -0
- gllm_docproc/loader/pdf/__init__.pyi +14 -0
- gllm_docproc/loader/pdf/adobe_pdf_extract_loader.pyi +37 -0
- gllm_docproc/loader/pdf/azure_ai_document_intelligence_loader.pyi +47 -0
- gllm_docproc/loader/pdf/azure_ai_document_intelligence_raw_loader.pyi +49 -0
- gllm_docproc/loader/pdf/glair_vision_ocr_loader.pyi +38 -0
- gllm_docproc/loader/pdf/pdf_loader_utils.pyi +59 -0
- gllm_docproc/loader/pdf/pdf_miner_loader.pyi +38 -0
- gllm_docproc/loader/pdf/pdf_miner_word_loader.pyi +33 -0
- gllm_docproc/loader/pdf/pdf_page_loader.pyi +41 -0
- gllm_docproc/loader/pdf/pdf_plumber_loader.pyi +35 -0
- gllm_docproc/loader/pdf/pymupdf_loader.pyi +55 -0
- gllm_docproc/loader/pdf/pymupdf_span_loader.pyi +56 -0
- gllm_docproc/loader/pdf/pymupdf_utils.pyi +77 -0
- gllm_docproc/loader/pdf/tabula_loader.pyi +32 -0
- gllm_docproc/loader/pdf/text_inject_pdf_plumber_loader.pyi +37 -0
- gllm_docproc/loader/pipeline_loader.pyi +48 -0
- gllm_docproc/loader/pptx/__init__.pyi +3 -0
- gllm_docproc/loader/pptx/python_pptx_loader.pyi +48 -0
- gllm_docproc/loader/txt/__init__.pyi +3 -0
- gllm_docproc/loader/txt/txt_loader.pyi +55 -0
- gllm_docproc/loader/video/__init__.pyi +3 -0
- gllm_docproc/loader/video/video_loader_utils.pyi +97 -0
- gllm_docproc/loader/video/video_transcript_loader.pyi +59 -0
- gllm_docproc/loader/xlsx/__init__.pyi +3 -0
- gllm_docproc/loader/xlsx/openpyxl_loader.pyi +36 -0
- gllm_docproc/model/__init__.pyi +7 -0
- gllm_docproc/model/element.pyi +38 -0
- gllm_docproc/model/element_metadata.pyi +35 -0
- gllm_docproc/model/loader_type.pyi +20 -0
- gllm_docproc/model/media.pyi +51 -0
- gllm_docproc/model/parser_type.pyi +19 -0
- gllm_docproc/parser/__init__.pyi +4 -0
- gllm_docproc/parser/base_parser.pyi +28 -0
- gllm_docproc/parser/document/__init__.pyi +7 -0
- gllm_docproc/parser/document/docx_parser.pyi +27 -0
- gllm_docproc/parser/document/pdf_parser.pyi +35 -0
- gllm_docproc/parser/document/pptx_parser.pyi +34 -0
- gllm_docproc/parser/document/txt_parser.pyi +22 -0
- gllm_docproc/parser/document/xlsx_parser.pyi +26 -0
- gllm_docproc/parser/html/__init__.pyi +4 -0
- gllm_docproc/parser/html/flat/__init__.pyi +0 -0
- gllm_docproc/parser/html/flat/html_flat_parser.pyi +27 -0
- gllm_docproc/parser/html/nested/__init__.pyi +0 -0
- gllm_docproc/parser/html/nested/html_json_processor.pyi +158 -0
- gllm_docproc/parser/html/nested/html_nested_parser.pyi +24 -0
- gllm_docproc/parser/html/nested/nested_element.pyi +31 -0
- gllm_docproc/parser/image/__init__.pyi +4 -0
- gllm_docproc/parser/image/image_mime_normalization_parser.pyi +43 -0
- gllm_docproc/parser/image/image_plain_small_filter_parser.pyi +45 -0
- gllm_docproc/parser/pipeline_parser.pyi +33 -0
- gllm_docproc/parser/table/__init__.pyi +3 -0
- gllm_docproc/parser/table/table_caption_parser.pyi +66 -0
- gllm_docproc/request_handler/__init__.pyi +3 -0
- gllm_docproc/request_handler/base_request_handler.pyi +16 -0
- gllm_docproc/response_handler/__init__.pyi +3 -0
- gllm_docproc/response_handler/base_response_handler.pyi +38 -0
- gllm_docproc/utils/__init__.pyi +3 -0
- gllm_docproc/utils/async_utils.pyi +22 -0
- gllm_docproc/utils/file_utils.pyi +76 -0
- gllm_docproc/utils/html_constants.pyi +122 -0
- gllm_docproc/validator/__init__.pyi +6 -0
- gllm_docproc/validator/base_validator.pyi +34 -0
- gllm_docproc/validator/character_count_validator.pyi +26 -0
- gllm_docproc/validator/file_size_validator.pyi +20 -0
- gllm_docproc/validator/model/__init__.pyi +4 -0
- gllm_docproc/validator/model/validator_input.pyi +50 -0
- gllm_docproc/validator/model/validator_result.pyi +19 -0
- gllm_docproc/validator/page_count_validator.pyi +23 -0
- gllm_docproc/validator/pipeline_validator.pyi +40 -0
- gllm_docproc.build/.gitignore +1 -0
- gllm_docproc.cpython-311-darwin.so +0 -0
- gllm_docproc.pyi +222 -0
- gllm_docproc_binary-0.7.26.dist-info/METADATA +216 -0
- gllm_docproc_binary-0.7.26.dist-info/RECORD +168 -0
- gllm_docproc_binary-0.7.26.dist-info/WHEEL +5 -0
- gllm_docproc_binary-0.7.26.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_docproc.model.element_metadata import ElementMetadata as ElementMetadata
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
PAGE: str
|
|
7
|
+
HEADER: str
|
|
8
|
+
TITLE: str
|
|
9
|
+
HEADING: Incomplete
|
|
10
|
+
MAX_HEADING_LEVEL: int
|
|
11
|
+
PARAGRAPH: str
|
|
12
|
+
FOOTER: str
|
|
13
|
+
FOOTNOTE: str
|
|
14
|
+
TABLE: str
|
|
15
|
+
IMAGE: str
|
|
16
|
+
AUDIO: str
|
|
17
|
+
VIDEO: str
|
|
18
|
+
UNCATEGORIZED_TEXT: str
|
|
19
|
+
|
|
20
|
+
class Element(BaseModel):
|
|
21
|
+
"""An Element model.
|
|
22
|
+
|
|
23
|
+
This class serves as the Element model for storing element text, structure, and metadata.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
text (str): The element text.
|
|
27
|
+
structure (str): The element structure.
|
|
28
|
+
metadata (dict): The element metadata.
|
|
29
|
+
"""
|
|
30
|
+
text: str
|
|
31
|
+
structure: str
|
|
32
|
+
metadata: ElementMetadata
|
|
33
|
+
@staticmethod
|
|
34
|
+
def to_list_dict(elements: list['Element']) -> list[dict[str, Any]]:
|
|
35
|
+
"""Convert a list of Element objects to a list of dictionaries."""
|
|
36
|
+
@staticmethod
|
|
37
|
+
def from_list_dict(elements: list[dict[str, Any]]) -> list['Element']:
|
|
38
|
+
"""Convert a list of dictionaries to a list of Element objects."""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
|
|
3
|
+
PDF: str
|
|
4
|
+
DOCX: str
|
|
5
|
+
XLSX: str
|
|
6
|
+
PPTX: str
|
|
7
|
+
CSV: str
|
|
8
|
+
TXT: str
|
|
9
|
+
HTML: str
|
|
10
|
+
AUDIO: str
|
|
11
|
+
IMAGE: str
|
|
12
|
+
VIDEO: str
|
|
13
|
+
|
|
14
|
+
class ElementMetadata(BaseModel):
|
|
15
|
+
"""Element metadata model.
|
|
16
|
+
|
|
17
|
+
This class serves as the Element metadata model for storing element metadata.
|
|
18
|
+
|
|
19
|
+
Mandatory Attributes:
|
|
20
|
+
source (str): The source of the element.
|
|
21
|
+
source_type (str): The source type of the element.
|
|
22
|
+
loaded_datetime (datetime): The datetime when the element is loaded.
|
|
23
|
+
"""
|
|
24
|
+
source: str
|
|
25
|
+
source_type: str
|
|
26
|
+
loaded_datetime: str
|
|
27
|
+
class Config:
|
|
28
|
+
"""Pydantic model configuration.
|
|
29
|
+
|
|
30
|
+
This class defines the Pydantic model configuration for the ElementMetadata model.
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
extra (str): Allow extra fields.
|
|
34
|
+
"""
|
|
35
|
+
extra: str
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
class LoaderType(StrEnum):
|
|
4
|
+
"""Loader Type Enum.
|
|
5
|
+
|
|
6
|
+
This enum defines the different loader types.
|
|
7
|
+
"""
|
|
8
|
+
AUDIO_LOADER: str
|
|
9
|
+
CSV_LOADER: str
|
|
10
|
+
DOCX_LOADER: str
|
|
11
|
+
HTML_LOADER: str
|
|
12
|
+
IMAGE_LOADER: str
|
|
13
|
+
JSON_ELEMENTS_LOADER: str
|
|
14
|
+
PDF_LOADER: str
|
|
15
|
+
PPTX_LOADER: str
|
|
16
|
+
TXT_LOADER: str
|
|
17
|
+
VIDEO_LOADER: str
|
|
18
|
+
XLSX_LOADER: str
|
|
19
|
+
UNCATEGORIZED: str
|
|
20
|
+
KEY: str
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from pydantic import BaseModel, computed_field
|
|
3
|
+
|
|
4
|
+
class MediaType(StrEnum):
|
|
5
|
+
"""Defines valid media types."""
|
|
6
|
+
IMAGE: str
|
|
7
|
+
AUDIO: str
|
|
8
|
+
VIDEO: str
|
|
9
|
+
YOUTUBE: str
|
|
10
|
+
|
|
11
|
+
class MediaSourceType(StrEnum):
|
|
12
|
+
"""Defines valid media source types."""
|
|
13
|
+
BASE64: str
|
|
14
|
+
URL: str
|
|
15
|
+
|
|
16
|
+
class Media(BaseModel):
|
|
17
|
+
"""Media model which contains media information.
|
|
18
|
+
|
|
19
|
+
This class serves as the base model for storing media information in element metadata.
|
|
20
|
+
Element with media (image, audio, video, youtube) will have metadata `media` in list of dict.
|
|
21
|
+
Each dict will be following the Media model schema.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
media_id (str): Unique identifier for the media, automatically generated from media_type and media_content.
|
|
25
|
+
media_type (MediaType): Type of media (image, audio, video, youtube).
|
|
26
|
+
media_content (str): Base64 encoded string or URL pointing to the media content.
|
|
27
|
+
media_content_type (MediaSourceType): Type of content source (base64 or url).
|
|
28
|
+
"""
|
|
29
|
+
media_type: MediaType
|
|
30
|
+
media_content: str
|
|
31
|
+
media_content_type: MediaSourceType
|
|
32
|
+
@computed_field
|
|
33
|
+
@property
|
|
34
|
+
def media_id(self) -> str:
|
|
35
|
+
"""Generate a standardized media ID.
|
|
36
|
+
|
|
37
|
+
This property generates a standardized media ID in the format:
|
|
38
|
+
{media_type}_{sha256_from_media_content_16_digit}
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
str: The generated media ID.
|
|
42
|
+
"""
|
|
43
|
+
class Config:
|
|
44
|
+
"""Pydantic model configuration.
|
|
45
|
+
|
|
46
|
+
This class defines the Pydantic model configuration for the Media model.
|
|
47
|
+
|
|
48
|
+
Attributes:
|
|
49
|
+
extra (str): Allow extra fields.
|
|
50
|
+
"""
|
|
51
|
+
extra: str
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
class ParserType(StrEnum):
|
|
4
|
+
"""Parser Type Enum.
|
|
5
|
+
|
|
6
|
+
This enum defines the different parser types.
|
|
7
|
+
"""
|
|
8
|
+
AUDIO_PARSER: str
|
|
9
|
+
CSV_PARSER: str
|
|
10
|
+
DOCX_PARSER: str
|
|
11
|
+
HTML_PARSER: str
|
|
12
|
+
IMAGE_PARSER: str
|
|
13
|
+
PDF_PARSER: str
|
|
14
|
+
PPTX_PARSER: str
|
|
15
|
+
TXT_PARSER: str
|
|
16
|
+
VIDEO_PARSER: str
|
|
17
|
+
XLSX_PARSER: str
|
|
18
|
+
UNCATEGORIZED: str
|
|
19
|
+
KEY: str
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
class BaseParser(ABC):
|
|
5
|
+
"""Base class for document parser.
|
|
6
|
+
|
|
7
|
+
This class serves as the base for document parser, which will define the structure for every
|
|
8
|
+
content of document.
|
|
9
|
+
|
|
10
|
+
Methods:
|
|
11
|
+
parse(loaded_elements, **kwargs): Abstract method to parse a document.
|
|
12
|
+
"""
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def parse(self, loaded_elements: Any, **kwargs: Any) -> Any:
|
|
15
|
+
"""Parse loaded elements to get element structure.
|
|
16
|
+
|
|
17
|
+
This method is abstract and must be implemented in subclasses.
|
|
18
|
+
It defines the process of parsing a document using loaded elements.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
loaded_elements (Any): The loaded elements from loader. ideally formatted as List[Dict].
|
|
22
|
+
**kwargs (Any): Additional keyword arguments for customization.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
Any: The parsed document, ideally formatted as List[Dict]. Each dictionary within
|
|
26
|
+
the list are recommended to follows the structure of model 'Element',
|
|
27
|
+
to ensure consistency and ease of use across Document Processing Orchestrator.
|
|
28
|
+
"""
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from .docx_parser import DOCXParser as DOCXParser
|
|
2
|
+
from .pdf_parser import PDFParser as PDFParser
|
|
3
|
+
from .pptx_parser import PPTXParser as PPTXParser
|
|
4
|
+
from .txt_parser import TXTParser as TXTParser
|
|
5
|
+
from .xlsx_parser import XLSXParser as XLSXParser
|
|
6
|
+
|
|
7
|
+
__all__ = ['DOCXParser', 'PDFParser', 'PPTXParser', 'TXTParser', 'XLSXParser']
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element, FOOTER as FOOTER, HEADER as HEADER, HEADING as HEADING, MAX_HEADING_LEVEL as MAX_HEADING_LEVEL, PARAGRAPH as PARAGRAPH, TITLE as TITLE, UNCATEGORIZED_TEXT as UNCATEGORIZED_TEXT
|
|
2
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
class DOCXParser(BaseParser):
|
|
6
|
+
"""A DOCX parser for parsing DOCX document text structure.
|
|
7
|
+
|
|
8
|
+
This class serves as the DOCX parser for parsing DOCX document text structure.
|
|
9
|
+
It defines the structure for parsing DOCX document text structure from a given loaded_elements.
|
|
10
|
+
|
|
11
|
+
Methods:
|
|
12
|
+
parse(loaded_elements, **kwargs): Parse the document from the loaded elements.
|
|
13
|
+
"""
|
|
14
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
15
|
+
"""Parse the document from the loaded elements.
|
|
16
|
+
|
|
17
|
+
This method defines the process of defining text structure from loaded_elements (DOCX Loader output)
|
|
18
|
+
by their style_name. In cases there's customized style_name, it will be categorized as paragraph.
|
|
19
|
+
(example: 'Heading', 'Heading Body', 'Title 1', will be categorized as paragraph.)
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
loaded_elements (list[dict[str, Any]]): A list of loaded elements containing text content and metadata.
|
|
23
|
+
**kwargs (Any): Additional keyword arguments for parsing the document.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
list[dict[str, Any]]: A list of parsed elements containing text content and metadata.
|
|
27
|
+
"""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element, FOOTER as FOOTER, FOOTNOTE as FOOTNOTE, HEADER as HEADER, HEADING as HEADING, PARAGRAPH as PARAGRAPH, TITLE as TITLE, UNCATEGORIZED_TEXT as UNCATEGORIZED_TEXT
|
|
2
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
HEADER_THRESHOLD_POSITION: int
|
|
6
|
+
FOOTER_THRESHOLD_POSITION: int
|
|
7
|
+
FOOTNOTE_POSITION_RATIO: float
|
|
8
|
+
|
|
9
|
+
class PDFParser(BaseParser):
|
|
10
|
+
"""A class to parse PDF documents.
|
|
11
|
+
|
|
12
|
+
This class serves as a PDF parser for parsing or defining the structure of text within PDF documents
|
|
13
|
+
based on the text metadata (font size, font family, coordinates, etc.).
|
|
14
|
+
|
|
15
|
+
Methods:
|
|
16
|
+
parse: Parse the loaded elements.
|
|
17
|
+
"""
|
|
18
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
19
|
+
"""Parse the loaded elements.
|
|
20
|
+
|
|
21
|
+
This method defines the process of defining text structure of the loaded elements based on metadata
|
|
22
|
+
for PDF loaded elements.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
loaded_elements (list[dict[str, Any]]): A list of dictionaries containing loaded element
|
|
26
|
+
content and metadata.
|
|
27
|
+
**kwargs (Any): Additional keyword arguments.
|
|
28
|
+
|
|
29
|
+
Kwargs:
|
|
30
|
+
header_footer_tolerance (int, optional): An integer value indicating the tolerance for header and footer.
|
|
31
|
+
Defaults to 0.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
list[dict[str, Any]]: A list of dictionaries containing parsed element content and metadata.
|
|
35
|
+
"""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_docproc.model.element import Element as Element, FOOTER as FOOTER, PARAGRAPH as PARAGRAPH, TITLE as TITLE, UNCATEGORIZED_TEXT as UNCATEGORIZED_TEXT
|
|
3
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
class PPTXParser(BaseParser):
|
|
7
|
+
"""A PPTX parser for parsing PPTX document shape structure.
|
|
8
|
+
|
|
9
|
+
This class serves as the PPTX parser for parsing PPTX document shape structure.
|
|
10
|
+
It defines the structure for parsing PPTX document shape structure from a given loaded_elements.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Methods:
|
|
14
|
+
parse(loaded_elements, **kwargs): Parse the document from the loaded elements.
|
|
15
|
+
"""
|
|
16
|
+
logger: Incomplete
|
|
17
|
+
def __init__(self) -> None:
|
|
18
|
+
"""Initialize the PPTXParser class."""
|
|
19
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
20
|
+
"""Parse the document from the loaded elements.
|
|
21
|
+
|
|
22
|
+
This method defines the process of defining shape structure from loaded_elements (PPTX Loader output)
|
|
23
|
+
by their placeholder types. In cases there's customized placeholder types, it will be categorized as paragraph.
|
|
24
|
+
(example: 'BITMAP', 'MIXED', 'OBJECT', will be categorized as paragraph.)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
loaded_elements (list[dict[str, Any]]): A list of loaded elements containing shape content and metadata.
|
|
29
|
+
**kwargs (Any): Additional keyword arguments for parsing the document.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
list[dict[str, Any]]: A list of parsed elements containing shape content and metadata.
|
|
34
|
+
"""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element, PARAGRAPH as PARAGRAPH, UNCATEGORIZED_TEXT as UNCATEGORIZED_TEXT
|
|
2
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
class TXTParser(BaseParser):
|
|
6
|
+
"""TXT parser for parsing text files.
|
|
7
|
+
|
|
8
|
+
Methods:
|
|
9
|
+
parse: Parse a list of elements from a text file.
|
|
10
|
+
"""
|
|
11
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
12
|
+
"""Parse a list of elements from a text file.
|
|
13
|
+
|
|
14
|
+
all elements with structure UNCATEGORIZED_TEXT will be converted to PARAGRAPH
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
loaded_elements (list[dict[str, Any]]): The list of elements that have already been loaded.
|
|
18
|
+
**kwargs: Additional keyword arguments.
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
list[dict[str, Any]]: A list of elements.
|
|
22
|
+
"""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element
|
|
2
|
+
from gllm_docproc.parser import BaseParser as BaseParser
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
DEFAULT_SHEET_NAME_PATTERN: str
|
|
6
|
+
|
|
7
|
+
class XLSXParser(BaseParser):
|
|
8
|
+
"""A XLSX parser for parsing XLSX document text structure.
|
|
9
|
+
|
|
10
|
+
This class serves as the XLSX parser for parsing XLSX document text structure.
|
|
11
|
+
It defines the structure for parsing XLSX document text structure from a given loaded_elements.
|
|
12
|
+
|
|
13
|
+
Methods:
|
|
14
|
+
parse(loaded_elements, **kwargs): Parse the document from the loaded elements.
|
|
15
|
+
"""
|
|
16
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
17
|
+
"""Parse loaded elements by assigning a structure to each element.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
loaded_elements (list[dict[str, Any]]): A list of dictionaries representing loaded elements.
|
|
21
|
+
**kwargs (Any): Additional arguments for parsing the document.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
list[dict[str, Any]]: A list of dictionaries containing parsed elements with assigned structures.
|
|
25
|
+
|
|
26
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from gllm_docproc.model.element import PARAGRAPH as PARAGRAPH
|
|
2
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
3
|
+
from gllm_docproc.utils.html_constants import HTMLTags as HTMLTags, ItemDataKeys as ItemDataKeys, Structure as Structure
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
class HTMLFlatParser(BaseParser):
|
|
7
|
+
"""This class extends the BaseParser and is specifically designed for parsing elements loaded from web content.
|
|
8
|
+
|
|
9
|
+
It assigns a structure to each loaded element based on the HTML tags present in its metadata.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
None
|
|
13
|
+
|
|
14
|
+
Methods:
|
|
15
|
+
parse(loaded_elements: list[dict], **kwargs: dict[str, Any]) -> list[dict]:
|
|
16
|
+
Parses the loaded_elements and assigns a structure to each element based on its HTML tags.
|
|
17
|
+
"""
|
|
18
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: dict[str, Any]) -> list[dict[str, Any]]:
|
|
19
|
+
"""Parses the loaded_elements and assigns a structure to each element based on its HTML tags.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
loaded_elements (list[dict]): The elements loaded from web content to be parsed.
|
|
23
|
+
**kwargs (dict[str, Any]): Additional keyword arguments.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
list[dict]: The parsed elements with assigned structures.
|
|
27
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_docproc.model.element import PARAGRAPH as PARAGRAPH, TABLE as TABLE, TITLE as TITLE
|
|
3
|
+
from gllm_docproc.parser.html.nested.nested_element import NestedElement as NestedElement
|
|
4
|
+
from gllm_docproc.utils.html_constants import ContentDataKeys as ContentDataKeys, ErrorMessage as ErrorMessage, FORMATTING_TAGS as FORMATTING_TAGS, HTMLTags as HTMLTags, ItemDataKeys as ItemDataKeys, MetaDataKeys as MetaDataKeys, SPACING as SPACING, Structure as Structure, TableConstants as TableConstants
|
|
5
|
+
|
|
6
|
+
class HTMLJsonProcessor:
|
|
7
|
+
"""Processor for processing items scraped by the spider.
|
|
8
|
+
|
|
9
|
+
This pipeline processes the raw data scraped by the spider, formats it, and stores it in a JSON format.
|
|
10
|
+
It also handles errors during the processing and logging of the data.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
logger: An instance of a logger, used for logging runtime information.
|
|
14
|
+
element_id: A counter for the elements processed by the pipeSline.
|
|
15
|
+
processor_result: A dictionary that holds the processed data.
|
|
16
|
+
"""
|
|
17
|
+
logger: Incomplete
|
|
18
|
+
element_id: int
|
|
19
|
+
processor_result: Incomplete
|
|
20
|
+
def __init__(self) -> None:
|
|
21
|
+
"""Initialize the HTMLJsonProcessor."""
|
|
22
|
+
def process_item(self, item: list[dict]):
|
|
23
|
+
"""Processes each item passed by the spider.
|
|
24
|
+
|
|
25
|
+
The method formats the raw data and stores it in the processor_result dictionary.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
item (list): The raw data scraped by the spider.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
list: The processed item.
|
|
32
|
+
"""
|
|
33
|
+
def add_title_element(self, item) -> None:
|
|
34
|
+
"""Adds the title element to the processor_result dictionary.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
item (dict): The raw data scraped by the spider.
|
|
38
|
+
"""
|
|
39
|
+
def extract_data(self, current: dict, data: NestedElement):
|
|
40
|
+
"""Extracts data from the raw data.
|
|
41
|
+
|
|
42
|
+
This method traverses the raw data and extracts the necessary information.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
current (dict): The current node in the raw data.
|
|
46
|
+
data (NestedElement): The dictionary where the extracted data is stored.
|
|
47
|
+
"""
|
|
48
|
+
def handle_table_data(self, current, data: NestedElement):
|
|
49
|
+
"""Handles table content.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
current (dict): The current node in the raw data. It should contain the table content and metadata.
|
|
53
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
54
|
+
"""
|
|
55
|
+
def handle_media_data(self, current, data: NestedElement):
|
|
56
|
+
"""Handles media content.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
current (dict): The current node in the raw data.
|
|
60
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
61
|
+
"""
|
|
62
|
+
def handle_string_content(self, current, data: NestedElement):
|
|
63
|
+
"""Handles string content.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
current (dict): The current node in the raw data.
|
|
67
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
68
|
+
"""
|
|
69
|
+
def handle_other_cases(self, current, data: NestedElement):
|
|
70
|
+
"""Handles other cases.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
current (dict): The current node in the raw data.
|
|
74
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
75
|
+
"""
|
|
76
|
+
def handle_current_tag(self, current, data: NestedElement) -> tuple[NestedElement, dict]:
|
|
77
|
+
"""Handles the current tag. This method checks the current tag and updates the data accordingly.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
current (dict): The current node in the raw data.
|
|
81
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
NestedElement: The updated NestedElement object.
|
|
85
|
+
dict: A dictionary containing additional arguments.
|
|
86
|
+
"""
|
|
87
|
+
def handle_content(self, current, data: NestedElement, args: dict):
|
|
88
|
+
"""Handles content. This method iterates over the content and extracts the necessary information.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
current (dict): The current node in the raw data.
|
|
92
|
+
data (NestedElement): The dictionary where the extracted data is stored.
|
|
93
|
+
args (dict): The dictionary containing the arguments for the method.
|
|
94
|
+
"""
|
|
95
|
+
def add_result(self, data: NestedElement):
|
|
96
|
+
"""Adds the processed data to the processor_result dictionary.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
data (dict): The processed data.
|
|
100
|
+
"""
|
|
101
|
+
def add_link(self, data: NestedElement) -> NestedElement:
|
|
102
|
+
"""Adds a link to the processed data content.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
data (dict): The processed data.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
dict: The processed data.
|
|
109
|
+
"""
|
|
110
|
+
def add_index(self, data: NestedElement) -> NestedElement:
|
|
111
|
+
"""Adds a index to the processed data content.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
data (dict): The processed data.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
dict: The processed data.
|
|
118
|
+
"""
|
|
119
|
+
def handle_media(self, current, data: NestedElement) -> NestedElement:
|
|
120
|
+
"""Handles media content.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
current (dict): The current node in the raw data.
|
|
124
|
+
data (dict): The dictionary where the extracted data is stored.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
dict: The processed data.
|
|
128
|
+
"""
|
|
129
|
+
def handle_table(self, current, data: NestedElement) -> list:
|
|
130
|
+
"""Handle Table.
|
|
131
|
+
|
|
132
|
+
This method processes table content by iterating over its metadata, handling each row based on its type,
|
|
133
|
+
and appending the result to the table data.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
current (dict): The current node in the raw data. It should contain the table content and metadata.
|
|
137
|
+
data (dict): The dictionary where the extracted data is stored. This method adds a 'structure' key with the
|
|
138
|
+
value 'table', and appends the extracted table data to this dictionary.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
list: A list of dictionaries containing the extracted table data.
|
|
142
|
+
"""
|
|
143
|
+
def print_row(self, row, col_size=None):
|
|
144
|
+
"""Formats a table row.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
row (list): The row to be formatted.
|
|
148
|
+
col_size (list | None, optional): The size of the columns. Defaults to None.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
str: The formatted row.
|
|
152
|
+
"""
|
|
153
|
+
def print_table_separator(self, row):
|
|
154
|
+
"""Formats a table separator.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
str: The formatted table separator.
|
|
158
|
+
"""
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element
|
|
2
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
3
|
+
from gllm_docproc.parser.html.nested.html_json_processor import HTMLJsonProcessor as HTMLJsonProcessor
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
class HTMLNestedParser(BaseParser):
|
|
7
|
+
"""A parser class for processing JSON elements into a parsed elements.
|
|
8
|
+
|
|
9
|
+
This class inherits from the BaseParser class and implements the parse method
|
|
10
|
+
to convert loaded HTML elements into a processed JSON format.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
None
|
|
14
|
+
"""
|
|
15
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: dict[str, Any]) -> list[dict[str, Any]]:
|
|
16
|
+
"""Processes loaded HTML elements into a JSON format.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
loaded_elements (dict): The loaded HTML elements to be processed.
|
|
20
|
+
**kwargs (dict[str, Any]): Additional keyword arguments.
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
dict: The processed JSON representation of the HTML elements.
|
|
24
|
+
"""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from gllm_docproc.model.element import Element as Element
|
|
2
|
+
|
|
3
|
+
class NestedElement(Element):
|
|
4
|
+
"""A specialized class extending Element to represent nested elements.
|
|
5
|
+
|
|
6
|
+
This class includes additional functionality specific to nested elements, such as generating
|
|
7
|
+
a unique element_id and providing methods to convert the instance to a dictionary or Element.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
element_id (int): A unique identifier for the nested element.
|
|
11
|
+
|
|
12
|
+
Methods:
|
|
13
|
+
to_dict(): Convert the NestedElement instance to a dictionary.
|
|
14
|
+
to_element(): Convert the NestedElement instance to an Element.
|
|
15
|
+
"""
|
|
16
|
+
element_id: int
|
|
17
|
+
def to_dict(self):
|
|
18
|
+
"""Convert the NestedElement instance to a dictionary.
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
dict: A dictionary representation of the NestedElement instance.
|
|
22
|
+
"""
|
|
23
|
+
def to_element(self) -> Element:
|
|
24
|
+
"""Convert the NestedElement instance to an Element.
|
|
25
|
+
|
|
26
|
+
This method creates an Element instance from the current NestedElement. It deep copies the metadata,
|
|
27
|
+
assigns the element_id, and constructs an Element with the associated text, metadata, and structure.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
Element: The Element instance created from the NestedElement.
|
|
31
|
+
"""
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
from gllm_docproc.parser.image.image_mime_normalization_parser import ImageMIMENormalizationParser as ImageMIMENormalizationParser
|
|
2
|
+
from gllm_docproc.parser.image.image_plain_small_filter_parser import ImagePlainSmallFilterParser as ImagePlainSmallFilterParser
|
|
3
|
+
|
|
4
|
+
__all__ = ['ImageMIMENormalizationParser', 'ImagePlainSmallFilterParser']
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from gllm_docproc.model.element import Element as Element
|
|
3
|
+
from gllm_docproc.model.media import MediaSourceType as MediaSourceType, MediaType as MediaType
|
|
4
|
+
from gllm_docproc.parser.base_parser import BaseParser as BaseParser
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
SUPPORTED_TARGET_MIME_TYPES: Incomplete
|
|
8
|
+
|
|
9
|
+
class ImageMIMENormalizationParser(BaseParser):
|
|
10
|
+
"""Parser for normalizing unsupported image MIME types.
|
|
11
|
+
|
|
12
|
+
This parser identifies images with unsupported MIME types and converts them to the target MIME type.
|
|
13
|
+
"""
|
|
14
|
+
target_mime_type: Incomplete
|
|
15
|
+
target_format: Incomplete
|
|
16
|
+
supported_mime_types: Incomplete
|
|
17
|
+
logger: Incomplete
|
|
18
|
+
def __init__(self, target_mime_type: str = 'image/png', supported_mime_types: set[str] | None = None) -> None:
|
|
19
|
+
'''Initialize the image MIME normalization parser.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
target_mime_type (str, optional): The target MIME type to convert images to.
|
|
23
|
+
Must be one of the supported target MIME types. Defaults to "image/png".
|
|
24
|
+
supported_mime_types (set[str] | None, optional): Set of MIME types that don\'t need normalization.
|
|
25
|
+
If None, only the target format is considered supported. Defaults to None.
|
|
26
|
+
|
|
27
|
+
Raises:
|
|
28
|
+
ValueError: If target_mime_type is not in SUPPORTED_TARGET_MIME_TYPES.
|
|
29
|
+
'''
|
|
30
|
+
def parse(self, loaded_elements: list[dict[str, Any]], **kwargs: Any) -> list[dict[str, Any]]:
|
|
31
|
+
"""Parse unsupported MIME type image to the target MIME type.
|
|
32
|
+
|
|
33
|
+
This function will normalize the image base64 in element.media to the target mime type.
|
|
34
|
+
If conversion fails, we will keep the original image base64 and the process will continue.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
loaded_elements (list[dict[str, Any]]): A list of elements in list dict format where each dict
|
|
38
|
+
mirroring the Element model structure
|
|
39
|
+
**kwargs (Any): Additional keyword arguments.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
list[dict[str, Any]]: Elements with normalized images.
|
|
43
|
+
"""
|