मैंने अभी पाठ में शब्दों की भाषा का पता लगाने के लिए पाइथन में गोस्लेट लाइब्रेरी का उपयोग करना शुरू कर दिया है, लेकिन 7-8 इनपुट के लिए इसका परीक्षण करने के बाद, मैंने इनपुट जिसमें दो भाषाओं अरबी और अंग्रेजी में लिखे गए शब्द थे। इसके बाद, उसने मुझे त्रुटि देनी शुरू कर दी।HTTP त्रुटि: HTTP त्रुटि 503: सेवा अनुपलब्ध गोस्लेट भाषा का पता लगाने का अनुरोध: पायथन
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
execfile("C:/test_goslate.py");
File "C:/test_goslate.py", line 12, in <module>
language_id = gs.detect('الدولة')
File "C:\Python27\lib\site-packages\goslate.py", line 484, in detect
return self._detect_language(text)
File "C:\Python27\lib\site-packages\goslate.py", line 448, in _detect_language
return self._basic_translate(text[:50].encode('utf-8'), 'en', 'auto')[1]
File "C:\Python27\lib\site-packages\goslate.py", line 251, in _basic_translate
response_content = self._open_url(url)
File "C:\Python27\lib\site-packages\goslate.py", line 181, in _open_url
response = self._opener.open(request, timeout=self._TIMEOUT)
File "C:\Python27\lib\urllib2.py", line 410, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 503: Service Unavailable
मैं के रूप में कोड लिखा है:
# -*- coding: utf8 -*-
import urllib2
import goslate
gs = goslate.Goslate()
language_id = gs.detect('wait الدولة')
print (gs.get_languages()[language_id])
और अब यह किसी भी इनपुट जो मैं पहले परीक्षण किया है और मुझे एक ही त्रुटि दे रहा है के लिए बिल्कुल भी काम नहीं कर रहा। मैंने Google पर त्रुटि हल करने का प्रयास किया लेकिन कुछ भी मदद नहीं की। यह मैं क्या पाया है: Link 1 - StackOverflow
मैं कमांड के रूप में भी ऊपर के लिंक में सुझाव के साथ अद्यतन करने की कोशिश की:
pip install -U goslate
लेकिन यह मदद नहीं की, क्योंकि यह पहले से ही नवीनतम अद्यतन संस्करण है कि मैं कर रहा हूँ है का उपयोग करते हुए। इसके अलावा, मैं पुस्तकालय प्रलेखन कि एक अनुवाद के लिए त्रुटि के इस प्रकार हो जाता है में पढ़ा जब:
If you get HTTP 5xx error, it is probably because google has banned your client IP address from transation querying.
You could verify it by access google translation service in browser manually.
You could try the following to overcome this issue:
query through a HTTP/SOCK5 proxy, see Proxy Support
using another google domain for translation: gs = Goslate(service_urls=['http://translate.google.de'])
wait for 3 seconds before issue another querying
मैं प्रॉक्सी कनेक्शन का उपयोग करने की कोशिश की लेकिन कुछ भी मदद की।
संपादित करें क्या कारण यह है कि Google प्रति दिन केवल कुछ अनुरोधों की अनुमति देता है? उस मामले में बेहतर क्या किया जा सकता है? क्या कोई अन्य पायथन आधारित लाइब्रेरी है जो इसे हल करने में मेरी मदद कर सकती है?
कृपया कोई मेरी मदद करें। मैं इसके लिए नया हूँ।
यह एक उत्कृष्ट पसंद है। – AritzBi
नहीं, यह Google अनुवाद API पर भी बनाया गया है। आपको एक ही त्रुटि का सामना करना पड़ेगा। Textblob.py से, लाइन 34: url = "http://translate.google.com/translate_a/t" – Taylor
कोई समाचार? क्या एक व्यावहारिक विकल्प है जो काम करता है? –