Metadata-Version: 2.1
Name: lm-detect
Version: 0.0.1
Summary: Zero-Shot Machine-Generated Text Detection
Author-email: André Storhaug <andr3.storhaug@gmail.com>
Maintainer-email: André Storhaug <andr3.storhaug@gmail.com>
Project-URL: Homepage, https://github.com/andstor/lm-detect/
Project-URL: Tracker, https://github.com/andstor/lm-detect/issues
Project-URL: Funding, https://github.com/sponsors/andstor
Project-URL: Source, https://github.com/andstor/lm-detect/
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: test
License-File: LICENSE

# lm-detect

> Zero-Shot Machine-Generated Text Detection

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

## Installation

```bash
pip install lm-detect
```

## Usage

```python
>>> 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](https://github.com/andstor) <andr3.storhaug@gmail.com>

## License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.
