Hi Boyan, I didn't understand that I must create JAPE rule before I do everything else. I'll try this now.
Thank you! Srecko On Thu, Jul 14, 2011 at 2:13 PM, Boyan Kukushev <boyan.kukus...@ontotext.com > wrote: > Hi Srecko, > > In order to see your Topic annotations, you must create the JAPE rule that > Philip suggested: > > Phase: GazTopic > Input: Lookup > Options: control = appelt > Rule: Topic > ( > {Lookup.class == "http://proton.semanticweb.org/2006/05/protont#Topic"} > ):topic > --> > :topic.Topic = {rule=GazTopic, class=:topic.Lookup.class, > inst=:topic.Lookup.inst} > > and put that rule just after the gazetteer phases within the GATE pipeline. > The easiest way to do this is using the KIM GATE interface by starting > KIM/bin/kim(.bat) gate > > and modifying the pipeline. > > You have already added the Topic annotation type to the list of allowed > annotation types in KIM/config/nerc.properties. After you run the pipeline > with this new resource incuded, Topic annotations should appear in the > default > annotation set for each document you process. > > To be able to use again the pipeline, you should save it, again using the > KIM > GATE interface - right click on the pipeline and select 'Save application > state'. Remember to remove (or empty) the document corpus used by the > application. You choose whether to overwrite the default KIM pipeline > (IE.gapp) or create a new one and point KIM to use it (setting the > corresponding property in KIM/config/nerc.properties). > > Hope this helps! > > Regards, > Boyan > > P.S. What is happening exactly: > - the gazetteer phases use pre-defined knowledge base to find specific > 'things' in the text you process; they produce annotations of type Lookup > - the JAPE rule would take all Lookup annotations that have the specific > class (in your case that is > "http://proton.semanticweb.org/2006/05/protont#Topic") and would create a > new > annotation of type Topic that is fully overlapping the current Lookup > annotation > - the last phase in the pipeline removes all temporary annotations - the > Lookup annotation is also a temporary annotation, but Topic (as it is added > to > the allowed annotations list) will not be removed. > > On Thursday, July 14, 2011 14:50:51 srecko joksimovic wrote: > > I configured nerc.properties, and now I have this: > > > > com.ontotext.kim.KIMConstants.IE_ANN_TYPES=Abstract, Brand, ContactInfo, > > Date, Entity, Event, GeneralTerm, KeyLocation, KeyOrganization, > KeyPerson, > > KeyPhrase, Location, Money, Object, Organization, Percent, Person, > > Position, Time, Acquirement, JobTitle, Number, Topic > > > > then I disabled last resource in pipeline, but I still can't see Topic. > > Maybe I didn't understand well... should I first create Jape rule, or > this > > is enough to see Topic? > > > > Best, > > Srecko > > > > > > > > On Thu, Jul 14, 2011 at 1:15 PM, Philip Alexiev @ Ontotext < > > > > philip.alex...@ontotext.com> wrote: > > > 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-92c912 > > > 1b4297 > > > > > > 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-8227de > > > 53c015 > > > > > > 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-ecdde5 > > > d5ee1a> . > > > > > > < > > > > http://www.lornet.org/acm-ccs/proton#Alias_ff639082-2cc4-484e-92f7-5f0f09 > > > 898d2d > > > > > > 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-2eb53a > > > e3b0b6 > > > > > > 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-7d4a8c > > > 034636 > > > > > > 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-811610 > > > a2f77f > > > > > > 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-740d8d > > > 150f30 > > > > > > 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-c88176 > > > 47765a > > > > > > 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-b8a93b > > > 55f9c7> . > > > > > > <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-8d5b94 > > > 790c4e> . > > > > > > <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-e8c994 > > > 542b23> . > > > > > > <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-df7973 > > > 4c5a3d> . > > > > > > <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-22332a > > > d9d839> . > > > > > > <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-8416d2 > > > 8f4cf1> . > > > > > > < > > > > http://www.lornet.org/acm-ccs/proton#Alias_d680fd76-0dcf-417b-9f4e-5cbda4 > > > 616b72 > > > > > > 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 > > -- > Boyan Kukushev > Senior Software Engineer / Java Developer > Ontotext AD @ Sirma Group Corp. >
_______________________________________________ Kim-discussion mailing list Kim-discussion@ontotext.com http://ontotext.com/mailman/listinfo/kim-discussion