damarsimple / DetectGPT

Pytorch implementation of DetectGPT (https://arxiv.org/pdf/2301.11305v1.pdf)

Home Page:https://gptzero.sg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DetectGPT

An open-source Pytorch implementation of DetectGPT

Introduction

DetectGPT is an amazing method to determine whether a piece of text is written by large language models (like ChatGPT, GPT3, GPT2, BLOOM etc). However, we couldn't find any open-source implementation of it. Therefore this is the implementation of the paper.

installation

pip install -r requirements.txt

Usage

Here v1.1 refers to DetectGPT, v1.0 is GPTZero

Using Python function

python3 infer.py

example

from model import GPT2PPL
model = GPT2PPL()
sentence = "your text here"
model(sentence, "number of words per chunk", "v1.1")

Using Python input

python3 local_infer.py

example

Please enter your sentence: (Press Enter twice to start processing)
Hello World.
My name is mike.
(empty line)

Acknowledgements

  1. Mitchell, Eric, et al. "DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature." arXiv preprint arXiv:2301.11305 (2023).

About

Pytorch implementation of DetectGPT (https://arxiv.org/pdf/2301.11305v1.pdf)

https://gptzero.sg

License:MIT License


Languages

Language:Python 98.9%Language:Dockerfile 1.1%