-
Notifications
You must be signed in to change notification settings - Fork 4k
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
how to convert LM's binary model to arpa file #3777
Comments
Well it may involves several steps, and the exact process may vary depending on the specific LM format and tools you have available. Identify the Binary LM Format. Different tools and frameworks may use different binary formats, and the conversion process may vary accordingly. Install Required Software. Common tools for language modeling include SRILM and KenLM. If your binary LM is in the SRILM format, you can use SRILM's utilities to convert it to ARPA. Here's an example command:
Replace binary_lm_file with the path to your binary LM file and N with the LM order test_corpus.txt should be replaced with the path to a text corpus that will be used to generate the ARPA file. The -ppl flag is used to specify that you want to compute perplexity, which will also create the ARPA file. Note that - If your binary LM is in the KenLM format, you can use KenLM's bin2arpa tool to convert it to ARPA:
Depending on your specific use case, you may need to perform additional preprocessing on the ARPA file, such as removing certain entries or adjusting probabilities. Keep in mind that the exact steps and tools may vary depending on the binary LM format and the toolkit used. Make sure to refer to the documentation of the specific toolkit you are working with for detailed instructions. Hope it helps! |
KenLM doesn't seem to have a bin2arpa tool
…---- Replied Message ----
| From | Aadarsh ***@***.***> |
| Date | 09/28/2023 02:49 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [mozilla/DeepSpeech] how to convert LM's binary model to arpa file (Issue #3777) |
Well it may involves several steps, and the exact process may vary depending on the specific LM format and tools you have available.
Although I can try give u a general guideline for converting a binary LM to an ARPA file:
Identify the Binary LM Format. Different tools and frameworks may use different binary formats, and the conversion process may vary accordingly. Install Required Software. Common tools for language modeling include SRILM and KenLM.
If your binary LM is in the SRILM format, you can use SRILM's utilities to convert it to ARPA. Here's an example command:
ngram -lm binary_lm_file -order N -ppl test_corpus.txt
Replace binary_lm_file with the path to your binary LM file and N with the LM order test_corpus.txt should be replaced with the path to a text corpus that will be used to generate the ARPA file. The -ppl flag is used to specify that you want to compute perplexity, which will also create the ARPA file.
Note that - If your binary LM is in the KenLM format, you can use KenLM's bin2arpa tool to convert it to ARPA:
bin2arpa binary_lm_file > arpa_lm_file.arpa
Replace binary_lm_file with the path to your binary LM file, and arpa_lm_file.arpa with the desired name for the resulting ARPA file.
Depending on your specific use case, you may need to perform additional preprocessing on the ARPA file, such as removing certain entries or adjusting probabilities.
Keep in mind that the exact steps and tools may vary depending on the binary LM format and the toolkit used. Make sure to refer to the documentation of the specific toolkit you are working with for detailed instructions.
Hope it helps!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
how to convert LM's binary model to arpa file
The text was updated successfully, but these errors were encountered: