
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
d-ser-t-service
Advanced tools
Dynamic Sentence Error Rate Testing: A Package for testing the CRIS speech-to-text model, quantifying the quality of the model with respect to its Word Error Rate
This project quantifies speech audio transcription in near real time, by taking sample audio with expected transcriptions and outputting WER & SER for all utterances.
These instructions will get you started using the service. For development / contributing see CONTRIBUTING.md.
Install the project from npm
npm install d-ser-t-service
// with import
import { CustomSpeechTestHarness } from 'd-ser-t-service';
// with require
const CustomSpeechTestHarness = require('d-ser-t-service').CustomSpeechTestHarness;
Create an instance of the test harness and pass the appropriate values as noted below.
const testHarness = new CustomSpeechTestHarness(
{
audioDirectory='path/to/audio/directory',
concurrency='number of concurrent calls, ≥ 1',
crisEndpointId='Custom Speech Endpoint ID',
serviceRegion='Speech service region, e.g. westus',
transcriptionFile='path/to/existing/transcription/file.txt',
audioFile="optional; use if there's a single file to transcribe",
outFile='optional; defaults to ./test_results.json'
}
);
/* Single file recognition, no transcription.txt file necessary
results outputs to terminal.*/
testHarness.singleFileTranscribe();
/* Multiple file recognition with a transcription.txt file and an audio directory.
results stored in `test_results.json` by default. */
testHarness.multipleFileTranscription();
Testing stores test results in JSON format which is stored in ../test_results.json
by default, storage location can be changed with a flag.
sample test_results.json
{
metaData: {
"transcriptionFile": "<path to transcription>.txt",
"sentenceErrorRate": "<ratio of occurence of an error in recognition> range 0 - 1",
"averageWordErrorRate": "<average distribution of error in each recognition> range 0 - 1",
"totalTestingTime": "<total transcription time>"
},
results: [
{
"actualTranscription": "Actual recognized output from the speech service.",
"expectedTranscription": "Expected output from the speech service.",
"wordErrorRate": 0.167
}
]
}
First, we must create the audio files that we wish to test, along with their expected transcriptions.
Audio must be .wav
files sampled at 16kHz
. My recommended approach for generating test audio is using Audacity to record wav
files.
S
on each individual label and rename, select right arrow on each label: >
, drag right to mark end of phrase/labeling.location/of/audiodata/folder
Note: if transcription Text File is edited in VSCODE, VSCODE optionally adds a new line to end of all files, this will affect how tests are ran. Disable feature before saving.
As you create your audio files, keep track of the expected transcriptions in a text file called transcriptions.txt
. The structure for .txt
file is the same structure used for training a custom acoustic model. Each line of the transcription file should have the name of an audio file, followed by the corresponding transcription. The file name and transcription should be separated by a tab (\t).
Important: TXT files should be encoded as UTF-8 BOM and not contain any UTF-8 characters above U+00A1 in the Unicode characters table. Typically –, ‘, ‚, “ etc. This harness tries to address this by cleaning your data.
Please read CONTRIBUTING.md for details on contributing, and the process for submitting pull requests to us.
We use SemVer for versioning.
>= 10
FAQs
Dynamic Sentence Error Rate Testing: A Package for testing the CRIS speech-to-text model, quantifying the quality of the model with respect to its Word Error Rate
The npm package d-ser-t-service receives a total of 1 weekly downloads. As such, d-ser-t-service popularity was classified as not popular.
We found that d-ser-t-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.