Book Image

Machine Learning Techniques for Text

By : Nikos Tsourakis
Book Image

Machine Learning Techniques for Text

By: Nikos Tsourakis

Overview of this book

With the ever-increasing demand for machine learning and programming professionals, it's prime time to invest in the field. This book will help you in this endeavor, focusing specifically on text data and human language by steering a middle path among the various textbooks that present complicated theoretical concepts or focus disproportionately on Python code. A good metaphor this work builds upon is the relationship between an experienced craftsperson and their trainee. Based on the current problem, the former picks a tool from the toolbox, explains its utility, and puts it into action. This approach will help you to identify at least one practical use for each method or technique presented. The content unfolds in ten chapters, each discussing one specific case study. For this reason, the book is solution-oriented. It's accompanied by Python code in the form of Jupyter notebooks to help you obtain hands-on experience. A recurring pattern in the chapters of this book is helping you get some intuition on the data and then implement and contrast various solutions. By the end of this book, you'll be able to understand and apply various techniques with Python for text preprocessing, text representation, dimensionality reduction, machine learning, language modeling, visualization, and evaluation.
Table of Contents (13 chapters)

Understanding CNN

A convolutional neural network (CNN or ConvNet) is a category of neural network. It can include one or more convolutional layers capable of efficiently processing spatial patterns in data with a grid-like topology. Therefore, CNNs find extensive utility in image-processing applications that work with two-dimensional image data. The layers are arranged in such a way as to detect simpler or more complex patterns.

For example, in an image classification task, the first layers can identify simpler features such as lines and arcs. In contrast, the layers, further along, can detect patterns such as part of a face or an object. So, a CNN made of a single layer can only learn low-level features, and in typical applications, we stack more than one. The plot in Figure 8.14 illustrates this process:

Figure 8.14 – Stacking convolutional layers

Each convolutional layer of the network includes a set of kernels, also known as filters, that aim...