Textblob 语言翻译

问题描述 投票:0回答:1
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'

有什么解决办法吗?

python automation textblob
1个回答
0
投票

我在语言检测方面也遇到了同样的问题。看来 TextBlob 已经没有方法了。这里有一个解决方案https://github.com/dsfsi/textaugment/issues/34

© www.soinside.com 2019 - 2024. All rights reserved.