New to Dream to Learn? Check out our Quick Start guide!  

1COMMENTS1RECOMMENDS

Build your own HARRY POTTER Sorting Hat (basic version)

48
POSTED IN: Building Bridges from R to IBM Watson

Build your own #STEM Harry Potter Sorting Hat! Happy Halloween 2016! 

 

A few folks have asked about building a Harry Potter sorting hat similar to the one we built last year -> so I created a 4-day (bite size pieces) - project to create a simpler version of the hackathon model we built.  The intent is to have something #STEM accessible - that mom or dad could do with kids.  Modular, so you can do any/all of the pieces.

PROJECT STATUS: CT 2nd - Midway through Part 3 / Day 3 - hope to complete full blog by Friday Oct 7th.  (But Day 1 and Day 2 are ready to roll!)

 

 

 

 

Project Overview - #STEM #SortingHat - Four Days of Fun

 

CODE REPO:

https://github.com/rustyoldrake/Harry_Potter_Sorting_Hat_Simple

 

 

 

DAY 1 - HAT HARDWARE AND ELECTRICAL TEST
CHASSIS:

below are just examples of AMAZON gear - heaps of other options:

 

LED INTENSITY:

NOT REQUIRED - But if curious - For math to calculate LED Current - see: https://www.sparkfun.com/tutorials/219 - you can measure the Voltage Drop across each LED - will vary, but you can assume about 2V, so the resistor Voltage drop will be about 3 volts, or a bit less, divided by 220 ohms gives you current.   - http://electronics.stackexchange.com/questions/131076/how-to-calculate-current-going-through-an-led 20mA is a good rule of thumb. 

 

WIRING:

 

 

CODE AND ELECTRICAL TEST:

 

 

 

 

 

DAY 2 - BRAINS: NATURAL LANGUAGE CLASSIFIER (IBM Watson API)
 

FIRING UP A FRESH NLC (Natural Language Classifier) ON BLUEMIX

 

UPLOAD GROUND_TRUTH.CSV TO TRAIN NLC to be a smart sorting Hat:

 

WAIT WHILE IT TRAINS (~30m)

BE PATIENT!  this can take 20-30+ minutes depending on complexity of Ground Truth;  IBM Watson is using some sophisticated technology under the covers to build out the classifier model. 

CHECK STATUS: while it's training - if you care to query it with CURL - you'll get back a list of CLASSIFIERS - and then if you ask for STATUS of the specific classifier - you will see this: (while it's Training)

"{\n  \"classifier_id\" : \"2d7ac0x100-nlc-3406\",\n  \"name\" : \"harry_potter_NLC\",\n  \"language\" : \"en\",\n  \"created\" : \"2016-09-29T05:19:46.230Z\",\n  \"url\" : \"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/2d7ac0x100-nlc-3406\",\n  \"status\" : \"Training\",\n  \"status_description\" : \"The classifier instance is in its training phase, not yet ready to accept classify requests\"\n}"

WHEN READY - this changes to

"{\n  \"classifier_id\" : \"2d7ac0x100-nlc-3406\",\n  \"name\" : \"harry_potter_NLC\",\n  \"language\" : \"en\",\n  \"created\" : \"2016-09-29T05:19:46.230Z\",\n  \"url\" : \"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/2d7ac0x100-nlc-3406\",\n  \"status\" : \"Available\",\n  \"status_description\" : \"The classifier instance is now available and is ready to take classifier requests.\"\n}"

 

READY!

 

 

TEST MODEL

(later - for the 'learning' in ML, errors can be captured and ground truth updated)

 

GOOF AROUND - PASTE WIKIPEDIA INTROS (like Stephen Hawking)

 

 

 

 

 

DAY 3 - SPEECH AND CONVERSATION (Optional)

 

 

#Intents and @Entities then a DIALOG Tree - Example

 

Text to Speech (Hat talks back) + R interface to Conversation Service

 

 

 

DAY 4 - SYSTEM INTEGRATION AND TESTING

Section Title

 

 

 

 

 

 

 

 

 

Interested in more content by this author?

Before you can comment, you need to sign-up or login

responded September 2016

Very neat!

About the Author

Ryan Anderson

Ryan Anderson

Hi! I like to play with data, analytics and hack around with robots and gadgets in my garage. Lately I've been learning about machine learning.

About this blog

This is an informal blog that explores tools, code and tricks that group members have developed to engage IBM Watson cognitive computing services - from the R Programming Language. Packages include RCURL to access Watson APIs - for services that include Natural Language Classifier and Speech to Text. THIS IS MY PERSONAL BLOG - it does not represent the views of my employer. Code is presented as 'use at your own risk' (it has lots of bugs)

Created: September 13, 2015

English

Up Next