Back to Course

아이들을 위한 인공 지능

0% Complete
0/0 Steps
  1. 시작하기
    수업 1: 인공 지능 소개
    3 Topics
    |
    1 Quiz
  2. 수업 2: PictoBlox 소개
    3 Topics
    |
    1 Quiz
  3. 인공 지능
    수업 3: 컴퓨터 비전
    6 Topics
    |
    1 Quiz
  4. 수업 4: 얼굴 인식
    4 Topics
    |
    1 Quiz
  5. 수업 5: 광학 문자 인식
    3 Topics
    |
    1 Quiz
  6. 수업 6: 음성 인식
    3 Topics
    |
    1 Quiz
  7. 머신러닝
    수업 7: 머신 러닝
    7 Topics
    |
    1 Quiz
  8. 수업 8: AI를 이용한 가위바위보 - 1부
    3 Topics
  9. 수업 9: AI를 이용한 가위바위보 - 2부
    2 Topics
  10. 수업 10: 포즈 분류자
    4 Topics
  11. AI의 윤리
    수업 11: 윤리
    2 Topics
  12. 캡스톤 프로젝트
    수업 12: 캡스톤 프로젝트
Lesson 6, Topic 3
In Progress

활동: 나만의 Alexa 만들기

Lesson Progress
0% Complete

In this project, we will make our own personal assistant like Alexa.

We will be making a script that will recognize our voice command and analyze it to play the Mario theme song or the Spider-Man theme song. If the command is not recognized, it will say that it didn’t understand the command.

Let’s start.

Setting Up the Stage

Download the songs from here:

  1. Spider-Man: https://ql.reallyai.net/wp-content/uploads/2022/02/Spiderman.mp3
  2. Mario: https://ql.reallyai.net/wp-content/uploads/2022/02/Mario.mp3

Once you open the link:

Follow the steps to set up the Stage:

  1. Switch to the Sounds tab and select Upload Sound from the bottom left corner.
    Choose Sound
  2. Select the two sounds downloaded, and open the sounds.
  3. Delete the Grunt sound from the library.
  4. Switch to Code Tab.

In this project, we will also use the Text to Speech extension to respond to the user. To add it, click the Add extension button and add the Text to Speech extension.

Text to Speech

Speech Recognition

  1. Add a when flag clicked block into the scripting area.
  2. Snap a recognize speech for () s in () block below the when flag clicked block. Change the time to 4 seconds.
    Alexa 1
  3. Now, snap an if () else block below the recognize speech for () seconds block.
  4. In the condition of the if () else block, add a () contains ()? block from the Operators palette. In the first argument, add a speech recognition result block, and in the second write “mario“. So, if the decoded text contains the word Mario, it will execute the if branch blocks.
  5. Add a speak () block from Text to Speech palette under the if arm and write the message “Playing Mario Song!“.
  6. Next, a snap play sound () until done block below the speak () block and select Mario. This is how the script looks:
    Alexa 2
  7. Duplicate the if () else block and snap it under the else arm.
  8. Change “mario” to “spiderman” in the condition of the if arm.
  9. Change the message in the speak block to “Playing Spiderman Song!“.
  10. Change the sound to Spiderman.
    Alexa 3
  11.  Finally, under the else arm, add a speak () block and write “Sorry, I am unable to understand the command“.

The script is complete. It will look like this:Alexa 4 Click the green flag to start the script.

Assignment

Before you move on to the next lesson, a small assignment awaits you!

You must upload the PictoBlox program you wrote in this activity to the website.

Submitting the assignment is a must in order to receive the certificate after completing the course.

Follow the steps below to upload your assignment:

  1. Click Choose File.
  2. Select the image from the pop-up window that opens up.
  3. Once the image is selected, click Upload Assignment.
evive Alert
The file type allowed is the SB3 file generated from the PictoBlox program. The maximum file size allowed is 15 MB.

Good luck!