CNN text classification method combined with multi-head self-attention mechanism

A text classification and attention technology, applied in neural learning methods, semantic analysis, computer components, etc., can solve problems such as excessive calculation, poor classification performance, and limited applications

Pending Publication Date: 2020-06-09
上海勃池信息技术有限公司
View PDF6 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

At present, text classification based on deep learning mostly uses RNN, CNN and Transformer models, among which RNN and Transformer can learn the global semantic information of text, but due to the large amount of calculation, the application is limited
CNN has a small amount of calculation and is con...

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • CNN text classification method combined with multi-head self-attention mechanism
  • CNN text classification method combined with multi-head self-attention mechanism
  • CNN text classification method combined with multi-head self-attention mechanism

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] Text classification is a common downstream application of NLP. The CNN model has incomparable advantages in the application of text classification due to its small amount of calculation and the characteristics of easy parallel acceleration. However, due to the limited convolution kernel width, the CNN model cannot Learning global semantic information of text leads to limited classification performance.

[0031] The present invention proposes a CNN text classification method combined with a multi-head self-attention mechanism. The CNN model obtains feature input including global semantic information through the self-attention mechanism, and improves the classification performance of the CNN model on the premise of ensuring a low amount of calculation.

[0032] The technical solutions of the present invention will be further described below in combination with specific implementation methods and accompanying drawings. figure 1 Show that the present invention provides a ki...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a CNN text classification method combined with a multi-head self-attention mechanism, and the method comprises the steps: obtaining a word segmentation sequence of a to-be-classified text, and carrying out the filtering of special symbols and stop words; querying a preset or randomly initialized word embedding model to obtain an embedding matrix of the word segmentation sequence, wherein each line of the matrix is an embedding vector of each segmented word; for each row vector of the obtained embedded matrix, superposing the position coding vector of the word segmentation corresponding to the vector; generating a self-attention matrix for the embedded matrix after superposition position coding through a self-attention mechanism; repeating the generation of the self-attention matrix for a plurality of times, and splicing the plurality of generated matrixes on the dimension of the column; multiplying the self-attention matrix after word sequence splicing by the weighting matrix to realize dimensionality reduction and fusion; and inputting the dimensionality-reduced and fused self-attention matrix into a CNN for training or prediction.

Description

【Technical field】 [0001] The present invention relates to a CNN text classification method combined with a multi-head self-attention mechanism, and in particular, one or more embodiments relate to the technical field of natural language processing (NLP). 【Background technique】 [0002] Text classification is one of the common downstream tasks in NLP. Deep learning algorithms are widely used in text classification and have excellent performance. At present, text classification based on deep learning mostly uses RNN, CNN and Transformer models. Among them, RNN and Transformer can learn the global semantic information of text, but due to the large amount of calculation, the application is limited. CNN has a small amount of calculation and is convenient for parallel acceleration. It has incomparable advantages in industrial applications. However, due to the limitation of the width of the receptive field, it can only learn local semantic information of the text, and its classific...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F40/289G06F40/30G06N3/04G06N3/08G06K9/62
CPCG06N3/08G06N3/045G06F18/24
Inventor 刘星辰陈晓峰麻沁甜
Owner 上海勃池信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products