CodeTextCompositionSampleEvaluator
About 156 wordsLess than 1 minute
2025-10-09
📘 Overview
CodeTextCompositionSampleEvaluator evaluates code samples based on character composition to provide scores for filtering binary files, encrypted content, and other non-readable text. It analyzes the ratio of alphabetic and alphanumeric characters to ensure readable content.
init
def __init__(self)| Parameter | Type | Default | Description |
|---|---|---|---|
| No parameters |
Prompt Template Descriptions
| Prompt Template Name | Primary Use | Applicable Scenarios | Feature Description |
|---|---|---|---|
run
def run(self, storage: DataFlowStorage, input_key: str)| Name | Type | Default | Description |
|---|---|---|---|
| storage | DataFlowStorage | Required | Data flow storage instance, responsible for reading and writing data. |
| input_key | str | Required | Input column name, corresponding to the data to be evaluated. |
🧠 Example Usage
🧾 Default Output Format
| Field | Type | Description |
|---|---|---|
| CodeTextCompositionAlphaRatio | float | The ratio of alphabetic characters in the text. |
| CodeTextCompositionAlnumRatio | float | The ratio of alphanumeric characters in the text. |
| CodeTextCompositionScore | float | The comprehensive composition score (0.0 or 1.0), where 1.0 indicates the sample passes the composition check. |

