tatt为多个语音到文本(stt)服务创建了一个统一的api。

tatt的Python项目详细描述


转录所有内容™

tatt是一个用于创建和管理语音文本转换的cli。

demo

安装

pip install tatt

依赖关系

  1. 要转录的录音。
  2. a)一个aws帐户或b)一个带有语音对文本api和 已启用云存储。
  3. ffmpeg对于某些操作,但是tatt将在需要时通知您。

用法

列出所有命令

$ transcribe --help

Usage: transcribe [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  get        Downloads and/or saves completed transcript.
  languages
  list       Lists available STT services.
  services   Lists available speech-to-text services.
  status     Check the status of a transcription job.
  this       Sends a media file to be transcribed.

列出所有STT服务

$ transcribe services

Here are all the available speech-to-text services:

  amazon		$0.006 per 15 seconds
  google		$0.009 per 15 seconds

获取转录的内容

$ transcribe this <path_to_media_file> <service_name>

Okay, transcribing <path_to_media_file> using <service_name>...
Okay, job <job_name> is being transcribed.  Use "get" command to download it.

$ transcribe this --help

Usage: transcribe this [OPTIONS] MEDIA_FILEPATH SERVICE_NAME

Sends a media file to be transcribed.

Options:
  --punctuation                   only for Google Speech, defaults to True
  --speaker-id / --no-speaker-id  only for google and amazon, defaults to True
  --num_speakers INTEGER          only for google and amazon, defaults to 2
  --model TEXT                    only for Google Speech, defaults to
                                  "phone_call"
  --use-enhanced                  only for Google Speech, defaults to True
  --language-code TEXT            only for google and amazon, defaults to en-
                                  US
  --help                          Show this message and exit.

列出成绩单

$ transcribe list

Service Job Name                                Status
------- --------                                ------
amazon  tester.mp3                              IN_PROGRESS
amazon  messed_up.mp4                           FAILED
amazon  done_test.mp3                           COMPLETED
amazon  also_done.MP3                           COMPLETED
google  hey_there.mp3                           COMPLETED


$ transcribe list <job_name>

Service Job Name                                Status
------- --------                                ------
amazon  <job_name>                              IN_PROGRESS

获取完整的成绩单

$ transcribe get <job_name> # prints to stdout

{'accountId': '416321668733',
 'jobName': 'a1bace5e-8b08-4ce4-b08c-834a23aafcf1',
 'results': {'items': [{'alternatives': [{'confidence': '0.9774',
                                          'content': 'Hi'}],
                        'end_time': '1.5',
                        'start_time': '1.23',
                        'type': 'pronunciation'},
                       {'alternatives': [{'confidence': '0.9429',
                                          'content': 'is'}],
                        'end_time': '1.71',
                        'start_time': '1.5',
                        'type': 'pronunciation'},
                       ...

$ transcribe get --save <job_name>

Saved transcript to <job_name>.json

支持的服务

计划

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动应用程序:JNLP错误   java根据用户输入在PreparedStatement中使用setTime()或setNull()   java EJB与同步   java以object为键通过hashmap进行搜索   java中的模10^9+7   针对包含其他对象的对象的java OOP最佳实践   如何将字符串作为HTML代码从Java文件读取到JSP页面?   java我的POM怎么了?“解析表达式..检测到递归表达式循环”   用于Hbase的Mapreduce的java NoSuchMethodError   JAVAlang.SecurityException:权限拒绝:启动意图{act=安卓.Intent.action.MAIN cat=[安卓.Intent.category.LAUNCHER]   数组初始化谜语Java   通过arraylist搜索时的java句柄关联