Annotation values

Indri
2013-11-13
2013-11-13
  • Leonid Boytsov

    Leonid Boytsov - 2013-11-13

    Hi,

    Is there a way to have annotation values? For example, instead of having a separate field for each POS tag value, can I define a field named POS? Then, NN, NP, ... would be tag values?

    Do I understand it correctly that it might be possible by using an attribute annotation. I have read the docs, but I am still not sure about it.

    Thank you!

     
    Last edit: Leonid Boytsov 2013-11-13
  • David Fisher

    David Fisher - 2013-11-13

    Suppose you have:

    <POS type="DET">the</POS> <POS type="NN">cat</POS>
    

    You can define a new file class environment in FileClassEnvironmentFactory.cpp that has a conflation list that looks like (no warranty, expressed or implied):

    static const char* pos_conflations[] = {
    // tag    attr    value  newtag
       "pos", "type", "DET", "det",
       "pos", "type", "NN", "nn", …
        0,0,0,0};
    

    which enables mapping the POS type="DET" to the field named det. You would still have to index each of the fields separately, eg:

    <parameters><field><name>det</name></field>
    <field><name>nn</name></field></parameters>
    

    So at query time, you will generate field restricted queries according to the indexed field names, eg someterm.nn.

    Note that the field names must be lowercase, and that the attribute value is case sensitive.

     
  • Leonid Boytsov

    Leonid Boytsov - 2013-11-13

    Ok, so, they should all go to different fields. But what is the purpose of attribute value then? And why tags can have additional integer values?

     
  • David Fisher

    David Fisher - 2013-11-13

    When using offset annotations, the attribute value is used for conflation to a filed name, as I described above.

    A numeric field has an integer value. That value is parsed from the data when using inline annotations, and provided directly when using offset annotations.

     
  • Leonid Boytsov

    Leonid Boytsov - 2013-11-13

    Ohh, I see, I didn't quite get this conflation thing in the first read.
    Thank you!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks