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