Text classification with spaCy and Keras
Let’s look at how to use spaCy with deep-learning libraries like TensorFlow and Keras.
We'll cover the following...
In this lesson, we will learn about methods for blending spaCy with neural networks using another very popular Python deep learning library, TensorFlow, and its high-level API, Keras.
Deep learning is a broad family of machine learning algorithms that are based on neural networks. Neural networks are human brain-inspired algorithms that contain connected layers, which are made from neurons. Each neuron is a mathematical operation that takes its input, multiplies it by its weights, and then passes the sum through the activation function to the other neurons. The following diagram shows a neural network architecture with three layers—the input layer, hidden layer, and output layer:
TensorFlow is an end-to-end open source platform for machine learning. TensorFlow might be the most popular deep learning library among research engineers and scientists. It has huge community support and great documentation, available here.
Keras is a high-level deep learning API that can run on top of popular machine learning libraries such as TensorFlow, Theano, and CNTK. Keras is very popular in the research and development world because it supports rapid prototyping and provides a user-friendly API to neural network architectures.
TensorFlow 2 introduced great changes in machine learning methods by tightly integrating with Keras and providing a high-level API, tf.keras
. TensorFlow 1 was a bit ugly with symbolic graph computations and other low-level computations. With TensorFlow 2, developers can take advantage of Keras' user-friendliness as well as TensorFlow's low-level methods.
Neural networks are commonly used for computer vision and NLP tasks, including object detection, image classification, and scene understanding, as well as text classification, POS tagging, text summarization, and natural language generation.
Next, we'll go through the details of a neural network architecture for text classification implemented with tf.keras
. We'll be using TensorFlow 2. Let's warm up to neural networks with some neural network ...