hydra.utils.types

Typing utilities.

type hydra.utils.types.AnyLabelList = SimpleLabelList | NestedLabelList
class hydra.utils.types.DatasetInstance[source]

Bases: TypedDict

A dataset instance as used in Hydra training and evaluation.

adjacency_matrix: NotRequired[NestedIntLabelList]
anchor_hs: NotRequired[SimpleLabelList]
anchors: NotRequired[SimpleLabelList]
deprels: NotRequired[IntLabelList]
graph_adjacency_matrix: NotRequired[NestedIntLabelList]
graph_deprels: NotRequired[NestedIntLabelList]
graph_heads: NotRequired[NestedIntLabelList]
heads: NotRequired[IntLabelList]
lemma_cases: NotRequired[SimpleLabelList]
lemma_rules: NotRequired[SimpleLabelList]
lemmas: NotRequired[StrLabelList]
ne_iobs: NotRequired[IntLabelList]
nonterminals: NotRequired[Any]
segs: NotRequired[SimpleLabelList]
spines: NotRequired[SimpleLabelList]
tags: NotRequired[IntLabelList]
tokens: NotRequired[TokenList]
type hydra.utils.types.EvalResults = list[tuple[str, dict[str, Any]]]
class hydra.utils.types.HydraAnalysis[source]

Bases: TypedDict

An analysis of a single sentence as returned by parse().

conllu: NotRequired[str]
json: NotRequired[dict[str, Any] | None]
labels: NotRequired[LabelDict]
logits: NotRequired[Any]
metadata: dict[str, Any]
sentence: str
tokens: TokenList
tree: NotRequired[Any]
type hydra.utils.types.IntLabelList = list[int | None]
class hydra.utils.types.LabelDict[source]

Bases: TypedDict

Model-predicted labels before or after preprocessing.

adjacency_matrix: NotRequired[NestedIntLabelList]
anchor_hs: NotRequired[StrLabelList]
anchors: NotRequired[StrLabelList]
deprels: NotRequired[StrLabelList]
graph_adjacency_matrix: NotRequired[NestedIntLabelList]
graph_deprels: NotRequired[NestedStrLabelList]
graph_heads: NotRequired[NestedIntLabelList]
heads: NotRequired[IntLabelList]
lemma_cases: NotRequired[StrLabelList]
lemma_rules: NotRequired[StrLabelList]
lemmas: NotRequired[StrLabelList]
ne_iobs: NotRequired[StrLabelList]
nps: NotRequired[list[bool]]
segs: NotRequired[StrLabelList]
spines: NotRequired[StrLabelList]
tags: NotRequired[StrLabelList]
type hydra.utils.types.NestedIntLabelList = list[IntLabelList]
type hydra.utils.types.NestedLabelList = NestedIntLabelList | NestedStrLabelList
type hydra.utils.types.NestedStrLabelList = list[StrLabelList]
type hydra.utils.types.SimpleLabelList = IntLabelList | StrLabelList
type hydra.utils.types.StrLabelList = list[str | None]
type hydra.utils.types.TokenList = list[str]
type hydra.utils.types.TreeDict = dict[str, Any]