How do you use a prior file from within python?
Is it possible to use the prior customization file from within a python application? If not, is there an easy workaround? Thank you, Mike
the same as your question, when I use prior argument within a python application, the following issues:recognize() got an unexpected keyword argument 'prior'
I ran into a similar issue trying to get it to run on my GPU. It's not really all that hard, just a PITA. Basically, read_recognize() takes either the model name as a string, or an argparse Namespace. So, in order to really use it in python, you need to rebuild the argparse Namespace that's created in run.py. Here's a sample of code that rebuilds the default:
import argparse
import allosaurus.model
args = argparse.Namespace()
args.device_id = -1
args.model = allosaurus.model.resolve_model_name('latest')
args.lang = 'ipa'
args.topk = 1
args.timestamp = False
args.prior = None
args.emit = 1.0
args.approximate = False