Parsito

Parsito web service is available on http(s)://lindat.mff.cuni.cz/services/parsito/api/.

The web service is freely available for testing. Respect the CC BY-NC-SA licence of the models – explicit written permission of the authors is required for any commercial exploitation of the system. If you use the service, you agree that data obtained by us during such use can be used for further improvements of the systems at UFAL. All comments and reactions are welcome.

API Reference

The Parsito REST API can be accessed directly or via any other web programming tools that support standard HTTP request methods and JSON for output handling.

Service Request Description HTTP Method
models return list of models and supported methods GET/POST
parse parse supplied data GET/POST

Method models

Return the list of models available in the Parsito REST API, and for each model enumerate methods supported by this models. The default model (used when user supplies no model to a method call) is also returned – this is guaranteed to be the latest Czech model.

Browser Example

http://lindat.mff.cuni.cz/services/parsito/api/models

Example JSON Response

{
 "models": [
  "czech-ud1.2-151120",
  "ancient-greek-ud1.2-151120",
  "ancient-greek-proiel-ud1.2-151120",
  "arabic-ud1.2-151120",
  "basque-ud1.2-151120",
  "bulgarian-ud1.2-151120",
  "croatian-ud1.2-151120",
  "danish-ud1.2-151120",
  "dutch-ud1.2-151120",
  "english-ud1.2-151120",
  "estonian-ud1.2-151120",
  "finnish-ud1.2-151120",
  "finnish-ftb-ud1.2-151120",
  "french-ud1.2-151120",
  "german-ud1.2-151120",
  "gothic-ud1.2-151120",
  "greek-ud1.2-151120",
  "hebrew-ud1.2-151120",
  "hindi-ud1.2-151120",
  "hungarian-ud1.2-151120",
  "indonesian-ud1.2-151120",
  "irish-ud1.2-151120",
  "italian-ud1.2-151120",
  "japanese-ktc-ud1.2-151120",
  "latin-ud1.2-151120",
  "latin-itt-ud1.2-151120",
  "latin-proiel-ud1.2-151120",
  "norwegian-ud1.2-151120",
  "old-church-slavonic-ud1.2-151120",
  "persian-ud1.2-151120",
  "polish-ud1.2-151120",
  "portuguese-ud1.2-151120",
  "romanian-ud1.2-151120",
  "slovenian-ud1.2-151120",
  "spanish-ud1.2-151120",
  "swedish-ud1.2-151120",
  "tamil-ud1.2-151120"
 ],
 "default_model": "czech-ud1.2-151120"
}

Method parse

Parse given data as described in the User's Manual.

ParameterMandatoryData typeDescription
datayesstringInput text in UTF-8.
modelnostringModel to use; see model selection for model matching rules.
inputnostring (conllu)Input format to use; default is conllu.
outputnostring (conllu)Output format to use; default is conllu.

The response is in JSON format of the following structure:

{
 "model": "Model used",
 "acknowledgements": ["URL with acknowledgements", ...],
 "result": "parser_output"
}
The parser_output is the output of the parser in the requested output format.

Browser Examples

http://lindat.mff.cuni.cz/services/parsito/api/parse?data=1%09Z%09_%09ADP%09_%09AdpType=Prep|Case=Gen%09_%09_%09_%09_%0A2%09očí%09_%09NOUN%09_%09Case=Gen|Gender=Fem|Negative=Pos|Number=Plur%09_%09_%09_%09_%0A3%09do%09_%09ADP%09_%09AdpType=Prep|Case=Gen%09_%09_%09_%09_%0A4%09očí%09_%09NOUN%09_%09Case=Gen|Gender=Fem|Negative=Pos|Number=Plur%09_%09_%09_%09_

Model Selection

There are several possibilities how to select required model using the model option:

Note that the last possibility allows using czech or english as models.


Accessing API using Curl

The described API can be comfortably used by curl. Several examples follow:

Passing Input on Command Line (if UTF-8 locale is being used)

curl --data 'data=1%09Z%09_%09ADP%09_%09AdpType=Prep|Case=Gen%09_%09_%09_%09_%0A2%09očí%09_%09NOUN%09_%09Case=Gen|Gender=Fem|Negative=Pos|Number=Plur%09_%09_%09_%09_%0A3%09do%09_%09ADP%09_%09AdpType=Prep|Case=Gen%09_%09_%09_%09_%0A4%09očí%09_%09NOUN%09_%09Case=Gen|Gender=Fem|Negative=Pos|Number=Plur%09_%09_%09_%09_' http://lindat.mff.cuni.cz/services/parsito/api/parse

Using Files as Input (files must be in UTF-8 encoding)

curl -F 'data=@input_file' http://lindat.mff.cuni.cz/services/parsito/api/parse

Specifying Additional Parameters

curl -F 'data=@input_file' -F 'model=english' http://lindat.mff.cuni.cz/services/parsito/api/parse

Converting JSON Result to Plain Text

curl -F 'data=@input_file' http://lindat.mff.cuni.cz/services/parsito/api/parse | PYTHONIOENCODING=utf-8 python -c "import sys,json; sys.stdout.write(json.load(sys.stdin)['result'])"