CN116629211B - Writing method and system based on artificial intelligence - Google Patents

Writing method and system based on artificial intelligence Download PDF

Info

Publication number
CN116629211B
CN116629211B CN202310183555.3A CN202310183555A CN116629211B CN 116629211 B CN116629211 B CN 116629211B CN 202310183555 A CN202310183555 A CN 202310183555A CN 116629211 B CN116629211 B CN 116629211B
Authority
CN
China
Prior art keywords
feature
search
feature vector
semantic understanding
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310183555.3A
Other languages
Chinese (zh)
Other versions
CN116629211A (en
Inventor
朱勤荣
魏世杰
虞嘉俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Yanji Network Technology Co ltd
Original Assignee
Zhejiang Yanji Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Yanji Network Technology Co ltd filed Critical Zhejiang Yanji Network Technology Co ltd
Priority to CN202310183555.3A priority Critical patent/CN116629211B/en
Publication of CN116629211A publication Critical patent/CN116629211A/en
Application granted granted Critical
Publication of CN116629211B publication Critical patent/CN116629211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the field of intelligent auxiliary writing, and particularly discloses a writing method and system based on artificial intelligence, which utilize a natural language processing technology based on deep learning and convolutional neural network to excavate high-dimensional semantic understanding implicit characteristic information under a middle distance and a long distance contained in writing material demand description and alternative writing material through a two-way long-short-term memory neural network model and a context encoder based on a converter, and match and compare the two in a high-dimensional space. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.

Description

Writing method and system based on artificial intelligence
Technical Field
The application relates to the field of intelligent auxiliary writing, in particular to an artificial intelligence-based writing method and system.
Background
Writing practice is an indispensable link of students in Chinese learning. Most of the authoring programs (also called authoring auxiliary programs or authoring auxiliary clients) in the market at present can collect or capture a large amount of authoring materials and store the materials in a database, and select the authoring materials from the database according to user requirements and then recommend the materials to a user to assist the user in authoring.
In practice it has been found that the user cannot use the authoring material effectively, since most users use the authoring program to assist himself just because he has not touched the type of authoring to be written, and the authoring program only provides some fragmented material and does not inspire the user to author well.
Thus, an artificial intelligence based authoring solution is provided.
Disclosure of Invention
The present application has been made to solve the above-mentioned technical problems. The embodiment of the application provides an artificial intelligence-based writing method and system, which utilize a natural language processing technology based on a deep learning and convolution neural network to excavate high-dimensional semantic understanding implicit characteristic information of a writing material requirement description and a long-distance and medium-dimensional semantic understanding implicit characteristic information of an alternative writing material through a two-way long-short-term memory neural network model and a context encoder based on a converter, and match and compare the two in a high-dimensional space. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.
According to one aspect of the present application, there is provided an artificial intelligence based authoring method comprising:
Acquiring a writing material requirement description input by a user;
the writing material requirement description is subjected to word segmentation processing and then passes through a word embedding layer to obtain a sequence of search word embedding vectors;
the sequence of the search word embedded vector is passed through a two-way long-short term memory neural network model to obtain a first scale search semantic understanding feature vector;
embedding the sequence of search terms into a vector, and obtaining a second scale search semantic understanding feature vector through a context encoder based on a converter;
fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector;
acquiring alternative writing materials;
extracting semantic feature vectors of the alternative writing materials from the alternative writing materials through the word embedding layer, the two-way long-short-term memory neural network model and the context encoder based on the converter;
performing association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector to obtain a matching feature matrix; and
and the matching feature matrix is passed through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold.
In the artificial intelligence-based writing method, the step of obtaining the second scale search semantic understanding feature vector by passing the sequence of the search word embedded vector through a context encoder based on a converter comprises the following steps: inputting a sequence of the search term embedded vectors into the converter-based context encoder to obtain the plurality of search feature vectors; and cascading the plurality of search feature vectors to obtain the second-scale search semantic understanding feature vector.
In the above artificial intelligence based authoring method, inputting the sequence of search term embedded vectors into the converter based context encoder to obtain the plurality of search feature vectors, comprising: arranging the sequence of the search word embedded vectors into an input vector; respectively converting the input vector into a query vector and a key vector through a learning embedding matrix; calculating the product between the query vector and the transpose vector of the key vector to obtain a self-attention correlation matrix; carrying out standardization processing on the self-attention association matrix to obtain a standardized self-attention association matrix; inputting the standardized self-attention association matrix into a Softmax activation function to activate so as to obtain a self-attention feature matrix; and multiplying the self-attention feature matrix with each search word embedding vector in the sequence of search word embedding vectors as a value vector to obtain the plurality of search feature vectors.
In the above artificial intelligence based writing method, fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector includes: fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector according to the following formula; wherein, the formula is:
X=Concat[V 1 ,V 2 ]
wherein V is 1 Representing the first scale search semantic understanding feature vector, V 2 Representing the second scale search semantic understanding feature vector, concat [. Cndot.,)]Representing a cascading function, and X represents the search depth semantic understanding feature vector.
In the above-mentioned artificial intelligence-based authoring method, extracting, by the word embedding layer, the two-way long-short-term memory neural network model, and the converter-based context encoder, an alternative authoring material semantic feature vector from the alternative authoring material includes: the alternative writing materials are subjected to word segmentation processing and then pass through the word embedding layer to obtain a sequence of material word embedding vectors; the sequence of the embedded vectors of the material words passes through the two-way long-short-term memory neural network model to obtain semantic understanding feature vectors of the first-scale material; the sequence of the embedded vectors of the material words passes through the context encoder based on the converter to obtain semantic understanding feature vectors of the second-scale material; and fusing the semantic understanding feature vector of the first scale material and the semantic understanding feature vector of the second scale material to obtain semantic feature vectors of the alternative writing material.
In the above-mentioned artificial intelligence-based authoring method, performing association coding on the search depth semantic understanding feature vector and the candidate authoring material semantic feature vector to obtain a matching feature matrix, including: calculating the product between the transpose vector of the search depth semantic understanding feature vector and the semantic feature vector of the alternative writing material to obtain an initial matching feature matrix; obtaining a matching feature map through the initial matching feature matrix by using a convolutional neural network serving as a feature extractor, wherein the number of channels of the convolutional neural network serving as the feature extractor is the same as the length of the search depth semantic understanding feature vector; calculating an instance normalization and consistency correlation recovery factor of each feature matrix of the matching feature graph along a channel dimension to obtain a channel weighted feature vector formed by a plurality of instance normalization and consistency correlation recovery factors; the channel weighted feature vector is used as a weighted feature vector to respectively weight the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to obtain a corrected search depth semantic understanding feature vector and a corrected alternative writing material semantic feature vector; and calculating the product between the transpose vector of the corrected search depth semantic understanding feature vector and the corrected candidate writing material semantic feature vector to obtain the matching feature matrix.
In the above-mentioned artificial intelligence-based writing method, obtaining the matching feature map from the initial matching feature matrix by using a convolutional neural network as a feature extractor includes: each layer using the convolutional neural network is performed in forward transfer of the layer: carrying out convolution processing on input data to obtain a convolution characteristic diagram; carrying out mean pooling based on a local feature matrix on the convolution feature map to obtain a pooled feature map; performing nonlinear activation on the pooled feature map to obtain an activated feature map; the output of the last layer of the convolutional neural network is the matching feature map, and the input of the first layer of the convolutional neural network is the initial matching feature matrix.
In the above artificial intelligence based authoring method, calculating an instance normalization and consistency correlation recovery factor for each feature matrix of the matching feature map along a channel dimension to obtain a channel weighted feature vector comprised of a plurality of instance normalization and consistency correlation recovery factors, comprising: calculating an instance normalization and consistency correlation recovery factor for each feature matrix along a channel dimension of the matching feature map to obtain a channel weighted feature vector comprised of a plurality of instance normalization and consistency correlation recovery factors, in accordance with the following equation; wherein, the formula is:
Wherein m is i,j For the eigenvalues of the (i, j) th position of each eigenvalue, μ and σ are the mean and variance of the set of eigenvalues of each position of the eigenvalue matrix, and W and H are the width and height of the eigenvalue matrix, respectively, exp represents an exponential operation with e as the base, log represents a logarithmic operation with 2 as the base, and α represents the example normalization and consistency related recovery factor.
In the above-mentioned artificial intelligence-based writing method, the step of passing the matching feature matrix through a classifier to obtain a classification result, where the classification result is used to indicate whether the adaptation degree between the candidate writing material and the writing material requirement description input by the user exceeds a predetermined threshold, includes: expanding the matching feature matrix into classification feature vectors according to row vectors or column vectors; inputting the classification feature vector into a Softmax classification function of the classifier to obtain a probability value of the classification feature vector belonging to each classification label; and determining the classification label corresponding to the maximum probability value as the classification result.
According to another aspect of the present application, there is provided an artificial intelligence based authoring system comprising:
the user demand acquisition module is used for acquiring the writing material demand description input by the user;
The requirement data structuring module is used for obtaining a sequence of search word embedding vectors through a word embedding layer after carrying out word segmentation processing on the writing material requirement description;
the medium-distance semantic understanding module is used for enabling the sequence of the search word embedded vector to pass through a two-way long-short-term memory neural network model to obtain a first-scale search semantic understanding feature vector;
the long-distance semantic understanding module is used for enabling the sequence of the search word embedded vectors to pass through a context encoder based on a converter to obtain second-scale search semantic understanding feature vectors;
the depth demand understanding module is used for fusing the first scale searching semantic understanding feature vector and the second scale searching semantic understanding feature vector to obtain a searching depth semantic understanding feature vector;
the alternate writing material acquisition module is used for acquiring alternate writing materials;
the semantic understanding module of the material of writing is used for extracting the semantic feature vector of the material of writing alternatives from the material of writing alternatives through the word embedding layer, the two-way long-short-term memory neural network model and the context encoder based on the converter;
the association coding module is used for carrying out association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to obtain a matching feature matrix; and
And the adaptation degree result generation module is used for passing the matching feature matrix through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold value.
According to still another aspect of the present application, there is provided an electronic apparatus including: a processor; and a memory having stored therein computer program instructions that, when executed by the processor, cause the processor to perform the artificial intelligence based authoring method as described above.
According to yet another aspect of the present application, there is provided a computer readable medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the artificial intelligence based authoring method as described above.
Compared with the prior art, the artificial intelligence-based writing method and system provided by the application utilize a natural language processing technology based on deep learning and convolutional neural network to excavate the writing material demand description and the high-dimensional semantic understanding implicit characteristic information under the middle distance and the long distance contained in the alternative writing material through a two-way long-short-term memory neural network model and a context encoder based on a converter, and match and compare the two in a high-dimensional space. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing embodiments of the present application in more detail with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of embodiments of the application and are incorporated in and constitute a part of this specification, illustrate the application and together with the embodiments of the application, and not constitute a limitation to the application. In the drawings, like reference numerals generally refer to like parts or steps.
FIG. 1 is a flow chart of an artificial intelligence based authoring method in accordance with an embodiment of the present application.
FIG. 2 is a schematic diagram of an artificial intelligence based authoring method in accordance with an embodiment of the present application.
FIG. 3 is a flow chart of inputting the sequence of search term embedded vectors into the converter-based context encoder to derive the plurality of search feature vectors in an artificial intelligence-based authoring method in accordance with an embodiment of the present application.
Fig. 4 is a flowchart of performing association coding on the search depth semantic understanding feature vector and the semantic feature vector of the alternative authoring material in the artificial intelligence-based authoring method according to an embodiment of the present application to obtain a matching feature matrix.
FIG. 5 is a block diagram of an artificial intelligence based authoring system in accordance with an embodiment of the present application.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
Hereinafter, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and it should be understood that the present application is not limited by the example embodiments described herein.
Summary of the application
Accordingly, since the authoring program does not deeply understand the real authoring requirements of the user, and at the same time, the alternative authoring materials also lack semantic understanding, and for the user, the authoring program only provides some fragmented materials with high and low relativity, but cannot accurately meet the authoring requirements of the user, and cannot well inspire the user to author. Therefore, deep semantic understanding and analysis are expected to be carried out on the writing material demand description and the alternative writing material input by the user so as to obtain real writing demand semantic feature information of the user and implicit semantic understanding feature information of the alternative writing material, and matching and comparison are carried out in a high-dimensional space, so that the writing material output by the writing program can be accurately adapted to the writing demand of the user, further writing experience of the user is optimized, and satisfaction degree of the user is improved.
In recent years, deep learning and neural networks have been widely used in the fields of computer vision, natural language processing, text signal processing, and the like. In addition, deep learning and neural networks have also shown levels approaching and even exceeding humans in the fields of image classification, object detection, semantic segmentation, text translation, and the like.
The development of natural language processing technology based on deep learning and neural network provides solution ideas and schemes for constructing artificial intelligence-based writing schemes.
Specifically, in the technical scheme of the application, firstly, the writing material requirement description input by the user is acquired.
In the technical scheme of the application, the written material requirement description is subjected to word segmentation processing to avoid word sequence confusion and then passes through a word embedding layer to obtain a sequence of search word embedding vectors. Here, the Word embedding layer functions to map a Word into a search Word embedding vector, and may be constructed based on a Word bag model or a low-dimensional semantic embedding model, for example, word2Vec, etc.
Then, in order to understand the high-dimensional implicit associated features which are included in the description of the requirements of the authoring material and are related to the real requirements of the user in a deeper and more scale manner, the sequence of the search word embedded vectors is passed through a two-way long-short term memory neural network model to obtain a first-scale search semantic understanding feature vector, and the sequence of the search word embedded vectors is passed through a context encoder based on a converter to obtain a second-scale search semantic understanding feature vector.
It should be understood that the two-way Long Short-Term Memory neural network model (LSTM) is a time-cycled neural network, which enables the weight of the neural network to be self-updated by adding an input gate, an output gate and a forgetting gate, and the weight scale at different moments can be dynamically changed under the condition of fixed parameters of the network model, so that the problems of gradient disappearance or gradient expansion can be avoided. The two-way long-short-term memory neural network model is formed by combining a forward LSTM and a backward LSTM, the forward LSTM can learn the implicit characteristic information of the writing requirement before the current search word embedded vector, and the backward LSTM can learn the implicit characteristic information of the writing requirement after the current search word embedded vector, so that the first-scale search semantic understanding characteristic vector obtained through the two-way long-short-term memory neural network model learns the information of the global context.
The context encoder includes a Transformer (Transformer) based Bert model. The function of the converter-based Bert model is to globally context-based semantic encoding the sequence of search term embedded vectors (i.e., globally context-based semantic encoding each search term embedded vector in the sequence of search term embedded vectors) to obtain a plurality of context-semantic understanding feature vectors corresponding to the sequence of search term embedded vectors, wherein one context-semantic understanding feature vector in the plurality of context-semantic understanding feature vectors corresponds to one context-semantic understanding feature. That is, based on the transducer concept, the use of a transducer is able to capture the longer range context dependent characteristics, with a transducer-based context encoder having a wider range of feature extraction than a two-way long and short term memory neural network model. In the technical scheme of the application, the context semantic understanding feature vectors are cascaded to obtain the second scale search semantic understanding feature vector.
And then, merging the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to integrate the middle-distance semantic understanding feature and the long-distance semantic understanding feature which are contained in the writing material requirement description and related to the real writing requirement of the user so as to obtain a search depth semantic understanding feature vector.
For the alternative authoring material, the same method is used for processing to mine the implicit semantic understanding characteristic information contained in the alternative authoring material. That is, first, an alternative authoring material is acquired; then, extracting semantic feature vectors of the alternative composition material from the alternative composition material through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter.
And then, carrying out association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to fuse semantic understanding hidden feature information expressed by the search depth semantic understanding feature vector and related to real writing requirements of a user with high-dimensional hidden semantic understanding information of the alternative writing material expressed by the alternative writing material semantic feature vector, thereby obtaining a matching feature matrix.
After the matching feature matrix is obtained, the matching feature matrix is passed through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold. That is, in the technical solution of the present application, the labels of the classifier include that the adaptation degree between the candidate writing material and the writing material requirement description input by the user exceeds a predetermined threshold (first label), and that the adaptation degree between the candidate writing material and the writing material requirement description input by the user does not exceed a predetermined threshold (second label), wherein the classifier determines to which classification label the matching feature matrix belongs through a soft maximum function. It should be appreciated that during actual operation of the authoring program, the candidate authoring material is prioritized in response to the classification result being that a degree of adaptation between the candidate authoring material and the user-entered authoring material requirement description exceeds a predetermined threshold. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.
Particularly, in the technical scheme of the application, when the search depth semantic understanding feature vector and the candidate writing material semantic feature vector are subjected to association coding to obtain the matching feature matrix, the feature value of each position of the matching feature matrix is a non-weighted product among feature values of the feature vector, so that the feature values of the matching feature matrix are not distinguished based on the association degree between the search depth semantic understanding feature vector and the feature values of the candidate writing material semantic feature vector, and the feature expression effect of the matching feature matrix is affected.
In general, feature values of feature vectors can be distinguished based on a channel attention mechanism for expressing feature patterns of associated features, and therefore, first, the matching feature matrix is obtained by a convolutional neural network as a feature extractor capable of expressing associated features between the search depth semantic understanding feature vector and the candidate composition semantic feature vector, wherein the number of channels of the convolutional neural network as a feature extractor is the same as the length of the search depth semantic understanding feature vector.
Further, if the channel weighted feature vector is obtained by global averaging of each feature matrix of the matching feature map, which is arranged along the channel dimension, so as to weight the search depth semantic understanding feature vector and the candidate writing material semantic feature vector, the channel weighted feature vector is further expected to be optimized to restore feature distribution information of the feature vector expressed by the overall distribution correlation among each feature matrix expressed by the matching feature map as much as possible, so that the expression effect of the channel weighted feature vector on the channel dimension feature correlation distribution among each feature matrix of the matching feature map is improved.
Thus, calculating an instance normalized and consistent correlation recovery factor for each feature matrix of the matching feature map to construct the channel weighted feature vector, the instance normalized and consistent correlation recovery factor expressed as:
mu and sigma are feature sets m i,j E means and variance of M, M i,j Is the eigenvalue of the (i, j) th position of the eigenvalue M, and W and H are the width and height of the eigenvalue M, respectively.
Here, the instance normalization and consistency correlation restoration factor is directed to the problem that the global averaging of the feature matrix inevitably loses the distinctive feature information, and based on the instance normalization (Instance Normalization: IN) of the spatial distribution feature of the channel instance expressed by the feature matrix, consistency correlation features IN the statistical information are restored into the feature value representation by distilling the consistency correlation features from the statistical residual features of class probabilities, so as to realize restoration of the channel causality constraint caused by the spatial distribution of the feature matrix of the channel weighted feature vector relative to the matched feature graph. Thus, by constructing the channel weighted feature vector by the factor, the channel weighted feature vector can be made to contain feature distribution information of the feature vector expressed by the overall distribution correlation among the feature matrices expressed by the matching feature map, thereby improving the expression effect of the channel weighted feature vector on the channel dimension feature correlation distribution among the feature matrices of the matching feature map.
And then, weighting the search depth semantic understanding feature vector and the alternative writing material semantic feature vector by the channel weighting feature vector to obtain the matching feature matrix, so that the feature expression effect of the matching feature matrix can be improved.
Having described the basic principles of the present application, various non-limiting embodiments of the present application will now be described in detail with reference to the accompanying drawings.
Exemplary method
FIG. 1 is a flow chart of an artificial intelligence based authoring method in accordance with an embodiment of the present application. As shown in fig. 1, the artificial intelligence based authoring method according to an embodiment of the present application includes: s110, acquiring a writing material requirement description input by a user; s120, carrying out word segmentation on the writing material requirement description, and then obtaining a sequence of search word embedded vectors through a word embedded layer; s130, enabling the sequence of the search word embedded vectors to pass through a two-way long-short-term memory neural network model to obtain first-scale search semantic understanding feature vectors; s140, enabling the sequence of the search word embedded vectors to pass through a context encoder based on a converter to obtain second-scale search semantic understanding feature vectors; s150, fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector; s160, obtaining alternative writing materials; s170, extracting semantic feature vectors of the alternative writing materials from the alternative writing materials through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter; s180, carrying out association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector to obtain a matching feature matrix; and S190, passing the matching feature matrix through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold.
FIG. 2 is a schematic diagram of an artificial intelligence based authoring method in accordance with an embodiment of the present application. In this architecture, as shown in fig. 2, first, a description of authoring material requirements entered by a user is acquired; then, the writing material requirement description is subjected to word segmentation processing and then passes through a word embedding layer to obtain a sequence of search word embedding vectors; then, the sequence of the search word embedded vectors passes through a two-way long-short term memory neural network model to obtain a first-scale search semantic understanding feature vector, and simultaneously, the sequence of the search word embedded vectors passes through a context encoder based on a converter to obtain a second-scale search semantic understanding feature vector; then, fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector, and simultaneously obtaining an alternative writing material; then, extracting semantic feature vectors of alternative writing materials from the alternative writing materials through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter; performing association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector to obtain a matching feature matrix; and finally, the matching feature matrix passes through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing materials and the writing material requirement description input by the user exceeds a preset threshold.
Accordingly, since the authoring program does not deeply understand the real authoring requirements of the user, and at the same time, the alternative authoring materials also lack semantic understanding, and for the user, the authoring program only provides some fragmented materials with high and low relativity, but cannot accurately meet the authoring requirements of the user, and cannot well inspire the user to author. Therefore, deep semantic understanding and analysis are expected to be carried out on the writing material demand description and the alternative writing material input by the user so as to obtain real writing demand semantic feature information of the user and implicit semantic understanding feature information of the alternative writing material, and matching and comparison are carried out in a high-dimensional space, so that the writing material output by the writing program can be accurately adapted to the writing demand of the user, further writing experience of the user is optimized, and satisfaction degree of the user is improved.
In recent years, deep learning and neural networks have been widely used in the fields of computer vision, natural language processing, text signal processing, and the like. In addition, deep learning and neural networks have also shown levels approaching and even exceeding humans in the fields of image classification, object detection, semantic segmentation, text translation, and the like.
The development of natural language processing technology based on deep learning and neural network provides solution ideas and schemes for constructing artificial intelligence-based writing schemes.
In step S110, a authoring material requirement description input by a user is acquired.
In step S120, the required description of the authoring material is subjected to word segmentation, and then a word embedding layer is used to obtain a sequence of search word embedding vectors. In the technical scheme of the application, the written material requirement description is subjected to word segmentation processing to avoid word sequence confusion and then passes through a word embedding layer to obtain a sequence of search word embedding vectors. Here, the Word embedding layer functions to map a Word into a search Word embedding vector, and may be constructed based on a Word bag model or a low-dimensional semantic embedding model, for example, word2Vec, etc.
In step S130 and step S140, the sequence of search word embedded vectors is passed through a two-way long-short term memory neural network model to obtain a first scale search semantic understanding feature vector, and the sequence of search word embedded vectors is passed through a context encoder based on a converter to obtain a second scale search semantic understanding feature vector. In order to understand the high-dimensional implicit associated features which are included in the description of the requirements of the material to be written and are related to the real requirements of the user in a deeper and more scale, in the technical scheme of the application, the sequence of the search word embedded vectors is used for obtaining a first-scale search semantic understanding feature vector through a two-way long-short-term memory neural network model, and the sequence of the search word embedded vectors is used for obtaining a second-scale search semantic understanding feature vector through a context encoder based on a converter.
It should be understood that the two-way Long Short-Term Memory neural network model (LSTM) is a time-cycled neural network, which enables the weight of the neural network to be self-updated by adding an input gate, an output gate and a forgetting gate, and the weight scale at different moments can be dynamically changed under the condition of fixed parameters of the network model, so that the problems of gradient disappearance or gradient expansion can be avoided. The two-way long-short-term memory neural network model is formed by combining a forward LSTM and a backward LSTM, the forward LSTM can learn the implicit characteristic information of the writing requirement before the current search word embedded vector, and the backward LSTM can learn the implicit characteristic information of the writing requirement after the current search word embedded vector, so that the first-scale search semantic understanding characteristic vector obtained through the two-way long-short-term memory neural network model learns the information of the global context.
The context encoder includes a Transformer (Transformer) based Bert model. The function of the converter-based Bert model is to globally context-based semantic encoding the sequence of search term embedded vectors (i.e., globally context-based semantic encoding each search term embedded vector in the sequence of search term embedded vectors) to obtain a plurality of context-semantic understanding feature vectors corresponding to the sequence of search term embedded vectors, wherein one context-semantic understanding feature vector in the plurality of context-semantic understanding feature vectors corresponds to one context-semantic understanding feature. That is, based on the transducer concept, the use of a transducer is able to capture the longer range context dependent characteristics, with a transducer-based context encoder having a wider range of feature extraction than a two-way long and short term memory neural network model. In the technical scheme of the application, the context semantic understanding feature vectors are cascaded to obtain the second scale search semantic understanding feature vector.
Specifically, in an embodiment of the present application, the encoding process of embedding the sequence of search terms into the vector through the context encoder based on the converter to obtain the second scale search semantic understanding feature vector includes: first, inputting a sequence of the search term embedded vectors into the converter-based context encoder to obtain the plurality of search feature vectors; and then cascading the plurality of search feature vectors to obtain the second-scale search semantic understanding feature vector.
FIG. 3 is a flow chart of inputting the sequence of search term embedded vectors into the converter-based context encoder to derive the plurality of search feature vectors in an artificial intelligence-based authoring method in accordance with an embodiment of the present application. As shown in fig. 3, inputting the sequence of search term embedded vectors into the converter-based context encoder to obtain the plurality of search feature vectors, comprising the steps of: s210, arranging the sequence of the search word embedded vectors into input vectors; s220, converting the input vector into a query vector and a key vector through a learning embedding matrix respectively; s230, calculating the product between the query vector and the transpose vector of the key vector to obtain a self-attention correlation matrix; s240, carrying out standardization processing on the self-attention association matrix to obtain a standardized self-attention association matrix; s250, inputting the standardized self-attention association matrix into a Softmax activation function to activate so as to obtain a self-attention feature matrix; and S260, multiplying the self-attention feature matrix and each search word embedded vector in the sequence of the search word embedded vectors as a value vector to obtain a plurality of search feature vectors.
In step S150, the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector are fused to obtain a search depth semantic understanding feature vector. That is, the mid-distance semantic understanding features and the long-distance semantic understanding features which are included in the description of the authoring material requirements and related to the real authoring requirements of the user are integrated to obtain a search depth semantic understanding feature vector
Specifically, in the embodiment of the application, the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector are fused by the following formula to obtain a search depth semantic understanding feature vector; wherein, the formula is:
X=Concat[V 1 ,V 2 ]
wherein V is 1 Representing the first scale search semantic understanding feature vector, V 2 Representing the second scale search semantic understanding feature vector, concat [. Cndot.,)]Representing a cascading function, and X represents the search depth semantic understanding feature vector.
In step S160 and step S170, an alternative writing material is obtained, and semantic feature vectors of the alternative writing material are extracted from the alternative writing material through the word embedding layer, the two-way long-short-term memory neural network model and the context encoder based on the converter. For the alternative authoring material, the same method is used for processing to mine the implicit semantic understanding characteristic information contained in the alternative authoring material. That is, first, an alternative authoring material is acquired; then, extracting semantic feature vectors of the alternative composition material from the alternative composition material through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter.
Specifically, in the embodiment of the present application, the encoding process for extracting the semantic feature vector of the alternative writing material from the alternative writing material through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter includes: firstly, word segmentation is carried out on the alternative writing materials, and then a sequence of material word embedding vectors is obtained through the word embedding layer; then, the sequence of the embedded vectors of the material words passes through the two-way long-short-term memory neural network model to obtain semantic understanding feature vectors of the first-scale material; then, the sequence of the embedded vectors of the material words passes through the context encoder based on the converter to obtain semantic understanding feature vectors of the second-scale material; and finally, fusing the semantic understanding feature vector of the first scale material and the semantic understanding feature vector of the second scale material to obtain semantic feature vectors of the alternative writing material.
In step S180, the search depth semantic understanding feature vector and the candidate writing material semantic feature vector are associated and encoded to obtain a matching feature matrix. The semantic understanding hidden characteristic information expressed by the search depth semantic understanding characteristic vector and related to the real writing requirement of the user is fused with the high-dimensional hidden semantic understanding information of the alternative writing material expressed by the alternative writing material semantic characteristic vector, so that a matching characteristic matrix is obtained.
Fig. 4 is a flowchart of performing association coding on the search depth semantic understanding feature vector and the semantic feature vector of the alternative authoring material in the artificial intelligence-based authoring method according to an embodiment of the present application to obtain a matching feature matrix. As shown in fig. 4, performing association coding on the search depth semantic understanding feature vector and the semantic feature vector of the alternative writing material to obtain a matching feature matrix, which includes the steps of: s310, calculating the product between the transpose vector of the search depth semantic understanding feature vector and the semantic feature vector of the alternative writing material to obtain an initial matching feature matrix; s320, the initial matching feature matrix is used for obtaining a matching feature map through a convolutional neural network serving as a feature extractor, wherein the number of channels of the convolutional neural network serving as the feature extractor is the same as the length of the search depth semantic understanding feature vector; s330, calculating an instance normalization and consistency correlation recovery factor of each feature matrix of the matching feature graph along the channel dimension to obtain a channel weighted feature vector formed by a plurality of instance normalization and consistency correlation recovery factors; s340, the channel weighted feature vector is used as a weighted feature vector to respectively weight the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to obtain a corrected search depth semantic understanding feature vector and a corrected alternative writing material semantic feature vector; and S350, calculating the product between the transpose vector of the corrected search depth semantic understanding feature vector and the corrected candidate writing material semantic feature vector to obtain the matching feature matrix.
Specifically, in the embodiment of the present application, obtaining the initial matching feature matrix through a convolutional neural network serving as a feature extractor includes: each layer using the convolutional neural network is performed in forward transfer of the layer: carrying out convolution processing on input data to obtain a convolution characteristic diagram; carrying out mean pooling based on a local feature matrix on the convolution feature map to obtain a pooled feature map; performing nonlinear activation on the pooled feature map to obtain an activated feature map; the output of the last layer of the convolutional neural network is the matching feature map, and the input of the first layer of the convolutional neural network is the initial matching feature matrix.
Particularly, in the technical scheme of the application, when the search depth semantic understanding feature vector and the candidate writing material semantic feature vector are subjected to association coding to obtain the matching feature matrix, the feature value of each position of the matching feature matrix is a non-weighted product among feature values of the feature vector, so that the feature values of the matching feature matrix are not distinguished based on the association degree between the search depth semantic understanding feature vector and the feature values of the candidate writing material semantic feature vector, and the feature expression effect of the matching feature matrix is affected.
In general, feature values of feature vectors can be distinguished based on a channel attention mechanism for expressing feature patterns of associated features, and therefore, first, the matching feature matrix is obtained by a convolutional neural network as a feature extractor capable of expressing associated features between the search depth semantic understanding feature vector and the candidate composition semantic feature vector, wherein the number of channels of the convolutional neural network as a feature extractor is the same as the length of the search depth semantic understanding feature vector.
Further, if the channel weighted feature vector is obtained by global averaging of each feature matrix of the matching feature map, which is arranged along the channel dimension, so as to weight the search depth semantic understanding feature vector and the candidate writing material semantic feature vector, the channel weighted feature vector is further expected to be optimized to restore feature distribution information of the feature vector expressed by the overall distribution correlation among each feature matrix expressed by the matching feature map as much as possible, so that the expression effect of the channel weighted feature vector on the channel dimension feature correlation distribution among each feature matrix of the matching feature map is improved.
Thus, calculating an instance normalized and consistent correlation recovery factor for each feature matrix of the matching feature map to construct the channel weighted feature vector, the instance normalized and consistent correlation recovery factor expressed as:
wherein m is i,j For the eigenvalues of the (i, j) th position of each eigenvalue, μ and σ are the mean and variance of the set of eigenvalues of each position of the eigenvalue matrix, and W and H are the width and height of the eigenvalue matrix, respectively, exp represents an exponential operation with e as the base, log represents a logarithmic operation with 2 as the base, and α represents the example normalization and consistency related recovery factor.
Here, the instance normalization and consistency correlation restoration factor is directed to the problem that the global averaging of the feature matrix inevitably loses the distinctive feature information, and based on the instance normalization (Instance Normalization: IN) of the spatial distribution feature of the channel instance expressed by the feature matrix, consistency correlation features IN the statistical information are restored into the feature value representation by distilling the consistency correlation features from the statistical residual features of class probabilities, so as to realize restoration of the channel causality constraint caused by the spatial distribution of the feature matrix of the channel weighted feature vector relative to the matched feature graph. Thus, by constructing the channel weighted feature vector by the factor, the channel weighted feature vector can be made to contain feature distribution information of the feature vector expressed by the overall distribution correlation among the feature matrices expressed by the matching feature map, thereby improving the expression effect of the channel weighted feature vector on the channel dimension feature correlation distribution among the feature matrices of the matching feature map.
And then, weighting the search depth semantic understanding feature vector and the alternative writing material semantic feature vector by the channel weighting feature vector to obtain the matching feature matrix, so that the feature expression effect of the matching feature matrix can be improved.
In step S190, the matching feature matrix is passed through a classifier to obtain a classification result, where the classification result is used to indicate whether the adaptation degree between the candidate authoring material and the user-input authoring material requirement description exceeds a predetermined threshold. That is, in the technical solution of the present application, the labels of the classifier include that the adaptation degree between the candidate writing material and the writing material requirement description input by the user exceeds a predetermined threshold (first label), and that the adaptation degree between the candidate writing material and the writing material requirement description input by the user does not exceed a predetermined threshold (second label), wherein the classifier determines to which classification label the matching feature matrix belongs through a soft maximum function. It should be appreciated that during actual operation of the authoring program, the candidate authoring material is prioritized in response to the classification result being that a degree of adaptation between the candidate authoring material and the user-entered authoring material requirement description exceeds a predetermined threshold. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.
Specifically, in the embodiment of the present application, the matching feature matrix is passed through a classifier to obtain a classification result, where the classification result is used in an encoding process for indicating whether the adaptation degree between the candidate writing material and the writing material requirement description input by the user exceeds a predetermined threshold, and the encoding process includes: firstly, the matching feature matrix is unfolded into classification feature vectors according to row vectors or column vectors; then, inputting the classification feature vector into a Softmax classification function of the classifier to obtain a probability value of the classification feature vector belonging to each classification label; and then, determining the classification label corresponding to the maximum probability value as the classification result.
In summary, an artificial intelligence based authoring method according to an embodiment of the present application is explained, which utilizes a natural language processing technology based on deep learning and convolutional neural network to mine the high-dimensional semantic understanding implicit characteristic information of the mid-distance and long-distance contained in the authoring material requirement description and the alternative authoring material through a two-way long-short-term memory neural network model and a context encoder based on a converter, and match and compare the two in a high-dimensional space. Therefore, the writing materials output by the writing program can be accurately adapted to the writing requirements of the user, the writing experience of the user is further optimized, and the satisfaction degree of the user is improved.
Exemplary System
FIG. 5 is a block diagram of an artificial intelligence based authoring system in accordance with an embodiment of the present application. As shown in fig. 5, an artificial intelligence based authoring system 100 in accordance with an embodiment of the present application includes: a user demand acquisition module 110 for acquiring a authoring material demand description input by a user; the requirement data structuring module 120 is configured to perform word segmentation on the sketch material requirement description, and then obtain a sequence of search word embedding vectors through a word embedding layer; the medium-distance semantic understanding module 130 is configured to insert the search term into the sequence of vectors through a two-way long-short term memory neural network model to obtain a first-scale search semantic understanding feature vector; a long-distance semantic understanding module 140, configured to insert the sequence of search terms into the vector, through a context encoder based on a converter, to obtain a second-scale search semantic understanding feature vector; the depth requirement understanding module 150 is configured to fuse the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector; the alternate writing material obtaining module 160 is configured to obtain an alternate writing material; the authoring material semantic understanding module 170 is configured to extract an alternative authoring material semantic feature vector from the alternative authoring material through the word embedding layer, the two-way long-short term memory neural network model and the context encoder based on the converter; the association coding module 180 is configured to perform association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector to obtain a matching feature matrix; and an adaptation degree result generating module 190, configured to pass the matching feature matrix through a classifier to obtain a classification result, where the classification result is used to indicate whether the adaptation degree between the candidate writing material and the writing material requirement description input by the user exceeds a predetermined threshold.
Here, it will be understood by those skilled in the art that the specific functions and operations of the respective units and modules in the above-described artificial intelligence-based authoring system 100 have been described in detail in the above description of the artificial intelligence-based authoring method with reference to fig. 1 to 4, and thus, repetitive descriptions thereof will be omitted.
As described above, the artificial intelligence based authoring system 100 according to an embodiment of the present application may be implemented in various terminal devices, such as a server or the like for artificial intelligence based authoring. In one example, the artificial intelligence based authoring system 100 in accordance with an embodiment of the present application may be integrated into a terminal device as a software module and/or hardware module. For example, the artificial intelligence based authoring system 100 may be a software module in the operating system of the terminal device or may be an application developed for the terminal device; of course, the artificial intelligence based authoring system 100 may also be one of a number of hardware modules of the terminal device.
Alternatively, in another example, the artificial intelligence based authoring system 100 and the terminal device may be separate devices and the artificial intelligence based authoring system 100 may be connected to the terminal device through a wired and/or wireless network and communicate the interactive information in a agreed data format.
Exemplary electronic device
Next, an electronic device according to an embodiment of the present application is described with reference to fig. 6. Fig. 6 is a block diagram of an electronic device according to an embodiment of the application. As shown in fig. 6, the electronic device 10 includes one or more processors 11 and a memory 12.
The processor 11 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
Memory 12 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that can be executed by the processor 11 to implement the functions in the artificial intelligence based authoring method and/or other desired functions of the various embodiments of the present application described above. Various contents such as a description of the demands of the authoring material, an alternate authoring material, etc., entered by a user, may also be stored in the computer-readable storage medium.
In one example, the electronic device 10 may further include: an input device 13 and an output device 14, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
The input means 13 may comprise, for example, a keyboard, a mouse, etc.
The output device 14 may output various information including the classification result and the like to the outside. The output means 14 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device 10 that are relevant to the present application are shown in fig. 6 for simplicity, components such as buses, input/output interfaces, etc. are omitted. In addition, the electronic device 10 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, embodiments of the application may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform steps in the functions of the artificial intelligence based authoring method according to various embodiments of the application described in the "exemplary methods" section of this specification.
The computer program product may write program code for performing operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also be a computer-readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform steps in the functions of the artificial intelligence based authoring method according to various embodiments of the present application described in the above "exemplary methods" section of the present specification.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present application have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present application are merely examples and not intended to be limiting, and these advantages, benefits, effects, etc. are not to be considered as essential to the various embodiments of the present application. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, as the application is not necessarily limited to practice with the above described specific details.
The block diagrams of the devices, apparatuses, devices, systems referred to in the present application are only illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
It is also noted that in the apparatus, devices and methods of the present application, the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the application to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (10)

1. An artificial intelligence based authoring method comprising:
acquiring a writing material requirement description input by a user;
The writing material requirement description is subjected to word segmentation processing and then passes through a word embedding layer to obtain a sequence of search word embedding vectors;
the sequence of the search word embedded vector is passed through a two-way long-short term memory neural network model to obtain a first scale search semantic understanding feature vector;
embedding the sequence of search terms into a vector, and obtaining a second scale search semantic understanding feature vector through a context encoder based on a converter;
fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector;
acquiring alternative writing materials;
extracting semantic feature vectors of the alternative writing materials from the alternative writing materials through the word embedding layer, the two-way long-short-term memory neural network model and the context encoder based on the converter;
performing association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector to obtain a matching feature matrix; and
and the matching feature matrix is passed through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold.
2. The artificial intelligence based authoring method of claim 1 wherein passing said sequence of search term embedded vectors through a transducer-based context encoder to derive a second scale search semantic understanding feature vector comprises:
inputting the sequence of search term embedded vectors into the converter-based context encoder to obtain a plurality of search feature vectors; and
and cascading the plurality of search feature vectors to obtain the second-scale search semantic understanding feature vector.
3. The artificial intelligence based authoring method of claim 2 wherein inputting said sequence of search term embedded vectors into said converter-based context encoder to derive said plurality of search feature vectors comprises:
arranging the sequence of the search word embedded vectors into an input vector;
respectively converting the input vector into a query vector and a key vector through a learning embedding matrix;
calculating the product between the query vector and the transpose vector of the key vector to obtain a self-attention correlation matrix;
carrying out standardization processing on the self-attention association matrix to obtain a standardized self-attention association matrix;
Inputting the standardized self-attention association matrix into a Softmax activation function to activate so as to obtain a self-attention feature matrix; and
and multiplying the self-attention feature matrix with each search word embedded vector in the sequence of search word embedded vectors as a value vector to obtain a plurality of search feature vectors.
4. The artificial intelligence based authoring method of claim 3, wherein fusing said first scale search semantic understanding feature vector and said second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector comprises:
fusing the first scale search semantic understanding feature vector and the second scale search semantic understanding feature vector to obtain a search depth semantic understanding feature vector according to the following formula;
wherein, the formula is:
X=Concat[V 1 ,V 2 ]
wherein V is 1 Representing the first scale search semantic understanding feature vector, V 2 Representing the second scale search semantic understanding feature vector, concat [. Cndot.,)]Representing a cascading function, and X represents the search depth semantic understanding feature vector.
5. The artificial intelligence based authoring method of claim 4 wherein extracting candidate authoring material semantic feature vectors from said candidate authoring material by way of said word embedding layer, said two-way long and short term memory neural network model and said converter-based context encoder comprises:
The alternative writing materials are subjected to word segmentation processing and then pass through the word embedding layer to obtain a sequence of material word embedding vectors;
the sequence of the embedded vectors of the material words passes through the two-way long-short-term memory neural network model to obtain semantic understanding feature vectors of the first-scale material;
the sequence of the embedded vectors of the material words passes through the context encoder based on the converter to obtain semantic understanding feature vectors of the second-scale material; and
and fusing the semantic understanding feature vector of the first scale material and the semantic understanding feature vector of the second scale material to obtain semantic feature vectors of the alternative writing material.
6. The artificial intelligence based authoring method of claim 5, wherein performing associative encoding on said search depth semantic understanding feature vector and said alternative authoring material semantic feature vector to obtain a matching feature matrix comprises:
calculating the product between the transpose vector of the search depth semantic understanding feature vector and the semantic feature vector of the alternative writing material to obtain an initial matching feature matrix;
obtaining a matching feature map through a convolutional neural network serving as a feature extractor, wherein the number of channels of the convolutional neural network serving as the feature extractor is the same as the length of the search depth semantic understanding feature vector;
Calculating an instance normalization and consistency correlation recovery factor of each feature matrix of the matching feature graph along a channel dimension to obtain a channel weighted feature vector formed by a plurality of instance normalization and consistency correlation recovery factors;
the channel weighted feature vector is used as a weighted feature vector to respectively weight the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to obtain a corrected search depth semantic understanding feature vector and a corrected alternative writing material semantic feature vector; and
and calculating the product between the transpose vector of the corrected search depth semantic understanding feature vector and the corrected candidate writing material semantic feature vector to obtain the matching feature matrix.
7. The artificial intelligence based authoring method of claim 6 wherein said initially matching feature matrix is passed through a convolutional neural network as a feature extractor to obtain a matching feature map comprising:
each layer using the convolutional neural network is performed in forward transfer of the layer:
carrying out convolution processing on input data to obtain a convolution characteristic diagram;
carrying out mean pooling based on a local feature matrix on the convolution feature map to obtain a pooled feature map; and
Non-linear activation is carried out on the pooled feature map so as to obtain an activated feature map;
the output of the last layer of the convolutional neural network is the matching feature map, and the input of the first layer of the convolutional neural network is the initial matching feature matrix.
8. The artificial intelligence based authoring method of claim 7, wherein calculating instance normalization and consistency related recovery factors for each feature matrix of said matched feature map along a channel dimension to arrive at a channel weighted feature vector comprised of a plurality of instance normalization and consistency related recovery factors, comprises:
calculating an instance normalization and consistency correlation recovery factor for each feature matrix along a channel dimension of the matching feature map to obtain a channel weighted feature vector comprised of a plurality of instance normalization and consistency correlation recovery factors, in accordance with the following equation;
wherein, the formula is:
wherein m is i,j For the eigenvalues of the (i, j) th position of each eigenvalue, μ and σ are the mean and variance of the set of eigenvalues of each position of the eigenvalue matrix, and W and H are the width and height of the eigenvalue matrix, respectively, exp represents an exponential operation with e as the base, log represents a logarithmic operation with 2 as the base, and α represents the example normalization and consistency related recovery factor.
9. The artificial intelligence based authoring method of claim 8 wherein passing said matching feature matrix through a classifier to obtain a classification result indicating whether a degree of adaptation between the candidate authoring material and the user-entered authoring material requirement description exceeds a predetermined threshold comprises:
expanding the matching feature matrix into classification feature vectors according to row vectors or column vectors;
inputting the classification feature vector into a Softmax classification function of the classifier to obtain a probability value of the classification feature vector belonging to each classification label; and
and determining the classification label corresponding to the maximum probability value as the classification result.
10. An artificial intelligence based authoring system comprising:
the user demand acquisition module is used for acquiring the writing material demand description input by the user;
the requirement data structuring module is used for obtaining a sequence of search word embedding vectors through a word embedding layer after carrying out word segmentation processing on the writing material requirement description;
the medium-distance semantic understanding module is used for enabling the sequence of the search word embedded vector to pass through a two-way long-short-term memory neural network model to obtain a first-scale search semantic understanding feature vector;
The long-distance semantic understanding module is used for enabling the sequence of the search word embedded vectors to pass through a context encoder based on a converter to obtain second-scale search semantic understanding feature vectors;
the depth demand understanding module is used for fusing the first scale searching semantic understanding feature vector and the second scale searching semantic understanding feature vector to obtain a searching depth semantic understanding feature vector;
the alternate writing material acquisition module is used for acquiring alternate writing materials;
the semantic understanding module of the material of writing is used for extracting the semantic feature vector of the material of writing alternatives from the material of writing alternatives through the word embedding layer, the two-way long-short-term memory neural network model and the context encoder based on the converter;
the association coding module is used for carrying out association coding on the search depth semantic understanding feature vector and the alternative writing material semantic feature vector so as to obtain a matching feature matrix; and
and the adaptation degree result generation module is used for passing the matching feature matrix through a classifier to obtain a classification result, wherein the classification result is used for indicating whether the adaptation degree between the alternative writing material and the writing material requirement description input by the user exceeds a preset threshold value.
CN202310183555.3A 2023-02-25 2023-02-25 Writing method and system based on artificial intelligence Active CN116629211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310183555.3A CN116629211B (en) 2023-02-25 2023-02-25 Writing method and system based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310183555.3A CN116629211B (en) 2023-02-25 2023-02-25 Writing method and system based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN116629211A CN116629211A (en) 2023-08-22
CN116629211B true CN116629211B (en) 2023-10-27

Family

ID=87640550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310183555.3A Active CN116629211B (en) 2023-02-25 2023-02-25 Writing method and system based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN116629211B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274270B (en) * 2023-11-23 2024-01-26 吉林大学 Digestive endoscope real-time auxiliary system and method based on artificial intelligence

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563160A (en) * 2020-04-15 2020-08-21 华南理工大学 Text automatic summarization method, device, medium and equipment based on global semantics
CN112749566A (en) * 2019-10-31 2021-05-04 兰雨晴 English writing auxiliary oriented semantic matching method and device
CN113822076A (en) * 2021-07-12 2021-12-21 腾讯科技(深圳)有限公司 Text generation method and device, computer equipment and storage medium
CN114925687A (en) * 2022-05-17 2022-08-19 西安交通大学 Chinese composition scoring method and system based on dynamic word vector representation

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10902738B2 (en) * 2017-08-03 2021-01-26 Microsoft Technology Licensing, Llc Neural models for key phrase detection and question generation
US11520971B2 (en) * 2019-03-30 2022-12-06 The Regents Of The University Of California System and method for artificial intelligence story generation allowing content introduction
US11727913B2 (en) * 2019-12-23 2023-08-15 Adobe Inc. Automatically associating context-based sounds with text
US20230059494A1 (en) * 2021-08-19 2023-02-23 Digital Asset Capital, Inc. Semantic map generation from natural-language text documents

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112749566A (en) * 2019-10-31 2021-05-04 兰雨晴 English writing auxiliary oriented semantic matching method and device
CN111563160A (en) * 2020-04-15 2020-08-21 华南理工大学 Text automatic summarization method, device, medium and equipment based on global semantics
CN113822076A (en) * 2021-07-12 2021-12-21 腾讯科技(深圳)有限公司 Text generation method and device, computer equipment and storage medium
CN114925687A (en) * 2022-05-17 2022-08-19 西安交通大学 Chinese composition scoring method and system based on dynamic word vector representation

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Authorship Attribution on Kannada Text using Bi-Directional LSTM Technique;Chandrika C P etc.;International Journal of Advanced Computer Scinece and Applications;第13卷(第09期);全文 *
Sentiment Classification Using a Single-Layered BiLSTM Model;ZABIT HAMEED etc.;IEEEAccess;全文 *
基于对抗训练的文本表示和分类算法;张晓辉等;计算机科学(第S1期);全文 *
结合自注意力机制的神经网络文本分类算法研究;贾红雨等;计算机应用与软件(第02期);全文 *
融合实体上下文特征的深度文本语义匹配模型;徐文峰等;武汉大学学报(理学版)(第05期);全文 *

Also Published As

Publication number Publication date
CN116629211A (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN109033068B (en) Method and device for reading and understanding based on attention mechanism and electronic equipment
CN108959246B (en) Answer selection method and device based on improved attention mechanism and electronic equipment
CN111226222B (en) Depth context-based grammar error correction using artificial neural networks
CN109190131B (en) Neural machine translation-based English word and case joint prediction method thereof
CN108416058B (en) Bi-LSTM input information enhancement-based relation extraction method
CN111460807B (en) Sequence labeling method, device, computer equipment and storage medium
CN107798140B (en) Dialog system construction method, semantic controlled response method and device
CN108959482B (en) Single-round dialogue data classification method and device based on deep learning and electronic equipment
CN111401084B (en) Method and device for machine translation and computer readable storage medium
CN109214006B (en) Natural language reasoning method for image enhanced hierarchical semantic representation
CN111666758B (en) Chinese word segmentation method, training device and computer readable storage medium
CN110796160A (en) Text classification method, device and storage medium
CN114676234A (en) Model training method and related equipment
CN113704416B (en) Word sense disambiguation method and device, electronic equipment and computer-readable storage medium
CN112329476A (en) Text error correction method and device, equipment and storage medium
CN113987169A (en) Text abstract generation method, device and equipment based on semantic block and storage medium
CN116257406A (en) Gateway data management method and system for smart city
CN116629211B (en) Writing method and system based on artificial intelligence
CN113705196A (en) Chinese open information extraction method and device based on graph neural network
CN112464655A (en) Word vector representation method, device and medium combining Chinese characters and pinyin
CN114925702A (en) Text similarity recognition method and device, electronic equipment and storage medium
CN111597816A (en) Self-attention named entity recognition method, device, equipment and storage medium
CN110852071A (en) Knowledge point detection method, device, equipment and readable storage medium
CN113420117A (en) Emergency classification method based on multivariate feature fusion
CN113609873A (en) Translation model training method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Zhu Qinrong

Inventor after: Wei Shijie

Inventor after: Yu Jiajun

Inventor before: Zhu Qinrong

GR01 Patent grant
GR01 Patent grant