Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

How to built ctc_topo with blankid != 0 #249

Open
Slyne opened this issue Oct 13, 2022 · 1 comment
Open

How to built ctc_topo with blankid != 0 #249

Slyne opened this issue Oct 13, 2022 · 1 comment

Comments

@Slyne
Copy link

Slyne commented Oct 13, 2022

Hi experts,
I was wondering if the build_ctc_topo interface can be used for blankid is not equal to 0?
What's the correct way to build the ctc_topo in this situation? My model has a blankid=1024.

I believe the root cause of this question is I don't understand how we map the logits/probabilities of vocabulary to the arcs in T.fst. If you can help explain, I would be really grateful.

Thank you!!

@csukuangfj
Copy link
Collaborator

Can you use k2.ctc_topo() or k2.ctc_graph() for this?

Even if the doc says that token ID 0 is the blank, you can treat 0 as a normal token and use a non-zero ID for the blank by modifying the generated CTC graph to swap their IDs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants