{"id":2928,"date":"2023-12-19T03:29:00","date_gmt":"2023-12-19T08:29:00","guid":{"rendered":"https:\/\/www.both.org\/?p=2928"},"modified":"2023-12-18T11:30:01","modified_gmt":"2023-12-18T16:30:01","slug":"interview-hack-ai-saves-the-dayand-ears","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=2928","title":{"rendered":"Interview Hack: AI saves the day(and ears)"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"2928\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>I love interviews. It\u2019s a great way to get to know a person and it\u2019s often a great way to learn. One of the most challenging aspects of interviews was capturing exactly what the subject had to say. I have used my mobile phone to capture a subject\u2019s voice. I have also used Audacity. In both cases, I am left to transcribe that content into written form. Now, the paradigm is changing with the advent of Whisper, which is an openly licensed program developed by OpenAI. OpenAI\u2019s website introducing Whisper states, \u201cWhisper is an automatic speech recognition (ASR) system trained on 680,000 hours of multilingual and multitask supervised data collected from the web.\u201d<\/p>\n\n\n\n<p>It\u2019s amazing software and easy to install on Linux, which is my daily driver. I used&nbsp;Pop!_OS, but you can also easily install Whisper on Fedora-based distributions. You need to make sure that Python is installed and you can easily test that by entering the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$python3 --version<\/code><\/pre>\n\n\n\n<p>In my case the result was<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Python 3.10.6<\/code><\/pre>\n\n\n\n<p>Then install a Python virtual environment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install python3.10-venv<\/code><\/pre>\n\n\n\n<p>Next, you need to install Python pip3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install python3-pip<\/code><\/pre>\n\n\n\n<p>Initialize the Python virtual environment for Whisper with<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$python3 -m venv whisper<\/code><\/pre>\n\n\n\n<p>I changed into the \u2018whisper\u2019 directory with<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$cd whisper<\/code><\/pre>\n\n\n\n<p>Finally, I installed \u2018whisper\u2019 with<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pip3 install whisper<\/code><\/pre>\n\n\n\n<p>I am ready to use this amazing new tool to transcribe mp3 and mp4 files into easily readable text. If you don\u2019t have any and you would like to try out Whisper you can point your web browser at&nbsp;<a href=\"https:\/\/librivox.org\/\">Librivox<\/a>&nbsp;and download a free book or part of one. I chose Robert Frost\u2019s \u2018Mending Wall\u2019<\/p>\n\n\n\n<p>I can use \u2018whisper\u2019 from the command line to convert the mending wall mp3 to text<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ whisper 04_mending_wall_frost_bc.mp3 --model base<\/code><\/pre>\n\n\n\n<p>In a little over a minute \u2018whisper\u2019 has converted the \u2018mp3\u2019 to text that can easily be read. The conversion outputs 5 files. One of them is a text file with the text of the \u2018mp3\u2019. Here are the first few lines taken from 04_mending_wall_frost_bc.mp3.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u201cMending Wall by Robert Frost, read for libravox.org by Becky Crackle, November 16, 2006, Canal Winchester, Ohio. Something there is that doesn\u2019t love a wall that sends the frozen groundswell under it and spills the upper boulders in the sun, and makes gaps even too can pass abreast. The work of hunters is another thing. I have come after them and made repair where they have left not one stone on a stone, but they would have the rabbit out of hiding to please the yelping dogs.\u201d<\/p>\n<\/blockquote>\n\n\n\n<p>As you can see the results are accurate. You can create a Python script to automate the process.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$import whisper\nmodel = whisper.load_model(\u201cbase\u201d)\nresult = model.transcribe(\u201c04_mending_wall_frost_bc.mp3\u201d) print(result&#91;\u201ctext\u201d])<\/code><\/pre>\n\n\n\n<p>Using the Python script provides a much cleaner output.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u201cMending Wall by Robert Frost, read for Librevox.org by Becky Crackle, November 16th, 2006, Canal Winchester, Ohio. Something there is that doesn\u2019t love a wall that sends the frozen groundswell under it and spills the upper boulders in the sun, and makes gaps even too can pass abreast. The work of hunters is another thing. I have come after them and made repair where they have left not one stone on a stone, but they would have the rabbit out of hiding to please the yelping dogs. The gaps I mean, no one has seen them made or heard them made, but at spring-mending time we find them there. I let my neighbor know beyond the hill, and on a day we meet to walk the line and set the wall between us once again. \u201d<\/p>\n<\/blockquote>\n\n\n\n<p>Whisper has an&nbsp;<a href=\"https:\/\/github.com\/openai\/whisper\/blob\/main\/LICENSE\">MIT license<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love interviews. It&rsquo;s a great way to get to know a person and it&rsquo;s often a great<\/p>\n","protected":false},"author":32,"featured_media":2936,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[98,5],"tags":[123,124,122],"class_list":["post-2928","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-linux","tag-ai","tag-interviews","tag-whisper"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2928"}],"version-history":[{"count":3,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2928\/revisions"}],"predecessor-version":[{"id":2935,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2928\/revisions\/2935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2936"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}