Skip to content

FastAPI-based backend API for detecting AI-generated text

Notifications You must be signed in to change notification settings

Errec/is-replicant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-Replicant - An AI-Generated Text Detection API

Introduction

The is-Replicant project provides a FastAPI-based backend API for detecting AI-generated text. It analyzes text inputs using natural language processing techniques and returns probabilities indicating whether the text was generated by AI. The service uses PostgreSQL, follows secure API practices and Python data libraries.

Development

Build and start the services with Docker Compose:

docker-compose build
docker-compose up -d

Swagger documentation:

Production Deployment

Build a standalone API image and run it with an environment file:

cp api/.env.example api/.env  # update values for your environment
docker build -t is-replicant-api -f api/Dockerfile api
docker run --env-file api/.env -p 8000:8000 is-replicant-api

The repository includes a sample GitHub Actions workflow in .github/workflows/docker.yml that builds the container and starts it with temporary environment variables.

Testing

Install dependencies and run the test suite:

pip install -r api/requirements.txt
pytest

Database Population

Populate the database with the initial word and phrase data:

python db/populate_db.py

The script will prompt for confirmation before inserting records. Use the --force flag or the POPULATE_DB_FORCE=1 environment variable to bypass the prompt in automated environments:

python db/populate_db.py --force
# or
POPULATE_DB_FORCE=1 python db/populate_db.py

pgAdmin

  • URL: http://localhost:5050
  • Email: admin@admin.com
  • Password: admin
  • POSTGRES_DB=is_replicant
  • POSTGRES_USER=user
  • POSTGRES_PASSWORD=password

TODO

  • CI/CD
  • Docker Setup
  • Project Initial Structure
  • Setting Up FastAPI Application
  • Database Migrations
  • Swagger
  • Text Analysis Service
  • Database Models
  • Database Connection and ORM Setup
  • Running with Uvicorn
  • Text Analysis Endpoints
  • Testing the API
  • Testing with Pytest
  • Deploy API
  • Set DB to cloud
  • Prompt before populate DB

About

FastAPI-based backend API for detecting AI-generated text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published