Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

BNS Law RAG Dataset

Dataset: Hrutik2003/Bns_Law_Rag_DB
Purpose: Text corpus for RAG systems on the new Indian criminal laws (BNS, BNSS, BSA).

Dataset Summary

This dataset contains cleaned and processed text extracted from the new Indian criminal laws introduced in 2023 and old IPC laws:

  • Bharatiya Nyaya Sanhita (BNS) 2023
  • Bharatiya Nagarik Suraksha Sanhita (BNSS) 2023
  • Bharatiya Sakshya Adhiniyam (BSA) 2023
  • The Code of Criminal Procedure (CrPC)
  • The Indian Penal Code (IPC)
  • The Indian Evidence Act (IEA)

The text has been cleaned, normalized, and split into chunks for easy use in Retrieval-Augmented Generation (RAG) pipelines.

Contents

  • documents/ – Raw or cleaned legal text
  • chunks/ – Split text used for embeddings/vectorstores
  • metadata/ – JSON files for section mapping
  • examples/ – Sample Q&A for training / legal assistant prompts
  • vectorstore/ (optional) – Prebuilt vector index files (Chroma/FAISS)

Intended Use

  • Legal RAG systems
  • Building chatbots on BNS/BNSS/BSA
  • Semantic search / embedding-based retrieval
  • Fine-tuning small LLMs for legal Q&A

Note: Not intended for official legal advice.

Loading the Dataset

from datasets import load_dataset
ds = load_dataset("Hrutik2003/Bns_Law_Rag_DB")

Access text:

texts = ds["train"]["text"]

Example: Using with ChromaDB

from datasets import load_dataset
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_chroma import Chroma

ds = load_dataset("Hrutik2003/Bns_Law_Rag_DB")

splitter = RecursiveCharacterTextSplitter(
    chunk_size=800,
    chunk_overlap=100
)

embeddings = HuggingFaceEmbeddings(
    model_name="sentence-transformers/all-MiniLM-L6-v2"
)

chunks = splitter.split_text("\n\n".join(ds["train"]["text"]))
db = Chroma.from_texts(chunks, embedding=embeddings)

License

MIT Public legal text belongs to Government of India; processed dataset © 2025 Hrutik Pisal.

Author

Created by Hrutik Pisal for Indian Law RAG systems.

Downloads last month
31

Space using Hrutik2003/Bns_Law_Rag_DB 1