Python API Usage example

Examples are from native_client/python/client.cc.

Creating a model instance and loading model

115
    ds = Model(args.model)

Performing inference

149
150
151
152
153
154
    if args.extended:
        print(metadata_to_string(ds.sttWithMetadata(audio, 1).transcripts[0]))
    elif args.json:
        print(metadata_json_output(ds.sttWithMetadata(audio, 3)))
    else:
        print(ds.stt(audio))

Full source code

See Full source code.