freme-project / freme-ner

Apache License 2.0
6 stars 1 forks source link

Missing annotations on NIF service response #171

Open kurzum opened 7 years ago

kurzum commented 7 years ago

Hi guys, so the error is simple and legit:

Terms.nt

We uploaded the terms.nt as SBR2 and it seems to have been uploaded correctly. We attached the terms.nt file, wich contains this line: <http://data.sbrcurnet/Referentiedetail/204.4.2.01> <http://www.w3.org/2004/02/skos/core#prefLabel> "ankerloze spouwmuur"@nl .

terms.nt.zip

entity linking

entities are not matched in the text, although there is a direct occurrence. Below is the snippet and the terms.nt to reproduce the bug.

curl -X POST --header 'Content-Type: text/plain' --header 'Accept: application/ld+json' -d "Voor de details waarbij een ankerloze spouwmuur aansluit op een plat dak is ter voorkoming van brandoverslag / branddoorslag een 15 mm vezelversterkte gipskartonplaat als plafond aangegeven. " 'https://api.freme-project.eu/current/e-entity/freme-ner/documents?prefix='http://data.sbrcurnet.nl/Infobladen/008/nif'&language=nl&dataset=sbr2&mode=all&nif-version=2.1'
kurzum commented 7 years ago

Ah yes, the services provides blank nodes (with no further properties) as a result of the matching. DBpedia NL is working fine

grep taIdentRef nif1-008.nt 
_:genid2 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid1 .
_:genid3 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Achtergrond> .
_:genid5 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid4 .
_:genid6 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Gezondheidszorg> .
_:genid7 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://data.sbrcurnet/Referentiedetail/201.4.1.03.PH> .
_:genid8 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Passiefhuis> .
_:genid10 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid9 .
_:genid11 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Medaille> .
_:genid12 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Medaille> .
_:genid14 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid13 .
_:genid15 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Civiele_vlag> .
_:genid17 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid16 .
_:genid19 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid18 .
_:genid21 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid20 .
_:genid23 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid22 .
_:genid25 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid24 .
_:genid27 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid26 .
_:genid29 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid28 .
_:genid31 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid30 .
_:genid32 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Civiele_vlag> .
_:genid33 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Medaille> .
_:genid35 <http://www.w3.org/2005/11/its/rdf#taIdentRef> _:genid34 .
_:genid36 <http://www.w3.org/2005/11/its/rdf#taIdentRef> <http://nl.dbpedia.org/resource/Vacu\u00FCm> .
kurzum commented 7 years ago

for the whole text corpus (10 texts) we recieve 212 of these erroneous matches

grep taIdentRef * | grep '> _:genid' | wc -l
212
jnehring commented 7 years ago

The curl you provided does not work. I changed the server. And I changed the output format for better readibility:

curl -X POST --header 'Content-Type: text/plain' --header 'Accept: text/turtle' -d "Voor de details waarbij een ankerloze spouwmuur aansluit op een plat dak is ter voorkoming van brandoverslag / branddoorslag een 15 mm vezelversterkte gipskartonplaat als plafond aangegeven. " 'http://rv1460.1blu.de/current/e-entity/freme-ner/documents?prefix='http://data.sbrcurnet.nl/Infobladen/008/nif'&language=nl&dataset=sbr2&mode=all&nif-version=2.1'

The output:

@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://data.sbrcurnet.nl/Infobladen/008/nif/#collection>
        a               nif:ContextCollection ;
        nif:hasContext  <http://data.sbrcurnet.nl/Infobladen/008/nif/#offset_0_191> ;
        <http://purl.org/dc/terms/conformsTo>
                <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core/2.1> .

<http://data.sbrcurnet.nl/Infobladen/008/nif/#offset_0_191>
        a               nif:Context , nif:OffsetBasedString ;
        nif:beginIndex  "0"^^xsd:nonNegativeInteger ;
        nif:endIndex    "191"^^xsd:nonNegativeInteger ;
        nif:isString    "Voor de details waarbij een ankerloze spouwmuur aansluit op een plat dak is ter voorkoming van brandoverslag / branddoorslag een 15 mm vezelversterkte gipskartonplaat als plafond aangegeven. "^^xsd:string .

<http://data.sbrcurnet.nl/Infobladen/008/nif#offset_0_191>
        a               nif:Context , nif:OffsetBasedString ;
        nif:beginIndex  "0"^^xsd:nonNegativeInteger ;
        nif:endIndex    "191"^^xsd:nonNegativeInteger ;
        nif:isString    "Voor de details waarbij een ankerloze spouwmuur aansluit op een plat dak is ter voorkoming van brandoverslag / branddoorslag een 15 mm vezelversterkte gipskartonplaat als plafond aangegeven. "^^xsd:string .

There are no entity annotations. I think it is the same bug as https://github.com/freme-project/freme-ner/issues/170

The language model does not spot the entities and therefore they are not send to linking.

Besides this the NIF isString property is produced twice. Therefore I reopened https://github.com/freme-project/freme-ner/issues/161