---
title: ai-text-detector-logreg
canonical_url: "https://www.modelscope.cn/models/AI-ModelScope/ai-text-detector-logreg"
md_url: "https://www.modelscope.cn/models/AI-ModelScope/ai-text-detector-logreg.md"
repository: AI-ModelScope/ai-text-detector-logreg
last_updated: 2026-08-12
license: apache-2.0
pipeline_tag: text-classification
tasks:
  - text-classification
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 5
stars: 0
tags:
  - ai-text-detection
  - binary-classification
---

# ai-text-detector-logreg

> ai-text-detector-logreg - AI-ModelScope 在 ModelScope 开源的模型。TF-IDF Logistic Regression AI-Text Detector

AI-ModelScope/ai-text-detector-logreg 是 ModelScope 魔搭社区上的text-classification模型，采用 apache-2.0 许可。

- **Repository**: AI-ModelScope/ai-text-detector-logreg
- **License**: apache-2.0
- **Tasks**: text-classification
- **Tags**: ai-text-detection, binary-classification
- **Downloads**: 5
- **Stars**: 0
- **Last updated**: 2026-08-12

Source: https://www.modelscope.cn/models/AI-ModelScope/ai-text-detector-logreg

---

# TF-IDF Logistic Regression AI-Text Detector

This is a binary classifier for distinguishing human-written and AI-generated text. It combines word-level TF-IDF features with logistic regression and applies Platt scaling to the output scores.

The model was trained on [`rasbt/human-vs-ai-50k`](https://huggingface.co/datasets/rasbt/human-vs-ai-50k). Human-written text has label 0 and AI-generated text has label 1. The recorded cross-validation accuracy was 98.17%.

`logreg-ai-detector.json` contains the training and calibration metadata. The recommended inference implementation is provided in the [`rasbt/ai-detector`](https://github.com/rasbt/ai-detector) repository.

&nbsp;
## Download and use

```bash
hf download rasbt/ai-text-detector-logreg \
  --local-dir models/ai-text-detector-logreg
```

```python
from pathlib import Path

from joblib import load


model_dir = Path("models/ai-text-detector-logreg")
classifier = load(model_dir / "logreg-ai-detector.joblib")

text = "Paste the text to classify here."
ai_column = list(classifier.classes_).index(1)
ai_probability = classifier.predict_proba([text])[0, ai_column]

print({"score": round(100 * float(ai_probability), 4)})
```

&nbsp;
## Related models

- [DistilBERT](https://huggingface.co/rasbt/ai-text-detector-distilbert)
- [DistilBERT with LoRA](https://huggingface.co/rasbt/ai-text-detector-distilbert-lora)
- [DistilBERT with MiCA](https://huggingface.co/rasbt/ai-text-detector-distilbert-mica)
- [ModernBERT](https://huggingface.co/rasbt/ai-text-detector-modernbert)
- [GPT-2 with a fixed-position readout](https://huggingface.co/rasbt/ai-text-detector-gpt2-fixed)
- [GPT-2 with a variable-position readout](https://huggingface.co/rasbt/ai-text-detector-gpt2-variable)
- [Qwen3 0.6B with a fixed-position readout](https://huggingface.co/rasbt/ai-text-detector-qwen3-0.6b-fixed)
- [Qwen3 0.6B with a variable-position readout](https://huggingface.co/rasbt/ai-text-detector-qwen3-0.6b-variable)

&nbsp;
## Limitations

Performance may change for text from generators, domains, languages, and editing workflows not represented in the training set. Short or partly AI-assisted text may also be harder to classify. The score should not be treated as definitive evidence that a person did or did not write a text.

The `.joblib` file uses Python serialization. Only load it from a repository you trust.
