From c4c79cc6162b3266f4f92575aa6a76e536e60148 Mon Sep 17 00:00:00 2001 From: Kees van den Broek Date: Mon, 29 Jun 2020 09:39:57 +0200 Subject: [PATCH 1/2] refactor: adapt to new sentence index counting Since its-ws-server >6.0.0, counting starts at 1, not 0 --- docs/api/feedback.md | 24 ++++++++++++------------ docs/websocket/feedback.md | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/api/feedback.md b/docs/api/feedback.md index a8bdfcb..4d4ae25 100644 --- a/docs/api/feedback.md +++ b/docs/api/feedback.md @@ -48,7 +48,7 @@ Content-Disposition: form-data; name="sentences" Content-Type: application/json { - "sentence": 0, + "sentence": 1, "errors": 1, "confidence": -159.0, "currentFrame": 64, @@ -57,7 +57,7 @@ Content-Type: application/json "tokenType": "EOS" "words": [ { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 0, "expected": "hello", "recognized": "hello", @@ -68,7 +68,7 @@ Content-Type: application/json "endTiming": 400 }, { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 1, "expected": "there", "recognized": "there-ERR", @@ -85,7 +85,7 @@ Content-Disposition: form-data; name="sentences" Content-Type: application/json { - "sentence": 1, + "sentence": 2, "errors": 0, "confidence": -124.1, "currentFrame": 87, @@ -94,7 +94,7 @@ Content-Type: application/json "tokenType": "EOS" "words": [ { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 2, "expected": "general", "recognized": "general", @@ -105,7 +105,7 @@ Content-Type: application/json "endTiming": 320 }, { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 3, "expected": "kenobi", "recognized": "kenobi", @@ -146,7 +146,7 @@ Content-Type: application/json "challengeId": "chal", "sentences": [ { - "sentence": 0, + "sentence": 1, "errors": 1, "confidence": -159.0, "currentFrame": 64, @@ -155,7 +155,7 @@ Content-Type: application/json "tokenType": "EOS" "words": [ { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 0, "expected": "hello", "recognized": "hello", @@ -166,7 +166,7 @@ Content-Type: application/json "endTiming": 400 }, { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 1, "expected": "there", "recognized": "there-ERR", @@ -179,7 +179,7 @@ Content-Type: application/json ] }, { - "sentence": 1, + "sentence": 2, "errors": 0, "confidence": -124.1, "currentFrame": 87, @@ -188,7 +188,7 @@ Content-Type: application/json "tokenType": "EOS" "words": [ { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 2, "expected": "general", "recognized": "general", @@ -199,7 +199,7 @@ Content-Type: application/json "endTiming": 320 }, { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 3, "expected": "kenobi", "recognized": "kenobi", diff --git a/docs/websocket/feedback.md b/docs/websocket/feedback.md index e79aa0c..40235f6 100644 --- a/docs/websocket/feedback.md +++ b/docs/websocket/feedback.md @@ -72,7 +72,7 @@ the following json is sent as a progressive result: ```json { "feedback_id": "recording_1", - "sentence": 0, + "sentence": 1, "errors": 1, "confidence": -78.0, "currentFrame": 68, @@ -81,7 +81,7 @@ the following json is sent as a progressive result: "tokenType": "EOS" "words": [ { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 1, "expected": "funny", "recognized": "funny", @@ -90,7 +90,7 @@ the following json is sent as a progressive result: "explanation": "The pronunciation matches the expected text." }, { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 1, "expected": "gif", "recognized": "gif-ERR", @@ -105,7 +105,7 @@ the following json is sent as a progressive result: Name | Type | Description -------------|----------|------------ feedback_id | `string` | The unique id of the feedback this results belongs to. -sentence | `int` | The index of the sentence, starting at `0`. +sentence | `int` | The index of the sentence, starting at `1`. errors | `int` | Amount of errors made. confidence | `float` | Confidence of the end of sentence detection. currentFrame | `int` | Audio frame of end of sentence detection. @@ -118,7 +118,7 @@ The list of words each contain the following fields: Name | Type | Description --------------|----------|------------ -sentenceIndex | `int` | Index of the sentence. +sentenceIndex | `int` | Index of the sentence, starting at `1`. textIndex | `int` | Index of the whole text. expected | `string` | The word as it was expected to be pronounced. recognized | `string` | The recognized result. If nothing is recognized this field is `null`. @@ -150,7 +150,7 @@ When the recording is finished a recording with feedback is returned: "audioUrl": "https://api.itslanguage.nl/download/audio.wav", "sentences": [ { - "sentence": 0, + "sentence": 1, "errors": 1, "confidence": -159.0, "currentFrame": 64, @@ -159,7 +159,7 @@ When the recording is finished a recording with feedback is returned: "tokenType": "EOS" "words": [ { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 0, "expected": "hello", "recognized": "hello", @@ -170,7 +170,7 @@ When the recording is finished a recording with feedback is returned: "endTiming": 400 }, { - "sentenceIndex": 0, + "sentenceIndex": 1, "textIndex": 1, "expected": "there", "recognized": "there-ERR", @@ -183,7 +183,7 @@ When the recording is finished a recording with feedback is returned: ] }, { - "sentence": 1, + "sentence": 2, "errors": 0, "confidence": -124.1, "currentFrame": 87, @@ -192,7 +192,7 @@ When the recording is finished a recording with feedback is returned: "tokenType": "EOS" "words": [ { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 2, "expected": "general", "recognized": "general", @@ -203,7 +203,7 @@ When the recording is finished a recording with feedback is returned: "endTiming": 320 }, { - "sentenceIndex": 1, + "sentenceIndex": 2, "textIndex": 3, "expected": "kenobi", "recognized": "kenobi", @@ -276,4 +276,4 @@ nl.itslanguage.feedback.resume Name | Type | Description ------------|----------|------------ id | `string` | **Required** The id of the feedback to resume. -sentence_id | `int` | **Required** The id of the sentence (starting with `0`) to resume on. +sentence_id | `int` | **Required** The id of the sentence (starting with `1`) to resume on. From 4de5324273d972222eb46e8d9862db79216dc8ff Mon Sep 17 00:00:00 2001 From: Kees van den Broek Date: Mon, 29 Jun 2020 10:02:12 +0200 Subject: [PATCH 2/2] refactor: adapt to new text index counting Since its-ws-server >6.0.0, counting starts at 1, not 0 --- docs/api/feedback.md | 16 ++++++++-------- docs/websocket/feedback.md | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/api/feedback.md b/docs/api/feedback.md index 4d4ae25..7411d50 100644 --- a/docs/api/feedback.md +++ b/docs/api/feedback.md @@ -58,7 +58,7 @@ Content-Type: application/json "words": [ { "sentenceIndex": 1, - "textIndex": 0, + "textIndex": 1, "expected": "hello", "recognized": "hello", "label": "CW", @@ -69,7 +69,7 @@ Content-Type: application/json }, { "sentenceIndex": 1, - "textIndex": 1, + "textIndex": 2, "expected": "there", "recognized": "there-ERR", "label": "PC", @@ -95,7 +95,7 @@ Content-Type: application/json "words": [ { "sentenceIndex": 2, - "textIndex": 2, + "textIndex": 3, "expected": "general", "recognized": "general", "label": "CW", @@ -106,7 +106,7 @@ Content-Type: application/json }, { "sentenceIndex": 2, - "textIndex": 3, + "textIndex": 4, "expected": "kenobi", "recognized": "kenobi", "label": "CW", @@ -156,7 +156,7 @@ Content-Type: application/json "words": [ { "sentenceIndex": 1, - "textIndex": 0, + "textIndex": 1, "expected": "hello", "recognized": "hello", "label": "CW", @@ -167,7 +167,7 @@ Content-Type: application/json }, { "sentenceIndex": 1, - "textIndex": 1, + "textIndex": 2, "expected": "there", "recognized": "there-ERR", "label": "PC", @@ -189,7 +189,7 @@ Content-Type: application/json "words": [ { "sentenceIndex": 2, - "textIndex": 2, + "textIndex": 3, "expected": "general", "recognized": "general", "label": "CW", @@ -200,7 +200,7 @@ Content-Type: application/json }, { "sentenceIndex": 2, - "textIndex": 3, + "textIndex": 4, "expected": "kenobi", "recognized": "kenobi", "label": "CW", diff --git a/docs/websocket/feedback.md b/docs/websocket/feedback.md index 40235f6..c13ca71 100644 --- a/docs/websocket/feedback.md +++ b/docs/websocket/feedback.md @@ -91,7 +91,7 @@ the following json is sent as a progressive result: }, { "sentenceIndex": 1, - "textIndex": 1, + "textIndex": 2, "expected": "gif", "recognized": "gif-ERR", "label": "PC", @@ -119,7 +119,7 @@ The list of words each contain the following fields: Name | Type | Description --------------|----------|------------ sentenceIndex | `int` | Index of the sentence, starting at `1`. -textIndex | `int` | Index of the whole text. +textIndex | `int` | Index of word as position in the whole text, starting at `1`. expected | `string` | The word as it was expected to be pronounced. recognized | `string` | The recognized result. If nothing is recognized this field is `null`. label | `string` | Label describing what was recognized. @@ -160,7 +160,7 @@ When the recording is finished a recording with feedback is returned: "words": [ { "sentenceIndex": 1, - "textIndex": 0, + "textIndex": 1, "expected": "hello", "recognized": "hello", "label": "CW", @@ -171,7 +171,7 @@ When the recording is finished a recording with feedback is returned: }, { "sentenceIndex": 1, - "textIndex": 1, + "textIndex": 2, "expected": "there", "recognized": "there-ERR", "label": "PC", @@ -193,7 +193,7 @@ When the recording is finished a recording with feedback is returned: "words": [ { "sentenceIndex": 2, - "textIndex": 2, + "textIndex": 3, "expected": "general", "recognized": "general", "label": "CW", @@ -204,7 +204,7 @@ When the recording is finished a recording with feedback is returned: }, { "sentenceIndex": 2, - "textIndex": 3, + "textIndex": 4, "expected": "kenobi", "recognized": "kenobi", "label": "CW",