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.
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 |
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.
http://quest.ms.mff.cuni.cz/soudec/api/detect?input=txt&output=txt&text=SouDec tvrdí, že tohle je citace. |
The described API can be comfortably used by curl
. Several examples follow:
curl --data 'input=txt&output=txt&text=SouDec tvrdí, že tohle je citace.' http://quest.ms.mff.cuni.cz/soudec/api/detect
curl --data-urlencode 'input=txt' --data-urlencode 'output=html' --data-urlencode 'text@input_file.txt' http://quest.ms.mff.cuni.cz/soudec/api/detect
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'])"