https://reviewreward-production.up.railway.app
If you like my work, consider buying me a coffee! ☕️
This project is a Flask-based API designed to check the authenticity of text reviews. It uses machine learning models to determine if a review is genuine or fake. The API supports both manual text review and automated checks using Cohere's language model.
- Text Review Authenticity Check: Determines if a given text review is real, fake, or computer-generated.
- Machine Learning Models: Utilizes Naive Bayes and SVM models trained on a dataset of deceptive and truthful reviews.
- Cohere Language Model Integration: Checks review authenticity using Cohere's language model for an additional layer of verification.
- Python 3.11.5
- Flask
- Vercel CLI (for deployment)
- AWS S3 (optional, for remote model storage)
-
Clone the repository:
git clone https://github.com/yourusername/review-authenticity-checker.git cd review-authenticity-checker
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Download NLTK stopwords:
python -m nltk.downloader stopwords
-
Cohere API Key: Set up your Cohere API key as an environment variable to keep it secure:
export COHERE_API_KEY="your-cohere-api-key"
-
AWS S3 Configuration (Optional): If you store your model files in AWS S3, configure your AWS credentials.
-
Run the Flask app:
flask run
-
API Endpoint:
The API has one main endpoint:
-
/api/review
(POST): Check the authenticity of a text review.Request:
{ "productName": "Product Name", "category": "Category", "brand": "Brand", "purchaseDate": "2023-08-01", "purchasePrice": "100", "productReview": "This is my review text.", "shoppingLink": "http://shoppinglink.com" }
Response:
{ "message": "Original" // or "Fake" }
-
-
Create
.vercelignore
file:.venv
-
Generate
requirements.txt
:pip freeze > requirements.txt
-
Deploy to Vercel:
vercel
Follow the prompts to complete the deployment process.
your-project/
├── .vercelignore
├── requirements.txt
├── app.py
├── templates/
├── static/
└── ...