The process is described in the customization guide you mentioned. You have added this RDF to the semantic repository. This means that now the gazetteer will be able to match the instances described there (searching for their labels in the texts) and will create Lookup annotations, when it finds a match. The lookup process is generally only one side of the IE process. Lookup annotations are further examined by some logic to determine their validity, or they take part in the recognition of more complex phrases. That is why they are not left after the IE has finished over the document.
Tip: You can disable the last resource in the pipeline and run it again over a document to see all the annotations that are created in the process - also the temporary ones. This will show you the Lookup annotations as well. You can search for your Topic instances there. Once you have the lookups, you should tell KIM that they are important for you and you want to keep them. Add the Topic annotation type to the com.ontotext.kim.KIMConstants.IE_ANN_TYPES list. This will tell KIM not to clear them in the end of the IE process. Now what is left for you to do, is to create a Topic annotation over the Lookup for the topic that the Gazetteer has created. You can use a simple Jape rule to do that: Phase: GazTopic Input: Lookup Options: control = appelt Rule: Topic ( {Lookup.class == "http://proton.semanticweb.org/2006/05/protont#Topic"} ):topic --> :topic.Topic = {rule = Topic, class = :topic.Lookup.class, inst=:topic.Lookup.inst} This is all that you need to include your topics in the IE process and to be able to see them in the graphical interface. Hope this helps philip On 14 Jul 2011, at 1:58 PM, srecko joksimovic wrote: > It is little hard to explain because I didn't do customisation. I took the > file where one of my colleagues did it. File contains about 1200 instances > and has content like this: > > @prefix protons: <http://proton.semanticweb.org/2006/05/protons#> . > @prefix protont: <http://proton.semanticweb.org/2006/05/protont#> . > > <http://www.lornet.org/acm-ccs/proton#Alias_07c6001f-8f5c-49e1-ae3c-92c9121b4297> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Convex Programming@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_63786f1d-7b3c-4872-b4e0-8227de53c015> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Document and Text Processing@en" . > > <http://www.lornet.org/acm-ccs/proton#J.7.1> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_dee6eec3-b503-4d3e-a98d-ecdde5d5ee1a> > . > > <http://www.lornet.org/acm-ccs/proton#Alias_ff639082-2cc4-484e-92f7-5f0f09898d2d> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Store and Forward Networks@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_7f00cebc-8828-4415-83b3-2eb53ae3b0b6> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Integral Equations@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_08a8af20-311b-4a43-b996-7d4a8c034636> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Information Filtering@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_bb28b422-05f4-47f8-a8f5-811610a2f77f> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Surfac eFitting@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_8b20c6a0-1b02-4c34-bd30-740d8d150f30> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Reliability,Availability and Serviceability@en" . > > <http://www.lornet.org/acm-ccs/proton#Alias_b6e48ecc-f1a9-44e6-8ff9-c8817647765a> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Aerospace@en" . > > <http://www.lornet.org/acm-ccs/proton#B.7.3.1> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_a4fdb728-b855-4ee6-b220-b8a93b55f9c7> > . > > <http://www.lornet.org/acm-ccs/proton#K.7.2> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_4694954a-ba5e-4333-9ea9-8d5b94790c4e> > . > > <http://www.lornet.org/acm-ccs/proton#D.3.2.10> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_d59afecf-26fc-4a5b-af92-e8c994542b23> > . > > <http://www.lornet.org/acm-ccs/proton#G.3.16> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_33e428d6-3157-41ca-95ee-df79734c5a3d> > . > > <http://www.lornet.org/acm-ccs/proton#C.1.1.2> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_2d3fd573-5a41-403b-bdf3-22332ad9d839> > . > > <http://www.lornet.org/acm-ccs/proton#B.5.2.1> > a protont:Topic ; > protons:generatedBy <http://www.lornet.org/acm-ccs/proton#TrustedSrc> ; > protons:hasMainAlias > > <http://www.lornet.org/acm-ccs/proton#Alias_171d052f-553e-4990-bd15-8416d28f4cf1> > . > > <http://www.lornet.org/acm-ccs/proton#Alias_d680fd76-0dcf-417b-9f4e-5cbda4616b72> > a protons:Alias ; > <http://www.w3.org/2000/01/rdf-schema#label> > "Pixel Classification@en" . > > I added this document to owlim.ttl and imported my instances. > > I tried to follow document Customizing KIM 3.pdf, but as mapping has already > been done, I didn't know what else to do. Maybe I should create Jape rule, or > something like that, but I think that I should see Topic with or without my > instances. I'm not sure, that is only my opinion. > > Best, > Srecko > > On Thu, Jul 14, 2011 at 12:48 PM, Philip Alexiev @ Ontotext > <philip.alex...@ontotext.com> wrote: > Can you describe the exact actions you take to add the topics to the IE > logic ? The exact customizations you have made to KIM. > > Thanks, > Philip > > On 14 Jul 2011, at 1:41 PM, srecko joksimovic wrote: > >> Hi Philip, >> with GATE is same as with Java code. I get the same annotations. I tried to >> edit nerc.properties and add Topic to >> com.ontotext.kim.KIMConstants.IE_ANN_TYPES list, but nothing changed. >> >> Do I have to change something else? >> >> Best, >> Srecko >> >> On Thu, Jul 14, 2011 at 12:26 PM, Philip Alexiev @ Ontotext >> <philip.alex...@ontotext.com> wrote: >> Hi Srecko, >> >> You can run the gate interface to check exactly what annotations are create >> ant their type. You can do this by running: >> bash KIM/bin/kim gate >> >> You probably use a Jape rule to match the Lookup annotations with >> class="http://proton.semanticweb.org/2006/05/protont#Topic" and are >> creating one of the entity annotations over it (the entity annotations are >> a whitelist of annotations that remain after the annotation process >> finishes, all annotations not in this list are removed). >> >> So check what type of annotation you are creating. >> >> If this is not the case, please provide more details how you handle the >> topic lookups. >> >> All the best, >> Philip >> >> >> On 14 Jul 2011, at 1:19 PM, srecko joksimovic wrote: >> >> > Hello Philip, >> > >> > I included my instances in KIM. When I use web UI, I see them all, and >> > everything looks ok. But when I run code like this: >> > >> > KIMDocument kimDoc = >> > apiCorpora.createDocument(_string_to_annotate, true); >> > >> > kimDoc = apiSemAnn.execute(kimDoc); >> > >> > KIMAnnotationSet kimASet = kimDoc.getAnnotations(); >> > Set typesSet = kimASet.getAllTypes(); >> > Iterator iterator = typesSet.iterator(); >> > >> > // show annotations of every type separately >> > while(iterator.hasNext()) >> > { >> > Object key = iterator.next(); >> > KIMAnnotationSet kimFilteredASet = >> > kimASet.get(String.valueOf(key)); >> > Iterator annIterator = kimFilteredASet.iterator(); >> > System.out.println(" = Annotations of type [" + >> > String.valueOf(key) + "] :"); >> > >> > while(annIterator.hasNext()) >> > { >> > System.out.println(" -- " + annIterator.next()); >> > } >> > } >> > System.out.println("[ Document's Typed Annotations (end) ]"); >> > >> > I don't see any annotation of type Topic. I see all of them when I use web >> > UI, like I said. But when I try to annotate string from Java application, >> > I don't get any Topic annotations. >> > >> > Could you please help me on this one? >> > >> > Best, >> > Srecko >> > _______________________________________________ >> > Kim-discussion mailing list >> > Kim-discussion@ontotext.com >> > http://ontotext.com/mailman/listinfo/kim-discussion >> >> >> _______________________________________________ >> Kim-discussion mailing list >> Kim-discussion@ontotext.com >> http://ontotext.com/mailman/listinfo/kim-discussion > >
_______________________________________________ Kim-discussion mailing list Kim-discussion@ontotext.com http://ontotext.com/mailman/listinfo/kim-discussion