I want to transalte a column of my dataframe from Japanese to English. After searching I found Google translate API. I tried various codes as below
Sample Code
from googletrans import Translator
translator = Translator()
sp["Spl"] = sp["件名"].map(lambda x: translator.translate(x, src="ja", dest="en").text)
but everytime I was getting following error AttributeError: 'NoneType' object has no attribute 'group'
I changed the column type from object to string but the error was same.
So I tried the codes on simple strings as follows:
import googletrans
text1 = '日本語が難しい'
text2 = 'What are you doing'
translator = Translator()
print(translator.detect(text1))
print(translator.detect(text2))
Still same error AttributeError: 'NoneType' object has no attribute 'group'