from textblob import TextBlob
trans = TextBlob("text")
translated_text = trans.translate(to='en')
print("Translated text:", translated_text)
运行此代码时,我收到如下错误:
translated_text = trans.translate(from_lang="ml",to='en')
AttributeError: 'TextBlob' object has no attribute 'translate'
有什么解决办法吗?
我在语言检测方面也遇到了同样的问题。看来 TextBlob 已经没有方法了。这里有一个解决方案https://github.com/dsfsi/textaugment/issues/34