dkmfbk / pikes

Pikes is a Knowledge Extraction Suite
GNU General Public License v3.0
23 stars 8 forks source link

code: 503 for URL: http://api.dbpedia-spotlight.org/annotate #13

Open lenyabloko opened 4 years ago

lenyabloko commented 4 years ago

Hi there, I am trying to use Pikes

sudo apt-get install openjdk-8-jdk
sudo apt-get install maven

wget https://knowledgestore.fbk.eu/files/pikes/download/pikes-all.tar.gz # Download the full package
tar xzf pikes-all.tar.gz
cd pikes
bash run.sh

After that the server is running and responding

import requests

endpoint = 'http://35.245.146.92:8011/text2naf?text='

# Make the request to a url
r = requests.get(endpoint)
c = r.content
print(c)

What is b` in from of XML?

b'<?xml version="1.0" encoding="UTF-8"?>\n<NAF xml:lang="en" version="v3">\n  <nafHeader>\n    <fileDesc creationtime="2020-02-24T08:39:46Z" />\n    <public uri="http://pikes.fbk.eu/" />\n    <linguisticProcessors layer="text">\n      <lp name="Stanford CoreNLP" beginTimestamp="2020-02-24T08:39:46.474+0000" endTimestamp="2020-02-24T08:39:46.774+0000" />\n    </linguisticProcessors>\n    <linguisticProcessors layer="naf-filter">\n      <lp name="NAF filter" beginTimestamp="2020-02-24T08:39:46.775+0000" endTimestamp="2020-02-24T08:39:46.775+0000" />\n    </linguisticProcessors>\n  </nafHeader>\n  <timeExpressions>\n    <timex3 id="tmx0" type="DATE" value="2020-02-24" />\n  </timeExpressions>\n</NAF>\n'

But in the server log I see this:

code: 503 for URL: http://api.dbpedia-spotlight.org/annotate
java.io.EOFException: No content to map to Object due to end of input
        at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2775)
        at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718)
        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)
        at eu.fbk.dkm.pikes.twm.DBpediaSpotlightAnnotate.tag(DBpediaSpotlightAnnotate.java:35)
        at eu.fbk.dkm.pikes.twm.LinkingAnnotator.annotate(LinkingAnnotator.java:54)
        at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:76)
        at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:605)
        at eu.fbk.dkm.pikes.tintop.AnnotationPipeline.parseAll(AnnotationPipeline.java:1026)
        at eu.fbk.dkm.pikes.tintop.AnnotationPipeline.parseAll(AnnotationPipeline.java:993)
        at eu.fbk.dkm.pikes.tintop.AnnotationPipeline.parseFromNAF(AnnotationPipeline.java:1039)
        at eu.fbk.dkm.pikes.tintop.server.Text2NafHandler.service(Text2NafHandler.java:29)
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
        at java.lang.Thread.run(Thread.java:748)

I tried to go to http://api.dbpedia-spotlight.org/annotate

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
BenediktHeinrichs commented 9 months ago

So this seems to be an issue from fcw. In my Docker build, I worked around this by doing the following during build:

git clone https://github.com/fbk/fcw \
  && cd fcw \
  && grep -rl "http://model.dbpedia-spotlight.org/en" . | xargs sed -i 's/http:\/\/model.dbpedia-spotlight.org\/en/https:\/\/api.dbpedia-spotlight.org\/en/g' \
  && git checkout develop \
  && mvn versions:set -DnewVersion=1.0-SNAPSHOT \
  && mvn clean install -DskipTests -Dgpg.skip

Maybe this helps if someone stumbles upon this issue.