requests.exceptions.TooManyRedirects while using Tagme in Python -


my python code contains method follows:

import tagme  def concept_extraction (): tagme.gcube_token = "702e87ce-3750-4069-900d-92d12a17cda4-843334162" string = "sachin running in kolkata stadium." print string lunch_annotations = tagme.annotate(string) #print annotations score higher 0.1 ann in lunch_annotations.get_annotations(0.1):     print ann return; 

where given string, want determine entities present in string. getting error follows:

file "/home/krishnendu/python_workspace/qg/concept_extraction.py", line 8, in concept_extraction lunch_annotations = tagme.annotate(string) file "/usr/local/lib/python2.7/dist-packages/tagme/__init__.py", line 201, in annotate json_response = _issue_request(api, payload, gcube_token) file "/usr/local/lib/python2.7/dist-packages/tagme/__init__.py", line 271, in _issue_request res = requests.post(api, data=payload) file "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/api.py", line 88, in post return request('post', url, data=data, **kwargs) file "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) file "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 335, in request resp = self.send(prep, **send_kwargs) file "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 454, in send history = [resp resp in gen] if allow_redirects else [] file "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/sessions.py", line 87, in resolve_redirects raise toomanyredirects('exceeded %s redirects.' % self.max_redirects) requests.exceptions.toomanyredirects: exceeded 30 redirects. 

question: python version 2.7 , tagme version 0.1.3. how handle issue?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -