Hi @lucas0
I tried the following (I took it from the beginning of the post)
Lucas@MacBook-Pro in Lux -$>sudo docker run -itd --restart unless-stopped -p 0.0.0.0:2222:80 dbpedia/spotlight-english spotlight.sh
a4a1b05d51aba464b5030f130b1c49b8b2502f7fe8fc6cbdaff90bb77aae5418
I got the following
jhernandez@DESKTOP-6LIFDE8:~$ sudo docker run -itd --restart unless-stopped -p 0.0.0.0:2222:80 dbpedia/spotlight-english spotlight.sh
Unable to find image 'dbpedia/spotlight-english:latest' locally
docker: Error response from daemon: pull access denied for dbpedia/spotlight-english, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
jhernandez@DESKTOP-6LIFDE8:~$
In your post, you mentioned that you could be able to start the spotlight image
a4a1b05d51aba464b5030f130b1c49b8b2502f7fe8fc6cbdaff90bb77aae5418
Then, I imagine that you have an old spotlight image in your docker. To try something different, maybe you could start with another port, for example 2224
docker run -tid \
--restart unless-stopped \
--name dbpedia-spotlight.es \
--mount source=spotlight-models,target=/opt/spotlight \
-p 2224:80 \
dbpedia/dbpedia-spotlight \
spotlight.sh es
I am exemplifying this with the Spanish language because it is a “small” language model. After that, you can try the following request
curl http://localhost:2224/rest/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: text/turtle"
Please let me know if this works for you, thanks again.
UPDATE:
I ran the following command (command and output):
jhernandez@DESKTOP-6LIFDE8:~$ docker run -tid --restart unless-stopped --name dbpedia-spotlight.es --mount source=spotlight-model,target=/opt/spotlight -p 2224:80 dbpedia/dbpedia-spotlight spotlight.sh es
Unable to find image 'dbpedia/dbpedia-spotlight:latest' locally
latest: Pulling from dbpedia/dbpedia-spotlight
e7c96db7181b: Pull complete
f910a506b6cb: Pull complete
b6abafe80f63: Pull complete
54cd1b8a02b8: Pull complete
8e0905f6c0f0: Pull complete
cc062f7b308d: Pull complete
45efe250a884: Pull complete
Digest: sha256:89cd13d0ea29b7a0869ead2553d652219552b2d6bb2e85780ed6d9fb3ed42a0b
Status: Downloaded newer image for dbpedia/dbpedia-spotlight:latest
d8696cfccf17b36a967e5349953afa44d623d07390f42a58e7bc1491dd67fd85
Just to be sure if the language model was downloaded (or is downloading) I used the docker logs
command
jhernandez@DESKTOP-6LIFDE8:~$ docker logs dbpedia-spotlight.es
Selected language: es
/opt/spotlight/es http://0.0.0.0:80/rest/
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemoryQuantizedCountStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (42 ms)
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemoryTokenTypeStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryTokenTypeStore - Creating reverse-lookup for Tokens.
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (2026 ms)
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemorySurfaceFormStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemorySurfaceFormStore - Summing total SF counts.
[main] INFO org.dbpedia.spotlight.db.memory.MemorySurfaceFormStore - Creating reverse-lookup for surface forms, adding normalized surface forms.
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (7156 ms)
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemoryResourceStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryResourceStore - Creating reverse-lookup for DBpedia resources.
[main] INFO org.dbpedia.spotlight.db.memory.MemoryResourceStore - Counting total support...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryResourceStore - Done.
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (2266 ms)
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemoryCandidateMapStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (1482 ms)
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Loading MemoryContextStore...
[main] INFO org.dbpedia.spotlight.db.memory.MemoryStore$ - Done (25469 ms)
After that I send the resquest:
jhernandez@DESKTOP-6LIFDE8:~$ curl http://localhost:2224/rest/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: text/turtle"
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .
@prefix nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .
<http://www.dbpedia-spotlight.com/#offset_23_32>
a nif:Phrase , nif:OffsetBasedString ;
nif:anchorOf "Wednesday" ;
nif:beginIndex "23"^^xsd:nonNegativeInteger ;
nif:endIndex "32"^^xsd:nonNegativeInteger ;
nif:referenceContext <http://www.dbpedia-spotlight.com/#offset_0_189> ;
itsrdf:taAnnotatorsRef <http://www.dbpedia-spotlight.com> ;
itsrdf:taClassRef <http://www.wikidata.org/entity/Q937857> , <Http://xmlns.com/foaf/0.1/Person> , <http://dbpedia.org/ontology/Agent> , <http://dbpedia.org/ontology/SoccerPlayer> , <http://www.wikidata.org/entity/Q5> , <http://dbpedia.org/ontology/Person> , <http://dbpedia.org/ontology/Athlete> , <http://www.wikidata.org/entity/Q215627> , <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Agent> , <http://schema.org/Person> , <http://www.wikidata.org/entity/Q24229398> , <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#NaturalPerson> ;
itsrdf:taConfidence "0.5502101090744884"^^xsd:double ;
itsrdf:taIdentRef <http://dbpedia.org/resource/Sheffield_Wednesday_Football_Club> .
<http://www.dbpedia-spotlight.com/#collection>
a nif:ContextCollection ;
nif:hasContext <http://www.dbpedia-spotlight.com/#offset_0_189> ;
<http://purl.org/dc/terms/conformsTo>
<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core/2.1> .
<http://www.dbpedia-spotlight.com/#offset_0_189>
a nif:OffsetBasedString , nif:Context ;
nif:beginIndex "0"^^xsd:nonNegativeInteger ;
nif:endIndex "189"^^xsd:nonNegativeInteger ;
nif:isString "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." .
<http://www.dbpedia-spotlight.com/#offset_10_15>
a nif:OffsetBasedString , nif:Phrase ;
nif:anchorOf "Obama" ;
nif:beginIndex "10"^^xsd:nonNegativeInteger ;
nif:endIndex "15"^^xsd:nonNegativeInteger ;
nif:referenceContext <http://www.dbpedia-spotlight.com/#offset_0_189> ;
itsrdf:taAnnotatorsRef <http://www.dbpedia-spotlight.com> ;
itsrdf:taClassRef <http://dbpedia.org/ontology/Person> , <http://www.wikidata.org/entity/Q5> , <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#NaturalPerson> , <Http://xmlns.com/foaf/0.1/Person> , <http://www.wikidata.org/entity/Q215627> , <http://dbpedia.org/ontology/Agent> , <http://schema.org/Person> , <http://www.wikidata.org/entity/Q24229398> , <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Agent> ;
itsrdf:taConfidence "0.9999999999977263"^^xsd:double ;
itsrdf:taIdentRef <http://dbpedia.org/resource/Barack_Obama> .
jhernandez@DESKTOP-6LIFDE8:~$
I hope this example helps …