音频文件分析-- 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

相关推荐
2301_8223754418 分钟前
Python虚拟环境(venv)完全指南:隔离项目依赖
jvm·数据库·python
2301_7903009619 分钟前
Python类型提示(Type Hints)详解
jvm·数据库·python
Eric.Lee202124 分钟前
SLAM 路径规划的安全走廊实现
python·机器人·ros·路径规划·避障·安全走廊
小W与影刀RPA31 分钟前
【影刀RPA】:智能过滤敏感词,高效输出表格
大数据·人工智能·python·低代码·自动化·rpa·影刀rpa
Yorlen_Zhang36 分钟前
python Tkinter Frame 深度解析与实战指南
开发语言·python
2401_8384725137 分钟前
Python多线程与多进程:如何选择?(GIL全局解释器锁详解)
jvm·数据库·python
2301_822363601 小时前
Python单元测试(unittest)实战指南
jvm·数据库·python
叫我辉哥e11 小时前
新手进阶Python:办公看板升级交互式可视化+移动端适配+多终端同步
开发语言·python
m0_561359671 小时前
Python面向对象编程(OOP)终极指南
jvm·数据库·python
zhangfeng11331 小时前
deepseek部署和训练的PyTorch CUDA Transformers Accelerate PEFT稳定版本呢推荐
人工智能·pytorch·python