Cognitive Services

The Cognitive Services extension provides more images, sounds, and knowledge functions for sprites, which allows you to have more fun with sprite programming.

Add "Cognitive Services"

(1) Click the Sprites tab and click + extension at the bottom of the Blocks area.

(2) In the Extension center dialog box that appears, click + Add at the bottom of Cognitive Services.

(3) On the editing page, Cognitive Services blocks are displayed.

Use "Cognitive Services" Blocks

Try to use the Cognitive Services blocks. Create a project and program Panda to recognize your happy emotion.

(1) Drag the Events block when green flag clicked to the Scripts area, and then drag the Cognitive Services block recognize emotion after ( ) seconds to the Scripts area. After the programming, Panda recognizes your emotion two seconds after you click the green flag.

(2) Let's make Panda react to your happy emotion. Drag the Control block if ( ) then ( ) and the Operators block ( ) > ( ) to the Scripts area, drag the block happiness value onto the Operators block, and enter the number 10 on the Operators block. In this way, Panda recognizes that you are happy when the value is greater than 10.

(3) Let's make Panda say "You are happy!" when it recognizes that you are happy. We need to add the Looks block say ( ) for ( ) seconds.

(4) Now, execute the script. When you click the green flag, the recognition window is displayed, and Panda recognizes your emotion in two seconds. The recognition result is displayed on the stage. The value 50 indicates that you are happy, and Panda says "You are happy!"

results matching ""

    No results matching ""