mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-26 18:24:18 +00:00
Minor fixes.
This commit is contained in:
parent
c17527433d
commit
ad8a290047
@ -321,6 +321,17 @@ def get_alignments(best_paths: k2.Fsa, kind: str) -> List[List[int]]:
|
|||||||
Returns a list of lists of int, containing the token sequences we
|
Returns a list of lists of int, containing the token sequences we
|
||||||
decoded. For `ans[i]`, its length equals to the number of frames
|
decoded. For `ans[i]`, its length equals to the number of frames
|
||||||
after subsampling of the i-th utterance in the batch.
|
after subsampling of the i-th utterance in the batch.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
When `kind` is `labels`, one possible alignment example is (with
|
||||||
|
repeats)::
|
||||||
|
|
||||||
|
c c c blk a a blk blk t t t blk blk
|
||||||
|
|
||||||
|
If `kind` is `aux_labels`, the above example changes to::
|
||||||
|
|
||||||
|
c blk blk blk a blk blk blk t blk blk blk blk
|
||||||
|
|
||||||
"""
|
"""
|
||||||
assert kind in ("labels", "aux_labels")
|
assert kind in ("labels", "aux_labels")
|
||||||
# arc.shape() has axes [fsa][state][arc], we remove "state"-axis here
|
# arc.shape() has axes [fsa][state][arc], we remove "state"-axis here
|
||||||
|
@ -82,7 +82,6 @@ def test():
|
|||||||
print(aux_labels_alignment)
|
print(aux_labels_alignment)
|
||||||
print(labels_alignment_length)
|
print(labels_alignment_length)
|
||||||
print(aux_labels_alignment_length)
|
print(aux_labels_alignment_length)
|
||||||
# print(cuts)
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user