bff v2ex

by Rafael Belchior

通过拉斐尔·贝尔基奥尔(Rafael Belchior)

语音备忘录的BFF-如何通过Machine Learning简化Speech2Text (The voice memo’s BFF — how to make Speech2Text easy with Machine Learning)

Do you think recording voice memos is inconvenient because you have to transcribe them? Do you waste your precious voice memos because you never write them down? Do you feel like you are not unlocking the full potential of what you record?

您是否认为录制语音备忘录很不方便,因为您必须转录它们? 您是否因为从未写下来而浪费了宝贵的语音备忘录? 您是否觉得自己没有释放录制内容的全部潜力?

Yeah, that sucks. ?

是的,太烂了。 ?

I’m a Computer Science masters student. As I think that all work and no play makes me a dull boy, I’ve decided to invest some time in doing something different. Where? In the student’s group to which I belong, by interviewing a professor.

我是计算机科学的硕士生。 由于我认为所有工作和没有玩耍会使我变得乏味,所以我决定花一些时间做一些不同的事情。 哪里? 在我所属的学生小组中 , 通过采访一位教授。

I’ve talked to professor Rui Henriques, a teacher assistant @ Técnico Lisboa and researcher @ INESC-ID. He is an expert in Data Mining and Bioinformatics. The 20 minutes interview turned into almost a full hour conversation.

我已经与Rui Henriques教授,TécnicoLisboa的助教和INESC-ID的研究员进行了交谈。 他是数据挖掘和生物信息学方面的专家。 20分钟的采访变成了几乎一个小时的谈话。

Rui is not only a brilliant academic but also a very honest, cheerful and easy going person, which made it very easy. I learned a lot while talking to him, and I’m sure you also can. The interview will be online soon enough. ?

芮不仅是一位出色的学者,而且还是一个非常诚实,开朗和随和的人,这使他变得非常容易。 与他交谈时,我学到了很多东西,我相信你也可以。 采访将很快上线。 ?

Anyway, I had a problem and a need. I wanted to save time by not having to transcribe the whole interview. The idea was to invest only twenty to sixty minutes in order to skyrocket performance when it comes to transcribing. This is not limited to interviews, of course. You can transcribe audio notes taken from several sources like classes, writing notes, thoughts, your shopping list, or your most philosophical pieces.

无论如何,我有一个问题和需求。 我想节省时间,而不必抄写整个采访。 这个想法是只花20到60分钟就可以使转录性能飞速增长。 当然,这不仅限于采访。 您可以抄录来自多个来源的音频笔记,例如课堂,写作笔记,想法,购物清单或最有哲理的作品。

那么,我们该怎么做呢? (So, how do we do that?)

I’m also lecturing on It Infrastructure Management and Administration @ Técnico Lisboa. In classes, we have used Google Cloud Engine. I remembered a service called Google Speech-To-Text, which we could use in this case. And no, Google is not paying me to write this ?

我也在讲授IT 基础设施管理和管理 @ TécnicoLisboa 。 在课堂上,我们使用了Google Cloud Engine。 我记得一个叫做Google Speech-To-Text的服务 ,我们可以在这种情况下使用它。 不, 谷歌不付钱给我写这个吗?

So, how to turn an interview of 55 minutes into easily editable text? How to reduce our efforts and focus on what matters? ?

那么,如何将55分钟的采访变成容易编辑的文字? 如何减少我们的精力并专注于重要的事情? ?

? By the way, to make the most out of this method, please cut noise and try to record with a loud, clear voice. ?

? 顺便说一句,要充分利用此方法,请降低噪音并尝试以清晰大声的声音进行录制。 ?

步骤1:安装所需的软件 (Step 1: Installing the required software)

I use Vagrant to manage virtual machines. The advantage is that to use the environment you need to instantiate the Speech-To-Text service. In this article, I show step by step how to configure these tools (read it up to the section “The Experiment”). If you prefer to do this on your local machine, go directly to the third step.

我使用Vagrant来管理虚拟机。 优点是要使用环境,您需要实例化语音转文本服务。 在本文中,我将逐步展示如何配置这些工具 (请阅读“实验”部分)。 如果您希望在本地计算机上执行此操作,请直接转到第三步。

步骤2:启动虚拟机 (Step 2: Start the virtual machine)

Now, open your console and run:

现在,打开控制台并运行:

$ vagrant up --provision && vagrant ssh

The virtual machine is booting, installing all the required dependencies. This may take a while.

虚拟机正在引导,并安装了所有必需的依赖项。 可能还要等一下。

Wait a bit. Done. Nice. Kudos to you ?

稍等一会。 做完了 真好 对您表示敬意?

步骤3:获取支持文件 (Step 3: Getting the support files)

Fork this repository containing the support files and then clone it to your computer. Put it in the folder that is being synced with your guest machine.

分叉包含支持文件的此存储库 ,然后将其克隆到您的计算机。 将其放在与您的访客计算机同步的文件夹中。

步骤4:在Google Cloud Engine建立帐户 (Step 4: Creating an account at Google Cloud Engine)

You can require a free grant ($300) for this experiment ? After creating the account, go to Google Console. Create a project. You can name it “easy-interview” if you are confident enough. You should see something like this:

您可以为此实验申请免费赠款($ 300)吗? 创建帐户后,转到Google控制台。 创建一个项目。 如果您有足够的信心,可以将其命名为“简易采访”。 您应该会看到以下内容:

After that, go to “APIs & Services”, in order to activate the API we need to get the job done.

之后,转到“ API和服务”,为了激活API,我们需要完成工作。

Click on “Create Credentials”. Choose “Cloud Speech API”. On “Are you planning to use this API with App Engine or Compute Engine?” say “No”. On step 2, “Create a service account” name the service “transcribing”. The role is Project => Owner. Key type: JSON.

点击“创建证书”。 选择“ Cloud Speech API”。 在“您打算将此API与App Engine或Compute Engine一起使用吗?” 说不”。 在步骤2中,“创建服务帐户”将服务命名为“转录”。 角色是项目=>所有者。 密钥类型:JSON。

By now, you should have downloaded a file called “file.txt”. It contains the credentials you need to use the service. Rename the file to “terraform-credentials.json”. Copy it to the folder containing the support files. As that folder is synced with your virtual machine, you will have access to those files from the guest machine. Now, run:

现在,您应该已经下载了一个名为“ file.txt”的文件。 它包含使用该服务所需的凭据。 将文件重命名为“ terraform-credentials.json”。 将其复制到包含支持文件的文件夹中。 由于该文件夹已与您的虚拟机同步,因此您将可以从来宾计算机访问这些文件。 现在,运行:

$ gcloud auth login

Follow the instructions. Authenticate yourself following the link that is shown. Now, analyze the request.json file:

按照说明进行操作。 按照显示的链接进行身份验证。 现在,分析request.json文件:

{  "config": {      "encoding":"FLAC",      "sampleRateHertz": 16000,      "languageCode": "en-US",      "enableWordTimeOffsets": false  },  "audio": {      "uri":"gs://cloud-samples-tests/speech/brooklyn.flac"  }}

Make sure to tune the parameters to fit your case. Beware that there are limitations on the encoding that you can use. If your file is in a different format than flac or wav, you will need to convert it. You can convert audio files with Audacity, a free, open-source audio software. After converting the audio, you have to upload it to Google Storage. For that, you have to create a bucket.

确保调整参数以适合您的情况。 请注意,可以使用的编码存在限制。 如果您的文件格式不同于flacwav ,则需要对其进行转换。 您可以使用免费的开源音频软件Audacity转换音频文件。 转换音频后,您必须将其上传到Google存储空间。 为此, 您必须创建一个bucket 。

The settings may be:

设置可能是:

After that, upload your file to the bucket. On the Bucket menu, you should be able to access the URI associated with your file. The format is gs://BUCKET/FILE.EXTENSION. Take that URI and replace it on the file my-request.json.

之后,将文件上传到存储桶。 在“存储桶”菜单上,您应该能够访问与文件关联的URI。 格式为gs://BUCKET/FILE.EXTENSION 。 使用该URI并将其替换在文件my-request.json上

Your file should look something like this:

您的文件应如下所示:

{  "config": {      "encoding":"FLAC",      "sampleRateHertz": 16000,      "languageCode": "pt-PT",      "enableWordTimeOffsets": false  },  "audio": {      "uri":"gs://easy-interview/interview.flac"  }}

Before we use the API, we need to load the credentials. Run the script load-credentials.sh to load them:

在使用API​​之前,我们需要加载凭据。 运行脚本load-credentials.sh加载它们:

$ source load-credentials.sh

This has set the GOOGLE_APPLICATION_CREDENTIAL environment variable. Next, to test if the connection is successful, run:

这已设置了GOOGLE_APPLICATION_CREDENTIAL环境变量。 接下来,要测试连接是否成功,请运行:

$ curl -s -H "Content-Type: application/json" \    -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \    https://speech.googleapis.com/v1/speech:recognize \    -d @test-request.json

You should be able to see a response with some transcribed text. Note that we ran test-request.json, which is just for testing purposes. Now, to make the call with your data, run:

您应该能够看到带有一些转录文本的回复。 请注意,我们运行了test-request.json,仅用于测试目的。 现在,要使用您的数据进行呼叫,请运行:

$ curl -s -H "Content-Type: application/json" \    -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \    https://speech.googleapis.com/v1/speech:longrunningrecognize \    -d @my-request.json >> name.out

If you run more name.out, you will see that the response contains a field called name. That name corresponds to the operation name that was created to meet the request. Now you have to wait a bit until the operation completes. Run (replace NAME with your operation’s name):

如果运行更多name.out,您将看到响应包含一个名为name的字段。 该名称对应于为满足请求而创建的操作名称。 现在,您需要稍等片刻,直到操作完成。 运行(用您的操作名称替换NAME):

$ curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \     -H "Content-Type: application/json; charset=utf-8" \     "https://speech.googleapis.com/v1/operations/NAME" >> result.out

While the operation doesn’t finish, your result.out will have a content similar to this:

当操作未完成时,您的result.out将具有类似于以下内容:

{ “name”: “8254262642733152416”, “metadata”: { “@type”: “type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata”, “progressPercent”: 33, “startTime”: “2018–12–08T01:15:08.969852Z”, “lastUpdateTime”: “2018–12–08T01:19:25.105683Z” }}

{“名称”:“ 8254262642733152416”,“元数据”:{“ @type ”:“ type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata”,“ progressPercent”:33,“ startTime”:“ 2018– 12–08T01:15:08.969852Z”,“ lastUpdateTime”:“ 2018–12–08T01:19:25.105683Z”}}

For a 60mb file, encoded with flac , it took about 12 minutes. You will have a file called results.out with your precious content. It will be in your host machine as well. I’ve written a very simple Python script that parses results.out. The script redirects the output to a file named results-parsed.out. To execute it, run:

对于使用flac编码的60mb文件,大约需要12分钟。 您将拥有一个名为results.out的文件,其中包含您的宝贵内容。 它也将在您的主机中。 我编写了一个非常简单的Python脚本来解析result.out。 该脚本将输出重定向到名为results-parsed.out的文件。 要执行它,运行:

$ python parse.py

If you don’t like the results, tune the parameters and try again.

如果您不喜欢结果,请调整参数,然后重试。

Enjoy your content! You are done ? To finish this experiment, exit the machine:

享受您的内容! 你做完了吗? 要完成此实验,请退出计算机:

$ gcemgmt: exit

Now, stop the virtual machine:

现在,停止虚拟机:

$ vagrant halt

Don’t forget to delete the files that you uploaded to Google Cloud.

不要忘记删除上传到Google Cloud的文件。

Well done!?

做得好!?

Well, this took me several hours to write, but at least I didn’t have to transcribe the whole interview. ?

好吧,这花了我几个小时来写,但是至少我不必抄写整个采访。 ?

底线 (Bottomline)

Firstly, I would ❤️to hear your opinion! Do you record lots of voice memos? Do you find this procedure useful? Do you have a different one?

首先,我会❤️听到您的意见! 您录制很多语音备忘录吗? 您觉得此程序有用吗? 您有其他人吗?

If you liked this article, please click the ? button on the left. Do you have a friend or family member that would benefit from this solution? Share this article!

如果您喜欢这篇文章 ,请单击“?”。 左边的按钮。 您有没有可以从该解决方案中受益的朋友或家人? 分享此文章!

Keep Rocking ?

继续摇摆吗?

Entrepreneurship ?

创业精神?

Top 8 lessons I’ve learned in European Innovation Academy 2017Imagine you are seeing the opportunity to improve yourself at every level. Would you take it?blog.startuppulse.net

我在2017年欧洲创新学院中学到的8课, 想象一下,您正在看到在各个层次上提高自己的机会。 你会接受吗? blog.startuppulse.net

DevOps101 ☄️

DevOps101☄️

DevOps101 — Improve Your Workflow! First Steps on VagrantAnd make clients and developers happier.hackernoon.comDevOps101 — Infrastructure as Code With VagrantAnd deploying a simple IT infrastructure (Two LAMP web servers and a client machine).hackernoon.com

DevOps101 —改善您的工作流程! 无家可归的第一步 使客户和开发人员更快乐。 hackernoon.com DevOps101-基础架构 随处 可见, 并部署了一个简单的IT基础架构(两个LAMP Web服务器和一个客户端计算机)。 hackernoon.com

Blockchain For Students ⛓️

学生区块链⛓️

Blockchain For Students 101 -The Basics (Part 1)Are you ready to dig deep into this life-changing technology?hackernoon.com

学生用区块链101-基础知识(第1部分) 您准备好深入研究这种改变生活的技术了吗? hackernoon.com

翻译自: https://www.freecodecamp.org/news/the-voice-memos-bff-speech-to-text-powered-by-machine-learning-1dbc7a6c65f1/

bff v2ex

bff v2ex_语音备忘录的BFF-如何通过Machine Learning简化Speech2Text相关推荐

  1. mobile还有人用吗 spring_话说,苹果手机语音备忘录功能还有人用吗?

    hi,各位,苹果手机自带的语音备忘录功能还有人在用吗? 前两天,有小伙伴在后台留言问:"苹果手机语音备忘录怎么恢复?" 小编一时还有些恍惚"它是什么,手机上有吗?&quo ...

  2. iphone手机备忘录迁移_如何在iPhone和iPad上使用语音备忘录

    iphone手机备忘录迁移 Whether you're recording a voice message as a reminder of that million dollar idea or ...

  3. 苹果手机语音备忘录在哪_苹果手机的录音功能在哪?教你快速开启,想录音太方便了...

    阅读本文前,请您先点击上面的"蓝色字体",再点击"关注",这样您就可以继续免费收到最新文章了.每天都有分享.完全是免费订阅,请放心关注.声明:图文来源于网络,版 ...

  4. 保护个人隐私,你需要这样设置 iPhone 的语音备忘录,禁用位置命名

    如果你使用 iPhone 内置的「语音备忘录」,所录制下来的音频文件将是以你所在的位置命名的.物理位置和时间相结合,极易泄露你的个人隐私信息.如果你想阻止每次「语音备忘当」使用你的位置信息做为文件名? ...

  5. 华为手机坏了数据怎么导出_苹果手机的语音备忘录怎么导出来?

    iPhone是美国苹果公司旗下的一款智能数字移动电话机,人们经常称他为苹果手机,它不但可以为用户提供良好的通话服务,还有很多辅助功能可供选择.语音备忘录就是一种比较实用的工具,苹果手机的语音备忘录怎么 ...

  6. 手机屏幕坏了怎么把数据导出来_苹果手机的语音备忘录怎么导出来?

    iPhone是美国苹果公司旗下的一款智能数字移动电话机,人们经常称他为苹果手机,它不但可以为用户提供良好的通话服务,还有很多辅助功能可供选择.语音备忘录就是一种比较实用的工具,苹果手机的语音备忘录怎么 ...

  7. iPhone苹果手机语音备忘录M4A文件损坏显示时长无法播放修复方法

    使用iPhone手机语音备忘录录了1个小时会议录音,但是手机播放不了,语音备忘录上有显示录音时长 ,但是点播放无响应.将录音导入电脑使用播放器,播放器提示:此文件无法播放.这可能是因为文件类型不受支持 ...

  8. 苹果语音备忘录怎么改名字_语音备忘录误删除怎么恢复?安利你个简单方法

    语音备忘录误删除怎么恢复?在苹果手机里,我们可以通过语音备忘录录音,能够被保留在手机上的数据都是很重要的,如果不小心删除了语音备忘录该怎么办?很多人误删除数据以后会觉得不知所措,有些人甚至认为删除的数 ...

  9. 苹果语音备忘录怎么改名字_苹果手机语音备忘录怎么恢复?教你在手机上直接操作...

    苹果手机语音备忘录怎么恢复?苹果手机自带的语音备忘录可以帮助我们录音,如果平常有需要记录的语音内容可以通过语音备忘录直接录制保存,使用非常方便. 不过很多手机用户表示自己偶尔会误删除手机里的语音备忘录 ...

最新文章

  1. ssh协议是osi_TCP/IP 协议模型
  2. 团队-象棋游戏-设计文档
  3. 得到弹出菜单QMenu的高度
  4. 博客会暂时停止一段时间
  5. Ubuntu学习——第一篇
  6. jquery_选择器
  7. 【软件工程】设计原则与设计模式
  8. 程序员要掌握的20个实用技巧
  9. C++——数的进制和数据间隔
  10. Mac/Linux 安装联邦学习 Fate 框架单机部署所需的依赖(填坑大全)
  11. python3一爬虫库url_python3爬虫之Urllib库(一)
  12. Linux操作系统的VI命令
  13. 【OpenGL】实例渲染示例——草地渲染
  14. 腹腰部肌肉锻炼(腰会变粗)
  15. 阿里云培训-OSS(对象存储)
  16. redis未授权访问
  17. 利用CyclicBarrier实现赛马游戏
  18. Inverse Fourier transform
  19. MySql数据库练习01
  20. java中文字符转换,Java中文字符转换拼音

热门文章

  1. MapReduce 中 UDF、UDAF、UDTF
  2. JavaWeb项目第三次总结_成绩查询的实现
  3. 中国剩余定理(孙子定理)的证明和c++求解
  4. VUE 监听当前路由 侦听器 watch
  5. php读取本地xlsx格式文件的数据并按json格式返回
  6. 最佳DevOps工具获奖者:CloudBees Jenkins平台
  7. 深入Java虚拟机之虚拟机体系结构
  8. linux下jdk简单配置记录
  9. BIZTALK项目中WEB引用WEBSERVICES服务时候报错
  10. ti的硬件时钟和系统时钟同步