Compare commits
No commits in common. "2275e8b5be9e6b1c53624cbc64258f2f2dd90058" and "f3704a3aa4483a7fece365148b1da262857a920d" have entirely different histories.
2275e8b5be
...
f3704a3aa4
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 115 KiB |
BIN
page_0.png
BIN
page_0.png
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB |
BIN
page_1.png
BIN
page_1.png
Binary file not shown.
|
Before Width: | Height: | Size: 258 KiB |
@ -2,7 +2,6 @@
|
|||||||
langchain>=0.0.267
|
langchain>=0.0.267
|
||||||
langchain-community>=0.0.10
|
langchain-community>=0.0.10
|
||||||
transformers>=4.30.0
|
transformers>=4.30.0
|
||||||
langchain_community
|
|
||||||
|
|
||||||
# Document processing
|
# Document processing
|
||||||
unstructured>=0.10.0
|
unstructured>=0.10.0
|
||||||
@ -21,7 +20,7 @@ tabula-py>=2.7.0
|
|||||||
|
|
||||||
# Data manipulation
|
# Data manipulation
|
||||||
pandas>=2.0.0
|
pandas>=2.0.0
|
||||||
numpy
|
numpy>=1.24.0
|
||||||
|
|
||||||
# Visualization
|
# Visualization
|
||||||
matplotlib>=3.7.0
|
matplotlib>=3.7.0
|
||||||
@ -39,4 +38,3 @@ sentence-transformers>=2.2.2
|
|||||||
# Utilities
|
# Utilities
|
||||||
tqdm>=4.65.0
|
tqdm>=4.65.0
|
||||||
python-dotenv>=1.0.0
|
python-dotenv>=1.0.0
|
||||||
pi_heif
|
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,25 +0,0 @@
|
|||||||
from unstructured.partition.pdf import partition_pdf
|
|
||||||
|
|
||||||
output_path = "/home/sepehr/dev/rag/document/"
|
|
||||||
file_path = "/home/sepehr/dev/rag/document/04Extrait_Methodologie_Experimentale.pdf"
|
|
||||||
|
|
||||||
# Reference: https://docs.unstructured.io/open-source/core-functionality/chunking
|
|
||||||
chunks = partition_pdf(
|
|
||||||
filename=file_path,
|
|
||||||
infer_table_structure=True, # extract tables
|
|
||||||
strategy="hi_res", # mandatory to infer tables
|
|
||||||
|
|
||||||
extract_image_block_types=["Image"], # Add 'Table' to list to extract image of tables
|
|
||||||
# image_output_dir_path=output_path, # if None, images and tables will saved in base64
|
|
||||||
|
|
||||||
extract_image_block_to_payload=True, # if true, will extract base64 for API usage
|
|
||||||
|
|
||||||
chunking_strategy="by_title", # or 'basic'
|
|
||||||
max_characters=10000, # defaults to 500
|
|
||||||
combine_text_under_n_chars=2000, # defaults to 0
|
|
||||||
new_after_n_chars=6000,
|
|
||||||
|
|
||||||
# extract_images_in_pdf=True, # deprecated
|
|
||||||
)
|
|
||||||
|
|
||||||
print(chunks[3].metadata.orig_elements)
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user