LLM-Generated text detection in PyTorch
Project description
PyDetectGPT
LLM-Generated text detection in Pytorch.
Quick Start
from pydetectgpt import detect_ai_text
text = "text you want to check here"
result = detect_ai_text(text)
print("AI Generated" if result else "Human Written")
CLI
There is also a CLI wrapper.
pydetectgpt "Your text here"
"Detection Result: AI Generated" or "Detection Result: Human Written"
If you want just the 0/1 result (ex for scripting) use the -q flag:
pydetectgpt "Your text here" -q
0 or 1
For a full list of args see cli.py
Detection Methods
PyDetectGPT supports four detection methods, in order of effectiveness:
- FastDetectGPT (default): Implementation of Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text
- DetectLLM: Implementation of DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text
- LogRank: Average log token rank
- LogLikelihood: Basic log likelihood of the text
Acknowledgements
- Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text (Bao et al., ICLR 2024)
- DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text (Su et al., 2023)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydetectgpt-0.1.0.tar.gz.
File metadata
- Download URL: pydetectgpt-0.1.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8082a1fa44e5b7da2ef49e97905eded7084a6d608becd9a7c4e1aa2a393e51fd
|
|
| MD5 |
341ecf7f9ce0cb08f912530998abb426
|
|
| BLAKE2b-256 |
43cb673a8fbcc87c8153e7e89059528357bfa17a53db487c3632ec631c12f5af
|
File details
Details for the file pydetectgpt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydetectgpt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47f017ef400c0115289975345e7a905e8e54f059e800992f04a8779bd0bceb5e
|
|
| MD5 |
c4e58c6606535b1fd0965c53e844553b
|
|
| BLAKE2b-256 |
1a15859b54a1fcba744672507feccc1da1ae4bbe8afd2f23c591654bcdb04bd8
|