greenkey-asrtoolkit为自动语音识别(asr)文件转换和语料库组织提供了工具。
asrtoolkit的Python项目详细描述
Greenkey自动语音识别(ASR)工具包
greenkey asrtoolkit为文件转换和asr语料库组织提供了工具。它们旨在简化用于构建、定制和分析ASR模型的工作流,这对于科学家、工程师和其他语音识别技术人员非常有用。
支持的文件格式
文件格式在asrtoolkit/data_处理程序中具有特定于格式的处理程序。脚本convert_transcript
和wer
支持^{txt
和GreenKey ^{html
格式,但对于长期存储来说,这不应被视为一种稳定的格式,因为它会随时更改,恕不另行通知。
转换成绩单
usage: convert_transcript [-h] input_file output_file convert a single transcript from one text file format to another positional arguments: input_file input file output_file output file optional arguments: -h, --help show this help message and exit
此工具允许在上面列出的文件格式之间轻松转换。
注意:分析文件中不存在的段对象的属性保留其默认值
- 例如,为stm行的每一行创建
segment
对象 - 每一个都用以下未在stm文件中编码的默认值初始化:
formatted_text=''
;confidence=1.0
功率
usage: wer [-h] [--char-level] [--ignore-nsns] reference_file transcript_file Compares a reference and transcript file and calculates word error rate (WER) between these two files positional arguments: reference_file reference "truth" file transcript_file transcript possibly containing errors optional arguments: -h, --help show this help message and exit --char-level calculate character error rate instead of word error rate --ignore-nsns ignore non silence noises like um, uh, etc. This tool allows for easy comparison of reference and hypothesis transcripts in any format listed above.
清除格式
usage: clean_formatting.py [-h] files [files ...] cleans input *.txt files and outputs *_cleaned.txt positional arguments: files list of input files optional arguments: -h, --help show this help message and exit
这个脚本标准化了缩写、数字和其他格式化文本的表示方式,以便asr引擎可以轻松地将这些文件用作培训或测试数据。标准化输出格式对于可重复测量ASR精度至关重要。
分割音频文件
usage: split_audio_file [-h] [--target-dir TARGET_DIR] audio_file transcript Split an audio file using valid segments from a transcript file. For this utility, transcript files must contain start/stop times. positional arguments: audio_file input audio file transcript transcript optional arguments: -h, --help show this help message and exit --target-dir TARGET_DIR Path to target directory
准备音频语料库
usage: prepare_audio_corpora [-h] [--target-dir TARGET_DIR] corpora [corpora ...] Copy and organize specified corpora into a target directory. Training, testing, and development sets will be created automatically if not already defined. positional arguments: corpora Name of one or more directories in directory this script is run optional arguments: -h, --help show this help message and exit --target-dir TARGET_DIR Path to target directory
此脚本为成对的stm和sph文件筛选目录列表。如果存在train
、test
和dev
文件夹,则这些标签将用于输出文件夹。默认情况下,将创建“input data”的目标目录。注意,带有连字符的文件名将被清除为下划线,音频文件将被强制为单通道、16 kHz、带符号的pcm格式。如果有两个频道,则只使用第一个。
降级音频文件
usage: degrade_audio_file input_file1.wav input_file2.wav Degrade audio files to 8 kHz format similar to G711 codec
此脚本降低了输入音频文件的音频质量,以便声学模型可以使用G711编解码器从电话中学习功能。
提取excel电子表格
注意,使用此函数需要单独安装pandas
。这可以通过pip install pandas
完成。
usage: extract_excel_spreadsheets.py [-h] [--input-folder INPUT_FOLDER] [--output-corpus OUTPUT_CORPUS] convert a folder of excel spreadsheets to a corpus of text files optional arguments: -h, --help show this help message and exit --input-folder INPUT_FOLDER input folder of excel spreadsheets ending in .xls or .xlsx --output-corpus OUTPUT_CORPUS output folder for storing text corpus
要求
- python>;=3.5与
pip
贡献
行为准则
请务必阅读并遵守我们的Code of Conduct。
拉取请求过程
- 叉开它
- 创建功能分支(
git checkout -b feature/fooBar
) - 提交更改(
git commit -am 'Add some fooBar'
) - 推到分支(
git push origin feature/fooBar
) - 创建新的拉取请求
作者
许可证
版权所有2019 Greenkey Technologies
此存储库中的代码分布在Apache License, Version 2.0下。