-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPError: HTTP Error 400: Bad Request on translate call in 0.17.1 #401
Comments
Same issue while using .apply() |
I'm having the same problem and as I did some testing is because of the punctuation. You have to split all sentences when you find any period (.) |
I have the same problem from English to Vietnamese. It is becasue of exclamation marks ( ! ) from textblob import TextBlob
text = 'Bữa kia không biết cô Em Nhim nói gì! Nay mới hiểu!'
blob = TextBlob( text )
translated_text = blob.translate( from_lang='vi', to='en' ) |
I don't think so. I delete all "!", but the problem remains. |
This is the site: https://behai-translate.herokuapp.com/ I removed the two ! and it works. |
It seems because I have been rate-limited for calling it too much in succession. |
I am pretty new at this. This the Git for this web page: https://github.com/behai-nguyen/translation During writing this, I encountered two type of exceptions:
The Vietnamese sentence I quoted results in 400. I found at least a single English sentence which won't translate into Vietnamese. |
Similar issue here when trying to doing detect_language(), http error 400 bad request, without special characters. |
Similar issue here when trying to doing detect_language(), http error 400 bad request, without special characters. Same problem, any fix? |
Yea use specific version of googletrans==4.0.0rc1 instead |
Did someone solve this issue? I can't even do blob.detect_language(). |
I have had no success with this in TextBlob and it's been an issue for going on a year now. I have since moved my language recognition and translation code to deep translator. And there are lots of other libraries out there. |
Alright, got it, thank you Mr. Deitel! |
Thank you Mr. Deitel. I enjoy your book too, and I have learned a lot from it. |
It's not a good sign when the person who's course you are looking at has raised the call 2 years prior. (@pdeitel).
I've printed out the URL generated in the site-packages\textblob\translate.py (def detect(self, source, host=None, type_=None): line64). When you curl the URL you get:
|
So it looks like the general 'free' translate API which Google gives is not stable and is moved around a fair bit (ssut/py-googletrans#268) and that the only stable API for translation would involve you getting an account on google cloud, setting up a project and generating an API key (the URL would then be specific to your google cloud account). I'm not sure how helpful this is, but it looks like this code would need to be refactored to take this into account. |
Translation still failing in 0.17.1:
yields
The text was updated successfully, but these errors were encountered: