You are here

Machinese Phrase Tagger NLP REST API

Machinese Phrase Tagger webservice has a REST API, which means that the calls to the API are simple HTTP requests with two required arguments to the specific webservice URL.

Webservice URL

The webservice URL for Machinese Phrase Tagger follows the following pattern http://server.nlpengine.net/serv/tech/fdg1/lang, where the server is the name of the webservice server and lang is the ISO639 language code for the language in which the input text is written.

Server names will be provided by Connexor.

Currently the following language codes are supported by Machinese Phrase Tagger web service:

Language nameLanguage code
Englishen
Frenchfr
Spanishes
Germande
Italianit
Dutchnl
Finnishfi
Swedishsv
Danishda
Norwegianno

Arguments:

text (required)
The input text
AuthKey (required)
Authentication key. If you don't yet have one, you can get a free one for testing.

Usage Examples:

Example Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<cnxfdg0 language="fi" version="4.11">
<token pos="0" len="6">
<text>Tämä</text>
<lemma>tämä</lemma>
<tags morpho="PRON"/>
</token>
<token pos="7" len="2">
<text>on</text>
<lemma>olla</lemma>
<tags morpho="V"/>
</token>
<token pos="10" len="5">
<text>testi</text>
<lemma>testi</lemma>
<tags morpho="N"/>
</token>
</cnxfdg0>

Errors

If the service fails to properly process the request, it returns an error response, which complies with the following pattern:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
         <err code="error code number" msg="error message" />
</rsp>

The table below lists the error codes used in the error responses:

Code Message Explanation Cure
400 bad request The service path is incorrect. Check the <action> . It is missing or incorrect. Use POST (not GET).
401 unauthorized access Authorization did not succeed. Check AuthKey. You should restart session by calling ‘Authentication’ method. In 'Authentication' check login name and password.
403 access denied The service was denied. You do not have rights to access the service. Similar to 404.
404 missing handler The service path is incorrect. The address is incorrect. Check the path.
500 internal error The service makes various integretity checks during the processing. One of those tests have failed. Contact us. This should not happen.
503 no such service The server does not provide the requested service. Check <action> in your service path.