English 中文(简体)
textblob 错误列表对象没有属性条
原标题:textblob error list object has no attribute strip
I m using TextBlob to translate some text , it worked fine till I tested it today ... I m using python 3 textblob Version: 0.15.3. Is there a new update or something like that ?
最佳回答
Seems like it s been deprecated, and suggest using official Google Translate API: 0.16.0 (2020-04-26) Deprecations: TextBlob.translate() and TextBlob.detect_language are deprecated. Use the official Google Translate API instead (#215). Other changes: Backwards-incompatible: Drop support for Python 3.4. Test against Python 3.7 and Python 3.8. Pin NLTK to nltk<3.5 on Python 2 (#315). you can find such warning in the new version of the library: Translate the word to another language using Google s Translate API. .. deprecated:: 0.16.0 Use the official Google Translate API instead. .. versionadded:: 0.5.0 it appears that google blocks a request and asks to solve captcha: https://github.com/sloria/TextBlob/issues/215
问题回答
I suggest that you explicitly specify the input language blob = TextBlob("hello") blob.translate(from_lang= en , to= fr ) Here is the output TextBlob("bonjour")
referred by https://github.com/sloria/TextBlob/issues/371 The issue has been fixed.
Try by including both form and to language from textblob import TextBlob s=str( hello world ) translator = TextBlob(s) res = translator.translate(form= e ,to= ar ) print(res)




相关问题
Get webpage contents with Python?

I m using Python 3.1, if that helps. Anyways, I m trying to get the contents of this webpage. I Googled for a little bit and tried different things, but they didn t work. I m guessing that this ...

What is internal representation of string in Python 3.x

In Python 3.x, a string consists of items of Unicode ordinal. (See the quotation from the language reference below.) What is the internal representation of Unicode string? Is it UTF-16? The items ...

What does Python s builtin __build_class__ do?

In Python 3.1, there is a new builtin function I don t know in the builtins module: __build_class__(...) __build_class__(func, name, *bases, metaclass=None, **kwds) -> class Internal ...

what functional tools remain in Python 3k?

I have have read several entries regarding dropping several functional functions from future python, including map and reduce. What is the official policy regarding functional extensions? is lambda ...

Building executables for Python 3 and PyQt

I built a rather simple application in Python 3.1 using PyQt4. Being done, I want the application to be distributed to computers without either of those installed. I almost exclusively care about ...

热门标签