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

Adding DeepSpeech w/ TFLite #9

Merged
merged 1 commit into from
Mar 18, 2019
Merged

Conversation

lissyx
Copy link

@lissyx lissyx commented Mar 5, 2019

This is now is a shape good enough to justify discussions.

if (mMozillaSpeechService.ensureModelInstalled()) {
mMozillaSpeechService.start(getApplicationContext());
} else {
maybeDownloadOrExtractModel(getExternalFilesDir("models").getAbsolutePath(), mMozillaSpeechService.getLanguageDir());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is required on the app side because after checking with a few potential users they indeed want to be more in charge of securing / handling the selection and distribution of models.

return LocalSpeechRecognition.ensureModelInstalled(this.getModelPath() + "/" + this.getLanguageDir());
}

public String getModelDownloadURL() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended to provide access to "default" models. Packaging and hosting is open for debate.

@larsbergstrom
Copy link

cc @philip-lamb, @MortimerGoro: this is the work that will allow us to do on-device speech.

public static String kTrie = "trie";

private static Map<String,String> mLanguages = new HashMap<String, String>();
static {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be extended, for now producing DeepSpeech model using the same naming convention for languages as Common Voice, but for example, locale names in MR Browser is not the same. Here is a mapping helping.

mLanguages.put("fr-FR", "fra");
}

private static String kBaseModelURL = "https://github.com/lissyx/DeepSpeech/releases/download/android-test/";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously needs to be hosted at some proper place, this is here for debating.

@kdavis-mozilla
Copy link

@andrenatal @philip-lamb @MortimerGoro Just wondering who should take a look at this?

@andrenatal
Copy link
Contributor

Hey, I didn't even know this was here. I'll take a look tomorrow.

@andrenatal
Copy link
Contributor

Sorry guys, I'm late here but I promise this won't get past this weekend.

@andrenatal
Copy link
Contributor

andrenatal commented Mar 16, 2019

LGTM.

I won't be able to test it before Monday, but if @lissyx confirms it's working, I'm fine merging it.

@lissyx
Copy link
Author

lissyx commented Mar 16, 2019

LGTM.

I won't be able to test it before Monday, but if @lissyx confirms it's working, I'm fine merging it.

Well, I would not have opened the PR if it was not working locally :)

@andrenatal andrenatal merged commit 77665e3 into mozilla:master Mar 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants