An end-to-end Machine Learning application that classifies job postings as Fraudulent or Legitimate using NLP and structured features. The project includes a trained ML pipeline, a FastAPI prediction service, and a Streamlit demo UI for real-time inference.
Status: End-to-end prototype (model + API + frontend)
- ๐ง Trained ML pipeline (scikit-learn / XGBoost)
- ๐ FastAPI backend serving predictions
- ๐ Streamlit UI for easy testing
- ๐ฆ Model artifacts versioned and reusable
- ๐ณ Docker-ready backend (optional deployment)
app/app.pyโ FastAPI app exposing/(health) and/predictapp/predict.pyโ Model loading & prediction logicst.pyโ Streamlit demo UI (calls API)model/โ Saved model artifactsfraud_detection_pipeline.pkldecision_threshold.pkl
data/โ CSV datasets used during developmentmodel_notebooks/โ Training & evaluation notebooksdata_cleaning/,data_processing/โ Preprocessing notebooksDockerfileโ Backend container configurationrequirements.txtโ Python dependencies (Backend)requirements2.txtโ Python dependencies (Frontend)
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txtuvicorn app.app:app --host 0.0.0.0 --port 8000 --reloadHealth check:
GET http://localhost:8000/Response:
{"status":"API is running"}curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: application/json" \
-d '{
"job_description":"Work from home opportunity...",
"telecommuting":1,
"has_company_logo":0,
"has_questions":0,
"jd_word_count":18,
"req_exp_enc":0,
"employment_type_Full_time":0,
"employment_type_Part_time":0,
"employment_type_Temporary":0,
"employment_type_Other":1,
"employment_type_Unknown":0
}'Response includes:
fraud_probabilityprediction(Fraud / Real)threshold_used
- The API expects the same feature names used during training
- Input combines:
- Job description text
- Binary metadata features
- One-hot encoded employment types
- See
app/app.pyfor the exact schema
- Update API URL inside
st.py:
API_URL = "http://localhost:8000/predict"- Run:
streamlit run st.pyThe Streamlit app includes retry logic to handle cold-start delays on free hosting platforms.
The backend is Docker-ready and can be containerized later without code changes:
docker build -t fraud-job-detection .
docker run -p 8000:8000 fraud-job-detectionStored in model/ and loaded at runtime:
fraud_detection_pipeline.pklโ preprocessing + classifierdecision_threshold.pklโ probability threshold
- Add CI pipeline for linting & API smoke tests
- Add unit tests for prediction logic
- Docker Compose for API + Streamlit
- Model monitoring & logging
MIT License
Rajdip
If you found this project useful, feel free to โญ the repository.