diff --git a/README.md b/README.md index cc7fe3a..19db7b1 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,6 @@ model.recognize('sample.wav') For full features and details, please refer to the following sections. -### Online Demo -There is also an online version available for allosaurus. -You can try this at [https://www.dictate.app/phone](https://www.dictate.app/phone) - -![Online Demo](online_demo.png) - ## Inference The command line interface is as follows: diff --git a/allosaurus/app.py b/allosaurus/app.py index 248ee92..8a1a93f 100644 --- a/allosaurus/app.py +++ b/allosaurus/app.py @@ -54,6 +54,11 @@ def __init__(self, pm, am, lm, config): self.lm = lm self.config = config + def is_available(self, lang_id): + # check whether this lang id is available + + return self.lm.inventory.is_available(lang_id) + def recognize(self, filename, lang_id='ipa', topk=1, emit=1.0, timestamp=False): # recognize a single file diff --git a/allosaurus/lm/inventory.py b/allosaurus/lm/inventory.py index 4c57563..862eec6 100644 --- a/allosaurus/lm/inventory.py +++ b/allosaurus/lm/inventory.py @@ -37,6 +37,10 @@ def __init__(self, model_path, inference_config=None): self.lang2phonefile[iso_id.lower()] = phone_text self.lang2phonefile[glotto_id.lower()] = phone_text + def is_available(self, lang_id): + + return lang_id in self.lang2phonefile + def get_unit(self, lang_id): """ load a unit specified by the lang_id diff --git a/setup.py b/setup.py index d5aa768..10ca0da 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='allosaurus', - version='1.0.1', + version='1.0.2', description='a multilingual phone recognizer', author='Xinjian Li', author_email='xinjianl@cs.cmu.edu',