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

相关推荐
凛铄linshuo18 分钟前
爬虫简单实操2——以贴吧为例爬取“某吧”前10页的网页代码
爬虫·python·学习
牛客企业服务21 分钟前
2025年AI面试推荐榜单,数字化招聘转型优选
人工智能·python·算法·面试·职场和发展·金融·求职招聘
胡斌附体33 分钟前
linux测试端口是否可被外部访问
linux·运维·服务器·python·测试·端口测试·临时服务器
likeGhee1 小时前
python缓存装饰器实现方案
开发语言·python·缓存
项目題供诗1 小时前
黑马python(二十五)
开发语言·python
读书点滴1 小时前
笨方法学python -练习14
java·前端·python
笑衬人心。2 小时前
Ubuntu 22.04 修改默认 Python 版本为 Python3 笔记
笔记·python·ubuntu
蛋仔聊测试2 小时前
Playwright 中 Page 对象的常用方法详解
python
前端付豪2 小时前
17、自动化才是正义:用 Python 接管你的日常琐事
后端·python
jioulongzi2 小时前
记录一次莫名奇妙的跨域502(badgateway)错误
开发语言·python