2023-12-01 16:27:41 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Uploads the structured output of the files within the given S3 path to a Weaviate index.
|
|
|
|
|
|
|
|
# Structured outputs are stored in s3-small-batch-output-to-weaviate/
|
|
|
|
|
2023-12-11 20:04:15 -05:00
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
2023-12-01 16:27:41 -06:00
|
|
|
cd "$SCRIPT_DIR"/../../.. || exit 1
|
|
|
|
|
|
|
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
2023-12-18 23:48:21 -08:00
|
|
|
local \
|
|
|
|
--num-processes 2 \
|
|
|
|
--output-dir weaviate-output \
|
|
|
|
--strategy fast \
|
|
|
|
--verbose \
|
|
|
|
--reprocess \
|
|
|
|
--input-path example-docs/book-war-and-peace-1225p.txt \
|
|
|
|
--work-dir weaviate-work-dir \
|
2024-05-21 13:01:49 -04:00
|
|
|
--chunking-strategy by_title \
|
2023-12-18 23:48:21 -08:00
|
|
|
--chunk-new-after-n-chars 2500 --chunk-multipage-sections \
|
|
|
|
--embedding-provider "langchain-huggingface" \
|
|
|
|
weaviate \
|
|
|
|
--host-url http://localhost:8080 \
|
|
|
|
--class-name elements \
|
|
|
|
--batch-size 100
|