google-translate

google translate API bottleneck

google translate API bottleneck Question: I’m currently working on an ETL pipeline and it takes too long to run after checking which part of the code takes the longest I found this: I’m using the Google Cloud Translate API to translate keywords that don’t have translations in my db, but I’m running into a bottleneck …

Total answers: 1

Error using googletrans api in python translate() missing 1 required positional argument: 'self'

Error using googletrans api in python translate() missing 1 required positional argument: 'self' Question: I want to translate some text using googletrans. This is my code: inputtext = "Ich mag Schokolade" srclang = "de" dstlang = "en" translation = Translator.translate(text=inputtext, src=srclang, dest=dstlang) But when I run it, this Error comes up: translate() missing 1 required …

Total answers: 1

AttributeError: 'str' object has no attribute 'request' – googletrans

AttributeError: 'str' object has no attribute 'request' – googletrans Question: I am trying to use this google translate python library googletrans 3.0.0, which I installed from pypi. I used this code to start with: from googletrans import Translator proxies = {‘http’: ‘http://myproxy.com:8080’, ‘https’: ‘http://myproxy.com:8080’} translator = Translator(proxies=proxies) translator.translate("colour") When I call the translator in the …

Total answers: 2

Google Translate web gives two different translations (chrome browser vs Selenium/chromedriver)

Google Translate web gives two different translations (chrome browser vs Selenium/chromedriver) Question: I’m having a similar issue to this question, but with German. When I use a Chrome browser on my pc I get one translation (from https://translate.google.com), but with Selenium (in headless mode) I get a different translation. As an example, the following text …

Total answers: 2

AttributeError: 'NoneType' object has no attribute 'group' in googletrans

AttributeError: 'NoneType' object has no attribute 'group' in googletrans Question: I want to convert unknown language strings to English. For which I’m using googletrans python package that works along with an API to perform the desired task So, I did following from googletrans import Translator translator = Translator() translator.translate(‘안녕하세요.’, dest=’ja’) This gave ————————————————————————— AttributeError Traceback …

Total answers: 2

I can't understand why googletrans in python isn't working, it gives error: AttributeError: 'NoneType' object has no attribute 'group'

I can't understand why googletrans in python isn't working, it gives error: AttributeError: 'NoneType' object has no attribute 'group' Question: I was just trying to understand how to use googletrans in python and I wrote out the following code: from googletrans import Translator translator = Translator() result = translator.translate(‘Mikä on nimesi’, src=’fi’, dest=’fr’) print(result.src) print(result.dest) …

Total answers: 2

How to fix: AttributeError: 'NoneType' object has no attribute 'group'

How to fix: AttributeError: 'NoneType' object has no attribute 'group' Question: I am running the following code:- from googletrans import Translator, constants from pprint import print # init the Google API translator translator = Translator() # translate a spanish text to english text (by default) translation = translator.translate("Hola Mundo") print("{} ({}) –> {} ({})".format(translation.origin, translation.src, …

Total answers: 2

Googletrans not detecting language

Googletrans not detecting language Question: Good morning everyone, I am using googleTrans in my code to translate a list of sentence. It worked perfectly until today. Now when I run it, it perceive everything as English and then not making any translation. One classical code I tried to do a test: from googletrans import Translator …

Total answers: 1

Python – Googletrans for multiple txt files in loop

Python – Googletrans for multiple txt files in loop Question: I’m seeking to run googletrans to translate a series of 300 .txt files in a single folder. I’m struggling to construct a loop that will allow me to run a translation of each file and write the output in new .txt files. Googletrans has a …

Total answers: 1

How to translate other languages to English in pandas dataframe

How to translate other languages to English in pandas dataframe Question: I am having an excel file where the "value" column contains different language statements. I want to translate the entire value column into English. For testing purpose I’m using the below code, but it’s throwing some exception import pandas as pd from googletrans import …

Total answers: 2