Content Cleaner

Sanitize LLM outputs by removing markers and cleaning formatting

Content Cleaner

AI-generated

Summary

Clean raw AI-generated content by removing lines containing specified marker keywords and certain formatting indicators to sanitize the output.

Inputs

  • Content (required) — The raw AI-generated content to clean, provided as a string.
  • Markers to Remove — A comma-separated list of keywords or phrases used to detect marker lines that should be stripped from the content. Defaults to 'START, END, OUTPUT HERE'.

Output shape

a list of JSON objects, each with 'result' (the cleaned content string), 'originalLength' (length of the input content), and 'cleanedLength' (length after cleaning).

Each input item results in one output JSON object. Lines containing any marker keyword (case-insensitive) combined with formatting indicators like '***' or the word 'HERE' are removed. The output string is trimmed of leading/trailing whitespace.

Examples

Example 1: Cleaning AI output containing boundary markers

Content provided with default markers 'START, END, OUTPUT HERE'. Lines with these markers and formatting patterns are removed to produce sanitized content.

Links

Discussion