Behavioral Testing Config
Default value: BehavioralTestingOptions()
Environment Variable: BEHAVIORAL_TESTING
Behavioral Testing in the Key Concepts section explains how the different configuration attributes will affect the tests results. Note that language-related defaults are dynamically selected based on the language specified in the Language Config (default is English).
If your machine does not have a lot of computing power, behavioral_testing
can be set to null
.
It can be enabled later on in the application.
from typing import List
from pydantic import BaseModel
class NeutralTokenOptions(BaseModel):
threshold: float = 1 # (5)
suffix_list: List[str] = [] # Language-based default value # (6)
prefix_list: List[str] = [] # Language-based default value # (7)
class PunctuationTestOptions(BaseModel):
threshold: float = 1 # (4)
class FuzzyMatchingTestOptions(BaseModel):
threshold: float = 1 # (3)
class TypoTestOptions(BaseModel):
threshold: float = 1 # (2)
nb_typos_per_utterance: int = 1 # (1)
class BehavioralTestingOptions(BaseModel):
neutral_token: NeutralTokenOptions = NeutralTokenOptions()
punctuation: PunctuationTestOptions = PunctuationTestOptions()
fuzzy_matching: FuzzyMatchingTestOptions = FuzzyMatchingTestOptions()
typo: TypoTestOptions = TypoTestOptions()
seed: int = 300
- Ex: if
nb_typos_per_utterance
= 2, this will create 2 tests per utterance, one with 1 typo and another with 2 typos. - Threshold that defines the confidence gap above which the test will fail.
- Threshold that defines the confidence gap above which the test will fail.
- Threshold that defines the confidence gap above which the test will fail.
- Threshold that defines the confidence gap above which the test will fail.
- Strings appended to end of utterances for neutral token tests.
- Strings prepended to beginning of utterances for neutral token tests.
For example, to change the threshold for the punctuation test: