Skip to content

Commit

Permalink
[update] Description of multi_class attribute (#1327)
Browse files Browse the repository at this point in the history
* Update multi_class description

* Fix typo
  • Loading branch information
rahul-tuli authored Oct 18, 2023
1 parent 697752f commit c9dbc54
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/deepsparse/transformers/pipelines/mnli_text_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class MnliTextClassificationConfig(BaseModel):
description="Index of mnli model outputs which denotes contradiction", default=2
)
multi_class: bool = Field(
description="True if class probabilities are independent, default False",
description="Whether or not multiple candidate labels can be true. "
"If `False`, the scores are normalized as the softmax of entailment"
" score. If `True`, the labels are considered independent and probabilities "
"are normalized for each candidate by doing a softmax of the entailment score "
"vs. the contradiction score. Default is `False`.",
default=False,
)

Expand All @@ -95,8 +99,12 @@ class MnliTextClassificationInput(ZeroShotTextClassificationInputBase):
default=None,
)
multi_class: Optional[bool] = Field(
description="True if class probabilities are independent, default False. "
"If provided, overrides the multi_class value in the config.",
description="Whether or not multiple candidate labels can be true. "
"If `False`, the scores are normalized as the softmax of entailment score. "
"If `True`, the labels are considered independent and probabilities are "
"normalized for each candidate by doing a softmax of the entailment score "
"vs. the contradiction score. Default is `False`. If provided, overrides "
"the multi_class value in the config.",
default=None,
)

Expand Down

0 comments on commit c9dbc54

Please sign in to comment.