> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rapid | Validators

> Validators You can add validators to your project to help improve quality. Before a labeler submits a task, validators on the project will run and verify the response. A validator can be either blocking or non-blocking. 

# Validators

You can add validators to your project to help improve quality. Before a labeler submits a task, validators on the project will run and verify the response. A validator can be either blocking or non-blocking. Blocking validators force labelers to fix their responses to pass the validator before submitting; whereas, non-blocking validators appear as dismissible warnings which can remind labelers to double-check their work before submitting.

## **NLP Validators**

These validators can be setup for **text labels** which are available for the following use cases: **Text Generation**, **Text Transcription**, **Content Collection**

| Validator Name                     | Description                                                                                                                | Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Word Count**                     | This validator prevents responses that are too short or too long.                                                          | **Min words** *(optional)*<br /><br />**Max words** *(optional)*<br /><br />**Warning message** *(optional)*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Language & Gibberish Detection** | This validator detects the language of the response and whether or not the response is gibberish.                          | **Language**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Regex Blocklist**                | You can use this validator to build regex rules to prevent the most common errors or enforce certain response formats.     | **Regex rules**<br /><br />**Matching policy**<br />This parameter defines the logical relationship between rules:<br />- Every rule should match<br />- Some rules should match<br />- None of the rules should match”<br /><br />**Warning message**                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **String Blocklist**               | Use this validator to prevent a blocklist of strings. These strings can be words, phrases, etc.                            | **Strings to block**<br /><br />**Warning message**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Response Similarity**            | Use this validator to prevent labelers from submitting text that overlaps with other text fields within the same response. | **Threshold**<br />The threshold is the number from 0 to 1 which means the relative Levenshtein distance between two pieces of text. We recommend using 0.3 and tuning this number by running the validator in Task Preview.<br /><br />**Warning message**                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Instructions Similarity**        | This validator prevents labelers from submitting spam that overlaps with the task instructions.                            | **Threshold**<br />The threshold is the number from 0 to 1 which means the relative Levenshtein distance between two pieces of text. We recommend using 0.3 and tuning this number by running the validator in Task Preview.<br /><br />**Warning message**                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Grammar & Spellcheck**           | This validator identifies grammar and spelling errors and suggests fixes.                                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **URL Formatting**                 | This validator enforces certain text labels to have URL format.                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Text Formatting**                | Use this validator to ensure clean text responses                                                                          | **Enforce sentence case capitalization**<br /><br />**Prevent double whitespaces and trailing whitespaces**<br /><br />**Enforce punctuation at the end of the response**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Diversity**                      | This validator prevents labelers from submitting text that follow the same patterns as previous attempts                   | **Regex**<br /><br />**Min Attempts to Apply**<br />This is the minimum number of attempts for a labeler before this validator is applied to their future attempts.<br /><br />**Max Attempts to Look Back**<br />This is the maximum number of previous attempts from the labeler to analyze.<br /><br />**Threshold** *(optional)*<br />This is a number from 0 to 1 that represents the proportion of attempts that are analyzed and match the regex pattern before this validator triggers.<br /><br />**Number of Matches to Trigger** *(optional)*<br />This is the number of previous attempts that match the regex pattern for this validator to trigger.<br /><br />**Warning message** |

## **CV Validators**

These validators can be setup for **geometry labels (box, ellipse, point, etc.)** or **segmentation clusters** which are available for the following use cases: **Object Detection**, **Object & Event Detection**, **Semantic Segmentation**

|                        |                                                                                                                                                                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Size**               | This validator restricts sizes of annotations to a specified minimum or maximum.                                                                                                                             | **Width (px)**<br /><br />**Height (px)**<br /><br />**Width (%)**<br />The % is based on the corresponding image/video width<br /><br />**Height (%)**<br />The % is based on the corresponding image/video height<br /><br />**Diagonal (px)**<br />The diagonal is calculated as the hypotenuse of the bounding box surrounding the object/segmentation.<br /><br />**Min/max constraint**<br />Specifies whether or not ALL of the above constraints are to be used as minimum or maximum constraints.<br /><br />**Logical operator**<br />If multiple above constraints are utilizes, specifies whether to combine them under "AND" logic or "OR" logic. |
| **Label Usage**        | Use this validator to define a minimum required or maximum allowed number of annotations per label.                                                                                                          | **Min uses**<br /><br />**Max uses**<br /><br />**Warning message**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Contiguous Objects** | This validator checks that each annotation has contiguous frames.                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Collinear Points**   | This validator checks that polygon and line annotations contain no more than 2 collinear points, which would imply that the same polygon could be drawn with fewer points.                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Duplicate Vertex**   | This validator checks that polygon and line annotations do not contain multiple vertices with the exact same coordinate location.                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Overlap**            | This validator checks that all annotations of each provided label overlap with all other such annotations, or that each is completely disjoint.                                                              | **Overlap validation**<br />If set to "should not overlap," checks for disjointness. If set to "should overlap," checks for overlaps.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Containment**        | This validator checks that each annotation in a provided list of "inner labels" is contained by at least one annotation in a provided list of "outer labels," or contained by exactly zero such annotations. | **Inner labels**<br />The list of inner labels to check containment of.<br /><br />**Outer labels**<br />The list of outer labels to check containment with.<br /><br />**Containment validation**<br />If set to "should be contained," checks for containment. If set to "should not be contained," checks for the opposite.                                                                                                                                                                                                                                                                                                                                 |
| **Pixel Percentage**   | This validator checks that the total percentage of pixels in a given label does not fall outside a specified minimum and maximum percentage.                                                                 | **Min %**<br /><br />**Max %**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
