Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worse performance with language model #173

Open
jafioti opened this issue Nov 23, 2020 · 4 comments
Open

Worse performance with language model #173

jafioti opened this issue Nov 23, 2020 · 4 comments

Comments

@jafioti
Copy link

jafioti commented Nov 23, 2020

I am trying to use the KenLM language model to improve my results, but every time I try to use it, it outputs garbage output. Since the alpha is supposed to weight the LM, I tried setting it lower, but even at 0 it still outputs garbage. The only way I can get it to behave is by removing the LM path. Shouldn't the output be identical with and without the LM if alpha is set to 0?

Here is the decoder initialization:
decoder = CTCBeamDecoder(labels="".join([local_vocab.index2word[i][0] for i in range(local_vocab.num_words)]), model_path="test.arpa", alpha=0.5, beta=0.9, beam_width=100, blank_id=local_vocab.num_words - 1)

Here is the usage:
beam_results, beam_scores, timesteps, out_lens = decoder.decode(F.softmax(output, dim=-1).transpose(0, 1))

Is this expected behavior?

@2000ZRL
Copy link

2000ZRL commented Dec 15, 2020

I met the same problem. It also seems that the token must be one-character.

@Yushi-Hu
Copy link

Same problem here

@Sologa
Copy link

Sologa commented Apr 14, 2021

It seems that #31 has not been solved. My workaround is to replace my lm training file's tokens with Chinese characters.

@Jatin-WIAI
Copy link

@jafioti were you able to solve the issue?

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

No branches or pull requests

5 participants