Skip to main content

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

Project description

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

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

ai_text_cleaner-0.1.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_text_cleaner-0.1.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_text_cleaner-0.1.0.tar.gz.

File metadata

  • Download URL: ai_text_cleaner-0.1.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for ai_text_cleaner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e13b43770f9d08c1ac84108305d074c95a294c3e8e177cfc172b3c9782930f2
MD5 3ea8506b56f3065cc6e6311387c432df
BLAKE2b-256 80b95010be8bd0bca4d760f6e980d018b8fd0d4f5e3e20339d330da71adb1bb9

See more details on using hashes here.

File details

Details for the file ai_text_cleaner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_text_cleaner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b4b4cb4b865eecf0bda1b2d20e153a7a0e45b4145b67dcbf3bbd10821cf58a
MD5 b5c446edb2dd82ad664734e56991cae4
BLAKE2b-256 896b7064c9fbcae20a65c6551a12a58f68078bfccc5044e437ff0faad365b745

See more details on using hashes here.

Supported by

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