This project is a Semantic Search Engine built with Python, Sentence Transformers, and ChromaDB.
It extracts text from a PDF, creates overlapping text chunks, converts them into embeddings, stores them in ChromaDB, and allows users to search the document using natural language queries.
- Extract text from PDF files
- Split text into overlapping chunks
- Generate embeddings using Sentence Transformers
- Store embeddings in ChromaDB
- Semantic similarity search
- Retrieve page numbers for search results
- Persistent vector database
- Python
- PyMuPDF (fitz)
- Sentence Transformers
- ChromaDB
Semantic_Search_Engine/
├── data/ │ └── sample.txt │ ├── chroma_db/ │ ├── index_pdf.py ├── search.py ├── requirements.txt ├── README.md └── .gitignore
Clone the repository:
git clone <repository-url>Move into the project directory:
cd Semantic_Search_EngineInstall dependencies:
pip install -r requirements.txtThis repository does not include a PDF file.
- Place your PDF inside the
datafolder. - Rename it to:
ai_ml.pdf
Example:
data/
ai_ml.pdf
python index_pdf.pypython search.pyQuestion:
What is Deep Learning?
Output:
Page: 12
Deep Learning is a subset of Machine Learning...
- Support multiple PDF files
- Build a Streamlit web interface
- Add hybrid search
- Integrate with Large Language Models (RAG)