In the age of online shopping, product reviews play a crucial role in influencing customer decisions. However, not all reviews are genuine โ some are fake, either to promote products or sabotage competitors. To tackle this issue, we developed a Fake Review Detection System using Natural Language Processing (NLP) and Machine Learning, wrapped in a user-friendly Streamlit web interface.
This project enables users to upload a CSV file of product reviews and receive two separate downloadable files: one containing real reviews and the other with fake reviews.
๐ What You Will Learn
How to preprocess review data
How to train an NLP-based ML model
How to classify fake vs. real reviews
How to create a web interface using Streamlit
How to handle file upload and download in a web app
Heart Attack Prediction Using Machine Learning : Click here
๐ Tech Stack
Frontend: Streamlit (Python-based web framework)
Backend: Logistic Regression with TF-IDF Vectorizer
Language: Python
Libraries: Pandas, NumPy, scikit-learn, re, string
๐ Streamlit App Flow
1. Upload the CSV file
Users upload a CSV containing product review data.
2. NLP Model Processes Reviews
The system preprocesses the text (lowercasing, punctuation and digit removal) and uses a pre-trained TF-IDF + Logistic Regression model to classify reviews.
3. Download the Results
Two downloadable CSVs are generated: real_reviews.csv and fake_reviews.csv.
We used TF-IDF (Term Frequency-Inverse Document Frequency) to transform text data into numerical vectors. Then, we trained a Logistic Regression model using labeled data:
Label CG is treated as real (1)
Others are treated as fake (0)
๐ Full Streamlit Code Overview
The app is a single Python file:
Loads and trains a model using a sample dataset
Allows CSV upload
Validates column structure
Preprocesses text
Classifies reviews
Generates download buttons for real and fake reviews
๐ How to Run the App
Save the app as fake_review_app.py
Install dependencies:
pip install streamlit pandas numpy scikit-learn
Run the Streamlit app:
streamlit run fake_review_app.py
Open your browser at http://localhost:8501
Upload your review CSV and download results!
Report
The report will include:
โ Abstract โ Introduction (Overview, Problem Statement, Motivation) โ Literature Review โ Existing System & Drawbacks โ Proposed System โ System Architecture (Diagrams) โ System Specifications โ Experimental Design Diagrams โ Implementation (Setup, Modules, Sample Code) โ System Testing โ Results & Screenshots โ Conclusion & Future Scope โ References
Leave a Reply