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.