An artificial intelligence-assisted writing system
By designing an artificial intelligence-assisted writing system, using the CBOW model and semantic matrix association algorithm, the problem that the existing technology cannot perform text association is solved, and efficient sentence meaning calculation and text writing assistance is realized, reducing costs and time.
Patent Information
- Application Number
- CN202011002905.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-09-22
AI Technical Summary
Existing natural language processing technology cannot effectively implement associative calculations based on the text input by users, cannot return high-quality text with semantic closeness, and the training cost is high, making it difficult to assist users in writing and understanding literary works.
An artificial intelligence-assisted writing system was designed, including information processing module, word vector semantic module, sentence vector semantic module and sentence vector matrix module. Through the CBOW model neural network training module and sentence vector combination algorithm, phrase vector library and sentence characteristics are generated. Vector matrix library uses semantic matrix association algorithm to calculate the similarity between target text and literary works and output similar sentences.
It realizes similar operations based on sentence meanings to assist text writing, improves users' self-examination and comparison capabilities of text writing, reduces calculation time and cost, and improves sentence meaning computing efficiency.
Smart Images

Figure CN114254645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning, and in particular to an artificial intelligence assisted writing system. Background Art
[0002] For modeling complex natural language tasks, probabilistic model technology was initially used. However, when learning the joint probability function of the language model, there is a fatal dimensionality curse problem. If the dictionary size of the language model is 100,000, and the joint distribution of 10 consecutive words is represented by one-hot encoding, then the total number of parameters of the deep model may be 10 50 Correspondingly, the model needs to have sufficient confidence, and the number of samples required increases exponentially. In order to solve this problem, Hinton et al. first proposed the distributed representation technology in 1986. The basic idea is to represent words as n-dimensional continuous real number vectors. Distributed representation has a powerful feature representation capability. An n-dimensional vector with k values in each dimension can represent k n Features. The n of common open source trained word vector models is usually in the hundreds or even thousands of dimensions. The common word vector training method is CBOW (Continuous Bag-of-Word Model).
[0003] Word vectors are the foundation of NLP deep learning research. Since semantically similar words tend to appear in similar contexts, these vectors will try to capture the neighboring features of words during the learning process, thereby learning the similarities between words. Compared with text, the advantage of word vectors is that they are computable, and the similarity between words can be measured by calculating cosine distance, Euclidean distance, etc. However, they are powerless in terms of sentence semantic similarity and article similarity.
[0004] In addition, existing natural language understanding technology (NLP) not only fails to understand and remember literary works and various texts in terms of natural language understanding, but also fails to perform associative calculations based on the text input by the user, fails to return high-quality text with similar semantics, and fails to achieve the purpose of assisting users in association, citing classics, and writing. For example, Baidu's latest natural language understanding ERNIE 2.0 technology in 2020, although it has significantly surpassed the world's leading technology in 16 public data sets such as sentiment analysis, text matching, natural language reasoning, lexical analysis, reading comprehension, and intelligent question and answer, it also fails to perform associative calculations based on the text input by the user, fails to return high-quality text with similar semantics, and has high training costs. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide an artificial intelligence assisted writing system.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] The present invention provides an artificial intelligence assisted writing system, comprising a writing system, wherein the writing system comprises an information processing module, a word vector semantic module, a sentence vector semantic module and a sentence vector matrix module, wherein the word vector semantic module comprises a CBOW model neural network training module, the information processing module comprises an information collection module, a text box input module and a text box output module, the sentence vector semantic module comprises a sentence vector combination algorithm, and the sentence vector matrix module comprises a semantic matrix association algorithm, and specifically comprises the following steps:
[0008] A. Collect a large number of literary works through the information processing module, and after segmentation, convert the text into strings to form a text paragraph library;
[0009] B. Process the text paragraphs collected in step A through the word vector semantic module. First, the text paragraphs are segmented, and then the words are processed in turn through the CBOW model neural network training module to obtain the word vectors of each word, and then the word vectors are combined to form a phrase vector library;
[0010] The CBOW model neural network training module is used based on the word2vec bag-of-words algorithm model. The training process of the CBOW model neural network training module is to extract some literary sentences from a large number of literary sentences as training data, extract phrases W(t) from each sentence, and predict W(t) through context words w(t-2), w(t-1), w(t+1), and w(t+2). The trained CBOW model neural network training module quantifies word strings, including the following steps:
[0011] (1) Input the one-hot encoding of the context words of the current word into the input layer, where the one-hot encoding dimension is 1*V, and set up a matrix W1, where the dimension of W1 is V*N, where V is the total number of phrases in the dictionary and N is a custom dimension;
[0012] (2) Multiply the context words by the same matrix W1 to obtain the respective vectors 1*N of the context words, and average the 1*N vectors as a whole into a vector 1*N. Finally, multiply the average vector 1*N by the matrix W2 to become 1*V, where the dimension of W2 is N*V.
[0013] (3) After normalizing the 1*V vector, extract the probability vector of each word, and take the word corresponding to the largest probability value as the predicted word W(u). Then, calculate the error between the predicted word W(u) and the true expected word W(n), and do back-propagation gradient descent to adjust the matrix values of W1 and W2. The final W1 matrix value is the phrase vector library of the literary sentence.
[0014] C. Place the phrase vector library in step B as a whole into the sentence vector semantic module, and output the word vector as a sentence vector through the sentence vector combination algorithm, so that the sentences of the text paragraph are expressed by the sentence vector;
[0015] The sentence vector combination algorithm is based on the calculation under the CBOW model neural network training module. The word vector obtained by the CBOW model neural network training module forms the sentence vector. The specific method is: according to the obtained word vector, let sentence A contain n words, and each word is represented by an m-dimensional word vector in the phrase vector library. Then the word vector set contained in sentence A is X (X1, X2...X n ), where each word vector is represented as:
[0016] X1=[X 11 , X 12 ...X 1m ]
[0017] X2=[X 21 , X 22 ...X 2m ]
[0018] …
[0019] X n =[X n1 , X n2 ...X nm ]
[0020] Assume the semantic feature vector Avec of sentence A, then the algorithm of semantic feature vector Avec is:
[0021] Avec=[(X 11 +X 21 +……+X n1 ) / n,(X 12 +X 22 +……+X n2 ) / n,……,(X 1m +X 2m +……
[0022] +X nm ) / n], to simplify the representation, let:
[0023] Y1=(X 11 +X 21 +……+X n1 ) / n
[0024] Y2=(X 12 +X 22 +……+X n2 ) / n
[0025] …
[0026] Y m =(X 1m +X 2m +……+X nm ) / n
[0027] Then the semantic feature vector Avec of sentence A=[Y1,Y2,……,Y m ], where Y m The data type of is a floating point number. Therefore, after collecting multiple sentence vectors, let the total number of sentences be S. The floating point type matrix obtained according to the sentence vector is expressed as:
[0028]
[0029] The output matrices are combined to form the matrix library G of literary works;
[0030] D. Each paragraph in the text paragraph library generated in step A is subjected to steps B and C to obtain a sentence feature vector of each text paragraph. The feature sentence vector of the sentence is expressed in floating point type, and then all the sentence feature vectors are merged to form a literary work matrix library;
[0031] E. The user inputs the target text through the text box input module of the information processing module. After the text is converted into a string, the target sentence vector is formed through steps B and C;
[0032] F. Process the target sentence vector and the literary work matrix library in step D through the semantic matrix association algorithm of the sentence vector matrix module to obtain a set of similar sentence vectors, and output them to the text box output module of the information processing module, and arrange them in ascending order according to the similarity rate;
[0033] The semantic matrix association algorithm combines the target text and the literary work matrix library and includes the Euclidean distance formula, which includes the following steps:
[0034] The target text input by the user in step E is set as P text, and the n-dimensional feature vector of P text is obtained by steps B and C as X″(X″1, X″2…X″ n ), the X″ set here refers specifically to the set of P texts. The X″ sets described below are all concepts of P texts. Let the contrasting sentence be Y(Y1, Y2, …, Y m ), then the corresponding formula for multi-dimension is:
[0035]
[0036] Calculate the distance between the P text and the millions of sentence feature vectors stored in the program in sequence, which is the similarity between the sentences. Finally, sort the similar sentences.
[0037] As a preferred technical solution of the present invention, the information processing module includes a web crawler technology or a network API platform external port for extracting literary work information.
[0038] As a preferred technical solution of the present invention, the semantic matrix association algorithm includes an algorithm simplification process, and the steps are as follows:
[0039] First define the transformation matrix of m rows The m-row transformation matrix and the corresponding semantic feature vector Y(Y′1,Y′2,…,Y′ n ) and multiply them together to get:
[0040]
[0041] Then, all the memorized sentence feature vectors are merged into a matrix library G, and the matrix library G is a matrix with m rows and n columns, that is, the algorithm memorizes m sentences, and the feature vector of each sentence is n-dimensional;
[0042] D = X'-G, where X' is the text P input by the user, which is a matrix with one row and n columns, and is converted into a matrix X' with m rows and n columns by the transformation matrix C; after subtracting X' from the matrix library G, the difference between the semantic feature vector Avec of the text P and the vectors of all sentences in the matrix library G can be obtained to obtain the matrix D;
[0043] E = D⊙D, where the operator "⊙" is the Hadamard product, and E in the formula is the Hadamard product of the matrix D and itself;
[0044] Finally, F=E T *C, where E T is the transposed E, C is the transformation matrix, and the resulting F is a matrix of m rows and one column. The values in the matrix are the similarities between the P text and each sentence. After arranging them in ascending order, we can get a list of sentences that are closest to the P text.
[0045] As a preferred technical solution of the present invention, the semantic matrix association algorithm is mainly arranged on a GPU for operation.
[0046] As a preferred technical solution of the present invention, the semantic matrix association algorithm is mainly arranged on a GPU for operation.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] 1: The present invention can convert a piece of text or sentence into data that can be stored and calculated by a computer by creating a new sentence meaning algorithm. Compared with the previous word meaning calculation, it is more thoughtful and can output similar text for the user's input text based on the similarity operation between sentence meanings, thereby achieving the beneficial effect of assisting text writing and increasing the user's self-examination and comparison of text writing.
[0049] 2: The present invention changes the single-threaded operation mode to a matrix operation mode. Through efficient matrix operations on the GPU, the semantic calculation time can be reduced from m times to 1 time in a short time, which greatly improves the efficiency of sentence meaning operations.
[0050] 3: After implementing the matrix operation method, the present invention can reduce the cost of deep learning required for single-threaded operations and increase the efficiency of machine learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0052] Figure 1 It is a schematic diagram of the system structure of the present invention;
[0053] Figure 2 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0054] The preferred embodiments of the present invention are described below. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0055] Example 1
[0056] like Figure 1-2 As shown, the present invention provides an artificial intelligence assisted writing system, including a writing system, the writing system includes an information processing module, a word vector semantic module, a sentence vector semantic module and a sentence vector matrix module, the word vector semantic module includes a CBOW model neural network training module, the information processing module includes an information collection module, a text box input module and a text box output module, the sentence vector semantic module includes a sentence vector combination algorithm, and the sentence vector matrix module includes a semantic matrix association algorithm, which specifically includes the following steps:
[0057] A. Collect a large number of literary works through the information processing module, and after segmentation, convert the text into strings to form a text paragraph library;
[0058] B. Process the text paragraphs collected in step A through the word vector semantic module. First, the text paragraphs are segmented, and then the words are processed in turn through the CBOW model neural network training module to obtain the word vectors of each word, and then the word vectors are combined to form a phrase vector library;
[0059] The CBOW model neural network training module is used based on the word2vec bag-of-words algorithm model. The training process of the CBOW model neural network training module is to extract some literary sentences from a large number of literary sentences as training data, extract phrases W(t) from each sentence, and predict W(t) through context words w(t-2), w(t-1), w(t+1), and w(t+2). The trained CBOW model neural network training module quantifies word strings, including the following steps:
[0060] (1) Input the one-hot encoding of the context words of the current word into the input layer, where the one-hot encoding dimension is 1*V, and set up a matrix W1, where the dimension of W1 is V*N, where V is the total number of phrases in the dictionary and N is a custom dimension;
[0061] (2) Multiply the context words by the same matrix W1 to obtain the respective vectors 1*N of the context words, and average the 1*N vectors as a whole into a vector 1*N. Finally, multiply the average vector 1*N by the matrix W2 to become 1*V, where the dimension of W2 is N*V.
[0062] (3) After normalizing the 1*V vector, extract the probability vector of each word, and take the word corresponding to the largest probability value as the predicted word W(u). Then, calculate the error between the predicted word W(u) and the true expected word W(n), and do back-propagation gradient descent to adjust the matrix values of W1 and W2. The final W1 matrix value is the phrase vector library of the literary sentence.
[0063] C. Place the phrase vector library in step B as a whole into the sentence vector semantic module, and output the word vector as a sentence vector through the sentence vector combination algorithm, so that the sentences of the text paragraph are expressed by the sentence vector;
[0064] The sentence vector combination algorithm is based on the calculation under the CBOW model neural network training module. The word vector obtained by the CBOW model neural network training module forms the sentence vector. The specific method is: according to the obtained word vector, let sentence A contain n words, and each word is represented by an m-dimensional word vector in the phrase vector library. Then the word vector set contained in sentence A is X (X1, X2...X n ), where each word vector is represented as:
[0065] X1=[X 11 , X 12 ...X 1m ]
[0066] X2=[X 21 , X 22 ...X 2m ]
[0067] …
[0068] X n =[X n1 , X n2 ...X nm ]
[0069] Assume the semantic feature vector Avec of sentence A, then the algorithm of semantic feature vector Avec is:
[0070] Avec=[(X 11 +X 21 +……+X n1 ) / n,(X 12 +X 22 +……+X n2 ) / n,……,(X 1m +X 2m +……
[0071] +X nm ) / n], to simplify the representation, let:
[0072] Y1=(X 11 +X 21 +……+X n1 ) / n
[0073] Y2=(X 12 +X 22 +……+X n2 ) / n
[0074] …
[0075] Y m =(X 1m +X 2m +……+X nm ) / n
[0076] Then the semantic feature vector Avec of sentence A=[Y1,Y2,……,Y m ], where Y m The data type of is a floating point number. Therefore, after collecting multiple sentence vectors, let the total number of sentences be S. The floating point type matrix obtained according to the sentence vector is expressed as:
[0077]
[0078] The output matrices are combined to form the matrix library G of literary works;
[0079] D. Each paragraph in the text paragraph library generated in step A is subjected to steps B and C to obtain a sentence feature vector of each text paragraph. The feature sentence vector of the sentence is expressed in floating point type, and then all the sentence feature vectors are merged to form a literary work matrix library;
[0080] E. The user inputs the target text through the text box input module of the information processing module. After the text is converted into a string, the target sentence vector is formed through steps B and C;
[0081] F. Process the target sentence vector and the literary work matrix library in step D through the semantic matrix association algorithm of the sentence vector matrix module to obtain a set of similar sentence vectors, and output them to the text box output module of the information processing module, and arrange them in ascending order according to the similarity rate;
[0082] The semantic matrix association algorithm combines the target text and the literary work matrix library and includes the Euclidean distance formula, which includes the following steps:
[0083] The target text input by the user in step E is set as P text, and the n-dimensional feature vector of P text is obtained by steps B and C as X″(X″1, X″2…X″ n ), the X″ set here refers specifically to the set of P texts. The X″ sets described below are all concepts of P texts. Let the contrasting sentence be Y(Y1, Y2, …, Y m ), then the corresponding formula for multi-dimension is:
[0084]
[0085] Calculate the distance between the P text and the millions of sentence feature vectors stored in the program in sequence, which is the similarity between the sentences. Finally, sort the similar sentences.
[0086] The information processing module includes a web crawler technology or a network API platform external port for extracting literary work information.
[0087] The semantic matrix association algorithm includes an algorithm simplification process, the steps of which are as follows:
[0088] First define the transformation matrix of m rows The m-row transformation matrix and the corresponding semantic feature vector Y(Y′1,Y′2,…,Y′ n ) and multiply them together to get:
[0089]
[0090] Then, all the memorized sentence feature vectors are merged into a matrix library G, and the matrix library G is a matrix with m rows and n columns, that is, the algorithm memorizes m sentences, and the feature vector of each sentence is n-dimensional;
[0091] D = X'-G, where X' is the text P input by the user, which is a matrix with one row and n columns, and is converted into a matrix X' with m rows and n columns by the transformation matrix C; after subtracting X' from the matrix library G, the difference between the semantic feature vector Avec of the text P and the vectors of all sentences in the matrix library G can be obtained to obtain the matrix D;
[0092] E = D⊙D, where the operator "⊙" is the Hadamard product, and E in the formula is the Hadamard product of the matrix D and itself;
[0093] Finally, F=E T *C, where E T is the transposed E, C is the transformation matrix, and the resulting F is a matrix of m rows and one column. The values in the matrix are the similarities between the P text and each sentence. After arranging them in ascending order, we can get a list of sentences that are closest to the P text.
[0094] The semantic matrix association algorithm is mainly set up on the GPU for calculation.
[0095] Specifically, according to the above description, the present application mainly provides a text sentence meaning algorithm, which can convert the target text into a sentence vector that can be recognized by the program, and then combine the literary works into a database according to the characteristics of the sentence vector, and form a comparison between a single sentence vector and the literary work database according to the association algorithm, so as to find the most similar sentences. The sentence vector is mainly based on the existing word vector. Through the CBOW model neural network training module based on the word2vec algorithm, the semantics in the sentence is converted into the theme, theme weight and keywords contained in the body of the phrase. According to the keyword index phrase to sentence, the sentence is formed by word vector as the target, and the phrase matrix vector is combined into the target sentence. Then, according to the existing phrase matrix vector, the phrase matrix is converted into a sentence vector, that is, It converts each phrase in the sentence into a word vector, and superimposes the meanings of these word vectors. Since each set of word vectors is a single-column set of 1*N, the superimposed sentence matrix can also be converted into a single-column set of 1*N, so that the meanings of multiple phrase combinations are superimposed into sentence vectors. Sentence vectors are expressed through multiple phrase combinations. Finally, multiple sentence vectors containing semantic features are merged into a floating-point matrix, and this matrix and the original text are stored in the server. The sentence feature matrix here is the literary work matrix library. Since the matrix mainly feeds back the semantic features of the sentence, the computer can understand the meaning of the original text through the sentence meaning matrix. When the computer outputs, it mainly outputs the corresponding original text through the sentence meaning matrix to achieve the corresponding output effect.
[0096] When outputting by association, the text to be associated is mainly converted into a sentence vector through the above steps. The basis of the associative output mainly involves Euclid's associative formula. According to the associative formula, the distance between the P text and multiple sentence feature vectors is calculated, that is, the distance (also called similarity) between the P text and the millions of sentences stored in the program, such as the sentence feature vectors in the literary work matrix library described above, is calculated in turn. After that, the sentence is sorted to see which sentence is closest to the P text, so that we know which sentence is most similar to the P text in semantics. This method can accurately determine the degree of similarity between sentences and ensure that the output sentences have the same meaning.
[0097] If the number of sentences in the matrix library of literary works reaches tens of millions, it takes a long time to traverse it. Therefore, in order to improve the computational efficiency of sentence meaning, the single-loop association operation is improved to a matrix operation method again, and the required operation time is reduced from m times to one time. The method is mainly based on the semantic matrix association algorithm described in the present invention. By converting the X text into a matrix of the same dimension as the matrix library of literary works, and then merging the two to calculate the difference, and then converting according to the formula to obtain the final single-column matrix set, the data in the set is the similarity of the sentence vectors in the P text and the matrix library of literary works, and the similar numerical values That is, it represents the similarity of the sentence vectors in the matrix library of literary works. The output is in ascending order. The matrix association algorithm used simulates the association mechanism of the human brain to achieve understanding and association of user semantics. It can quickly extend from a single text to multiple similar and different semantic texts. The output is also the language of celebrity literary works collected by the matrix library of literary works. Therefore, the output sentences have a strong literary quality, which can stimulate the author's inspiration when writing. It can be used in various application fields such as screenwriting, literary creation and self-media copywriting, and has strong practicality and versatility.
[0098] Example 2
[0099] The present invention can be combined with an image recognition algorithm, and can identify the sun, sky and fog in the picture by identifying the patterns in the picture. After identification, the words can be converted according to the output phrase text according to the steps in Example 1, and finally output as corresponding literary works, so as to achieve the purpose of matching text and paragraphs with the picture and realize the effect of rapid creation.
[0100] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An artificial intelligence-assisted writing system, comprising a writing system, characterized in that: The writing system includes an information processing module, a word vector semantic module, a sentence vector semantic module and a sentence vector matrix module. The word vector semantic module includes a CBOW model neural network training module. The information processing module includes an information collection module, a text box input module and a text box output module. The sentence vector semantic module includes a sentence vector combination algorithm. The sentence vector matrix module includes a semantic matrix association algorithm. Specifically, the following steps are included: A. Collect a large number of literary works through the information processing module, and after segmentation, convert the text into strings to form a text paragraph library; B. Process the text paragraphs collected in step A through the word vector semantic module. First, the text paragraphs are segmented, and then the words are processed in turn through the CBOW model neural network training module to obtain the word vectors of each word, and then the word vectors are combined to form a phrase vector library; The CBOW model neural network training module is used based on the word2vec bag-of-words algorithm model. The training process of the CBOW model neural network training module is to extract some literary sentences from a large number of literary sentences as training data, extract phrases W(t) from each sentence, and predict W(t) through context words w(t-2), w(t-1), w(t+1), and w(t+2). The trained CBOW model neural network training module quantifies word strings, including the following steps: (1) Input the one-hot encoding of the context words of the current word into the input layer, where the one-hot encoding dimension is 1*V, and set up a matrix W1, where the dimension of W1 is V*N, where V is the total number of phrases in the dictionary and N is a custom dimension; (2) Multiply the context words by the same matrix W1 to obtain the respective vectors 1*N of the context words, and average the 1*N vectors as a whole into a vector 1*N. Finally, multiply the average vector 1*N by the matrix W2 to become 1*V, where the dimension of W2 is N*V. (3) After normalizing the 1*V vector, extract the probability vector of each word, and take the word corresponding to the largest probability value as the predicted word W(u). Then, calculate the error between the predicted word W(u) and the true expected word W(n), and do back-propagation gradient descent to adjust the matrix values of W1 and W2. The final W1 matrix value is the phrase vector library of the literary sentence. C. Place the phrase vector library in step B as a whole into the sentence vector semantic module, and output the word vector as a sentence vector through the sentence vector combination algorithm, so that the sentences of the text paragraph are expressed by the sentence vector; The sentence vector combination algorithm is based on the calculation under the CBOW model neural network training module. The word vector obtained by the CBOW model neural network training module forms the sentence vector. The specific method is: according to the obtained word vector, let sentence A contain n words, and each word is represented by an m-dimensional word vector in the phrase vector library. Then the word vector set contained in sentence A is X (X1, X2...X n ), where each word vector is represented as: X1=[X 11 ,X 12 ……X 1m ] X2=[X 21 ,X 22 ……X 2m ] …… X n =[X n1 ,X n2 ……X nm ] Assume the semantic feature vector Avec of sentence A, then the algorithm of semantic feature vector Avec is: With=[(X 11 +X 21 +……+X n1 ) / n,(X 12 +X 22 +……+X n2 ) / n,……,(X 1m +X 2m +…… +X nm ) / n], to simplify the representation, let: Y1=(X 11 +X 21 +……+X n1 ) / n Y2=(X 12 +X 22 +……+X n2 ) / n …… Y m =(X 1m +X 2m +……+X nm ) / n Then the semantic feature vector Avec of sentence A=[Y1,Y2,……,Y m ], where Y m The data type of is a floating point number. Therefore, after collecting multiple sentence vectors, let the total number of sentences be S. The floating point type matrix obtained according to the sentence vector is expressed as: The output matrices are combined to form the matrix library G of literary works; D. Each paragraph in the text paragraph library generated in step A is subjected to steps B and C to obtain a sentence feature vector of each text paragraph. The feature sentence vector of the sentence is expressed in floating point type, and then all the sentence feature vectors are merged to form a literary work matrix library; E. The user inputs the target text through the text box input module of the information processing module. After the text is converted into a string, the target sentence vector is formed through steps B and C; F. Processing the target sentence vector and the literary work matrix library in step D through the semantic matrix association algorithm of the sentence vector matrix module to obtain a set of similar sentence vectors, and outputting them to the text box output module of the information processing module, and arranging them in ascending order by similarity; The semantic matrix association algorithm combines the target text and the literary work matrix library and includes the Euclidean distance formula, which includes the following steps: The target text input by the user in step E is set as P text, and the n-dimensional feature vector of P text is obtained by steps B and C as X″(X″1, X″2…X″ n ), the X″ set here refers specifically to the set of P texts. The X″ sets described below are all concepts of P texts. Let the contrasting sentence be Y(Y1, Y2, …, Y m ), then the corresponding formula for multi-dimension is: Calculate the distance between the P text and the millions of sentence feature vectors stored in the program in sequence, which is the similarity between the sentences. Finally, sort the similar sentences.
2. An artificial intelligence-assisted writing system according to claim 1, characterized in that: The information processing module includes a web crawler technology or a network API platform external port for extracting literary work information.
3. An artificial intelligence-assisted writing system according to claim 2, characterized in that: The semantic matrix association algorithm includes an algorithm simplification process, and the steps are as follows: First define the transformation matrix of m rows The m-row transformation matrix and the corresponding semantic feature vector Y(Y′1,Y′2,…,Y′ n ) and multiply them together to get: Then, all the memorized sentence feature vectors are merged into a matrix library G, and the matrix library G is a matrix with m rows and n columns, that is, the algorithm memorizes m sentences, and the feature vector of each sentence is n-dimensional; D = X'-G, where X' is the text P input by the user, which is a matrix with one row and n columns, and is converted into a matrix X' with m rows and n columns by the transformation matrix C; after subtracting X' from the matrix library G, the difference between the semantic feature vector Avec of the text P and the vectors of all sentences in the matrix library G can be obtained to obtain the matrix D; E=D⊙D, where the operator "⊙" is the Hadamard product, and E in the formula is the Hadamard product of the matrix D and itself; Finally, F=E T *C, where E T is the transposed E, C is the transformation matrix, and the resulting F is a matrix of m rows and one column. The values in the matrix are the similarities between the P text and each sentence. After arranging them in ascending order, we can get a list of sentences that are closest to the P text.
4. The artificial intelligence-assisted writing system according to claim 1, characterized in that: The semantic matrix association algorithm is mainly configured to perform operations on a GPU.
