classy.scripts.model.describe
Functions
get_ui_metrics
Method that chooses the metrics to display based on the task and on the tokenization.
Args
task
- one of Sequence, Sentence-pair, Token and QA
tokenize
- the tokenizer language. Must be a valid language code for sacremoses. None means no tokenization
Returns
the list of UIMetrics selected based on task and tokenization
Classes
AnswerPositionUIMetric
UIMetric to compute the distribution of the position of the answers in the context.
ClassSpecificInputLenUIMetric
The class specific variant of "InputLenUIMetric". It computes all the stats of the InputLenUIMetric but for each class separated.
__init__
InfoBoxUIMetric
InputLenUIMetric
Simple metric to compute Avg, Max and Min length on the passed sequences (e.g. QA contexts). The length can be computed both on the number of characters and on the number of tokens depending on the input dataset_sample type.
__init__
update_metric
self,
dataset_sample: Union[str, List[str], Tuple[List[str], ClassySample]],
) ‑> None
LabelsUIMetric
UIMetrics to compute the classes distribution in the dataset both counting them (histogram) and computing their frequency (pie chart).
update_metric
self,
dataset_sample: Union[SequenceSample, SentencePairSample, TokensSample],
) ‑> None
LambdaWrapperUIMetric
UIMetric wrapper that let you define a lambda function as an indirection between the dataset_sample and the update_metric. e.g. "lambda dataset_sample: tokenize(dataset_sample.sequence)" in order to pass the input already tokenized.
__init__
UIMetric
Base class for metrics that knows how to update themselves with an iterable of dataset samples and how to update the streamlit page on the base of the computed metric.