Python API Usage example

Creating a model instance and loading model

1
2
    ds = Model(args.model, args.alphabet, BEAM_WIDTH)
        ds.enableDecoderWithLM(args.lm, args.trie, LM_ALPHA, LM_BETA)

Performing inference

1
2
3
4
    if args.extended:
        print(metadata_to_string(ds.sttWithMetadata(audio, fs)))
    else:
        print(ds.stt(audio, fs))

Full source code

See Full source code.