A simple Semantic Search Engine built with Python, Sentence Transformers, and FAISS.
The application reads a PDF document, converts the text into embeddings, stores them in a FAISS vector index, and retrieves the most semantically relevant chunks for a user's query.
- Read PDF documents
- Extract text page by page
- Split text into sentences
- Create overlapping text chunks
- Generate embeddings using Sentence Transformers
- Store embeddings in FAISS
- Perform semantic similarity search
- Display page number and chunk ID for retrieved results
- Python
- PyMuPDF
- Sentence Transformers
- FAISS
- NumPy
- PyTorch
Semantic_Search_Engine/
│
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
└── data/
└── ai_ml.pdf
Clone the repository:
git clone (https://github.com/ridazahra-ai/semantic-search-engine)Install dependencies:
pip install -r requirements.txtRun the application:
python app.pyAsk a question:
What is Machine Learning?
Top Results
Page: 5
Chunk ID: 12
Machine Learning is a subset of Artificial Intelligence...
While building this project, I learned:
- PDF processing with PyMuPDF
- Text chunking strategies
- Sentence embeddings
- Vector similarity search
- FAISS indexing
- Metadata management
- Building a semantic search pipeline
Place your own PDF inside the data/ folder.
Update the file path in app.py if necessary.
Rida Zahra
AI Engineering Learning Journey
