POS Tagger Web Service

Example Usage

pos-tagger-server start
curl -d 'input=<?xml version="1.0" encoding="UTF-8" standalone="no"?><KAF version="v1.opener" xml:lang="en"><kafHeader><linguisticProcessors layer="text"><lp name="opennlp-en-tok" timestamp="2013-06-11T13:41:37Z" version="1.0"/><lp name="opennlp-en-sent" timestamp="2013-06-11T13:41:37Z" version="1.0"/></linguisticProcessors></kafHeader><text><wf length="4" offset="0" para="1" sent="1" wid="w1">this</wf><wf length="2" offset="5" para="1" sent="1" wid="w2">is</wf><wf length="2" offset="8" para="1" sent="1" wid="w3">an</wf><wf length="7" offset="11" para="1" sent="1" wid="w4">english</wf><wf length="4" offset="19" para="1" sent="1" wid="w5">text</wf></text></KAF>' http://localhost:9292 -XPOST
outputs:
<?xml version='1.0' encoding='UTF-8'?>
<KAF version="v1.opener" xml:lang="en">
  <kafHeader>
    <linguisticProcessors layer="text">
      <lp name="opennlp-en-tok" timestamp="2013-06-11T13:41:37Z" version="1.0"/>
      <lp name="opennlp-en-sent" timestamp="2013-06-11T13:41:37Z" version="1.0"/>
    </linguisticProcessors>
    <linguisticProcessor layer="term">
      <lp timestamp="2013-06-12T15:18:03CEST" version="1.0" name="Open nlp pos tagger"/>
    </linguisticProcessor>
  </kafHeader>
  <text>
    <wf length="4" offset="0" para="1" sent="1" wid="w1">this</wf>
    <wf length="2" offset="5" para="1" sent="1" wid="w2">is</wf>
    <wf length="2" offset="8" para="1" sent="1" wid="w3">an</wf>
    <wf length="7" offset="11" para="1" sent="1" wid="w4">english</wf>
    <wf length="4" offset="19" para="1" sent="1" wid="w5">text</wf>
  </text>
  <terms>
    <term lemma="this" morphofeat="FM" pos="O" tid="t_1" type="open">
      <span>
        <target id="w1"/>
      </span>
    </term>
    <term lemma="is" morphofeat="FM" pos="O" tid="t_2" type="open">
      <span>
        <target id="w2"/>
      </span>
    </term>
    <term lemma="an" morphofeat="APPR" pos="P" tid="t_3" type="close">
      <span>
        <target id="w3"/>
      </span>
    </term>
    <term lemma="english" morphofeat="FM" pos="O" tid="t_4" type="open">
      <span>
        <target id="w4"/>
      </span>
    </term>
    <term lemma="text" morphofeat="FM" pos="O" tid="t_5" type="open">
      <span>
        <target id="w5"/>
      </span>
    </term>
  </terms>
</KAF>

Try the webservice

* required

** When entering a value no response will be displayed in the browser.













Actions

POST /
Tag the input tokenized text. See arguments listing for more options.
GET /
Show this page

Arguments

The webservice takes the following arguments:

* required

text*
The input text in KAF format. Sample KAF input:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<KAF version="v1.opener" xml:lang="en">
  <kafHeader>
    <linguisticProcessors layer="text">
      <lp name="opennlp-en-tok" timestamp="2013-06-11T13:41:37Z" version="1.0"/>
      <lp name="opennlp-en-sent" timestamp="2013-06-11T13:41:37Z" version="1.0"/>
    </linguisticProcessors>
  </kafHeader>
  <text>
    <wf length="4" offset="0" para="1" sent="1" wid="w1">this</wf>
    <wf length="2" offset="5" para="1" sent="1" wid="w2">is</wf>
    <wf length="2" offset="8" para="1" sent="1" wid="w3">an</wf>
    <wf length="7" offset="11" para="1" sent="1" wid="w4">english</wf>
    <wf length="4" offset="19" para="1" sent="1" wid="w5">text</wf>
  </text>
</KAF>
callbacks
You can provide a list of callback urls. If you provide callback urls the POS tagger will run as a background job and a callback with the results will be performed (POST) to the first url in the callback list. The other urls in callback list will be provided in the "callbacks" argument.

Using callback you can chain together several OpeNER webservices in one call. The first, will call the second, which will call the third, etc. See for more information the webservice documentation online.
error_callback
URL to notify if errors occur in the background process. The error callback will do a POST with the error message in the 'error' field.