everything work before but it error now when i try using googletrans library. here my code
import googletrans
from googletrans import Translator
translator = Translator()
df['data'] = df['tweet'].apply(lambda x: translator.translate(x, dest='en').text)
| 0 | tweet |
|---|---|
| 0 | Heureusement que Macron n’a pas profité de la guerre en Ukraine pour être réélu mdr |
| 1 | L’Ukraine Ce pays formidable N’est-ce pas Macron le fou |
>Solution :
your code work properly for me. make sure you have the latest googletrans version or 4.0.0-rc1.
here for check your googletrans version
pip freeze
and here for install googletrans version 4.0.0-rc1
install googletrans==4.0.0-rc1