Length Evals
Validating the structure and length of text is essential for ensuring that generated content meets specific requirements and maintains a high standard of quality.
The following evals help ensure that text adheres to predefined length and structural requirements:
1. One Line
Definition: Evaluates whether the input text consists of a single line. It checks if the text does not contain any newline characters, indicating that it is a single continuous line of text.
Evaluation using Interface
- input:
- text: The content column to check.
- output:
- result: Passed or Failed
Evaluation using Python SDK
Click here to learn how to setup evaluation using the Python SDK.
Input Type | Parameter | Type | Description | UI Component |
---|---|---|---|---|
Required Inputs | text | string | The content column to check. | Column Select |
What to Do When One Line Evaluation Fails: If the evaluation fails, examine the input text to identify the presence of newline characters. If the text contains multiple lines, consider revising it to ensure it meets the one-line requirement. Providing clearer instructions or constraints in the input can help prevent this issue in future evaluations.
2. Length Less Than
Definition: Evaluates whether the length of the input text is below a specified maximum threshold. It checks if the character count of the text is less than the defined maximum length.
Evaluation using Interface
- input:
- text: The content column to check.
- configuration parameters:
- max_length: The maximum allowed length.
- output:
- result: Passed or Failed
Evaluation using Python SDK
Click here to learn how to setup evaluation using the Python SDK.
Input Type | Parameter | Type | Description | UI Component |
---|---|---|---|---|
Required Inputs | text | string | The content column to check length. | Column Select |
Configuration Parameters | max_length | int | The maximum allowed length (exclusive). | Number Input |
What to Do When Length Less Than Evaluation Fails: If the evaluation fails, check the length of the input text against the specified maximum. If the text exceeds the maximum length, consider revising it to fit within the limit. Providing clearer constraints in the input can help ensure compliance in future evaluations.
3. Length Greater Than
Definition: Evaluates whether the length of the input text is greater than a specified minimum threshold. It checks if the character count of the text exceeds the defined minimum length.
Evaluation using Interface
- input:
- text: The content column to check.
- configuration parameters:
- min_length: The minimum allowed length.
- output:
- result: Passed or Failed
Evaluation using Python SDK
Click here to learn how to setup evaluation using the Python SDK.
Input Type | Parameter | Type | Description | UI Component |
---|---|---|---|---|
Required Inputs | text | string | The content column to check length. | Column Select |
Configuration Parameters | min_length | int | The minimum required length (exclusive). | Number Input |
What to Do When Length Greater Than Evaluation Fails: If the evaluation fails, check the length of the input text against the specified minimum. If the text is shorter than the minimum length, consider revising it to meet the requirement. Providing clearer constraints in the input can help ensure compliance in future evaluations.
4. Length Between
Definition: Evaluates whether the length of the input text falls within a specified range defined by minimum and maximum lengths. It checks if the character count of the text is between the defined limits.
Evaluation using Interface
- input:
- text: The content column to check.
- configuration parameters:
- min_length: The minimum allowed length.
- max_length: The maximum allowed length.
- output:
- result: Passed or Failed
Evaluation using Python SDK
Click here to learn how to setup evaluation using the Python SDK.
Input Type | Parameter | Type | Description | UI Component |
---|---|---|---|---|
Required Inputs | text | string | The content column to check length. | Column Select |
Configuration Parameters | min_length | int | The minimum allowed length (inclusive). | Number Input |
max_length | int | The maximum allowed length (inclusive). | Number Input |
What to Do When Length Between Evaluation Fails: If the evaluation fails, check the length of the input text against the specified minimum and maximum lengths. If the text is outside the defined range, consider revising it to fit within the limits. Providing clearer constraints in the input can help ensure compliance in future evaluations.