Validating the presence and validity of links in generated content is essential for ensuring that the content meets specific requirements and maintains a high standard of quality. The following evaluations help ensure that text adheres to link validation criteria:


1. Contains Valid Link

Definition:

Evaluates whether the output text contains at least one valid hyperlink. It checks if the text includes a URL that adheres to standard URL formatting and is accessible.


Calculation:

The evaluation process begins by configuring the input text to be assessed. The system scans the text for any valid URLs using regular expressions or URL validation libraries. If at least one valid link is found, the evaluation confirms that the text contains a valid link. The final result is generated as a Pass/Fail outcome. If the input text contains a valid link, it passes; otherwise, it fails.


What to Do When Contains Valid Link Evaluation Fails:

If the evaluation fails, review the output text to identify the absence of valid links. Consider revising the content to include appropriate hyperlinks that meet the required standards. Providing clearer instructions or constraints in the input can help prevent this issue in future evaluations.


2. No Valid Links

Definition:

Evaluates whether the output text does not contain any valid hyperlinks. It checks if the text is free from URLs that adhere to standard URL formatting.


Calculation:

The evaluation process begins by configuring the input text to be assessed. The system scans the text for any URLs using regular expressions or URL validation libraries. If no valid links are found, the evaluation confirms that the text does not contain any valid links. The final result is generated as a Pass/Fail outcome. If the input text is free from valid links, it passes; otherwise, it fails.


What to Do When No Valid Links Evaluation Fails:

If the evaluation fails, review the output text to identify the presence of valid links. If the text contains URLs that meet the criteria for valid links, consider revising it to ensure compliance with the requirement of having no valid links. Providing clearer constraints in the input can help ensure adherence in future evaluations.