It all starts at the beginning, having something to base our corona test on. As mentioned above, instead of looking to science for a solution, it's all going to be about the news and feelings.
To get the ball rolling, we fetch the most recent broadcast via News API. They provide an excellent example for fetching the latest headlines, using their handy API
After calling this endpoint with the keyword "corona", we receive a collection of twenty news articles, and because we'de like to use only a single one to determent the result, we pick one at random to be analysed.
This leaves us with the content of a corona headline, wich might be something like this;
Omicron may be less likely to cause long Covid than prior variants, study suggests...Dataflow - Feelings
To convert the gathered content into usable data, some AI magic is needed, queue sentiment analysis.
Sentiment analysis, also called 'opinion mining', uses natural language processing, text analysis and computational linguistics to identify and detect subjective information from the input text. This algorithm classifies each sentence in the input as very negative, negative, neutral, positive, or very positive.
This artificial intelligence is provided by DeepAI.org, in the shape of yet another impressive API. What's left is to feed the retrieved news content into the AI API. The AIs hard work then gets back to us in the shape of a list, looking very much like this:
[very positive, negative, very negative, neutral,...Dataflow - Making a Tally
To go from this dataset to a test result requires one more step: counting. We start with merging the five definitions (very positive, positive, neutral, negative, very negative) into three broader categories (neutral, positive and negative).
We add the total count of each broader category together, to get the total amount of tags received. This allows us to divide the count of negative emotions by the total amount of detected, giving us back the percentage of negative feelings over total feelings. A bit like this:
[very positive, negative, very negative, neutral]positive = 1negative = 2neutral = 1total = 4 (negative / total) *100(2 / 4) *100 = 50%
So, a 50% chance to have a positive test result. Overall this calculation means the more negative the news coverage, the higher the chance to get a positive result.
To do this all by hand would be too labour intensive, so instead, here's some python code to do the heavy lifting. It fetches the news article, retrieves the list from the opinion mining operation, makes a tally, rolls the dice and prints the result in console.
The Dodo - Digital SurgeryBecause of the recent extinction of the dodo we're forced to settle for an animatronic version.
This painting of a dodo by Roelan Savery is a beautiful bit of public domain and at the same time a fantastic starting point.
A bit of photoshopping is next. This bird has two moving parts, the head and wing. We separate these from the main body so we can attach servos to these later on.
We're also removing the wing and head from the main body, mostly to avoid a dodo with two heads and two wings...
All this selecting, cutting and blurring yields a nice printable file with all of the separated dodo parts. After carefully cutting you find yourself with a healthy pile of body part
The Dodo - AnimatronicsWith our pile ready, it's time to add some bones. Without some supports our feathered friend won't be able stand up, let alone flapper about. Gluing some thin metal bars to the back of the dodo does the trick, this supporting can however be done in many different ways.
Next up we make some small holes in the neck and belly, these serve as the attachment points for the head and wing. Now we can glue a lightweight servo(MG90s) behind each hole, with the servo head just poking out (see picture).
Attaching a servo cap on the back of the head/wing, and pushing them on the servos themselves completes the animatronics par
The Dodo - HardwareA Google AIY Voice Kit provides everything we need to give our beaked bestie a voice. It not only controles the head and wing servo, it also has a speaker attachment for audio, and provides the interface for a touch sensor.
This Adafruit CAP1188 touch sensor is the perfect COVID safe way to trigger the test. It can detect if a person comes near, and if so, activate it.
To tie it all together, we're adding a Raspberry Pi as nerve center. It will run everything we've done so far, and with an added power supply, the LiFePO4wered/Pi+ , it also features some much appreciated portability.
Building on the code from step 4, we add some control, timing and audio logic.
(Lego) PlantEveryone deserves a warm nest, so for ours a glas pitcher with some Silver inch plants is solid. Adding an afternoon of fun by building and arranging the LEGO flower bouquet set completes this bird's home turf.
Up and ReadyWith that we can proudly announce that an AI powered, news enabled, touch sensitive, dodo themed corona test is officially a thing
Comments