transcript-model
JSON schema and JavaScript model classes for dealing with time-aligned transcripts of speech.
Usage
Install in your project
$ npm install --save transcript-model
Then
const Transcript = ; // Define some transcript JSONconst json = speakers: name: "Alice" name: "Bob" segments: speaker: 0 words: start: 005 end: 064 text: "Hello" start: 070 end: 110 text: "Bob!" speaker: 1 words: start: 153 end: 188 text: "Hi" start: 192 end: 233 text: "Alice." // Instantiate a Transcript objectconst transcript = Transcript; // Do something with itconsole; // Serialise as JSONconsole;
Try it out on RunKit.
For more examples of creating and manipulating Transcript objects check out the source code.
CLI
A basic command line interface has been implemented to support conversion of BBC Kaldi output to the transcript JSON format.
Install
$ npm install -g transcript-model
Usage
To write to STDOUT:
$ transcript-model --kaldi path/to/transcript.json path/to/segments.json
To write to a file:
$ transcript-model --kaldi path/to/transcript.json path/to/segments.json > output.json