The ProCollab Search Engine Backend powers the search functionality for ProCollab, a project collaboration platform. This backend processes user queries and project data, delivering ranked results using natural language processing (NLP) techniques.
-
Flask-Based Backend:
- Built using Flask, a lightweight Python framework, to handle server-side logic.
-
Cross-Origin Requests:
- Uses
Flask-CORSto enable seamless communication between the frontend and backend.
- Uses
-
Data Processing with NLTK:
- Leverages the Natural Language Toolkit (NLTK) for tokenization, stopword removal, and lemmatization.
-
API Integration:
- Fetches project data from an external API and stores it in a global variable (
global_var).
- Fetches project data from an external API and stores it in a global variable (
-
TF-IDF Vectorization:
- Transforms text into numerical representations for similarity calculations.
-
Query Expansion:
- Enhances user search queries by adding synonyms to improve search results.
-
Cosine Similarity:
- Calculates the similarity between user queries and project data to rank results.
-
Result Ranking:
- Returns projects ranked by their similarity scores for the best user experience.
- Project data is fetched from an external API using the
get_data_from_api()function. - Both user queries and project data undergo text preprocessing:
- Tokenization
- Stopword removal
- Lemmatization
- User queries are expanded with synonyms to improve search coverage.
- Preprocessed queries are transformed into TF-IDF vectors.
- Cosine similarity scores are computed between the user's query and each project's data.
- Higher scores indicate better matches.
- Projects are ranked by similarity scores.
- The backend responds to the frontend with project IDs and similarity scores.
- Programming Language: Python
- Framework: Flask
- NLP Library: NLTK
- Vectorization: TF-IDF
- API Integration: External API for project data
- Cross-Origin Requests: Flask-CORS
- Clone the repository:
git clone https://github.com/your-username/procollab-backend.git cd procollab-backend
- Install dependencies:
pip install -r requirements.txt python app.py