A web application that enables semantic document search using Latent Semantic Indexing (LSI). The system preprocesses text, computes TF-IDF, applies Singular Value Decomposition (SVD) for dimensionality reduction, and retrieves documents based on cosine similarity.
- Preprocessing: Removes stopwords and applies stemming/lemmatization.
- TF-IDF Computation: Converts documents into numerical vectors.
- SVD Decomposition: Reduces dimensionality to enhance semantic search.
- Cosine Similarity: Ranks documents by relevance to the search query.
- Flask API: Handles search requests and retrieves relevant documents.
- React Frontend: Provides a user-friendly interface for searching.
π vwm
β
βββ π backend
β βββ server.py # ποΈ Flask backend API
β βββ db.py # π MongoDB database connection
β βββ preprocess.py # βοΈ Text preprocessing
β βββ TF-IDF.py # π’ TF-IDF computation
β βββ SVD.py # π Singular Value Decomposition
β βββ cosineSimilarity.py # π Cosine similarity computation
β
βββ π frontend
β βββ π src
β βββ pages/Home.js # π Search input and results display
β βββ App.js # βοΈ React app configuration
β βββ pages/home.css # π¨ Styling for UI
β βββ App.css' # π¨ Styling for UI
β
βββ app.py # π Runs both frontend & backend
βββ README.md # π Project documentation
git clone https://github.com/FirstOne96/LSI-Search-System.git
cd vwmcd backend python -m venv venv # Create a virtual environment source venv/bin/activate # Activate virtual environment (Mac/Linux) venv\bin\activate # Activate virtual environment (Windows) pip install -r requirements.txt # Install dependencies
cd ../frontend
rm -rf node_modules package-lock.json
npm cache clean --force
npm install
npm install --save-dev eslint-config-react-app eslint@latest
npm install eslint@^8.0.0 --save-dev
npm install eslint-config-react-app@latest --save-dev
npm startcd .. python app.py # Runs both backend & frontend
- π Flask β Web framework
- π MongoDB β NoSQL database
- β NLTK β Text processing
- π’ Scikit-learn β TF-IDF, SVD
- β React β UI framework
- π¨ Tailwind CSS β Styling
Feel free to fork this repository and submit a pull request with improvements!