Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 101 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,58 @@

## 📌 Project Overview

This project was developed by a three-person academic team over 10 weeks (part-time, $0 budget).
This project was developed by a three-person academic team over 10 weeks on a part-time basis with a $0 budget.

The **Review Guard System** is a locally runnable web application that uses **Natural Language Processing (NLP)** and **Machine Learning** to classify online reviews as:
**Review Guard** is a locally runnable web application that uses **Natural Language Processing (NLP)** and **Machine Learning** to classify online reviews as:

- ✅ Genuine
- ❌ Fake
* ✅ Genuine
* ❌ Fake

## 🚀 Features
- Single review prediction
- Batch CSV upload and processing
- Fake/Genuine classification
- Fake probability score output
- Download results as CSV
- Multiple model support (v1, v2, v3)
- Fully offline system

* Single review prediction
* Batch CSV upload and processing
* Fake/Genuine classification
* Fake probability score output
* Download results as CSV
* Multiple model support (`v1`, `v2`, `v3`)
* Fully offline system


```markdown
## 📂 CSV Format

The CSV file must contain the following columns:

```text
text,rating,helpful_vote,verified_purchase

```

## 🎯 Project Goals

- Achieve **greater than 80% classification accuracy** on unseen test data
- Develop a **fully offline, locally runnable web application**
- Support both **single review prediction and batch CSV processing**
- Provide **fake probability scores for each prediction**
- Follow an **Agile development methodology with iterative improvements**
- Ensure **fast response time and user-friendly interface**

* Achieve **greater than 80% classification accuracy** on unseen test data
* Develop a **fully offline, locally runnable web application**
* Support both **single review prediction and batch CSV processing**
* Provide **fake probability scores for each prediction**
* Follow an **Agile development methodology with iterative improvements**
* Ensure **fast response time and user-friendly interface**

## 🛠️ Technologies Used

- **Backend:** Python (Flask)
- **Frontend:** HTML, CSS, JavaScript
- **ML/NLP:** Scikit-learn, NLTK
- **Data Processing:** Pandas, NumPy
- **Model Storage:** Joblib
- **Testing:** Pytest
- **CI/CD:** GitHub Actions

* **Backend:** Python, Flask
* **Frontend:** HTML, CSS, JavaScript
* **ML/NLP:** Scikit-learn, NLTK
* **Data Processing:** Pandas, NumPy
* **Model Storage:** Joblib
* **Testing:** Pytest
* **CI/CD:** GitHub Actions

## 📂 Dataset

### Label Definition

- `1` → Fake review
- `0` → Genuine review

Note: The model uses binary classification where 1 represents fake and 0 represents genuine.


* `1` → Fake review
* `0` → Genuine review

The system uses binary classification where `1` represents a fake review and `0` represents a genuine review.

## 📂 Project Structure

Expand Down Expand Up @@ -103,110 +97,125 @@ Review-1/
│ ├── notebooks/
│ └── src/
└── images/
```

## ⚙️ Installation
- pip install -r requirements.txt

```bash
pip install -r requirements.txt
```

## ✅ RUN APPLICATION
## ✅ Run Application

```bash
python3 run.py
```

## 🏋️ Train Models

🏋️ Train Models
## Default Training (Recommended)
### Default Training (Recommended)

- python app/ml/training/train_model.py \
--input_csv dataset/amazon_labeled_fake_reviews/final_labeled_fake_reviews.csv \
--phase1_root app \
--random_seed 42
```bash
python app/ml/training/train_model.py \
--input_csv dataset/amazon_labeled_fake_reviews/final_labeled_fake_reviews.csv \
--phase1_root app \
--random_seed 42
```

### Train Model Versions

## 🔹 Train Model Versions
- **v1 (Hybrid):** Text + metadata
- **v2 (Text-only):** Only text features
- **v3 (Best Model):** Blended model combining v1 + v2
* **v1 (Hybrid):** Text + metadata
* **v2 (Text-only):** Only text features
* **v3 (Best Model):** Blended model combining v1 + v2

#### v1

```bash
python app/ml/training/train_model.py --include_behavioral --model_version phase1-v1
```

#### v2

## v1
- python app/ml/training/train_model.py --include_behavioral --model_version phase1-v1
```bash
python app/ml/training/train_model.py --model_version phase1-v2
```

#### v3 (Best)

## v2
- python app/ml/training/train_model.py --model_version phase1-v2
```bash
python app/ml/training/train_model_v3.py
```

### Optional (Advanced)

## v3 (Best)
- python app/ml/training/train_model_v3.py
```bash
python app/ml/training/train_model.py --enable_xgboost
```

## 🧪 Testing

- 106 test cases implemented
- 100% pass rate
- Includes:
- Unit Testing
- Integration Testing
- Security Testing
- Regression Testing
* 106 test cases implemented
* 100% pass rate
* Includes:

* Unit Testing
* Integration Testing
* Security Testing
* Regression Testing

### Run Tests

## Optional (Advanced)
```bash
python3 -m pytest -q app/tests
```

- python app/ml/training/train_model.py --enable_xgboost
## 📊 Model Evaluation

## Run Tests
- python3 -m pytest -q app/tests
The system is evaluated using:

* Accuracy
* Precision
* Recall
* F1-Score

📊 Model Evaluation
- Accuracy (>80%)
- Precision
- Recall
- F1-Score
## ⚠️ Risk and Validation

To reduce data leakage and improve reliability, the project includes:

⚠️ Risk & Validation
- To avoid data leakage:
- Text normalization + hashing
- Duplicate-safe splitting
- Near-duplicate audit
- Remaining Risk
- Paraphrased reviews may still exist → residual risk
* Text normalization and hashing
* Duplicate-safe splitting
* Near-duplicate audit

## ⚙️ CI/CD
### Remaining Risk

- GitHub Actions used
- Automated testing on every push
* Paraphrased reviews may still exist in the dataset, creating residual risk

## ⚙️ CI/CD

* GitHub Actions used
* Automated testing on every push

## 📊 Project Management (Jira)

The project was managed using Jira with sprint planning and task tracking.


The project was managed using **Jira** with sprint planning and task tracking.

### 🗂️ Jira Board Overview

![Jira Board](images/jira-board.png)

## 📅 Agile Milestones
- Planning & Dataset Preparation
- Model Development & Evaluation
- Web Application Integration
- Testing & Final Delivery


* Planning and dataset preparation
* Model development and evaluation
* Web application integration
* Testing and final delivery

## 👥 Team
- Kriti Subedi
- Swapnali Kudale
- Aditi Sharma


* Kriti Subedi
* Swapnali Kudale
* Aditi Sharma

## 📜 License
Developed for academic purposes only.

Developed for academic purposes only.
Loading