Hi Peter,

Thank you for these information, I think I get the idea behind this notion of 
view now, it was not very clear for me before.

Best regards,
Fouad

Le 26 juin 2013 à 18:33, Peter Klügl a écrit :

> Hi,
> 
> the TikaAnnotator creates a new view "textView" that contains the 
> MarkupAnnotations (I have seen no tika annotations in "_InitialView"). This 
> means that you cannot call the TikaAnnotator and match its annotations in the 
> same script. You could run two scripts, the first one calls the TikaAnnotator 
> and the second one with the rules is then applied on the new view. The view 
> on which the rules are applied can be specified in the run configuration. In 
> a real application, this would be solved with sofa mappings in an aggregate 
> analysis engine.
> 
> Best,
> 
> Peter
> 
> 
> On 26.06.2013 10:06, Fouad HAMDI wrote:
>> Hi Peter,
>> 
>> Thanks for your answer, some precisions are described below:
>> 
>>> Hi,
>>> 
>>> On 26.06.2013 09:33, Fouad HAMDI wrote:
>>>> Hi,
>>>> 
>>>> I am trying to use the Tika Annotator within RUTA scripts.
>>>> 
>>>> Here is my current script:
>>>> 
>>>> PACKAGE test;
>>>> 
>>>> ENGINE tika.MarkupAnnotator;
>>>> 
>>>> TYPESYSTEM tika.MarkupAnnotationTypeSystem;
>>>> DECLARE Link;
>>>> 
>>>> Document{-> EXEC(MarkupAnnotator, {MarkupAnnotation})};
>>>> 
>>>> MarkupAnnotation { FEATURE("name", "a") -> MARK(Link) };
>>>> 
>>>> 
>>>> and the file I try to annotate:
>>>> 
>>>> <html>
>>>>  <body>
>>>>    <ul>
>>>>      <li><a href="#">Link 1</a></li>
>>>>      <li><a href="#">Link 2</a></li>
>>>>    </ul>
>>>>    <p><a href="#">Link 3</a></li></p>
>>>>  </body>
>>>> </html>
>>>> 
>>>> After I execute the script, I noticed two points:
>>>> 
>>>>  - The annotation browser view does not display the "MarkupAnnotation" tags
>>>> 
>>>>  - The "MarkupAnnotation" condition is not triggered so that no "Link" tag 
>>>> is present in the output
>>>> 
>>>> (When I visualize the output file in a text editor, the "MarkupAnnotation" 
>>>> tags are here)
>>> 
>>> There are MarkupAnnotations in the xmiCAS, but they are not listed in in
>>> the Annotation Browser? Or are they not visualized (highlighted)? In the
>>> first case, I would bet that the CAS Editor was opened with a type
>>> system that does not contain the Tika type system. Here, you could
>>> deselect the usage of prior type systems in the preferences: UIMA Cas
>>> Editor->Cas Editor Ide
>>> 
>> 
>> The MarkupAnnotations are not listed by the viewer.
>> 
>> If I change the option and I select manually my type system (that imports 
>> the MarkupAnnotator system), they still are not listed (attachment in this 
>> email).
>> 
>> <Pièce jointe Mail.png>
>> 
>> For information, here is the content of my Test type system that I use to 
>> visualize the content in the Annotation Browser:
>> 
>> <?xml version="1.0" encoding="UTF-8"?><typeSystemDescription 
>> xmlns="http://uima.apache.org/resourceSpecifier";>
>>     <name>test.TestTypeSystem</name>
>>     <imports>
>>         <import location="../BasicTypeSystem.xml"/>
>>         <import location="../tika/MarkupAnnotationTypeSystem.xml"/>
>>     </imports>
>>     <types>
>>         <typeDescription>
>>             <name>test.Test.Link</name>
>>             <description>Type defined in test.Test</description>
>>             <supertypeName>uima.tcas.Annotation</supertypeName>
>>         </typeDescription>
>>     </types>
>> </typeSystemDescription>
>> 
>> Best regards,
>> Fouad
>> 
>> 
>>> 
>>>> Therefore, I have two questions (maybe the answer is the same):
>>>> 
>>>>  - How can I visualize the annotations placed by the external engine ?
>>> 
>>> Yes, that should be possible without any problems since that is only a
>>> functionality of the CAS Editor if the annotations have been added by
>>> the engine whether or not you can match with rules on them.
>>> 
>>>>  - How can I trigger the "MarkupAnnotation" condition within my script ?
>>> 
>>> I haven't tried the Tika annotator for a while. I take a look at your
>>> example later this day and try to find the problem.
>>> 
>>> Best,
>>> 
>>> Peter
>>> 
>>> 
>>>> Thank you for your help.
>>>> 
>>>> Best regards,
>>>> Fouad
>>>> 
>>>> FYI: I put the MarkupAnnotation.xml and MarkupAnnotationTypeSystem.xml 
>>>> files in my RUTA project and I reference the Tika libraries in my Run 
>>>> configuration. I use the HEAD version of the Tika Annotator.
>>> 
>> 
> 

Reply via email to