Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method of automatic text generation based on char-rnn model

An automatic generation and model technology, applied in the field of neural networks, can solve problems such as gradient disappearance and gradient explosion, and achieve the effect of avoiding errors and reducing word segmentation steps

Active Publication Date: 2021-06-29
GUANGZHOU UNIVERSITY
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, provide a method for automatic text generation based on the Char-RNN model, and solve the problem of gradient disappearance or gradient explosion that will occur when processing long sequence data

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
  • A method of automatic text generation based on char-rnn model
  • A method of automatic text generation based on char-rnn model
  • A method of automatic text generation based on char-rnn model

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0035] The main principle of the text automatic generation method based on the Char-RNN model of the present invention is: at first according to the text data provided as training sample data set, the text data in the data set is preprocessed to form the sample data for training (text is encoded , establish a mapping, letters are represented by one-hot vectors, and Chinese characters need to be added to the embedding layer); secondly, the processed training data is used as the input of the Char-RNN model for model training and output.

[0036] The Char-RNN, which is a character-level recurrent neural network, first came from The Unreasonable Effectiveness of Recurrent Neural Networks written by Andrej Karpathy. As we all know, RNN is very good at dealing with sequence problems. Sequence data has a strong correlation before and after, and RNN is reflected by sharing the weight and bias of each unit and cyclic calculation (the previously processed information will be used to proc...

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 method for automatically generating text based on a Char-RNN model, comprising the following steps: S1, acquiring text data meeting feature requirements; S2, modeling the text data, and using a vector matrix to represent letters or Chinese characters, get the training data; S3, input the training data batch by batch into the Char-RNN model for training, get the probability of the next character corresponding to each character, and continuously revise this probability with the increase of the training times to reach the preset After a good number of training times, the training model result will be saved; S4. Use the input keyword as the starting character, use the trained model result to obtain the probability corresponding to the next character and output it, and use this as the next character input , and so on to generate a piece of text. Compared with the common RNN model, the present invention solves the problem of gradient disappearance or gradient explosion that may occur during long sequence data processing.

Description

technical field [0001] The invention belongs to the technical field of neural networks, and in particular relates to a method for automatically generating text based on a Char-RNN model. Background technique [0002] Recurrent neural network (RNN) is a classic neural network and the network of choice for time series data. When it comes to certain sequential machine learning tasks, RNNs can achieve high levels of accuracy that no other algorithm can match. This is due to the fact that traditional neural networks only have a kind of short-term memory, while RNN has the advantage of limited short-term memory. [0003] The main purpose of RNN is to process sequence data. In the traditional neural network model, from the input layer to the hidden layer to the output layer, the layers are fully connected, and the nodes between each layer are unconnected. But this ordinary neural network is powerless for many problems. For example, when you want to predict what the next word in...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/30G06N3/02
CPCG06N3/02
Inventor 朱静黄颖杰杨晋昌黄文恺韩晓英邓文婷
Owner GUANGZHOU UNIVERSITY
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products