Skip to content

Commit

Permalink
Updated readme of demo
Browse files Browse the repository at this point in the history
  • Loading branch information
iPieter committed Sep 19, 2022
1 parent 8a4f930 commit 8e032f3
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions examples/die_vs_data_rest_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ By default, A Flask server will listen to port 5000. The endpoint is `/`.
First install the dependencies from the requirements.txt file using `pip install -r requirements.txt`

```shell script
$ python app.py
$ python app.py --model-path DTAI-KULeuven/robbertje-shuffled-dutch-die-vs-dat --fast-model-path pdelobelle/robbert-v2-dutch-base
```

And then make a http POST request to `/` with the parameter `sentence` filled in:
## Classification model
Simply make a http POST request to `/` with the parameter `sentence` filled in:

```shell script
$ curl --data "sentence=Daar loopt _die_ meisje." localhost:5000
Expand All @@ -22,9 +23,29 @@ This should give you the following response:

```json
{
"rating": 1,
"interpretation": "incorrect",
"confidence": 5.222124099731445,
"sentence": "Daar loopt _die_ meisje."
"rating": 1,
"interpretation": "incorrect",
"confidence": 5.222124099731445,
"sentence": "Daar loopt _die_ meisje."
}
```

## Zero-shot model
We also have a faster zero-shot model (using RobBERT base), which might be faster and easier to use. There is a small drop in accuracy, but that should be quite limited.

To use the faster zero-shot model, just make a http POST request to `/fast` with the same parameter `sentence` filled in:

```shell script
$ curl --data "sentence=Daar loopt _die_ meisje." localhost:5000/fast
```

This should give you the following response, which is similar, but also provides `die`, `dat`, `Die` or `Dat` as the rating value:

```json
{
"rating": "dat",
"interpretation": "incorrect",
"confidence": 2.567270278930664,
"sentence": "Daar loopt _die_ meisie."
}
```

0 comments on commit 8e032f3

Please sign in to comment.