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

相关推荐
yangshicong20 分钟前
第11章:结构化输出与数据提取 —— 让 AI 直接返回你想要的数据格式
数据库·人工智能·redis·python·langchain·ai编程
言之。32 分钟前
【Python】免费的中文 AI 配音方案
开发语言·人工智能·python
Warson_L35 分钟前
python dict key详解
python
天天进步20151 小时前
Python全栈项目:从零手操一个高性能 API 网关
开发语言·python
安生生申2 小时前
使用pygame实现2048
开发语言·python·pygame
徐图图不糊涂3 小时前
搭建简易版的Rag系统
python·pycharm
灰灰勇闯IT3 小时前
pyasc:用 Python 调用 CANN 的推理能力
开发语言·python
明月_清风4 小时前
FastAPI 从入门到实战:3 分钟构建高性能异步 API
后端·python·fastapi
bellus-4 小时前
ubuntu26测试win10的ollama大模型性能
python
水木流年追梦4 小时前
大模型入门-Reward 奖励模型训练
开发语言·python·算法·leetcode·正则表达式