Skip to main content

ai-text-cleaner

Regelbasierter + LLM-gestützter Cleaner für KI-typische Schreibmuster in deutschen Texten.

Erkennt und glättet z. B. Em-Dash-Overuse, Floskeln („In der heutigen Zeit", „Darüber hinaus", „Es ist wichtig zu beachten"), generische Intros, Buzzword-Verben, generische Headlines und gleichförmige Satzlängen.

Architektur

Zwei Stufen, optional kombinierbar:

  • Tier 1 — Rules (stdlib + YAML, offline, gratis, deterministisch)
  • Tier 2 — LLM-Polish (Anthropic Claude, Default claude-haiku-4-5-20251001, optional)

Geplant für v0.3.0: Tier 3 — Adversarial-Eval-Loop mit eigenem Klassifikator.

Installation

pip install ai-text-cleaner                 # nur Rules
pip install ai-text-cleaner[llm]            # mit LLM-Polish
pip install ai-text-cleaner[llm,clipboard]  # voll

CLI

ai-text-cleaner artikel.md                          # Default: Hybrid (Rules + LLM, falls Key vorhanden)
ai-text-cleaner artikel.md --rules-only             # nur Tier 1, offline
ai-text-cleaner artikel.md --llm-only               # nur Tier 2
ai-text-cleaner artikel.md -o out.md
ai-text-cleaner artikel.md --report                 # Analyse ohne Rewrite
ai-text-cleaner draft.json --format bm-json         # Blog-Machine-DraftVersion-JSON
cat artikel.md | ai-text-cleaner -                  # stdin → stdout
ai-text-cleaner --clipboard                         # liest + schreibt Clipboard
ai-text-cleaner artikel.md --rules em_dashes,floskeln

ENV: ANTHROPIC_API_KEY für die LLM-Stufe. Fehlt der Key → automatischer Rückfall auf --rules-only mit Warnung.

Python-API

from ai_text_cleaner import clean_text, analyze_text, Mode

result = clean_text(
    "In der heutigen Zeit revolutioniert KI die Branche — und das schnell — und tiefgreifend.",
    mode=Mode.HYBRID,
)
print(result.text)
print(result.report.markdown())

Was wird erkannt?

  • Em-Dashes: > 1 Em-Dash pro Absatz → Komma/Punkt
  • Floskeln: „In der heutigen Zeit", „Darüber hinaus", „Es ist wichtig zu beachten", „Zusammenfassend lässt sich sagen" u. a.
  • Buzzword-Verben: „revolutionieren"„verändert", „optimieren"„verbessert" (kontextabhängig)
  • Headlines: „Die ultimative/komplette/perfekte ..." → neutralisiert
  • Whitespace: NBSP, doppelte Leerzeichen, Mehrfach-Newlines
  • Satzlängen-Varianz: Hinweis im Report (kein Auto-Rewrite in v1)

Erweiterung der Patterns via eigene YAML: ai-text-cleaner artikel.md --patterns custom.yaml.

Grenzen

  • „100% KI-frei" ist technisch nicht garantierbar. Selbst menschliche Texte werden von AI-Detectors mit ~5–15% Falsch-Positiv-Rate als „KI" klassifiziert. Das Tool senkt die Wahrscheinlichkeit deutlich, kann sie aber nicht eliminieren.
  • v1 ist DE-fokussiert. EN-Patterns sind nicht im Scope.
  • LLM-Stufe ist nicht-deterministisch — Output variiert bei wiederholtem Lauf.

Tests

pip install -e ".[dev,llm,clipboard]"
pytest -v

Lizenz

MIT

Release files for ai-text-cleaner 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-text-cleaner 0.1.0
File Size Uploaded
ai_text_cleaner-0.1.0.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-text-cleaner 0.1.0
File Interpreter ABI Platform
ai_text_cleaner-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.2 kB

Release files / ai_text_cleaner-0.1.0.tar.gz

Download URL ai_text_cleaner-0.1.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e13b43770f9d08c1ac84108305d074c95a294c3e8e177cfc172b3c9782930f2
BLAKE2b-256 checksum
How to use checksums
80b95010be8bd0bca4d760f6e980d018b8fd0d4f5e3e20339d330da71adb1bb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / ai_text_cleaner-0.1.0-py3-none-any.whl

Download URL ai_text_cleaner-0.1.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7b4b4cb4b865eecf0bda1b2d20e153a7a0e45b4145b67dcbf3bbd10821cf58a
BLAKE2b-256 checksum
How to use checksums
896b7064c9fbcae20a65c6551a12a58f68078bfccc5044e437ff0faad365b745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page