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

Change translation from Goslate to Google Translate API #19

Merged
merged 1 commit into from Apr 15, 2016

Conversation

RNabel
Copy link
Contributor

@RNabel RNabel commented Mar 26, 2016

Reason:

  • Goslate is abandoned, new translation mechanism needed

New features:

  • translation using Google Translate API
  • added parameter to specify Google Translate API key, (-K API_KEY or --api-key API_KEY)
  • Reformatted autosub file to comply with PEP8
  • EDIT: Source / destination language codes updated according to Google's docs and simplified the parameter from --list-(src|dst)-languages to --list-languages

Fixes:

@RNabel RNabel changed the title Changed translation from Goslate to Google Translate API Chang translation from Goslate to Google Translate API Mar 26, 2016
@RNabel RNabel changed the title Chang translation from Goslate to Google Translate API Change translation from Goslate to Google Translate API Mar 26, 2016
@agermanidis
Copy link
Owner

Hey, thanks a lot for this! Can you add the new library dependency to setup.py? After that I can merge this in.

@RNabel RNabel force-pushed the master branch 4 times, most recently from b7ee4b1 to a29eb23 Compare April 12, 2016 12:37
 - added parameter to specify Google Translate API key,
 - Reformatted file to comply with PEP8
@RNabel
Copy link
Contributor Author

RNabel commented Apr 12, 2016

Hey, no problem!

I added the dependencies, and also updated the language codes according to Google's Translate Documentation as the other codes broke the translation (i.e. en-US-style did not work and was replaced with en-type codes).
Subsequently, the --list-(src|dst)-languages flags return the same codes, and I propose to simplify it to --list-languages.

Thoughts?

@agermanidis
Copy link
Owner

That looks good, but I wonder if we're losing transcription accuracy by not using the dialect-specific codes for the recognition (e.g. en-US). The Speech API is not very documented so it's hard to tell. What if you kept the source and destination codes and just passed self.src.split('-')[0] to the translator as src?

@agermanidis
Copy link
Owner

Did a few tests and it didn't seem like the dialect made any significant difference for the recognition accuracy, so I'll go ahead and merge this in, thanks again.

@agermanidis agermanidis merged commit a955f36 into agermanidis:master Apr 15, 2016
@RNabel
Copy link
Contributor Author

RNabel commented Apr 16, 2016

Awesome! The README may also need updating. I'll have a look at that tomorrow.

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

Successfully merging this pull request may close these issues.

None yet

2 participants