--- license: cc-by-sa-3.0 task_categories: - question-answering tags: - wikipedia - usearch - distilbert - msmarco - text size_categories: - 100Kindex sizes with various connectivity<>precision config pairs ``` ❯ du -sh ./20240720/connectivity-*/* 979M ./20240720/connectivity-16/simplewiki-20240720.f16.index 1.8G ./20240720/connectivity-16/simplewiki-20240720.f32.index 1.8G ./20240720/connectivity-200/simplewiki-20240720.f16.index 1.8G ./20240720/connectivity-200/simplewiki-20240720.f32.index 1.0G ./20240720/connectivity-32/simplewiki-20240720.f16.index 1.9G ./20240720/connectivity-32/simplewiki-20240720.f32.index 1.2G ./20240720/connectivity-64/simplewiki-20240720.f16.index 2.0G ./20240720/connectivity-64/simplewiki-20240720.f32.index ``` * index expansion add (`efConstruction` in HNSW terms) of 128 (usearch default) * quantizing embedding vectors from f32 to f16 - identical recall accuracy on test queries (i8 performed poorly by contrast) * `multi` key support enabled (*so more than one chunk can refer to the same section id*) the **original [simple english wikipedia dump](https://dumps.wikimedia.org/simplewiki/20240801/)** that was used to generate these artifacts, dated 2024-08-01 ### modifiable reproduction script `wikiembed.py` * *requires [msmarco distilbert tas b coreml](https://huggingface.co/ZachNagengast/coreml-msmarco-bert-base-dot-v5) model as written* * [coremltools](https://github.com/apple/coremltools) prediction only works on macOS[*](https://apple.github.io/coremltools/docs-guides/source/model-prediction.html), which was used to generate the vector embeddings for the semantic index. for cross-platform coreml prediction, check out [tvm](https://tvm.apache.org/docs/how_to/compile_models/from_coreml.html#load-pretrained-coreml-model) * other dependencies described in `requirements.txt`: ```sh pip3 install -r requirements.txt ``` * make any desired changes to e.g. index parameters, wikipedia dump language or date, or embeddings model in the script * run the script to download, clean, persist & index the dump contents ```sh chmod +x wikiembed.py ./wikiembed.py ``` --- released under [creative commons license (CC BY-SA 3.0 unported)](https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License) data cleaning adapted from [olm/wikipedia](https://huggingface.co/datasets/olm/wikipedia) by [britt lewis](https://bl3.dev)