音频文件分析-- whisper(python 文档解析提取)

使用whisper转文本,这里使用的是large-v3版本

sql 复制代码
pip install git+https://github.com/openai/whisper.git 
python 复制代码
import whisper
import os
from tqdm import tqdm

model = whisper.load_model("large-v3")

path = "rag_data"
for fi in tqdm(os.listdir(path)):
	file = os.path.join(path, fi)
	result = model.transcribe(file)
	text = result["text"]
	with open(os.path.join("rad_all_texts", file.split('.')[0] + ".txt"), 'a') as f:
		f.write(text + '\n')

参考

Introducing Whisper
OpenAI Whisper 新一代语音技术(更新至v3)
fine-tune-whisper
Whisper-Finetune

相关推荐
喜欢猪猪6 分钟前
注解的原理?如何自定义注解?
java·数据库·python
屿小夏.7 分钟前
Python实现万花筒效果:创造炫目的动态图案
开发语言·python·pygame
又逢乱世7 分钟前
[Python学习篇] Python函数
python
小白学大数据24 分钟前
Python爬虫与数据可视化:构建完整的数据采集与分析流程
开发语言·爬虫·python·信息可视化
工头阿乐24 分钟前
Python游戏脚本开发之大漠插件
前端·python·游戏
唤醒手腕39 分钟前
2024 年最新 Python 基于火山引擎豆包大模型搭建 QQ 机器人详细教程(更新中)
开发语言·python·火山引擎
wyw00001 小时前
pytorch-ResNet18简单复现
人工智能·pytorch·python
心易行者1 小时前
AI与Python共舞:如何利用深度学习优化推荐系统?(2)
人工智能·python·深度学习
Janee_Chen1 小时前
linux(ubuntu&centos)-安装libreoffice
linux·python·ubuntu·centos
张文君1 小时前
ubuntu,linux下屏蔽坏块方法-240625-240702封存
python