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

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.

The response is in JSON format of the following structure:

{
 "result": "processed_output"
 "stats": "statistics"
}

The processed_output is the output of SouDeC in the requested output format
and statistics is an HTML overview of the detected sources and their classes.

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'])"