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 Parameters

Input TypeParameterTypeDescription
Required InputstextstringThe content column to check.

Output

OutputTypeDescription
ScoreboolReturns 1 if the text is a valid email address, 0 otherwise.
from fi.testcases import TestCase
from fi.evals.templates import IsEmail

test_case = TestCase(
    text="john.doe@example"
)

template = IsEmail()
response = evaluator.evaluate(eval_templates=[template], inputs=[test_case])

print(f"Score: {response.eval_results[0].metrics[0].value}")


What to Do When “Is Email” Eval Fails

Review the input text to identify formatting issues. Common problems may include:

  • Missing the ”@” symbol.
  • Incorrect domain names.
  • Invalid characters.

Consider revising the input to ensure it meets the standard email format.


Differentiating “Is Email” with Contain Eval

The “Is Email” evaluation uses a regex pattern specifically designed for email validation, ensuring accurate identification of valid email addresses while minimising false positives. This approach prevents incorrect acceptance of improperly formatted emails. In contrast, Contains Evaluations may lead to inaccuracies by detecting partial matches, such as flagging “user@domain” as containing an email, even though it lacks the full structure of a valid email address. Unlike regex-based validation, these evaluations do not verify completeness, making them less reliable for strict email validation.