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

相关推荐
码界索隆21 分钟前
Python转Java系列:前言
java·开发语言·python
金銀銅鐵26 分钟前
用 Tkinter 实现一个罗马数字转整数的简单工具
后端·python
MC皮蛋侠客1 小时前
Ruff 完全指南:下一代 Python Linter 与 Formatter
python
happylifetree2 小时前
Python014-第二章13.数据容器-tuple案例
python
茉莉玫瑰花茶2 小时前
LangGraph 其他核心能力 [ 3 ]
python·ai
AI玫瑰助手2 小时前
Python函数:递归函数的定义与阶乘案例实现
开发语言·python·信息可视化
武子康2 小时前
调查研究-155 Open-LLM-VTuber 本地部署与互动实战指南
人工智能·python·深度学习·ai·数字人
北漂人Java2 小时前
Pycharm配置Miniconda教程
python·pycharm
CTA量化套保3 小时前
量化程序 while True 一直跑 CPU 很高:天勤降频与字段过滤
python·区块链
copyer_xyf3 小时前
Python 内存分析:从栈和堆理解对象引用
前端·后端·python