我面临着dbpedia聚光灯的问题。我似乎无法连接到找到的本地docker镜像here。
我将命令docker pull dbpedia/spotlight-english
与docker run -i -p 2222:80 dbpedia/spotlight-english
一起使用,然后检查容器是否正在使用docker ps
运行。一切正常。
之后,我尝试通过运行Spotlight documentation中给出的curl查询服务器:
curl http://0.0.0.0:2222/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"
与以下URL相同:
我得到的只是
curl: (52) Empty reply from server
。我什么不来?所有帮助表示赞赏。
最佳答案
正确的是
curl -X POST \
http://localhost:2222/rest/annotate \
-H 'accept: application/json' \
-H 'content-type: application/x-www-form-urlencoded' \
--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-urlencode "confidence=0.35"
关于docker - 如何使用dbpedia Spotlight docker 镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50735033/