pip install git+https://github.com/wenet-e2e/wenet.gitgit clone https://github.com/wenet-e2e/wenet.git
cd wenet
pip install -e .wenet --language chinese audio.wavYou can specify the following parameters.
-lor--language: chinese/english are supported now.-mor--model_dir: your own model dir-gor--gpu: the device id of gpu, default value -1 represents for cpu.-tor--show_tokens_info: show the token level information such as timestamp, confidence, etc.--align: force align the input audio and transcript--label: the input label to align--paraformer: use the best Chinese model--device: specify the backend accelerator (cuda/npu/cpu)
import wenet
model = wenet.load_model('chinese')
# or model = wenet.load_model(model_dir='xxx')
result = model.transcribe('audio.wav')
print(result['text'])