Offline language translation API [closed]
Asked Answered
C

1

24

Please note that I am aware that this question has appeared in various forms at several places, including stackoverflow, but I have yet to see a satisfying answer.

There are several pretty solid language translation APIs out there (eg., Microsoft and Google). They are HTTP RESTful APIs that work well for web or mobile applications, apps that operate in online mode.

However, I am looking for a language translation API that can translate short (or long) sentences in offline mode, when no Internet connectivity is available.

Another version of my question: Google Translate app comes with an option to download certain language models to allow it to operate in offline mode. Is there an Android Java library (official or unofficial; free or paid) that allows leveraging Google Translate's downloadable models for offline translations?

Cambyses answered 2/1, 2017 at 10:40 Comment(7)
Have you found solution for your question? About Android Java library for offline translation?Carcajou
@Carcajou No, I haven't found the solution. I am currently exploring a custom built machine translation solution using Tensorflow. It's difficult but not impossible. tensorflow.org/versions/r0.10/tutorials/seq2seqCambyses
Have you found any solution for this, please share if you have. Thanks...Mayers
@AnuragBhandari couple of years later wonder how you have managed it, any open source to share?Casefy
@MarcoMedrano It's been a while since I first posted. We didn't find a reliable solution and ended up with a cloud-based one. We originally needed an offline model for data privacy reasons.Cambyses
@AnuragBhandar thanks for answering. I found this one but it is only for mobile developers.google.com/ml-kit/language/translationCasefy
@MarcoMedrano AI kit is most conveniently used on mobile, but the licence terms allow general use excluding only embedded devices (such as smart speakers). See developers.google.com/ml-kit/language/translation/…Sprung
J
28

There are no web APIs that could operate in offline mode alone, without a client library component providing some offline functionality, since the nature of a web API is that that you are making requests to an external host.

That leaves client libraries. Both Google Translate offline and Microsoft Translator offline exist, but these are implemented as applications and not exposed as a developer accessible client library. Mature translation libraries exist in the form of Apache Joshua and Stanford Phrasal, however these are based on statistical rather than neural models.

If you're looking for the one perfect Java library for offline, neural based translation that has already been developed and ready to use you'd be out of luck. For now you'd need to roll your own, for example as you've mentioned using TensorFlow and the sample models. The trained models used by translation service providers are somewhat of a "secret sauce", so it is unlikely these would be made available to developers for free any time soon for use in offline translation, but its completely possible that quality open source or otherwise free translation models will be developed and released by the ML community or third parties.

Johannajohannah answered 27/1, 2017 at 18:55 Comment(2)
I agree, Adam. I had arrived at the same conclusion myself. But thank you for articulating it as an answer. And thanks for your reference to Joshua. I know that statistical models aren't as accurate as neural ones, but giving Joshua a try before diving into TensorFlow may be worth a shot.Cambyses
omg, that's why i love SO! i just had a task to be done and quickly found this answer.. thanks!Negris

© 2022 - 2024 — McMap. All rights reserved.