I have a dataframe with 205232 rows, i want to translate the column 'ingredients_text' which can contain 1 or more languages in a single row to english. This is an example of the df
I I tried the translation with two ways but it didn't work: code 1:
import googletrans
from googletrans import Translator
translator = Translator()
df['transalted']= df['ingredients_text'].apply(translator.translate ,dest='en').apply(getattr, args=('text',))
#then i want to save the result into a csv file
code 2:
import googletrans
from googletrans import Translator
translator = Translator()
for column in df['ingredients_text']:
translation=translator.translate(column, dest='fr').text
#then i want to save the result into a csv file
I greatly appreciate your help.