Output in triplet form


(Navratan) #1

Hi Team,

I am training my unstructured text file in this form with annotations:

START:brand Monster High are nothing to do with high.
START:brand Exerpeutic is a brand.
START:brand U-knit
START:brand Pepsi
START:brand Platinum Pets are not talking about pets.
Spiderman is like a START:brand Batman .
START:brand ProGear sports outfit is cool stuff.
START:brand Spiderman
START:brand Exerpeutic
START:brand Dickies is also a brand.
START:brand BuySeasons
START:brand Microsoft
START:brand Microsoft is own by Bill Gates.
START:brand Transformers is a movie.

Now I, getting the output in the following format in stardog

I want to see the output in triplet format, like:

ProGear is brand
(we have annotated it as a brand in training file) and testing it on the same file without annotations.

Please suggest how it can be done.

Thanks
Navratan


(Pedro Oliveira) #2

Hi Navratan,

The type of the entity is saved, as an IRI, with the rdf:type property. In your example, tag:stardog:api:docs:ner:brand.

You can use Stardog to extract the local name of the IRI and get it as a string. e.g.,:

select ?label (localname(?type) as ?typeString) where {
     graph ?g {
        ?doc stardog:docs:hasEntity ?entity .

        ?entity a ?type ;
                rdfs:label ?label .
    }
}

-pedro


(system) #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.