| --- |
| license: mit |
| task_categories: |
| - text-retrieval |
| - question-answering |
| language: |
| - en |
| tags: |
| - building-defects |
| - construction-quality |
| - ncc |
| - vba |
| - rag |
| - embeddings |
| - bge |
| pretty_name: Building Defects RAG Index |
| size_categories: |
| - 1K<n<10K |
| --- |
| |
| # Building Defects RAG Index |
|
|
| This dataset contains pre-built retrieval artifacts for the Building Defects |
| & Quality chatbot. It includes chunked documents, embeddings, and search |
| indexes ready for deployment. |
|
|
| ## Purpose |
|
|
| This dataset enables Retrieval-Augmented Generation (RAG) for answering |
| questions about building defects, construction tolerances, NCC Volume Two |
| requirements, and VBA Guide to Standards and Tolerances. |
|
|
| ## Embedding Model |
|
|
| - **Model**: `BAAI/bge-small-en-v1.5` |
| - **Dimension**: 384 |
| - **Storage**: float16 for 50% compression |
|
|
| ## Dataset Schema |
|
|
| ### chunks.parquet |
|
|
| Document chunks with metadata for retrieval. |
|
|
| | Column | Type | Description | |
| |--------|------|-------------| |
| | chunk_id | string | Unique identifier for the chunk | |
| | text | string | The chunk text content | |
| | heading_path | list[string] | Hierarchical heading context | |
| | source | string | Source PDF filename | |
| | page | int | Page number in source document | |
| | chunk_hash | string | SHA-256 hash (first 16 chars) | |
| |
| ### embeddings.parquet |
| |
| Embedding vectors for semantic search. |
| |
| | Column | Type | Description | |
| |--------|------|-------------| |
| | chunk_id | string | Matches chunk_id in chunks.parquet | |
| | chunk_hash | string | SHA-256 hash for deduplication | |
| | embedding | fixed_size_list[float16] | Embedding vector | |
|
|
| ### faiss_index.bin |
| |
| Serialized FAISS index for fast approximate nearest neighbor search. |
| Uses IndexFlatIP (inner product) for cosine similarity search. |
| |
| ### bm25_index.pkl |
|
|
| Serialized BM25 index for lexical/keyword search. |
| Used in hybrid retrieval with reciprocal rank fusion. |
|
|
| ### source_manifest.json |
| |
| Manifest of source files with hashes for change detection. |
| |
| | Field | Type | Description | |
| |-------|------|-------------| |
| | sources | list[SourceFile] | Source file metadata | |
| | created_at | string | ISO 8601 creation timestamp | |
| | total_chunks | int | Total chunk count | |
| | total_embeddings | int | Total embedding count | |
|
|
| ### index_version.txt |
| |
| Single-line version identifier for cache invalidation. |
| Format: `{timestamp}_{hash}` (e.g., `20240115_123456_abc123`) |
|
|
| ## Statistics |
|
|
| - **Total Chunks**: 1,523 |
| - **Total Embeddings**: 1,523 |
| - **Embedding Dimension**: 384 |
| - **Source Documents**: 0 |
| - **Storage Format**: Parquet with Snappy compression |
|
|
| ## Usage |
|
|
| ### Loading with HuggingFace Datasets |
|
|
| ```python |
| from datasets import load_dataset |
| |
| # Load chunks |
| chunks = load_dataset("sadickam/BuildingDefect_index", data_files="chunks.parquet") |
| |
| # Load embeddings |
| embeddings = load_dataset("sadickam/BuildingDefect_index", data_files="embeddings.parquet") |
| ``` |
|
|
| ### Loading with huggingface_hub |
| |
| ```python |
| from huggingface_hub import hf_hub_download |
|
|
| # Download FAISS index |
| faiss_path = hf_hub_download( |
| repo_id="sadickam/BuildingDefect_index", |
| filename="faiss_index.bin", |
| repo_type="dataset", |
| ) |
| |
| # Download BM25 index |
| bm25_path = hf_hub_download( |
| repo_id="sadickam/BuildingDefect_index", |
| filename="bm25_index.pkl", |
| repo_type="dataset", |
| ) |
| ``` |
| |
| ### Loading FAISS Index |
|
|
| ```python |
| import faiss |
| |
| index = faiss.read_index(faiss_path) |
| ``` |
|
|
| ## License |
|
|
| This dataset is released under the MIT License. |
|
|
| ## Sources |
|
|
| This dataset is based on: |
| - **NCC Volume Two (2022)** - National Construction Code, Australian Building Codes Board |
| - **VBA Guide to Standards and Tolerances** - Victorian Building Authority |
|
|