In the context of text processing, validating the presence or absence of specific keywords or patterns is crucial for ensuring that generated content meets the desired criteria.

Following evals help in assessing whether the text aligns with specific requirements, such as containing necessary information, adhering to expected formats, or avoiding unwanted terms:


1. Contains

Definition:

Evaluates whether the input text contains a specific keyword. This is useful for ensuring that essential terms are present in the text.

Calculation:

The evaluation checks if the specified keyword exists within the input text. The result is generated as a Pass/Fail outcome.

What to Do When Contains Evaluation Fails:

If the evaluation fails, consider revising the text to include the necessary keyword. Providing clearer instructions regarding required terms can help prevent this issue in future evaluations.


2. Contains Any

Definition:

Checks if the input text contains any of the specified keywords. This evaluation is useful for scenarios where the presence of at least one keyword is required.

Calculation:

The evaluation iterates through the list of specified keywords and checks if any of them are present in the input text. The result is generated as a Pass/Fail outcome.

What to Do When Contains Any Evaluation Fails:

If the evaluation fails, ensure that at least one of the required keywords is included in the text. Adjusting the content to meet this requirement can improve compliance in future evaluations.


3. Contains All

Definition:

Verifies that the input text contains all specified keywords. This evaluation is critical for ensuring comprehensive coverage of necessary terms.

Calculation:

The evaluation checks if every keyword in the specified list is present in the input text. The result is generated as a Pass/Fail outcome.

What to Do When Contains All Evaluation Fails:

If the evaluation fails, review the text to identify which keywords are missing. Revise the content to include all required keywords to meet the evaluation criteria.


4. Contains None

Definition:

Verifies that the input text contains none of the specified terms. This evaluation is important for filtering out unwanted or prohibited content.

Calculation:

The evaluation checks if any of the specified keywords are present in the input text. The result is generated as a Pass/Fail outcome.

What to Do When Contains None Evaluation Fails:

If the evaluation fails, identify which unwanted terms are present in the text. Revise the content to remove these terms to ensure compliance with the evaluation criteria.


5. Starts With

Definition:

Checks if the input text begins with a specific substring. This evaluation is useful for ensuring that text adheres to expected formats or structures.

Calculation:

The evaluation checks if the input text starts with the specified substring. The result is generated as a Pass/Fail outcome.

What to Do When Starts With Evaluation Fails:

If the evaluation fails, consider revising the text to ensure it begins with the required substring. Providing clearer formatting guidelines can help prevent this issue in future evaluations.


6. Ends With

Definition:

Checks if the input text ends with a specific substring. This evaluation is important for validating the conclusion of the text.

Calculation:

The evaluation checks if the input text ends with the specified substring. The result is generated as a Pass/Fail outcome.

What to Do When Ends With Evaluation Fails:

If the evaluation fails, revise the text to ensure it concludes with the required substring. Clear guidelines on expected endings can help improve compliance in future evaluations.


7. Equals

Definition:

Compares if the input text is exactly equal to a specified expected text. This evaluation is crucial for scenarios where precise matching is required.

Calculation:

The evaluation checks for exact equality between the input text and the expected text. The result is generated as a Pass/Fail outcome.

What to Do When Equals Evaluation Fails:

If the evaluation fails, review the text for discrepancies. Adjusting the content to match the expected text precisely can help meet the evaluation criteria.