google-translate

JSONDecodeError: Expecting value: line 1 column 1 (char 0) while translating text

社会主义新天地 提交于 2020-06-27 16:48:28
问题 I am getting the following error while translating a column from spanish to English: JSONDecodeError: Expecting value: line 1 column 1 (char 0) My data frame looks like the following: case_id es fr 1234 - - 2345 Hola como estas? Encantada de conocerte comment vas-tu aujourd'hui 3456 Hola como estas? Encantada de conocerte - 123321 - comment vas-tu aujourd'hui '-' is something that shows that there are no comments. My data frame has a blank strings as well apart from comments so I have

google translator toolkit - how to exclude portions of the text from being processed

一个人想着一个人 提交于 2020-06-23 08:28:08
问题 Does anybody know whether there is a possiblity to exclude portions of a text from being processed by the google translator toolkit? A great advantage of this tool is that it suggests the translations of sentences which have already been translated in another context. However, if any additional footnote and/or remark has been added to the text, it won't be recognized as a match. I am looking for a possibility to enclose such text in "brackets" within which it will be ignored. For example, the

Chromedriver: How to translate a page using selenium?

不想你离开。 提交于 2020-06-16 07:52:48
问题 I need to translate a page from Japanese to English, using selenium in chrome browser. I tried different ways one of sample code snippet is as following import java.util.concurrent.TimeUnit; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.DesiredCapabilities; public class Main { private WebDriver driver=null; WebDriverLoad a; @Test public void

Google Translate API authentication key and usage

一笑奈何 提交于 2020-06-14 10:00:40
问题 From https://cloud.google.com/translate/docs/basic/setup-basic, there's a need to set the environmental variable: export GOOGLE_APPLICATION_CREDENTIALS='/path/to/credential.json' Then a curl request can be made as such: curl -s -X POST -H "Content-Type: application/json" \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ --data "{ 'q': 'The Great Pyramid of Giza (also known as the Pyramid of Khufu or the Pyramid of Cheops) is the oldest and largest of the

Googletrans API error - daily limit or blocked IP?

好久不见. 提交于 2020-06-12 08:01:32
问题 I am using the googletrans package. I have translated quite a lot of text by using it throughout the day today. I had splitted my text into tokens of less than 15k characters as the documentations implies and I was re-instanting the Translator() at each case. (Actually just to mention that, if I was not missing something, I had to split my text in smaller than 15k-char tokens e.g. 2k because I think that the package was returning me an error even with something like 10k-char tokens - I do not

Android “Google Translation” popup programmatically

老子叫甜甜 提交于 2020-05-13 14:34:06
问题 Do you know that Google Translate now works inside any app on Android? I'd like to get rid of extra action in my app: copy text and press "translate button" . Instead of it I'd like to show this popup window using java code. Is it possible? 回答1: too late, may be useful for anyone regarding this question... its working for me Intent intent = new Intent(); intent .setType("text/plain"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { intent.setAction(Intent.ACTION_PROCESS_TEXT); intent

GoogleTrans suddenly stopped working and giving error

强颜欢笑 提交于 2020-04-30 10:08:25
问题 While using googletrans, I am unable to translate my text into any language. I am using python3 to do so. I have googled many things related to my question and have found many answers on Stack Overflow about it suggesting that there could be a limit issue of characters or IP blocked. But this isn't the case with me. It was working fine some time ago and now it's giving error. And if I ran same code on Google Collab it works fine. I have tried: clearing the cache; restarting my system twice;

GoogleTrans suddenly stopped working and giving error

ぐ巨炮叔叔 提交于 2020-04-30 10:05:45
问题 While using googletrans, I am unable to translate my text into any language. I am using python3 to do so. I have googled many things related to my question and have found many answers on Stack Overflow about it suggesting that there could be a limit issue of characters or IP blocked. But this isn't the case with me. It was working fine some time ago and now it's giving error. And if I ran same code on Google Collab it works fine. I have tried: clearing the cache; restarting my system twice;

GoogleTrans suddenly stopped working and giving error

回眸只為那壹抹淺笑 提交于 2020-04-30 10:05:32
问题 While using googletrans, I am unable to translate my text into any language. I am using python3 to do so. I have googled many things related to my question and have found many answers on Stack Overflow about it suggesting that there could be a limit issue of characters or IP blocked. But this isn't the case with me. It was working fine some time ago and now it's giving error. And if I ran same code on Google Collab it works fine. I have tried: clearing the cache; restarting my system twice;

Python Google Translate API error : How to translate a large amount of data

只谈情不闲聊 提交于 2020-04-13 05:48:47
问题 My problem I would like to use a kind of data-augmentation method for NLP consisting of back-translating dataset. Basically, I have a large dataset (SNLI), consisting of 1 100 000 english sentences. What I need to do is : translate these sentences in a language, and translate it back to English. I may have to do this for several language. So I have a lot of translations to do. I need a free solution. What I did so far I tried several python module for translation, but due to recent changes in