Menu

Parser and input tagging

2008-03-24
2013-04-16
  • Miroslaw Ochodek

    Hi everyone,

    I've got a question concerning English Parser. Is it possible to tag manually some tokens and let Parser use it?

    I am using TreebankParser static method to obtain ParserME. I was trying to feed Parse objects with the type, and give the tag I would like to enforce, but it doesn't work.

    To give example, I have following text:
    System displays welcome message.
    I obtain:
    (TOP (NP (NP (NNP System) (NNS displays)) (JJ welcome) (NN message)(. .)))

    In this case I would like to change displays to VBZ
    When I changed the type of Parse from TK to VBZ I received:
    (TOP (NP (NP (NNP System) (NNS (VBZ displays))) (JJ welcome) (NN message)(. .)))

    Is there any built-in way to feed parser with PoS?

    Thank you in advance for answer.

     
    • Thomas Morton

      Thomas Morton - 2008-03-24

      Hi,
         If you are going to pre-tag all words then you can modify the PaserME.parse() routine to not perform the following step:

      if (0 == i) {
         nd = advanceTags(tp);
      }

      and it should work fine.  There isn't anything built in to support this however.

      If you want to have the tagger supply some of the tags its more complicated.  Probably the easiest way is to subvert the tag dictionary object to somehow know which sentence you are parsing, and what tags are fixed.  Then have it return the tag as the only option for that word or call out to the regular tag dictionary in the case of a non tagged word.

      I'll look and see how difficult this type of functionality would be to add in a more general way. 

      Hope this helps...Tom

       
      • Miroslaw Ochodek

        Thank you very much for the response :)

        I will try to investigate, maybe I will be able to handle it according to your tips :)

        I am building system which will enables user interaction concerning processing result, so the user could suggest system if the parse is wrong. So in most cases I will receive tagging for one~few words only.

         

Log in to post a comment.