This project is a Streamlit-based application that classifies news articles as either Fake or Real using a trained LSTM model. The app provides an interactive and user-friendly interface for evaluating the authenticity of news content.
- Interactive Interface: Paste any news content and get a prediction instantly.
- Deep Learning Model: Powered by an LSTM model for accurate classification.
- Custom Styling: Enhanced visuals for an intuitive user experience.
- Real-Time Predictions: Quickly determine if news is fake or real.
Follow these steps to set up and run the application:
Clone this repository to your local system:
git clone https://github.com/your-username/fake-news-detector.git Move into the project folder:
cd fake-news-detector Install the required Python packages using the following command:
pip install -r requirements.txt Launch the Streamlit app:
streamlit run app.py fake-news-detector/
│
├── app.py # Streamlit app file
├── models/
│ └── LSTM_model.keras # Trained LSTM model
├── tokenizer.pkl # Tokenizer used for text preprocessing
├── data/
│ ├── True.csv # Dataset for real news
│ └── Fake.csv # Dataset for fake news
├── requirements.txt # List of dependencies
└── README.md # Documentation file
The app uses a labeled dataset containing two categories of news articles:
- True.csv: Real news articles.
- Fake.csv: Fake news articles.
Each category is combined into a single dataset for model training and evaluation.
- Architecture: LSTM-based Bidirectional RNN
- Embedding: Word embeddings with a vocabulary size derived from the dataset
- Layers:
- Embedding Layer
- Bidirectional LSTM
- Dense Layers with ReLU and Sigmoid activations
- Accuracy: Achieved a high test accuracy on validation data.
- Confusion Matrix: Provides insights into model performance on real vs. fake news classification.
This application was developed to address the challenge of identifying fake news using natural language processing (NLP) and deep learning techniques.
This project is licensed under the MIT License.
