mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-14 20:42:22 +00:00
update type hints
This commit is contained in:
parent
b769f10bf6
commit
af048b279c
@ -126,7 +126,7 @@ class Token:
|
|||||||
|
|
||||||
def set_token(
|
def set_token(
|
||||||
self,
|
self,
|
||||||
src_token,
|
src_token, # Token conneted to current token.
|
||||||
is_keyword_ilabel: bool,
|
is_keyword_ilabel: bool,
|
||||||
acoustic_score: float,
|
acoustic_score: float,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -163,9 +163,9 @@ class Token:
|
|||||||
class SingleDecodable:
|
class SingleDecodable:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
model_output,
|
model_output: np.array,
|
||||||
keyword_ilabel_start,
|
keyword_ilabel_start: int,
|
||||||
graph,
|
graph: FiniteStateTransducer,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
@ -234,7 +234,10 @@ class SingleDecodable:
|
|||||||
|
|
||||||
|
|
||||||
def decode_utt(
|
def decode_utt(
|
||||||
params: AttributeDict, utt_id: str, post_file, graph: FiniteStateTransducer
|
params: AttributeDict,
|
||||||
|
utt_id: str,
|
||||||
|
post_file: str,
|
||||||
|
graph: FiniteStateTransducer,
|
||||||
) -> Tuple[str, float]:
|
) -> Tuple[str, float]:
|
||||||
"""
|
"""
|
||||||
Decode a single utterance.
|
Decode a single utterance.
|
||||||
@ -244,7 +247,7 @@ def decode_utt(
|
|||||||
The return value of :func:`get_params`.
|
The return value of :func:`get_params`.
|
||||||
utt_id: utt_id to be decoded, used to fetch posterior matrix from post_file.
|
utt_id: utt_id to be decoded, used to fetch posterior matrix from post_file.
|
||||||
post_file: file to save posterior for all test set.
|
post_file: file to save posterior for all test set.
|
||||||
graph: decoding graph.
|
graph: decoding graph in FiniteStateTransducer format.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
utt_id and its corresponding probability to be a wake word.
|
utt_id and its corresponding probability to be a wake word.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user