cnn来进行文本分类_使用CNN进行文本分类

本文介绍了如何利用卷积神经网络(CNN)进行文本分类。内容来源于一篇翻译文章,探讨了在自然语言处理(NLP)领域中,CNN如何应用于文本理解与分类任务。
摘要由CSDN通过智能技术生成

cnn来进行文本分类

In this article, we are going to do text classification on IMDB data-set using Convolutional Neural Networks(CNN). We will go through the basics of Convolutional Neural Networks and how it can be used with text for classification.

在本文中,我们将使用卷积神经网络(CNN)对IMDB数据集进行文本分类。 我们将介绍卷积神经网络的基础知识,以及如何将其与文本一起用于分类。

  • Basics of Convolutional Neural Networks

    卷积神经网络的基础
  • How to use CNN for text classification?

    如何使用CNN进行文本分类?
  • Code Demonstration

    代码示范

卷积神经网络 (Convolutional Neural Networks)

Let’s first understand the term neural networks. In a neural network, where neurons are fed inputs which then neurons consider the weighted sum over them and pass it by an activation function and passes out the output to next neuron.

首先让我们了解神经网络一词。 在神经网络中,向神经元输入输入,然后神经元考虑它们的加权和,并通过激活函数传递加权和,然后将输出传递给下一个神经元。

Image for post

Now, a convolutional neural network is different from that of a neural network because it operates over a volume of inputs.

现在,卷积神经网络不同于神经网络,因为它在大量输入上运行。

Each layer tries to find a pattern or useful information of the data.

每一层都试图找到数据的模式或有用信息。

An example of multi-channel input is that of an image where the pixels are the input vector and RGB are the 3 input channels representing channel.

多通道输入的示例是图像的图像,其中像素是输入向量,RGB是表示通道的3个输入通道。

Image for post

This is what the architecture of a CNN normally looks like. It will be different depending on the task and data-set we work on. There are some terms in the architecutre of a convolutional neural networks that we need to understand before proceeding with our task of text classification.

这就是CNN的架构通常看起来像的样子。 根据我们处理的任务和数据集,它会有所不同。 在进行文本分类任务之前,我们需要了解卷积神经网络的架构中的一些术语。

Convolution: It is a mathematical combination of two relationships to produce a third relationship. Joins two sets of information.

卷积 :这是两个关系的数学组合以产生第三个关系。 连接两组信息。

Convolution over input: We slide over input data the convolution to extract features by applying a filter/ kernel (both can be used interchangeably). This is important in feature extraction. There are some parameters associated with that sliding filter like how much input to take at once and by what extent should input be overlapped.

卷积过输入 :我们滑过输入数据的卷积来提取物通过应用滤波器/内核功能(二者可以互换使用)。 这对于特征提取很重要。 有一些与该滑动滤波器相关的参数,例如一次要输入多少个输入以及输入应该重叠到什么程度。

  • Stride: Size of the step filter moves every instance of time.

    步幅:步进过滤器的大小会移动每个时间实例。
  • Filter count: Number of filters we want to use.

    过滤器数量:我们要使用的过滤器数量。

When we are done applying the filter over input and have generated multiple feature maps, an activation function is passed over the output to provide a non-linear relationship for our output.

当我们完成将滤波器应用于输入并生成多个特征图时, 激活函数将传递到输出上,以为输出提供非线性关系。

An example of activation function can be ReLu.

激活功能的一个示例可以是ReLu。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值