This repository contains an LSTM-based deep learning model for Fake-Review-Detection using pre-trained GloVe word embeddings. The project involves:
- Preprocessing: Loading GloVe embeddings and preparing an embedding matrix.
- Model Training: Implementing an LSTM model with hyperparameter tuning using Ray Tune.
- Hyperparameter Optimization: Tuning LSTM layers, units, and learning rate with Bayesian Optimization.
- Evaluation: Assessing model performance with accuracy, binary cross-entropy loss, and confusion matrices.
Try the deployed model here: Fake Review Detection App
📦 LSTM-Text-Classification
├── 📜 Embeddings.ipynb # Loading GloVe embeddings and preparing embedding matrix
├── 📜 Hyperparameter Tuning.ipynb # Hyperparameter tuning using Ray Tune
├── 📜 Model Training.ipynb # Training and evaluating the model
├── 📜 glove.6B.50d.txt # Pre-trained GloVe embeddings (50d vectors)
├── 📜 README.md # Project documentation
└── 📜 requirements.txt # Dependencies and packages required
- Embedding Layer: Pre-trained GloVe embeddings (non-trainable)
- LSTM Layers: Multiple LSTM layers with tuned units
- Dense Layer: Fully connected layer with a sigmoid activation function
- Optimizer: Adam with a tuned learning rate
- Loss Function: Binary Cross-Entropy
The model is evaluated using:
- Accuracy
- Binary Cross-Entropy Loss
- Confusion Matrix Visualization
A sample confusion matrix:
Predicted
Machine | Human
True Machine [TN] | [FP]
Human [FN] | [TP]
Hyperparameter optimization is performed using Ray Tune with Bayesian Optimization (BOHB). The tuning process explores:
- Number of LSTM layers
- LSTM hidden units
- Learning rate
- Python 3.8+
- TensorFlow
- NumPy
- Pandas
- Ray Tune
- Matplotlib
- Seaborn