Skip to main content

Zero-Shot Machine-Generated Text Detection

Project description

lm-detect

Zero-Shot Machine-Generated Text Detection

lm-detect provides tooling for automatically detecting AI-written text.

Installation

pip install lm-detect

Usage

>>> from transformers import AutoTokenizer, AutoModel

>>> tokenizer = AutoTokenizer.from_pretrained("gpt2")
>>> model = AutoModel.from_pretrained("gpt2")

>>> from lm_detect import Perplexity
>>> ppl = Perplexity(model, tokenizer)
>>> ppl("Lorem ipsum dolor sit amet")
6.536835670471191

Authors

lm-detect is written by André Storhaug andr3.storhaug@gmail.com

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lm-detect-0.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

lm_detect-0.0.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page