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

相关推荐
长行2 小时前
Python|Windows 安装 DeepSpeed 安装方法及报错 Unable to pre-compile async_io 处理
windows·python·deepspeed
百锦再2 小时前
python之路并不一马平川:带你踩坑Pandas
开发语言·python·pandas·pip·requests·tools·mircro
Python之栈2 小时前
5款拖拽式Python GUI生成器助你快速打造炫酷界面
python
灏瀚星空2 小时前
基于 Python 与 GitHub,打造个人专属本地化思维导图工具全流程方案(上)
开发语言·人工智能·经验分享·笔记·python·个人开发·visual studio
用什么都重名2 小时前
「实战指南」使用 Python 调用大模型(LLM)
python·大模型·llm·api调用
是Dream呀2 小时前
Python从0到100(一百):基于Transformer的时序数据建模与实现详解
开发语言·python·transformer
资源存储库2 小时前
【笔记】如何修改一个conda环境的python版本?
笔记·python·conda
xcLeigh2 小时前
AI的提示词专栏:Prompt 与 Python Pandas 的结合使用指南
人工智能·python·ai·prompt·提示词
草莓熊Lotso2 小时前
Python 入门超详细指南:环境搭建 + 核心优势 + 应用场景(零基础友好)
运维·开发语言·人工智能·python·深度学习·学习·pycharm
正在走向自律2 小时前
ksycopg2实战:Python连接KingbaseES数据库的完整指南
数据库·python·国产数据库·kingbase·kingbasees·数据库平替用金仓·ksycopg2