forked from lkrsnik/classla-api
75 lines
1.8 KiB
Markdown
75 lines
1.8 KiB
Markdown
# classla-api
|
|
|
|
## Description
|
|
This tool uses classla library as an API. It allows for calls on some preset classla settings, as well as a custom one.
|
|
|
|
## Standard UD
|
|
Preset classla settings:
|
|
```json
|
|
{
|
|
"lang": "sl",
|
|
"pos_lemma_pretag": false
|
|
}
|
|
```
|
|
Usage example:
|
|
```commandline
|
|
curl -X POST -d '{"text": "France Prešeren je rojen v Vrbi."}' http://127.0.0.1:5000/standard-ud
|
|
```
|
|
|
|
## Standard JOS
|
|
Preset classla settings:
|
|
```json
|
|
{
|
|
"lang": "sl",
|
|
"pos_use_lexicon": true,
|
|
"type": "standard_jos"
|
|
}
|
|
```
|
|
Usage example:
|
|
```commandline
|
|
curl -X POST -d '{"text": "France Prešeren je rojen v Vrbi."}' http://127.0.0.1:5000/standard-jos
|
|
```
|
|
|
|
## Nonstandard UD
|
|
Preset classla settings:
|
|
```json
|
|
{
|
|
"lang": "sl",
|
|
"pos_use_lexicon": true,
|
|
"type": "nonstandard_jos"
|
|
}
|
|
```
|
|
Usage example:
|
|
```commandline
|
|
curl -X POST -d '{"text": "kva smo mi zurali zadnje leto v zagrebu..."}' http://127.0.0.1:5000/nonstandard-ud
|
|
```
|
|
|
|
## Nonstandard JOS
|
|
Preset classla settings:
|
|
```json
|
|
{
|
|
"lang": "sl",
|
|
"pos_use_lexicon": true,
|
|
"processors": {
|
|
"tokenize": "nonstandard",
|
|
"lemma": "nonstandard",
|
|
"pos": "nonstandard",
|
|
"depparse": "standard_jos",
|
|
"ner": "nonstandard"
|
|
}
|
|
}
|
|
```
|
|
Usage example:
|
|
```commandline
|
|
curl -X POST -d '{"text": "kva smo mi zurali zadnje leto v zagrebu..."}' http://127.0.0.1:5000/nonstandard-jos
|
|
```
|
|
|
|
## Custom settings
|
|
Custom settings may be used, however they have to be in compliance with what the library allows (you can check this on https://github.com/clarinsi/classla)
|
|
|
|
###Warning: Usage of custom settings is a slow action! It may take more than 30s to get a result!
|
|
|
|
Usage example:
|
|
```commandline
|
|
curl -X POST -d '{"text": "France Prešeren je rojen v Vrbi.", "settings": {"lang": "sl", "pos_lemma_pretag": false}}' http://127.0.0.1:5000/custom-settings
|
|
``` |