Table of Contents

speech recognition result

Description

The function reports the last text detected from the speech.

Speech Recognition

Example

Speech Recognition
The example demonstrates how to make smart home automation for light control using NLP and Speech Recognition.

Script

Output

Read More
Discover a unique experience in a Synonym/antonyms World, where the combined powers of Speech Recognition and ChatGPT Extension.

Introduction

Hey! Welcome to the fascinating realm of “Synonym/Antonym World,” where the powers of Speech Recognition and ChatGPT converge. Immerse yourself in an innovative platform that not only recognizes your speech but also provides an extensive collection of synonyms and antonyms for any given word. With this powerful combination, you can effortlessly expand your vocabulary, explore alternative expressions, and delve into the nuances of language. Unleash the potential of speech recognition and ChatGPT as you navigate through a world where words find their perfect counterparts. Get ready to unlock new dimensions of linguistic exploration in the captivating Synonym/Antonym World!

Code

Logic

  1. Open PictoBlox and create a new file.
  2. Choose a suitable coding environment for Block-based coding.
  3. We create an instance of the Speech recognition.This class allows us to convert spoken audio into text.
  4. Next, we create an instance of the ChatGPT model called gpt. ChatGPT is a language model that can generate human-like text responses based on the input it receives. 
  5. Recognize speech for 5 seconds using recognize speech for ()s in the () block.
  6. Save the recognized result in the “input” variable.
  7. Use the “get(synonyms) of ()” function to obtain synonyms of the recognized speech result.
  8. ChatGPT will provide the answers for 10 response synonyms in the “Synonym World” based on the given input.
  9. Use the “get(antonyms) of ()” function to obtain antonyms of the recognized speech result.
  10. The output of the anonymous word of the given input will be displayed by the sprite.
  11. Click on the green flag to run the code.

Output

Read More
Experience an interactive chatbox where you can specify the tone of AI responses. Ask questions or share thoughts on various topics, and receive personalized answers.

Introduction

In this interactive chatbox experience, the user has the freedom to specify the tone in which they would like the AI to respond. The tone can be anything they prefer: Normal, sarcastic, Friend that suits their preference.

Once the user has selected a particular tone, they can provide their input or ask a question. Based on their input, the AI will generate a response that aligns with the chosen tone. This allows for the creation of a conversational atmosphere similar to real-life interactions.

Users are encouraged to ask any question or share their thoughts on various topics. They can also engage in discussions or seek assistance with the information they need. The AI is there to facilitate a meaningful conversation and provide helpful responses based on the tone chosen by the user.

So, the user is requested to let the AI know the specific tone they would like it to adopt, and then they are free to ask any question they have in mind. The AI is here to provide a personalized and engaging chat experience!

Code

Logic

  1. Open PictoBlox and create a new file.
  2. Choose a suitable coding environment for Block-based coding.
  3. We create an instance of the Speech recognition.This class allows us to convert spoken audio into text.
  4. Next, we create an instance of the ChatGPT model called gpt. ChatGPT is a language model that can generate human-like text responses based on the input it receives. 
  5. We create an instance of the Text to Speech.This class allows us to speak the output.
  6. Use the “recognize speech” block to capture the user’s speech for a duration of 5 seconds.
  7. First, ask the user which format they prefer for the answer: normal, sarcastic, or friendly
  8. If the user requests a normal response, the ChatGPT extension will generate feedback in normal mode.
  9. If the user requests a sarcastic response, ChatGPT will generate a sarcastic answer.
  10. If the user requests a friendly response, ChatGPT will generate a friendly answer. Additionally, Sprite will speak the answer.
  11. The “speak” block, which utilizes the text-to-speech recognition extension, will vocalize the answer to the asked question.

In summary, we can describe it as a chatbox that provides answers in three different ways based on the user’s mood and entertainment preferences. When a question is asked, it will respond accordingly.

Output

Read More
This project demonstrates how to create a voice-controlled smart plug using natural language processing (NLP), speech recognition, and a relay.

This project demonstrates how to create a voicecontrolled smart plug using natural language processing (NLP), speech recognition, and a relay.

Text Classifier in PictoBlox

We will use the PictoBlox Machine Learning environment for creating the text classifier.

Follow the steps to create the model:

  1. Open PictoBlox and the Machine Learning Environment.
  2. Click on Open Project and add import the following project file: Alexa
  3. Find the Alexa project in the list and open it to get the workspace of the text classifier.
  4. There will be 2 classes Lights On and Lights Off. Each class has some phases added corresponding to the action. You can add a few phases yourself.
  5. Click on Train Model to train the model.
  6. Once trained, you can check the model in the Testing tab. Add a phase and check if it provides the right sentiment.
    Note: If the model is not giving the desired results, then add more phases until the model is good.
  7. Click on the Export Model to create the blocks for the project.
  8. Test the block with some input text.

Circuit

The bulb is connected to the smart plug which is controlled with a relay.

Note:  A relay is an electromechanical switch that is used to turn on or turn off a circuit by using a small amount of power to operate an electromagnet to open or close a switch.

If the relay is ON, the smart switch gets ON, turning on the light. The relay has the following connections:

  1. GND Pin connected to GND of the Quarky Expansion Board.
  2. VCC Pin connected to VCC of the Quarky Expansion Board.
  3. Signal Pin connected to Servo 4 of the Quarky Expansion Board.

Code

The logic is the following – The Speech Recognition extension converts speech to text, which is then fed into the text classifier block. The text classifier block provides sentiment information, which is used to control the light via the relay.

Output

Read More
All articles loaded
No more articles to load