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

相关推荐
bst@微胖子几秒前
PyTorch深度学习框架项目合集一
人工智能·pytorch·python
Boxsc_midnight14 分钟前
【vLLM服务器并发能力测试程序】写一个python小程序来进行并发测试
服务器·python·vllm
深蓝电商API18 分钟前
爬虫日志分析:快速定位被封原因
爬虫·python
weixin1997010801632 分钟前
海外淘宝商品详情页前端性能优化实战
大数据·前端·python
深蓝海拓1 小时前
PySide6的QTimeLine详解
笔记·python·qt·学习·pyqt
纯.Pure_Jin(g)1 小时前
【Python练习四】Python 算法与进阶特性实战:数组、序列化与位运算专项练习(3道经典练习带你巩固基础——看完包会)
开发语言·vscode·python
龙山云仓1 小时前
No152:AI中国故事-对话祖冲之——圆周率与AI精度:数学直觉与极限探索
大数据·开发语言·人工智能·python·机器学习
琅琊榜首20201 小时前
AI+Python实操指南:用编程赋能高质量网络小说创作
开发语言·人工智能·python
Faker66363aaa1 小时前
基于YOLO13-C3k2-Strip的神经退行性疾病MRI影像自动识别
python
Dxy12393102162 小时前
Python 将 JSON 字符串转换为字典
前端·python·json