concept speech in category python

This is an excerpt from Manning's book Natural Language Processing in Action: Understanding, analyzing, and generating text with Python.
We focus entirely on English text documents and messages, not spoken statements. We bypass the conversion of spoken statements into text—speech recognition, or speech to text (STT). We also ignore speech generation or text to speech, converting text back into some human-sounding voice utterance. But you can still use what you learn to build a voice interface or virtual assistant like Siri or Alexa, because speech-to-text and text-to-speech libraries are freely available. Android and iOS mobile operating systems provide high quality speech recognition and generation APIs, and there are Python packages to accomplish similar functionality on a laptop or server.
Information extraction is used to find statements and information that you might want your chatbot to have “on the tip of its tongue.” Information extraction can be accomplished beforehand to populate a knowledge base of facts. Alternatively, the required statements and information can be found on-demand, when the chatbot is asked a question or a search engine is queried. When a knowledge base is built ahead of time, the data structure can be optimized to facilitate faster queries within larger domains of knowledge. A prebuilt knowledge base enables the chatbot to respond quickly to questions about a wider range of information. If information is retrieved in real-time, as the chatbot is being queried, this is often called “search.” Google and other search engines combine these two techniques, querying a knowledge graph (knowledge base) and falling back to text search if the necessary facts aren’t found. Many of the natural language grammar rules you learned in school can be encoded in a formal grammar designed to operate on words or symbols representing parts of speech. And the English language can be thought of as the words and grammar rules that make up the language. Or you can think of it as the set of all the possible things you could say that would be recognized as valid statements by an English language speaker.
POS tagging can be accomplished with language models that contain dictionaries of words with all their possible parts of speech. They can then be trained on properly tagged sentences to recognize the parts of speech in new sentences with other words from that dictionary. NLTK and spaCy both implement POS tagging functions. You’ll use spaCy here because it’s faster and more accurate. See the following listing.

This is an excerpt from Manning's book Hello App Inventor!: Android programming for kids and the rest of us.
You could enhance the app by having it play some sad music as you give your excuse—maybe it will sway your teachers. You could also have the text-to-speech component speak the excuse (we guarantee it will sound more plausible than you—because it won’t snicker or laugh).
What is the difference between text to speech and speech to text?
![]()
User/programmer
App Inventor
Need to be online?
Text to speech Inputs text Speaks aloud Nope Speech to text Speaks aloud Uses Google Voice to convert to text Yessir In recent years speech recognition has improved a great deal, but it still isn’t perfect. Text to speech is more reliable and effective but still has some funny quirks, such as mispronouncing words. Technical words are often mispronounced—for example, megapixel is pronounced “maygaypixel.” You’ll also have problems with Roman numerals: King George V is pronounced “King George Vee” by text to speech. But speech to text and text to speech both have the potential to allow you to produce some fun apps, so let’s give them a go.
The possibilities presented by text to speech are massive, from creating apps for visually impaired people to including spoken words in a game. The most basic example would be text added to a button so that when the user clicks the button, the text is read aloud. But text can be input by the user, too, or received via an SMS text from someone contacting the user, and automatically read aloud.