All right. 1
Welcome back. 2
In this module, we're going to be building something really exciting. And in order to do it, we're leveraging 3
one of the newest APIs that has come out in the IOs 12 bag of goodies that we got from Apple. 4
And this is, of course, CoreML 2. Now, CoreML 2 gives us access to the same machine learning framework 5
that's used across the Apple products including what they have inside Siri, inside the Camera, inside 6
Photos. 7
And it basically allows you to utilize all of the hard work that Apple has put into their own machine 8
learning models and place this directly inside your own apps. 9
Now, the part of this that I was most excited about is that they've now included inside CoreML 2 10
a Natural Language processing framework. 11
So this allows you to analyze text and speech and use machine learning models to understand what it 12
actually means. 13
So this is what we're going to be using. We're going to be creating our very own Natural Language processing 14
machine learning model and we're going to be training it up using Create ML, and then we're going 15
to be deploying it inside our very own app. 16
Now, what is this app going to do? 17
Well, recently, I was reading an article on Sentiment Analysis of Twitter Data for Predicting Stock Market 18
Movements. 19
And this was some research done at IIT and it's a really fascinating read, actually. I've included it 20
as a link in the Course Resources of this module 21
if you want to get some background info on the app that we're building. But, essentially, they looked at 22
whether if you can go onto Twitter and search for something like, say, @CocCola, and if you take a 23
look at the latest tweets that people have written about @CocaCola or trying to reply to Coca-Cola 24
or talking about Coca-Cola, then you get a gauge on how people feel about a particular company, 25
right? 26
So, for examplee, this tweet says, how, you know, the negative impact on dental health. Because Coca-Cola is 27
everywhere, so is diabetes. And this is an extremely negative view of Coca-Cola, right. Now if we create 28
a machine learning model that can read or scan through this text and understand that the same way that 29
humans do, such as you or I, being able to understand that this is a negative tweet. And having that negativity 30
associated with a particular company, a particular brand, then some research suggests that it can be able 31
to predict the stock market movements for that particular company. 32
Now, here's a big disclaimer. I am not a financial advisor. 33
I don't know anything about finance. 34
This is not financial advice at all. 35
So, now that we've gotten that over and done with, the interesting thing is is it possible for us to build 36
a machine learning model that can understand the sentiment or the emotions that are being expressed 37
in the text inside tweets, and then use that inside our app to be able to tap the pulse on Twitter of 38
how people feel about a certain company, a certain topic. 39
Now, by the end of this module, we would have built a very simple looking app, but it does some really 40
powerful stuff. 41
So I'll be able to put in a handle, for example. Let's see how people feel about at Apple. They feel kind 42
kind of meh, not so great. 43
We can also put in hashtags for certain stock symbols, so TWTR is the symbol for Twitter's stock. 44
So let's go ahead and put that in here and let's see how do people feel about Twitter Stock. 45
Pretty good. 46
Well, it looks-- 47
Yeah, it looks pretty good as well. 48
Now, what about something else? 49
What about Snapchat? 50
Less favorable. Or how do people feel about Tesla? 51
Equivocal. 52
So even though this app looks incredibly simple, but actually what it does is that whenever we put in 53
any search query in here, for example, Coca-Cola, 54
then it will go to Twitter, looking for tweets that have the handle Coca-Cola, 55
and then it will look at the latest 100 tweets that all mention it and it'll filter them by English 56
language. 57
So only look for the English language tweets. And once it has done that, it will run all hundred tweets 58
through a sentiment analysis, and it will determine whether if it's negative, positive, or neutral. And 59
it does that for each and every single tweet. 60
So then we end up with a hundred tweets that are either negative, positive, or neutral. And then we tally 61
up the scores. 62
So plus 1 for positive, minus 1, for negative, 0 for neutral. 63
And we get a score of how a particular handle or search term performs in terms of the tweets sentiment, 64
and then that gets interpreted as a particular emotion or sentiment. 65
The stronger the sentiment, the more extreme the emoticon. 66
So whereas a few years ago, there were companies charging millions for the ability to be able to analyze 67
Twitter data for sentiment and use it to predict things such as stock prices or voting polls. 68
We're going to do this with just a laptop, our knowledge of IOs development and CoreML 2 and 69
Create ML. 70
So I'm super excited about this module because it's actually a really, really fun thing to build. 71
So once you're ready, head over to the next lesson and we'll get started.