SouDeC API Reference

SouDeC REST API web service is available on http(s)://quest.ms.mff.cuni.cz/soudec/api/.

The service is freely available for testing under these terms of use. Explicit written permission of the authors of SouDeC and the external services called (UDPipe and NameTag) 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 SouDeC REST API can be accessed directly or via web programming tools that support standard HTTP request methods and JSON for output handling.

Service Request Description HTTP Method
detect detect and classify sources GET/POST
info get the server version and a list of supported features GET/POST

Method detect

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

Parameter Mandatory Data type Description
text yes string Input text in UTF-8.
input no string Input format; possible values: txt (default), presegmented, see input format for details.
output no string Output format; possible values: txt (default), html, conllu, see output format for details.
stats no string Format for statistics; possible values: html (default), tsv (tab-separated values), or a comma-separated list thereof.
uilang no string Language localization of the returned information; possible values: en (default), cs.

The response is in JSON format of the following structure:

{
 "message": "overview_message"
 "result": "processed_output"
 "stats_html": "statistics_html" (if specified in parameter stats or by default)
 "stats_tsv": "statistics_tsv" (if specified in parameter stats)
}

The overview_message is a short comprehensible message of what has been called,
processed_output is the output of SouDeC in the requested output format,
statistics_html is an HTML overview of the detected sources and their classes,
and statistics_tsv is a TSV (tab-separated values) overview of the detected sources and their classes.

Method info

Returns the info about the server - the SouDeC version and a list of supported features.

Parameter Mandatory Data type Description
uilang no string Language localization of the returned information; possible values: en (default), cs.

The response is in JSON format of the following structure:

{
 "version": "SouDeC_version"
 "features": "supported_features"
}

The SouDeC_version is the version of the server consisting of the version number and the creation date,
and supported_features is a list of the analysis features, separated by '•'.

Browser Example

http://quest.ms.mff.cuni.cz/soudec/api/detect?input=txt&output=txt&text=SouDec tvrdí, že tohle je citace.

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 'input=txt&output=txt&text=SouDec tvrdí, že tohle je citace.' http://quest.ms.mff.cuni.cz/soudec/api/detect

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

curl --data-urlencode 'input=txt' --data-urlencode 'output=html' --data-urlencode 'text@input_file.txt' http://quest.ms.mff.cuni.cz/soudec/api/detect

Converting JSON Result to Plain Text

curl --data 'input=txt&output=txt&text=SouDec tvrdí, že tohle je citace.' http://quest.ms.mff.cuni.cz/soudec/api/detect | PYTHONIOENCODING=utf-8 python -c "import sys,json; sys.stdout.write(json.load(sys.stdin)['result'])"