Readme drafted with gpt-4o
This project is an educational initiative aimed at deploying machine learning models detecting fake news on AWS. It demonstrates the process of building, saving, and deploying a simple text classification model using Flask and Scikit-learn.
- application.py: The main Flask application that serves the model and handles prediction requests.
- basic_classifier.pkl: A pre-trained Naive Bayes classifier model.
- count_vectorizer.pkl: A pre-trained CountVectorizer for text feature extraction.
- Python 3.x
- Flask
- Scikit-learn
- AWS account for deployment
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the application locally:
python application.py
The application will be available at
http://localhost:5000
.
-
Send a POST request to
/predict
with a JSON payload containing the text to classify:{ "text": "Your text here" }
-
The application will return a JSON response with the prediction.
This project is licensed under the MIT License
- Flask for providing a simple and powerful web framework.
- Scikit-learn for the machine learning tools.
- AWS for cloud infrastructure.