Is Email: Email Address Format Validation Metric
Evaluates whether input text is a valid email address, checking for standard formatting including an @ symbol, domain name, and valid top-level domain.
result = evaluator.evaluate(
eval_templates="is_email",
inputs={
"text": "john.doe@example.com"
},
model_name="turing_flash"
)
print(result.eval_results[0].output)
print(result.eval_results[0].reason)import { Evaluator, Templates } from "@future-agi/ai-evaluation";
const evaluator = new Evaluator();
const result = await evaluator.evaluate(
"is_email",
{
text: "john.doe@example.com"
},
{
modelName: "turing_flash",
}
);
console.log(result); | Input | |||
|---|---|---|---|
| Required Input | Type | Description | |
text | string | The content to check for email validity. |
| Output | ||
|---|---|---|
| Field | Description | |
| Result | Returns Passed if the text is a valid email address, or Failed if it’s not. | |
| Reason | Provides a detailed explanation of the evaluation. |
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.
Questions & Discussion