1
Create a Python file
2
Add the following code to your Python file
semantic_chunking.py
3
Create a virtual environment
Open the
Terminal and create a python virtual environment.4
Install libraries
5
Run PgVector
6
Run the script
Semantic Chunking Params
| Parameter | Type | Default | Description |
|---|---|---|---|
embedder | Embedder | OpenAIEmbedder | The embedder to use for semantic chunking. |
chunk_size | int | 5000 | The maximum size of each chunk. |
similarity_threshold | float | 0.5 | The similarity threshold for determining chunk boundaries. |