prevectorchunks-core 0.1.23__py3-none-any.whl → 0.1.25__py3-none-any.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.
- prevectorchunks_core/services/markdown_and_chunk_documents.py +3 -3
- {prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/METADATA +36 -1
- {prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/RECORD +6 -6
- {prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/WHEEL +0 -0
- {prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/licenses/LICENCE +0 -0
- {prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/top_level.txt +0 -0
|
@@ -12,9 +12,9 @@ from ..config.splitter_config import SplitterConfig
|
|
|
12
12
|
|
|
13
13
|
from dotenv import load_dotenv
|
|
14
14
|
|
|
15
|
-
from chunk_documents_crud_vdb import chunk_documents
|
|
16
|
-
from chunk_to_all_content_mapper import ChunkMapper
|
|
17
|
-
from
|
|
15
|
+
from .chunk_documents_crud_vdb import chunk_documents
|
|
16
|
+
from .chunk_to_all_content_mapper import ChunkMapper
|
|
17
|
+
from ..utils.file_loader import SplitType
|
|
18
18
|
|
|
19
19
|
load_dotenv(override=True)
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prevectorchunks-core
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.25
|
|
4
4
|
Summary: A Python module that allows conversion of a document into chunks to be inserted into Pinecone vector database
|
|
5
5
|
Author-email: Zul Al-Kabir <zul.developer.2023@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/yourusername/mydep
|
|
@@ -187,6 +187,41 @@ Updates existing chunks in the Vector Database by document name.
|
|
|
187
187
|
- Keeping VDB chunks up to date when documents change
|
|
188
188
|
- Re-ingesting revised or corrected content
|
|
189
189
|
|
|
190
|
+
---
|
|
191
|
+
### 5. ``markdown_and_chunk_documents``
|
|
192
|
+
```python
|
|
193
|
+
from prevectorchunks_core.services.markdown_and_chunk_documents import MarkdownAndChunkDocuments
|
|
194
|
+
|
|
195
|
+
markdown_processor = MarkdownAndChunkDocuments()
|
|
196
|
+
mapped_chunks = markdown_processor.markdown_and_chunk_documents("example.pdf")
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Description**
|
|
200
|
+
This new function automatically:
|
|
201
|
+
1. Converts a document (PDF, DOCX, etc.) into images using `DocuToImageConverter`.
|
|
202
|
+
2. Extracts **Markdown and text** content from those images using `DocuToMarkdownExtractor` (powered by GPT).
|
|
203
|
+
3. Converts the extracted markdown text into **RL-based chunks** using `ChunkMapper` and `chunk_documents`.
|
|
204
|
+
4. Merges unmatched markdown segments into the final structured output.
|
|
205
|
+
|
|
206
|
+
**Parameters**
|
|
207
|
+
- `file_path` (*str*): Path to the document (PDF, DOCX, or image) you want to process.
|
|
208
|
+
|
|
209
|
+
**Returns**
|
|
210
|
+
- `mapped_chunks` (*list[dict]*): A list of markdown-based chunks with both markdown and chunked text content.
|
|
211
|
+
|
|
212
|
+
**Example**
|
|
213
|
+
```python
|
|
214
|
+
if __name__ == "__main__":
|
|
215
|
+
markdown_processor = MarkdownAndChunkDocuments()
|
|
216
|
+
mapped_chunks = markdown_processor.markdown_and_chunk_documents("421307-nz-au-top-loading-washer-guide-shorter.pdf")
|
|
217
|
+
print(mapped_chunks)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Use Cases**
|
|
221
|
+
- End-to-end document-to-markdown-to-chunks pipeline
|
|
222
|
+
- Automating preprocessing for RAG/LLM ingestion
|
|
223
|
+
- Extracting structured markdown for semantic search or content indexing
|
|
224
|
+
|
|
190
225
|
---
|
|
191
226
|
|
|
192
227
|
## 🚀 Example Workflow
|
|
@@ -23,7 +23,7 @@ prevectorchunks_core/services/audio_processor.py,sha256=XKNYhXHIt_77a3PT2wwKvnCS
|
|
|
23
23
|
prevectorchunks_core/services/chunk_documents_crud_vdb.py,sha256=Md4vy7vJDnSYpvZiF0HbHCOA0StSVm62ALHAPYU2A7I,16279
|
|
24
24
|
prevectorchunks_core/services/chunk_to_all_content_mapper.py,sha256=xEz2idxJTsJwyCJWMPZCk3CFcalKhbSuucFH9TPouU0,2778
|
|
25
25
|
prevectorchunks_core/services/image_processor.py,sha256=2CRwTbI-czbakm9aG-kMdx908bc5H1rQETQiVCKbWd8,3518
|
|
26
|
-
prevectorchunks_core/services/markdown_and_chunk_documents.py,sha256=
|
|
26
|
+
prevectorchunks_core/services/markdown_and_chunk_documents.py,sha256=vfGvvirn3rtwIVJtVK5_dJSrV3JeO0p0d0rc5BOnGx8,2862
|
|
27
27
|
prevectorchunks_core/services/propositional_index.py,sha256=cVH3obhLtlcfJYA6VN4KfC3len4fe5nNcboorlouOb0,4151
|
|
28
28
|
prevectorchunks_core/services/video_analyser.py,sha256=1wI38xZ8vdE8T4EBAnxWzt7Hc8vTYrdQhbA4Y5VZLeY,6651
|
|
29
29
|
prevectorchunks_core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -32,8 +32,8 @@ prevectorchunks_core/utils/__init__.py,sha256=aez3v2dwGHXvmALXVBPR-mQgvxMqxv9NsE
|
|
|
32
32
|
prevectorchunks_core/utils/extract_content.py,sha256=fMDT-BsjYutHLnOFebLhMFpb1UFAB8ldGldxh11FsXw,2920
|
|
33
33
|
prevectorchunks_core/utils/file_loader.py,sha256=JkCKiz3M2TMw5qHoTJXhbn33PfTv5gvQ3nfrbaQOmHs,10689
|
|
34
34
|
prevectorchunks_core/utils/llm_wrapper.py,sha256=7GfyM5p5PeIehi4Dj5jgC7-xi2SjZuyyPuLkWtucQzQ,1139
|
|
35
|
-
prevectorchunks_core-0.1.
|
|
36
|
-
prevectorchunks_core-0.1.
|
|
37
|
-
prevectorchunks_core-0.1.
|
|
38
|
-
prevectorchunks_core-0.1.
|
|
39
|
-
prevectorchunks_core-0.1.
|
|
35
|
+
prevectorchunks_core-0.1.25.dist-info/licenses/LICENCE,sha256=Ljp4XVKnncsQ59h0eMW6J5V-ylsVeqDRC8smR7UPIDs,512
|
|
36
|
+
prevectorchunks_core-0.1.25.dist-info/METADATA,sha256=MkwN6c12SBuLRwFgaWUwANwGMsno4939fo5jU9otYBc,10687
|
|
37
|
+
prevectorchunks_core-0.1.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
38
|
+
prevectorchunks_core-0.1.25.dist-info/top_level.txt,sha256=OWJgfrUDNTh49PpKvRXHY8lVeWqzFbTr9OkDoAvpvPk,21
|
|
39
|
+
prevectorchunks_core-0.1.25.dist-info/RECORD,,
|
|
File without changes
|
{prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/licenses/LICENCE
RENAMED
|
File without changes
|
{prevectorchunks_core-0.1.23.dist-info → prevectorchunks_core-0.1.25.dist-info}/top_level.txt
RENAMED
|
File without changes
|