https://github.com/openai/whispergithub.com/openai/whisper Whisper目前有5个模型,随着参数的变多,转文字的理解性和准确性会提高,但相应速度会变慢: 这篇文章会介绍怎样安装和使用Whisper进行音频转文字。 一、Whisper的安装 1、安装Whisper包 pipinstallgit+https://github.com/openai/whisper.git 如果安装成...
model = whisper.load_model('tiny')tiny可以替换为上面提到的模型名称。定义语言检测器的函数 def lan_detector(audio_file): print('reading the audio file') audio = whisper.load_audio(audio_file) audio = whisper.pad_or_trim(audio) mel = whisper.log_mel_spectrogram(audio).to(model.device...
model string:允许您从不同版本的Whisper模型中选择。transcription string:允许您选择转录的格式,有纯文本、srt或vtt等选项。translate boolean:使您能够将文本翻译成英语。language string:允许您指定音频中所说的语言。temperature number:该参数控制模型输出的“创造性”。suppress_tokens string:您不希望模型输出的...
大家注意,Whisper Desktop 的模型文件并不是.pt 后缀的,而是.bin 后缀的,文件名中也多了 ggml-model 的字样,显然这是经过转换后的模型文件。 实际上,该软件就是Whisper 的ggml版本,ggml是一个用于机器学习的张量库,所使用的模型文件是bin格式的二进制文件,识别效果等同于 Whisper。 然后模型生成方式这里选择 GP...
要使用Whisper,我们就要先了解不同模型的的参数,大小和速度。 加载模型 复制 model=whisper.load_model('tiny') 1. tiny可以替换为上面提到的模型名称。 定义语言检测器的函数 复制 deflan_detector(audio_file):print('reading the audio file')audio=whisper.load_audio(audio_file)audio=whisper.pad_or_trim(...
然后是 Whisper Desktop 的界面和操作。打开后我们首先需要选择模型,Whisper Desktop 不需要指定的模型存放目录,手动选择模型地址就行。 大家注意,Whisper Desktop 的模型文件并不是.pt 后缀的,而是.bin 后缀的,文件名中也多了 ggml-model 的字样,显然这是经过转换后的模型文件。
In this article, you learn about the Whisper model from OpenAI that you can use for speech to text and speech translation.
importtimeimportwhisperimportopencc defa2text(model_type, path):start_time = time.time()# 记录开始时间# 加载 Whisper 模型model = whisper.load_model(model_type)# 加载音频文件并进行识别result = model.transcribe(path)cc = opencc.OpenCC("t2s")res = cc.convert(result['text'])print(res)end...
text = model.transcribe(audio_file) return text["text"] 在不同模型大小下运行上面的函数,timit训练和测试得到的单词错误率如下: 从u2b上转录语音 与其他语音识别模型相比,Whisper 不仅能识别语音,还能解读一个人语音中的标点语调,并插入适当的标点符号,我们下面使用u2b的视频进行测试。
text = model.transcribe(audio_file) return text["text"] 在不同模型大小下运行上面的函数,timit训练和测试得到的单词错误率如下: 从u2b上转录语音 与其他语音识别模型相比,Whisper 不仅能识别语音,还能解读一个人语音中的标点语调,并插入适当的标点符号,我们下面使用u2b的视频进行测试。