# dinesh-m-4103/fake-review-classification architecture

> Architecture diagram of the GitHub repository dinesh-m-4103/fake-review-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dinesh-m-4103/fake-review-classification
- Repository: https://github.com/dinesh-m-4103/fake-review-classification

## Overview

#### Purpose and Delivery Form
This repository is an exploratory NLP/ML project for detecting fake product reviews and extracting review themes. It is delivered as two Jupyter notebooks rather than a deployable application or package. Primary execution entry points are `Fake_Review_Classification_Notebook(1).ipynb` and `Fake_Review_Classification_Notebook(2).ipynb`; `FINAL PROJECT EVALUATION.pptx` is a presentation artifact.

#### Data and Preparation Pipeline
The notebooks process a dataset of 40,432 reviews with text and metadata. The central input transformation is review text normalization: tokenization, alphabetic filtering, lowercasing, NLTK stopword removal, lemmatization, and Porter stemming. Cleaned review text is converted to TF-IDF features with a 5,000-word vocabulary.
- `Fake_Review_Classification_Notebook(1).ipynb`
- `Fake_Review_Classification_Notebook(2).ipynb`

#### Unsupervised Analysis
TF-IDF feature vectors feed clustering and topic discovery. K-means cluster count is selected through an elbow/WCSS analysis, with four clusters chosen; DBSCAN provides an alternative density-based partitioning and better reported silhouette performance. LDA then derives interpretable word-topic distributions from review content.
- `Fake_Review_Classification_Notebook(1).ipynb`
- `Fake_Review_Classification_Notebook(2).ipynb`

#### Supervised Fake-Review Classification
The classification stage follows exploratory clustering/topic modeling and trains multiple model families against fake-review labels: Logistic Regression and SVM over engineered text features, an LSTM sequence model, and a pretrained RoBERTa transformer. This creates two key representation boundaries: TF-IDF vectors for conventional ML/clustering, versus tokenized sequences/transformer inputs for neural models.
- `Fake_Review_Classification_Notebook(1).ipynb`
- `Fake_Review_Classification_Notebook(2).ipynb`

#### Evaluation and Model Selection
Model outputs are evaluated with accuracy, precision, recall, and F1 for conventional ML; LSTM and RoBERTa use accuracy and loss. Reported results select LSTM as the strongest candidate (90% accuracy), followed by SVM (87%), Logistic Regression (85%), and RoBERTa (83%). Comparative reporting is likely surfaced in the project presentation.
- `FINAL PROJECT EVALUATION.pptx`
- `Fake_Review_Classification_Notebook(2).ipynb`

#### Runtime and External Dependencies
Execution requires a Python notebook runtime with NLP and ML libraries implied by the workflow: NLTK resources (English stopwords, WordNet), TF-IDF/vectorization and clustering/classical classifiers, LDA, deep-learning support for LSTM, and a transformer stack/model assets for RoBERTa. No service layer, API, database, deployment infrastructure, or external online service is represented in the repository tree.

Main entry points: [`Fake_Review_Classification_Notebook(1).ipynb`](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(1).ipynb) (Exploration Notebook), [`Fake_Review_Classification_Notebook(2).ipynb`](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(2).ipynb) (Classification Notebook), [`FINAL PROJECT EVALUATION.pptx`](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/FINAL%20PROJECT%20EVALUATION.pptx) (Project Evaluation Deck)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notebooks["Notebook Runtime"]
  node_nb1["Exploration Notebook<br/>Jupyter notebook"]
  node_nb2["Classification Notebook<br/>Jupyter notebook"]
  node_dataset[("Review Dataset<br/>review corpus")]
  node_nlp_resources["NLTK Resources<br/>NLP dependency"]
end

subgraph group_analysis["Text Analytics"]
  node_normalization["Text Normalization<br/>preprocessing"]
  node_tfidf["TF-IDF Features<br/>text representation"]
  node_elbow["Elbow / WCSS Selection<br/>cluster selection"]
  node_kmeans["K-means Clustering<br/>unsupervised model"]
  node_dbscan["DBSCAN Clustering<br/>unsupervised model"]
  node_lda["LDA Topic Discovery<br/>topic model"]
end

subgraph group_classification["Fake-Review Classification"]
  node_sequence_inputs["Tokenized Sequences<br/>neural representation"]
  node_transformer_inputs["RoBERTa Inputs<br/>transformer representation"]
  node_classical_models["Logistic Regression + SVM<br/>classical classifiers"]
  node_lstm["LSTM Classifier<br/>neural classifier"]
  node_roberta["RoBERTa Classifier<br/>transformer classifier"]
  node_evaluation["Model Evaluation<br/>metrics comparison"]
end

node_presentation["Project Evaluation Deck<br/>presentation"]

node_nb1 -->|"loads"| node_dataset
node_nb2 -->|"loads"| node_dataset
node_dataset -->|"review text"| node_normalization
node_nlp_resources -.->|"stopwords and lexical data"| node_normalization
node_normalization -->|"cleaned text"| node_tfidf
node_tfidf -->|"vectors"| node_elbow
node_elbow -->|"4 clusters"| node_kmeans
node_tfidf -->|"vectors"| node_dbscan
node_tfidf -->|"review terms"| node_lda
node_normalization -->|"cleaned text"| node_sequence_inputs
node_normalization -->|"review text"| node_transformer_inputs
node_tfidf -->|"features"| node_classical_models
node_dataset -->|"fake labels"| node_classical_models
node_sequence_inputs -->|"sequences"| node_lstm
node_dataset -->|"fake labels"| node_lstm
node_transformer_inputs -->|"transformer tokens"| node_roberta
node_dataset -->|"fake labels"| node_roberta
node_classical_models -->|"85% / 87% results"| node_evaluation
node_lstm -->|"90% accuracy and loss"| node_evaluation
node_roberta -->|"83% accuracy and loss"| node_evaluation
node_evaluation -->|"comparative results"| node_presentation
node_nb1 -.->|"executes"| node_normalization
node_nb2 -.->|"executes"| node_evaluation

click node_nb1 "https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(1).ipynb"
click node_nb2 "https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(2).ipynb"
click node_presentation "https://github.com/dinesh-m-4103/fake-review-classification/blob/main/FINAL%20PROJECT%20EVALUATION.pptx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nb1,node_nb2,node_dataset,node_nlp_resources toneBlue
class node_normalization,node_tfidf,node_elbow,node_kmeans,node_dbscan,node_lda toneAmber
class node_sequence_inputs,node_transformer_inputs,node_classical_models,node_lstm,node_roberta,node_evaluation toneMint
class node_presentation toneNeutral
```

## Components

### Notebook Runtime

Interactive Python analysis notebooks.

- [Exploration Notebook](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(1).ipynb): Jupyter notebook · Runs preparation, clustering, topics, and model experiments. · `Fake_Review_Classification_Notebook(1).ipynb`
- [Classification Notebook](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/Fake_Review_Classification_Notebook(2).ipynb): Jupyter notebook · Runs classification evaluation and comparative reporting. · `Fake_Review_Classification_Notebook(2).ipynb`
- **Review Dataset**: review corpus · 40,432 reviews with text, metadata, and fake-review labels.
- **NLTK Resources**: NLP dependency · English stopwords and WordNet resources.

### Text Analytics

- **Text Normalization**: preprocessing · Tokenizes, filters, lowercases, removes stopwords, lemmatizes, and stems text.
- **TF-IDF Features**: text representation · 5,000-word vocabulary vectors for conventional ML and clustering.
- **Elbow / WCSS Selection**: cluster selection · Selects four K-means clusters.
- **K-means Clustering**: unsupervised model
- **DBSCAN Clustering**: unsupervised model · Alternative density-based partitioning.
- **LDA Topic Discovery**: topic model · Produces interpretable word-topic distributions.

### Fake-Review Classification

- **Tokenized Sequences**: neural representation · Sequence inputs for the LSTM classifier.
- **RoBERTa Inputs**: transformer representation · Tokenized inputs and pretrained transformer assets.
- **Logistic Regression + SVM**: classical classifiers · Trained on TF-IDF text features against fake-review labels.
- **LSTM Classifier**: neural classifier · Selected strongest candidate at 90% accuracy.
- **RoBERTa Classifier**: transformer classifier
- **Model Evaluation**: metrics comparison · Compares accuracy, precision, recall, F1, and neural loss.

### Other components

- [Project Evaluation Deck](https://github.com/dinesh-m-4103/fake-review-classification/blob/main/FINAL%20PROJECT%20EVALUATION.pptx): presentation · Surfaces comparative model results. · `FINAL PROJECT EVALUATION.pptx`

## Connections

- Exploration Notebook → Review Dataset: loads
- Classification Notebook → Review Dataset: loads
- Review Dataset → Text Normalization: review text
- NLTK Resources → Text Normalization: stopwords and lexical data
- Text Normalization → TF-IDF Features: cleaned text
- TF-IDF Features → Elbow / WCSS Selection: vectors
- Elbow / WCSS Selection → K-means Clustering: 4 clusters
- TF-IDF Features → DBSCAN Clustering: vectors
- TF-IDF Features → LDA Topic Discovery: review terms
- Text Normalization → Tokenized Sequences: cleaned text
- Text Normalization → RoBERTa Inputs: review text
- TF-IDF Features → Logistic Regression + SVM: features
- Review Dataset → Logistic Regression + SVM: fake labels
- Tokenized Sequences → LSTM Classifier: sequences
- Review Dataset → LSTM Classifier: fake labels
- RoBERTa Inputs → RoBERTa Classifier: transformer tokens
- Review Dataset → RoBERTa Classifier: fake labels
- Logistic Regression + SVM → Model Evaluation: 85% / 87% results
- LSTM Classifier → Model Evaluation: 90% accuracy and loss
- RoBERTa Classifier → Model Evaluation: 83% accuracy and loss
- Model Evaluation → Project Evaluation Deck: comparative results
- Exploration Notebook → Text Normalization: executes
- Classification Notebook → Model Evaluation: executes
