FixedSizeChunking creates chunks up to chunk_size characters and avoids splitting a word when a boundary is available.
1
Create a Python file
fixed_size_chunking.py
2
Set up your virtual environment
3
Install dependencies
4
Export your OpenAI API key
5
Run PgVector
6
Run the script
split_on_pages=False so PDFReader combines the pages before applying FixedSizeChunking. Keep the default value of True to chunk each page independently.