Skip to content

bogusdeck/TEXT--review-checker-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://reviewreward-production.up.railway.app

If you like my work, consider buying me a coffee! ☕️

Review Authenticity Checker API

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.

Features

  • 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.

Getting Started

Prerequisites

  • Python 3.11.5
  • Flask
  • Vercel CLI (for deployment)
  • AWS S3 (optional, for remote model storage)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/review-authenticity-checker.git
    cd review-authenticity-checker
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Download NLTK stopwords:

    python -m nltk.downloader stopwords

Configuration

  1. 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"
  2. AWS S3 Configuration (Optional): If you store your model files in AWS S3, configure your AWS credentials.

Usage

  1. Run the Flask app:

    flask run
  2. 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"
      }

Deployment

  1. Create .vercelignore file:

    .venv
    
  2. Generate requirements.txt:

    pip freeze > requirements.txt
  3. Deploy to Vercel:

    vercel

    Follow the prompts to complete the deployment process.

Project Structure

your-project/
├── .vercelignore
├── requirements.txt
├── app.py
├── templates/
├── static/
└── ...

Acknowledgements

  • Cohere for their language model API.
  • NLTK for natural language processing tools.

About

API to check text review if they computer generated(fake) or Original(Truthful)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published