An open API service indexing awesome lists of open source software.

https://github.com/gabsedits/ai-detector

Check if an text is AI generated
https://github.com/gabsedits/ai-detector

Last synced: 11 months ago
JSON representation

Check if an text is AI generated

Awesome Lists containing this project

README

          


AI Detector


An API (with a webapp) that detects if a text is AI-generated


## Algorithm

The algorithm is based on a comprehensive analysis of the text, including
character count, word count, sentence count, unique word count, and average
sentence length. It calculates word frequency, identifies the most used word,
and evaluates sentence lengths to determine mean and variance. The type-token
ratio is computed to assess lexical diversity. Additionally, the algorithm
generates bigrams and trigrams to analyze word pairings and triplets. Heuristic
patterns are checked to identify common AI-generated text phrases. The AI
probability is adjusted based on sentence complexity and repetition checks,
resulting in a final AI probability score.

## API

The API is available at
[ai-detector-api.deno.dev](https://ai-detector-api.deno.dev).

### Installation

(After cloning the repository, and installing Deno, and being in the root
directory of the project)

### Running the API

```bash
deno run -N api/mod.ts
```

### Endpoints

> ![NOTE] Replace `:text` with the text you want to analyze.

- `GET

### Example

```bash
curl https://ai-detector-api.deno.dev/This%20is%20an%20example%20text%20to%20analyze%20using%20the%20API
```

## Webapp

The webapp is available at [ai-detector.gxbs.dev](https://ai-detector.gxbs.dev),
and is built using [Fresh](https://fresh.deno.dev).

### Installation

(After cloning the repository, and installing Deno, and being in the root
directory of the project)

```
deno i
```

### Running the Webapp

Development Server (with auto-reload):

```bash
deno run start
```

Build:

```bash
deno run build
```

## License

This project is open source and available under the [MIT License](LICENSE.txt).