Summarize the following text in less than 50 words. Let's think step by step: a brief history of speech to text + how it actually works the computer is listening... or rather, it's trying. hello from the snowy western us! i spoke this sentence to the computer, and it turned it into this text using speech to text. let's dive in speech to text, also known as automatic speech recognition (asr), is the task of taking human speech and turning it into computer text. thanks for reading mythical ai! subscribe for free to receive new posts and support my work. 'talking to the computer' is a classic item in science fiction, and humans have been working on machines that can understand human speech for over 70 years. amazingly, the dream of star trek has become real, with speech-to-text software progressing from buggy research projects, to high-end expensive software, to everywhere, included for free on every phone and computer. progress from the first speech to text system in 1952 has not been linear, and new ai methods are making speech to text faster, cheaper, and more available than ever before. i had to break this email into two, because there is just so much to learn and talk about! in today's episode we will cover: a brief history of speech to text how speech to text actually works in part 2 (read it here), we covered how to actually use speech to text with: 3 of the best speech to text apps 9 open source speech to text models you can build into products for free 9 paid apis if you don't want to fuss with installing software let's start by jumping back to the 1950's. a brief history of speech to text 1950's computers were huge, slow, and expensive in the 50's. in 1951 the univac 1, the first commercial computer to attract widespread public attention, was created by presper eckert and john mauchly. the univac 1 used 5,200 vacuum tubes and weighed 29,000 pounds. eventually, 46 univac 1s were sold at more than $1 million each. the next year in 1952, bell laboratories created the "audrey" system. audrey was the first known and documented speech recognizer. audrey could recognize strings of spoken digits if the user paused in between. it also took up a large portion of a room with its racks and processing units. it has accuracy rates of up to 90% if the user trained it, but dropped to 70-80% for users it didn't recognize. audrey's purpose was to help toll operators connect more phone calls, but the high cost and inability to recognize a wide array of voices meant it failed its commercial use case. 1960's in 1962 ibm introduced "shoebox" which was a voice controlled calculator. it understood and responded to 16 words in english, numbers and operators, and could do simple math calculations by feeding the numbers and operators (add, subtract) it recognized to an external adding machine which would print the response. shoebox was operated by a microphone converting voice sounds into electrical impulses which were classified according to various types and acted on. there were other speech to text efforts in the us, the uk, and the soviet union. but all these early systems were based on matching individual words against stored voice patterns which was difficult and expensive. 1970's meaningful advancements in speech to text happened in the 1970s. in 1971, the us department of defense's research agency darpa funded five years of a speech understanding research program, with the goal being a creation of a system with a minimum vocabulary of 1,000 words. ibm, carnegie mellon university, and stanford took part in the darpa program. the program was one of the largest in the history of speech recognition. and it resulted in harpy, the most advanced speech to text system of the time. carnegie mellon's "harpy' speech system was capable of understanding over 1,000 words, which is about a three-year-old's vocabulary. harpy was the first speech to text system that used a language model to determine which sequences of words made sense together which reduced errors. 1980's the '80s saw speech recognition vocabulary go from harpy's 1,000 words to several thousand words. in the mid 1984 ibm built a voice activated typewriter dubbed tangora, capable of handling a 20,000-word vocabulary. ibm's jump in performance was based on a hidden markov model. the hidden markov model estimated the probability of the unknown sounds actually being words, instead of just matching words to sound patterns. the method predicts the most likely words which follow a given word. for example "this charming gentleman" is statistically more likely to be a phrase than "this charming pineapple". like all the systems before, each speaker had to individually train the typewriter to recognize his or her voice, and use discrete dictation, meaning the user had to pause after every word. still, tangora represented the very best and most expensive speech to text system of that time. on the other end of the spectrum, very primitive speech recognition systems continued to get cheaper, showing up in novelty use cases. in 1987, the doll julie by worlds of wonder, could recognize specific words like 'play' or 'hungry'. 1990's in the 1990's speech recognition moved out of research projects and novelty uses and into business use cases. the rise of the personal computer continued to propel speech recognition forward. this decade was the real start of an entire speech recognition industry with companies like nuance, and speechworks joining belllabs, ibm, and dragon. in 1990, dragon released the first consumer speech recognition product, dragon dictate, which cost a stunning $9,000. on the corporate side, bellsouth introduced the voice portal (val) in 1996. the first dial-in interactive voice recognition system, this system gave birth to the (often hated) phone tree systems that are still used today. faster processors and larger storage mediums helped increase speech to text capabilities and in 1997, dragon released dragon naturallyspeaking, the first continuous speech recognition product that didn't require users to pause after every word. accuracy continued to improve, but all the systems still required each user to train the system, and speech recognition as a whole acquired a jaded reputation as being 'not good enough' for normal usage. 2000's by the year 2001, speech recognition technology had achieved close to 80% accuracy but progress was slow until google arrived with the launch of voice search. 1-800-goog-411 was a free phone information service that google launched in april 2007. it worked just like 411 information services had for yearsusers could call the number and ask for a phone book lookupbut google offered it for free. they could do this because no humans were involved in the lookup process, the 411 service was powered by voice recognition and a reverse text-to-speech engine. google's breakthrough was to use cloud computing to process the data instead of processing it on a device. this meant the app had massive amounts of computing power at its disposal instead of a single computer, and google was able to run large-scale data analysis for matches between the user's words and the huge number of human-speech examples it had amassed from billions of search queries. this allowed speech to text models to understand any user, without the user having to train the system on their voice specifically. google put this service into the google voice search app for iphone in 2008. biggest data sets, more computing power, and using neural networks started to improve accuracy rates and decrease costs. 2010's the 2010's were the decade of voice assistants. in 2010, voice actions launched on android market and allowed users to issue voice commands to their phone. apple launched siri in 2011. amazon released alexa, and microsoft released cortana in 2014. google home came out in 2016. large tech companies continued to work on research projects and new models which achieved ever-increasing accuracy rates. in 2016 ibm had the top mark with a word error rate of 6.9 percent. in 2017 microsoft beat ibm with a 5.9 percent claim. ibm quickly improved its rate to 5.5 percent. with increasing accuracy and failing costs, many commercial speech to text apis came out (more about those in part 2). google released their speech-to-text v1 api in 2017, and amazon launched amazon transcribe the same year. the deep learning (bigger neural networks) era for speech-to-text started in 2017 when baidu introduced the deepspeech paper. in 2017, mozilla created an open-source implementation of the baidu paper and released mozilla deepspeech as open-source. 2020's deep learning and machine learning techniques continue to decrease the cost, and increase the capability of speech to text. openai made a stir when it released whisper as open source in 2022. other models perform more accurately in certain contexts, whisper can recognize and convert 99 different languages to english text, and can recognize different speakers and give timecodes of the resulting text. now, let's open up the box and see how speech to text systems work. how speech to text works there are three main steps in a speech to text process. record analog speech into a digital audio file breaks the digital audio down, into individual sounds or chunks uses algorithms and models to find the most probable words from those chunks and outputs those words in text format. so to complete step 1, we need to capture a pressure wave. step 1 - record digital audio a sound is a vibration or pressure wave that moves through a transmission medium such as a gas, liquid, or solid. the transmission medium is usually air. to digitally record the sound, a computer captures how much pressure there is over time. the measurement of pressure is taken thousands of times a second. for good-quality audio, 44,100 samples are taken every second. if you look at it as a graph, the pressure of the wave is the y axis, and the sample timing is the x axis. recording audio into a digital format doesn't require ai. we have had digital audio for a while now with digital recording pioneered in japan by nhk and nippon columbia in the 1960s. once we have the digital sound files, we need to process them to separate them into usable chunks. step 2 - break down audio into individual sound chunks digital audio files are just a bunch of binary numbers (011010101010110001), which represent the characteristics of the pressure wave at different points in time. to turn audio into sound chunks, the system implements a frequency analysis. speech to text systems often filter the audio to distinguish the relevant sounds from the background or other noise. one way to analyze the audio is to visualize the audio file by using a log mel spectrogram. a spectrogram is a visual representation of the characteristics of the sound, as it varies with time. a common format for a spectrogram is a graph with two dimensions: one x axis represents time, and the other y axis represents frequency; a third dimension indicating the amplitude (energy or loudness) of a particular frequency at a particular time is represented by the brightness or color. you can also visualize the amplitude by using 3d height of each point in the image. the system then looks at these images of the audio and separates the audio into chunks. this can be done by modeling the spectrogram mathematically as a waveform frequency vector. this is one number that represents the information contained in that chunk of audio data. by comparing the various vectors of different chunks, the system can accurately separate the audio into hundredths or thousandths of seconds pieces, and each chunk is then matched to a sound or phoneme. a phoneme is a unit of sound that distinguishes one word from another in any given language. for example, there are approximately 44 sounds or phonemes in the english language. an example of a phoneme is phoneme 37 which is written in symbol form as 'a'. phoneme 37 is the ow, ou, ough, sound, like in 'now, shout, bough'. phonemes are used in speech-to-text systems because they represent the smallest unit of sound in a language. in contrast, letters represent written symbols, not necessarily sounds. in many languages, the same letter can represent different sounds or combinations of sounds. for example, the letter "c" can be pronounced differently in the words "cat," "cent," and "cello." this variability makes it more difficult to accurately transcribe spoken words into text using letters alone, so we use the more specific and accurate phoneme. when we speak, we produce a pressure wave vibration which is composed of a sequence of phonemes that form words and sentences. our system has captured the pressure wave, visualized the sounds, and separated them into a sequence of phonemes. now we need to figure out what words are created by the sequence of phonemes. for this, we need to use math. step 3 - use algorithms and models to find the most probable words from the sounds this sequence of phonemes or sounds, is then run through an ai model that matches the pieces of words to sentences, words, and phrases. it makes predictions what the correct text is, and outputs the text. ai uses the order, combination, and context of these phonemes to figure out what the speech is saying. for example, 'eight', and 'ate' are made up of the same three phonemes: /et/. by looking at the phonemes that surround it, the ai can figure out which word you actually meant. this is the hardest step in speech to text. the reason is humans talk very differently, and mean the same thing. more than text, speech sounds vary greatly based on regional dialects, speed, emphasis, even social class, and gender. this is why all the early speech to text systems had to be trained to each individual speaker and suffered more errors. humans will mean the same thing, but make sounds at different speeds, leave out certain sounds, slur, chop and stutter. background noise can hide or cover certain sounds. the location of the microphone to the user's vocal cords can change the sounds. dragon software still has entire help articles about how to place your microphone. let's use an example. since phoneme symbols are difficult to write and recognize, (what does /et/ even mean) let's use letters. you are playing the role of ai. you have been given a digital audio file and are requested to output the text it contains. we visualize the audio using a spectogram, and then break that audio file down into different sound chunks. the sequence of sounds is: 'totoihaveafeelingwerenotinkansasanymore'. what would you predict the text would be? if you predicted 'toto, i have a feeling we're not in kansas anymore.' congratulations, you are an effective speech to text ai. :) however, that example is the best, easiest example. speech audio can vary in quality. maybe there was background noise which muddied the audio. our system might have misidentified several sounds or phonemes. now the sequence looks like: 'totoayehaveaelingwherenotinkkansasanymore' the next difficulty level is our speaker has a different accent and way of saying certain words. the sequence of sounds now is this: 'totohiveafelingwhirnotinkkansasanymore' the early speech to text systems struggled because they tried to match one audio chunk to one sound. if the sounds didn't match, they didn't know what was said. they might have taken our example, diligently tried to match it, and come up with 'toto hive feeling whir not ink ansas anymore' this is where statistics comes to our aid. instead of just trying to match audio to sounds, the system would also predicts what the sounds are, and what sounds could or should be there. this is exactly why we need machine learning. (if you don't understand the term machine learning, might i suggest your read this article then come back) if a human were trying to write logic to take 'totohiveafelingwhirenotinkkansasanymore' and convert it to the correct text, they would have to write thousands or millions of rules. an example rule could be: rule 134: if the sound sequence 'where' is followed by the sound sequence 'not' there is a 70% chance the correct text is 'we are' instead of 'where'. this quickly becomes a mess of millions of conflicting rules. instead, we give the neural network tons of examples of human speech, labeled with the correct text output, and then train the machine. the machine learns what rules and logic to apply to predict the correct output. we can think of machine learning as helping in two ways. a neural model is trained to predict the text from speech, or a phonetic transcriber, and the second neural network is a language model, trained to predict text from preceding text. basically a spelling and grammar checker. of course, to train these models, the models need to know how well they are doing. so we need to answer the question how are speech to text models evaluated? there are a lot of metrics that assess speech to text model performance. some commonly used metrics for evaluating models include: word error rate (wer): wer measures the percentage of words that are incorrectly recognized by the system. a lower wer indicates better performance. perplexity: perplexity measures how well the stt model can predict the likelihood of the next word in a sequence based on the previous words. a lower perplexity indicates better performance. word confusion networks (wcns): wcns are graphical representations of the stt output that show the possible interpretations of a spoken word based on the acoustic input. evaluating the accuracy of wcns can help identify areas where the stt model may be struggling to correctly interpret speech. these metrics are often used in various combinations. let's look closer at the word error rate. wer compares the generated text, with the correct human-labeled text. wer counts the number of incorrect words and divides the sum by the total number of words provided in the human-labeled transcript (n). incorrectly identified words fall into three categories: insertion (i): words that are incorrectly added to the generated text deletion (d): words that are missing in the generated text substitution (s): words that were substituted between labeled and generated text here's an example that shows 3 incorrectly identified words, when compared to the human-labeled transcript: the formula to calculate wer is to take the 3 types of incorrect words, add them up, and divide by the total number of words. let's use our wizard of oz example. the human labeled phrase of 'toto, i have a feeling we're not in kansas anymore.' has 10 words. if the speech to text generated the text 'toto, i have a feeling we're knot in kansas anymore.' we have 1 incorrect word, a substitution from 'not' to 'knot'. 1/10 = 0.1 * 100 = 10%. 4.7% accuracy is considered closer to human level accuracy, so our system has work to do. speech to text is progressing rapidly it is amazing how far speech to text has come. what used to cost millions of dollars to develop is now available as free and open source. transcribing minutes of footage costs less than a dollar and almost any application or use case where turning speech into text can be valuable, can now accomplish it. i remember distinctly my sister training dragon software. she has a learning disability and can't type well. my parents bought her the software and the microphone, and she would sit for hours reading prompts, and correcting the software when it got it wrong. now you can press a button in google docs and without training on your voice, google docs is better than her program ever was (and it's free). now we need to use this amazing technology! we will look at some amazing ai tools, go through the various open source libraries you can use to build your own products, and cover the leading companies and apis providing speech to text services your business can use. sources https://huggingface.co/tasks/automatic-speech-recognition https://blog.deepgram.com/benchmarking-top-open-source-speech-models/ https://slator.com/how-big-a-deal-is-whisper-for-asr-multilingual-transcription/ https://www1.icsi.berkeley.edu/pubs/speech/audreytosiri12.pdf https://medium.com/ibm-watson-speech-services/how-to-properly-evaluate-speech-to-text-engines-c90fa902667f https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-custom-speech-evaluate-data?pivots=speech-studio https://computerhistory.org/blog/audrey-alexa-hal-and-more/ https://www.bbc.com/future/article/20170214-the-machines-that-learned-to-listen https://www.timetoast.com/timelines/the-history-of-voice-recognition https://www.knowledgenile.com/blogs/what-are-some-of-the-best-open-source-speech-recognition-software/ https://huggingface.co/spaces/evaluate-metric/wer https://picovoice.ai/blog/top-transcription-engines/ https://medium.com/descript/a-brief-history-of-asr-automatic-speech-recognition-b8f338d4c0e5 https://blog.deepgram.com/the-trouble-with-wer/ https://careers.google.com/stories/how-one-team-turned-the-dream-of-speech-recognition-into-a-reality/ thanks for reading mythical ai! subscribe for free to receive new posts and support my work.