As text becomes more and more valuable form of unstructured data, there's been more and more attention paid to a natural language processing. Text can provide, of course, valuable signals about markets and about business decisions. For example, online reviews can tell us a lot about a product, they can tell us a lot about customers. Online chatter discussion can tell us a little bit about financial market activity. Lots of applications of how unstructured text can tell us something of predictive value for business. Texts can be used to make predictions, but we first have to convert text into features. We have to look at the text and figure out what's important about the text to make predictions or to make decisions. Lots of candidates when we think about converting text into different features. This includes sentiment, spelling, number of words used in the text. How we do this is we first take the text and pre-process it to prepare it for analysis. There's a number of things we can do here in terms of just correcting issues with say, whitespace or extra spaces or moving punctuation, and so on. Then we basically take the text and identify what it is about the texts that might be important for making predictions in the future. A simplest example of a feature and texts is just a word. For instance, we might look at which words appear in different text and use that to predict outcomes. For an example, like an online review, we might look at particular words that have meaning for making predictions about anything from product sales to repeat purchases, to whether or not a review is deemed helpful or not. This is up to us to choose what those words might be, how they're presented. It could be sentimental words, positive, negative words. It could be words about the product. If it's a camera, for instance, it might be something about Storage or it might be something about the type of format it uses. Lots of words that we can trigger on or identify that we can use to make a prediction based on the language in the text. Instead of single words, we can also branch out a little bit and use Mohr's more complex features. We can use combinations of words. We can use groups of words like two to three words grouped together. We can also construct overall measures of things like sentiment. Sentiment analysis is one of the most common examples of extracting or creating a feature from texts. This is basically describing whether the word somebody uses in a piece of text, anything, again, from an online review to a tweet, to a Facebook post. Sentiment analysis is going to say something about whether the language used and one of those pieces of text means that somebody is feeling more positive about what they're talking about or more negative about what they're talking about. Other ways to map sentiment in a way that can map to larger sets and emotions, not just positive and negative, maybe fear, maybe anger, things of that nature. We have these features and we take the text and we have these features like sentiment, like what types of words were used. We could also say, think about the length of a online review as a feature, we could think about the spelling of the quality of the grammar used in a online review. These features, once they're extracted from the texts, then allow us to predict outcomes. Sentiment, for instance, could predict buying behavior. Then that's one way in which natural language language is going to be used in a machine-learning algorithms. We take the language, we create the features, and then we use that for prediction. Deep-learning gives us even more flexibility because it can start to combine the textContent and richer ways are more meaningful ways than we might be limited to one hand coding these different features. Deep-learning gives us even more flexibility, but conceptually it works in much the same way. Some examples, Let's talk about examples like news articles or breaking news and stock price movements. What you might do to think about taking or creating an algorithm that starts with breaking news and generates information or predictions about stock price. Imagine we have a database of news articles or breaking news. We can then generate features from the news articles, things like sentiments, things like words that are appearing in the news, perhaps names that are appearing in the news, names of countries or political leaders. The label to be predicted is maybe the stock movement for a given time units. To make this more precise, maybe we're looking at news articles for a particular firm or organization. We have breaking news. We're going to think about the news that's covering that firm. We can start to generate features that indicate positivity towards the firm or maybe something about a new product release, innovation or patent. Then the labeled to be predicted is the stock movement for that firm for a given time unit. We have this training data now, we have a lot of data on features extracted from the language, from the news covering that firm. We have the training labels, which is what the stock was doing for that firm as that news was breaking. We can use that to train the model. The model is then going to learn how the language used to refer to that firm in the news might be affecting or these predicting how stock prices moving. We'll use that with training data, we'll set aside some test data to make sure that the model is performing accurately. Once we had the model setup in a way that is working well on the test dataset. We can then deploy that as a prediction model using Breaking news to predict what a firm's stock price is going to do. That's one type of application using text, using natural language processing to make predictions. Another common application for natural language processing instead of prediction is taking texts or taking language and putting that into groups or topics. This is an example of what's called unsupervised learning. We're not trying to predict a label or a class or category. We're basically trying to take large bodies of text and put them into different groups or topics. Topic modeling as a term used to refer to one approach which takes documents and classifies them by content in a way that makes them easier to interpret. If you had a large database of text messages or emails that were just about different topics. Could think about using topic modeling to take maybe a million messages and putting them into five or 10 categories or topics that can then be used to better understand how to make decisions based on those topics. The topic model will basically tell you about how these documents should be grouped together in a way that makes it easier to take action on them from a business perspective. An example of this approach, going back to our news example, is imagine we have lots and lots of incoming breaking news in all types of topics, articles from all different agencies. We want to take these thousands and thousands of news articles that are coming in each day and classify them into areas like business, tech, science, or entertainment. That's kind of classification obviously makes it much easier for a consumers to navigate and find topics or articles that are of interest to them. This is an example of topic modeling or unsupervised learning. Taking large amounts of unstructured data and using natural language processing to put these unstructured data into a smaller number of topics that we can act upon in a more convenient way from a consumer perspective or from a business decision perspective.