All Products
Search
Document Center

Platform For AI:LLM-Special Characters Ratio Filter (MaxCompute)

Last Updated:Apr 01, 2026

The LLM-Special Character Ratio Filter (MaxCompute) component filters text samples by the ratio of special characters to text length. Add it to your large language model (LLM) preprocessing pipeline to remove text that contains too many or too few special characters — improving training data quality before it reaches your model.

Limitations

This component supports MaxCompute resources only.

How it works

The component scans every character in the text and calculates:

special character ratio = count of special characters / total text length

Special characters fall into five categories:

  • Punctuation (string.punctuation)

  • Digits (string.digits)

  • Whitespace (string.whitespace)

  • Emojis

  • Other special characters

A text sample is filtered out if its ratio falls below the minimum threshold or above the maximum threshold.

Configure the component

Configure the following parameters in Machine Learning Designer.

Fields setting

ParameterRequiredDescriptionDefault
Select Target ColumnYesColumns to process. Select one or more columns.
Minimum RatioNoFilters out samples whose special character ratio is below this value. Set to 0 to keep all samples regardless of how few special characters they contain.0
Maximum RatioYesFilters out samples whose special character ratio exceeds this value.
Output table lifecycleNoRetention period for temporary tables generated by the component, in days. The value must be a positive integer. After this period, the tables are recycled.28

Tuning

ParameterRequiredValid valuesDefault
Number of CPUs per instance of map taskNo50–800100
The memory size per instance of map taskNo256–12288 MB1024
The maximum size of input data for a mapNo1–Integer.MAX_VALUE MB256

What's next

For an overview of Machine Learning Designer and how to build preprocessing pipelines, see Overview of Machine Learning Designer.