curl http://model.dbpedia-spotlight.org/en/annotate \ --data-urlencode "text=President Obama called Wednesday on Congress to extend a tax break for students included in last year's economic stimulus package, arguing that the policy provides more generous assistance." \ --data "confidence=0.35" \ -H "Accept: application/json"
Asked
Active
Viewed 123 times
0
-
2You can try with [Postman](https://www.getpostman.com/). First import it from curl, then export it to pyurl. – arekolek Apr 15 '17 at 13:15
-
Possible duplicate of [Convert curl example to pycurl](http://stackoverflow.com/questions/22799648/convert-curl-example-to-pycurl) – Ajay Singh Apr 15 '17 at 13:15
-
could someone write an example for it ? – Mithun Rangaswamy Apr 15 '17 at 13:18
1 Answers
0
url = 'http://model.dbpedia-spotlight.org/en/annotate'
data = {"text": query,"confidence":"0.35" ,"Subject": "Pycurl", "TextBody": "Some text"}
headers = {"Accept" : "application/json"}
res = req.get(url, params=data, headers=headers)
#print res.content
j = json.loads(res.content)

vallentin
- 23,478
- 6
- 59
- 81

Mithun Rangaswamy
- 11
- 3
-
1This requires some explanation. You could start with mentioning what `req` is. – vallentin Apr 16 '17 at 09:37
-
@Vallentin I guess its `import requests as req`, but this user doesn't even bother to mark his own answer as accepted. – Rafael T Aug 21 '18 at 12:05