I am experiencing some problems using the TextBlob library. I'm trying to run a very simple piece of code like this:
from textblob import TextBlob
text = 'this is just a test'
blob = TextBlob(text)
blob.detect_language()
And it continually gives me this error:
/usr/lib/python3.7/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
647 class HTTPDefaultErrorHandler(BaseHandler):
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
651 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found
What is the problem? I have tried it on several devices and it gives me the same error everytime.
Thanks!
CodePudding user response:
Function dectect_language()
sends a request to google translate service:
http://translate.google.com/translate_a/t?client=webapp&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=2&ssel=0&tsel=0&kc=1&sl=auto&tk=276174.132528
and this url returns 404.
From documentation on detect_language()
Deprecated since version 0.16.0: Use the official Google Translate API instead.
I wouldn't count on this function to be working in the future.