Text fluency detection method, device, equipment and computer-readable storage medium

Through word segmentation, part-of-speech analysis and semantic information fusion, combined with the neural network model, text fluency detection is performed, which solves the problem of low accuracy in the existing technology and improves the accuracy and reliability of detection.

CN112329433BActive Publication Date: 2024-10-22PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011249740.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-10
Publication Date
2024-10-22
Estimated Expiration
2040-11-10

AI Technical Summary

Technical Problem

Existing text fluency detection technology has low accuracy, and it is difficult to effectively judge whether the text conforms to the way humans speak, especially whether it is readable and understandable in terms of grammar and semantics.

Method used

By obtaining the text to be detected for word segmentation and part-of-speech analysis, the word's part-of-speech association information and semantic information are determined. After fusion, it is input into the neural network classifier for fluency prediction. The word vector model and the bidirectional transformation coding model are used to extract sentence feature information, and combine multiple The neural network model performs probability prediction to improve detection accuracy.

Benefits of technology

It improves the accuracy and reliability of text fluency detection, provides more comprehensive sentence feature extraction and prediction results by simultaneously considering part-of-speech associations and semantic information, and solves the problem of low accuracy in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112329433B_ABST
    Figure CN112329433B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and computer-readable storage medium for detecting text fluency, the method comprising: obtaining a text to be detected, performing word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtaining part-of-speech information corresponding to the text to be detected; determining part-of-speech association information of words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and determining semantic information of words in the text to be detected based on the text to be detected; fusing the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected; inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtaining a text fluency result of the text to be detected. The present invention solves the technical problem of low accuracy of existing text fluency detection technologies, and improves the detection accuracy of text fluency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a text fluency detection method, device, equipment and computer-readable storage medium. Background Art

[0002] Text fluency refers to whether a sentence or paragraph conforms to the way humans speak and whether it is readable and understandable in terms of grammar and semantics. Text fluency has many related applications in the field of natural language processing, such as in machine translation, judging whether the automatically translated sentence is fluent; in text summary generation, judging whether the automatically generated summary is fluent; in automatic document review, judging whether the written sentence is fluent, etc.

[0003] At present, there are two major methods for judging text fluency. One is to develop human language paradigms through linguistics. For example, a declarative sentence is composed of a subject, predicate, and object, and attributive modifiers need to be added before nouns. However, due to the great flexibility of word combinations in language, this method is difficult to solve the problems of multiple complex word combinations and polysemy of a word. The other is a statistical language model method based on n-gram. The basic idea is to perform a sliding window operation of size n on the text content according to bytes, and multiply the probability of occurrence of consecutive bytes in each window as the probability of sentence occurrence. However, this method only considers the co-occurrence information between words and lacks consideration of semantic level information.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a text fluency detection method, device, equipment and computer-readable storage medium, aiming to solve the technical problem of low accuracy of existing text fluency detection technology.

[0006] To achieve the above object, the present invention provides a text fluency detection method, the text fluency detection method comprising the following steps:

[0007] Acquire a text to be detected, perform word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtain part-of-speech information corresponding to the text to be detected;

[0008] Determine the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and determine the semantic information of the words in the text to be detected based on the text to be detected;

[0009] The part-of-speech association information and the semantic information corresponding to the text to be detected are integrated to obtain sentence feature information corresponding to the text to be detected;

[0010] The sentence feature information is input into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, thereby obtaining a text fluency result of the text to be detected.

[0011] Optionally, the step of determining part-of-speech association information of words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and determining semantic information of the words in the text to be detected based on the text to be detected includes:

[0012] Inputting the part-of-speech information corresponding to the text to be detected into the word vector model to determine the part-of-speech association information of the words in the text to be detected;

[0013] The text to be detected is input into a bidirectional conversion coding model, and the semantic information of the words in the text to be detected is output.

[0014] Optionally, before the step of inputting the part-of-speech information corresponding to the text to be detected into a word vector model to determine the part-of-speech association information of the words in the text to be detected, the step further includes:

[0015] Acquire a fluency corpus from a fluency corpus, perform word segmentation processing on the fluency corpus, and obtain a fluency word set corresponding to the fluency corpus;

[0016] Performing part-of-speech analysis on the fluency word set to obtain a part-of-speech information set corresponding to the fluency word set;

[0017] The part-of-speech information set is input into an initial word vector model for training, and the word vector model corresponding to the initial word vector model is obtained when the training of the initial word vector model is completed.

[0018] Optionally, before the step of acquiring a fluency corpus from a fluency corpus, performing word segmentation processing on the fluency corpus, and obtaining a fluency word set corresponding to the fluency corpus, the method further includes:

[0019] Acquire a fluent corpus, and perform a word insertion operation and / or a word deletion operation and / or a word order reversal operation on sentences in the fluent corpus to obtain an influent corpus;

[0020] The fluency corpus is constructed based on the fluency corpus and the incoherent corpus, wherein the fluency corpus set in the fluency corpus includes the fluent corpus and the incoherent corpus.

[0021] Optionally, the step of inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected to obtain a text fluency result of the text to be detected includes:

[0022] Inputting the sentence feature information into different pre-stored neural network classifiers to predict the text to be detected based on the prediction models corresponding to the different neural network classifiers, and obtaining the probability prediction values ​​corresponding to the text to be detected;

[0023] The various probability prediction values ​​are fused and processed to obtain the text fluency result of the text to be detected.

[0024] Optionally, the step of fusing the respective probability prediction values ​​to obtain a text fluency result of the text to be detected includes:

[0025] The probability prediction values ​​are averaged to obtain the target probability prediction value corresponding to the text to be detected;

[0026] The target probability prediction value is compared with a pre-stored threshold value to obtain a comparison result, and based on the comparison result, a text fluency result of the text to be detected is obtained.

[0027] Optionally, the step of determining semantic information of words in the text to be detected based on the text to be detected includes:

[0028] Determining a target word in the text to be detected and determining a context word corresponding to the target word in the text to be detected;

[0029] Calculating a similarity weight between the target word and the context word based on a target word vector corresponding to the target word and a context word vector corresponding to the context word;

[0030] Based on the similarity weight and the target word, the semantic information of the word in the text to be detected is determined.

[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a text fluency detection device, the text fluency detection device comprising:

[0032] An acquisition module is used to acquire a text to be detected, and perform word segmentation and part-of-speech analysis on the text to be detected in sequence to obtain part-of-speech information corresponding to the text to be detected;

[0033] A determination module, used to determine the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and to determine the semantic information of the words in the text to be detected based on the text to be detected;

[0034] A fusion module, used for fusing the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected;

[0035] The prediction module is used to input the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected and obtain a text fluency result of the text to be detected.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a text fluency detection device, which includes: a memory, a processor, and a text fluency detection program stored in the memory and executable on the processor, and the text fluency detection program implements the steps of the text fluency detection method as described above when executed by the processor.

[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a text fluency detection program is stored, and when the text fluency detection program is executed by a processor, the steps of the text fluency detection method as described above are implemented.

[0038] The present invention obtains a text to be detected, performs word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtains part-of-speech information corresponding to the text to be detected; based on the part-of-speech information corresponding to the text to be detected, determines the part-of-speech association information of words in the text to be detected, and based on the text to be detected, determines the semantic information of the words in the text to be detected; fuses the part-of-speech association information corresponding to the text to be detected and the semantic information to obtain sentence feature information corresponding to the text to be detected; inputs the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtains a text fluency result of the text to be detected. In this implementation, when judging the fluency of a text, the part-of-speech association relationship of each word in the text to be tested is analyzed to obtain the part-of-speech association information corresponding to the text to be tested, and the sentence meaning of each sentence in the text to be tested is analyzed to obtain the semantic level information corresponding to the text to be tested. Then, sentence feature information of the text to be tested is extracted based on the part-of-speech association information and semantic information of each sentence in the text to be tested. By using the part-of-speech association information and semantic information at the same time, sentence features are extracted more comprehensively, so that a more comprehensive judgment on whether the sentence is fluent can be made based on a neural network classifier in the subsequent process, making the text fluency detection result more reliable and accurate, thereby solving the technical problem of low precision of existing text fluency detection technology and improving the detection accuracy of text fluency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a structural diagram of a text fluency detection device in a hardware operating environment involved in an embodiment of the present invention;

[0040] Figure 2 It is a flowchart of the first embodiment of the text fluency detection method of the present invention;

[0041] Figure 3 Schematic diagram of the flow chart of the second embodiment of the text fluency detection method of the present invention.

[0042] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0044] like Figure 1 As shown, Figure 1 It is a structural diagram of a text fluency detection device in a hardware operating environment involved in an embodiment of the present invention.

[0045] The text fluency detection device in the embodiment of the present invention can be a PC, or it can be a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a portable computer, or other portable terminal devices with display function.

[0046] like Figure 1 As shown, the text fluency detection device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0047] Optionally, the text fluency detection device may further include a camera, a RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The sensor may be a light sensor, a motion sensor, or other sensors.

[0048] Those skilled in the art will understand that Figure 1 The text fluency detection device structure shown in the figure does not constitute a limitation on the text fluency detection device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0049] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a text fluency detection program.

[0050] exist Figure 1 In the text fluency detection device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the text fluency detection program stored in the memory 1005 and execute the text fluency detection method provided in the embodiment of the present invention.

[0051] The present invention also provides a method for detecting text fluency, referring to Figure 2 , Figure 2 Schematic diagram of the flow chart of the first embodiment of the text fluency detection method of the present invention.

[0052] In this embodiment, the text fluency detection method includes the following steps:

[0053] Step S10, obtaining a text to be detected, performing word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtaining part-of-speech information corresponding to the text to be detected;

[0054] The text fluency detection method proposed in the present invention is applied to a system architecture, which includes a preprocessing module, a word vector model, a bidirectional conversion coding model and a neural network classifier, wherein the preprocessing module is used to perform a preprocessing operation on the text, and the preprocessing operation includes a word segmentation operation and a part-of-speech analysis operation, that is, performing word segmentation and part-of-speech analysis on the text; the word vector model is used to perform a relationship analysis operation, that is, analyzing the association relationship between the contexts of the input text; the bidirectional conversion coding model is used to perform a semantic analysis operation on the input words, that is, analyzing the meaning of the words in the sentence; the neural network classifier is used to perform a classification prediction operation on the input information to determine whether the input information is fluent based on the classification prediction operation.

[0055] In this embodiment, in the process of text fluency detection of the text to be detected, the preprocessing module corresponding to the text fluency detection method is used to first segment the text to be detected to obtain the word set to be detected corresponding to the text to be detected, so as to perform a word segmentation operation on each sentence in the text to be detected, that is, to divide each sentence in the text to be detected into words one by one, such as obtaining the four words "dear / I / from / wilderness" after segmenting "Dear, I come from the wilderness"; then, the word set to be detected corresponding to the text to be detected is subjected to part-of-speech analysis to obtain the word set to be detected The corresponding part-of-speech information is analyzed to analyze the word set of each word in the word set to be detected, and analyze the grammatical features of the words, that is, analyze the grammatical functions of the words, such as analyzing to obtain segmentation or quantifiers or adjectives, etc. Among them, the part-of-speech information is the grammatical features of each word in the text to be detected, and one word corresponds to a part-of-speech analysis result, that is, the words in the text to be detected correspond to the part-of-speech information one by one.

[0056] Step S20, determining the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and determining the semantic information of the words in the text to be detected based on the text to be detected;

[0057] In this embodiment, after obtaining the part-of-speech information corresponding to the text to be detected, the text to be detected is input into the word vector model, so that the word vector model analyzes the word association relationship of each word in the text to be detected based on the part-of-speech information of the text to be detected, and obtains the part-of-speech association information of the words in the text to be detected. And the text to be detected without preprocessing is directly input into the bidirectional conversion encoding model, so that the bidirectional conversion encoding model analyzes the semantic information of the words and sentences in the text to be detected, that is, the meaning of the words and sentences in the text to be detected.

[0058] It should be noted that the part-of-speech information of the words in the text to be tested is analyzed to analyze the grammatical information of each word in the text to be tested, the semantic information of the words and sentences in the text to be tested is analyzed, and the word meanings of the words and sentence meanings of the sentences in the text to be tested are analyzed; there is no restriction on the execution order of determining the part-of-speech association information of the words in the text to be tested and determining the semantic information of the words in the text to be tested. The part-of-speech association information of the words in the text to be tested can be determined first and then the semantic information of the words in the text to be tested is determined, or the semantic information of the words in the text to be tested can be determined first and then the part-of-speech association information of the words in the text to be tested is determined, or the two can be performed at the same time.

[0059] Step S30, fusing the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected;

[0060] In this embodiment, after obtaining the part-of-speech association information of each word in the text to be detected and the semantic information of the sentences and words in the text to be detected, the part-of-speech association information and semantic information corresponding to each sentence of the text to be detected are spliced ​​one by one, that is, the part-of-speech association information and semantic information corresponding to each sentence of the text to be detected are fused one by one, and finally the sentence feature information corresponding to each sentence in the text to be detected is obtained. Among them, the sentence feature information of each sentence includes the part-of-speech association information contained in each sentence and the semantic information contained in each sentence. It can be understood that the sentence feature information includes the word association relationship and sentence meaning of the sentence.

[0061] Step S40, inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtaining a text fluency result of the text to be detected.

[0062] In this embodiment, after obtaining the sentence feature information corresponding to the text to be detected, the sentence feature information is input into a pre-stored neural network classifier, so that the neural network classifier predicts the text fluency of each sentence in the text to be detected based on the input sentence feature information, thereby judging the sentence fluency of each sentence in the text to be detected, outputting the sentence fluency result of each sentence in the text to be detected, and obtaining the text fluency result of the text to be detected. Among them, the text fluency result of the text to be detected includes the sentence fluency result of each sentence in the text to be detected, and the sentence fluency result includes a fluent sentence or an incoherent sentence. The neural network classifier is pre-trained, and the neural network classifier can be a plurality of neural network classifiers, including but not limited to a Softmax network, a CNN or an LSTM network, etc. The neural network classifier is not specifically limited in this embodiment.

[0063] Furthermore, the step of inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected and obtaining the text fluency result of the text to be detected includes:

[0064] Step S41, inputting the sentence feature information into different pre-stored neural network classifiers, so as to predict the text to be detected based on the prediction models corresponding to the different neural network classifiers, and obtaining the probability prediction values ​​corresponding to the text to be detected;

[0065] Step S42, fusing the various probability prediction values ​​to obtain a text fluency result of the text to be detected.

[0066] In this embodiment, after obtaining the sentence feature information, the sentence feature information is respectively input into different neural network classifiers for prediction, and each probability prediction value corresponding to the same text to be detected is obtained, wherein the text to be detected may include one or more sentences, and one sentence corresponds to multiple probability prediction values, so as to determine the text fluency of the sentence based on the multiple probability prediction values ​​corresponding to the sentence. It should be noted that multiple neural network classifiers are pre-trained, and the prediction models in the different neural network classifiers are different. Specifically, two prediction models corresponding to two neural network classifiers can be used, that is, two prediction models are fused to predict the text to be detected based on the sentence feature information, and each probability prediction value corresponding to the text to be detected is obtained. The probability prediction values ​​are fused and processed. Since multiple prediction models are used, the contingency between the models can be eliminated, and the detection precision and accuracy can be further improved. After obtaining each probability prediction value, the text fluency result of each sentence in the text to be detected can be obtained through each probability prediction value.

[0067] Furthermore, the step of fusing the respective probability prediction values ​​to obtain the sentence fluency result of the text to be detected includes:

[0068] Step S421, averaging the respective probability prediction values ​​to obtain a target probability prediction value corresponding to the text to be detected;

[0069] Step S422, comparing the target probability prediction value with a pre-stored threshold value, and obtaining a comparison result, and based on the comparison result, obtaining a text fluency result of the text to be detected.

[0070] In this embodiment, after obtaining a plurality of probability prediction values ​​corresponding to the text to be detected, the plurality of probability prediction values ​​are averaged, and the probability prediction value after the average processing is used as the target probability prediction value of the text to be detected. After obtaining the target probability prediction value, a pre-stored threshold is obtained, and the target probability prediction value is compared with the pre-stored threshold to obtain a comparison result. It should be noted that the pre-stored threshold is adjustable. After obtaining the comparison result, the text coherence result of the text to be detected can be obtained based on the comparison result, and the text coherence result includes a coherent sentence or an incoherent sentence.

[0071] It should be noted that after obtaining the target probability prediction value, the target probability prediction value can be output and processed to generate target prompt information, and the prompt method corresponding to the target prompt information is not specifically limited.

[0072] The text fluency detection method proposed in the present embodiment obtains a text to be detected, performs word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtains part-of-speech information corresponding to the text to be detected; then, based on the part-of-speech information corresponding to the text to be detected, determines the part-of-speech association information of the words in the text to be detected, and based on the text to be detected, determines the semantic information of the words in the text to be detected; then, fuses the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected; finally, inputs the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtains a text fluency result of the text to be detected. In this implementation, when judging the fluency of a text, the part-of-speech association relationship of each word in the text to be tested is analyzed to obtain the part-of-speech association information corresponding to the text to be tested, and the sentence meaning of each sentence in the text to be tested is analyzed to obtain the semantic level information corresponding to the text to be tested. Then, sentence feature information of the text to be tested is extracted based on the part-of-speech association information and semantic information of each sentence in the text to be tested. By using the part-of-speech association information and semantic information at the same time, sentence features are extracted more comprehensively, so that a more comprehensive judgment on whether the sentence is fluent can be made based on a neural network classifier in the subsequent process, making the text fluency detection result more reliable and accurate, thereby solving the technical problem of low precision of existing text fluency detection technology and improving the detection accuracy of text fluency.

[0073] Based on the first embodiment, a second embodiment of the text fluency detection method of the present invention is proposed, referring to Figure 3 In this embodiment, step S20 includes:

[0074] Step S21, inputting the part-of-speech information corresponding to the text to be detected into a word vector model to determine the part-of-speech association information of the words in the text to be detected;

[0075] Step S22, input the text to be detected into a bidirectional conversion coding model, and output the semantic information of the words in the text to be detected.

[0076] In this embodiment, after obtaining the part-of-speech information corresponding to the text to be detected, the text to be detected is input into the word vector model, so that the word vector model analyzes the association relationship of each word in the text to be detected based on the part-of-speech information of the text to be detected, and obtains the part-of-speech association information of the words in the text to be detected. After that, the text to be detected without preprocessing is directly input into the bidirectional conversion encoding model, so that the bidirectional conversion encoding model analyzes the semantic information of the words and sentences in the text to be detected, that is, the meaning of the words and sentences in the text to be detected.

[0077] Further, the word vector model is a word2vec model, and the word vector model is a word2vec model pre-trained based on a fluency corpus; the bidirectional conversion encoding model is a Bert model, and the bidirectional conversion encoding model is also a Bert model pre-trained based on a fluency corpus. The network structure of the word vector model includes an input layer, a hidden layer and an output layer, each output layer neuron of the input layer is connected to each hidden layer neuron of the hidden layer, each hidden layer neuron of the hidden layer is connected to the output layer neuron of the output layer, wherein the output layer has only one output layer neuron, that is, the output layer has only one output. Specifically, the part-of-speech information corresponding to the context words in the text to be detected is input into the input layer of the word vector model, so as to calculate the first intermediate result based on the input layer weight value and the part-of-speech information corresponding to the context words; the input layer of the word vector model outputs the first intermediate result to the hidden layer, the hidden layer calculates the second intermediate result based on the first intermediate result and the hidden layer weight value, the hidden layer outputs the second intermediate result to the output layer, and the input layer calculates the part-of-speech association information of the words in the text to be detected based on the preset activation function and the second intermediate result.

[0078] Furthermore, before the step of inputting the part-of-speech information corresponding to the text to be detected into the word vector model to determine the part-of-speech association information of the words in the text to be detected, it also includes:

[0079] Step S211, obtaining a fluency corpus from a fluency corpus, performing word segmentation processing on the fluency corpus, and obtaining a fluency word set corresponding to the fluency corpus;

[0080] Step S212, performing part-of-speech analysis on the fluency word set to obtain a part-of-speech information set corresponding to the fluency word set;

[0081] Step S213, inputting the part-of-speech information set into the initial word vector model for training, and obtaining the word vector model corresponding to the completion of training the initial word vector model.

[0082] In this embodiment, before obtaining the word vector model, it is necessary to train the initial word vector model corresponding to the untrained word vector model. Specifically, obtain the fluency corpus pre-stored in the fluency corpus, and then segment the fluency corpus, that is, segment each sentence in the fluency corpus, so as to obtain the fluency word set corresponding to the fluency corpus, that is, divide each sentence in the fluency corpus into words one by one; then, perform part-of-speech analysis on the fluency word set corresponding to the fluency corpus, and obtain the part-of-speech information set corresponding to the fluency corpus, so as to analyze the grammatical features of each word in the fluency word set, that is, analyze the grammatical functions of the words, such as analyzing to obtain participles or quantifiers or adjectives, etc. After obtaining the part-of-speech information set corresponding to the fluency corpus, the part-of-speech information set is input into the initial word vector model to train the initial word vector model, and the word vector model is obtained when the training of the initial word vector model is completed.

[0083] Furthermore, before the step of obtaining a fluency corpus from a fluency corpus, performing word segmentation processing on the fluency corpus, and obtaining a fluency word set corresponding to the fluency corpus, the method further includes:

[0084] Step S2111, obtaining a fluent corpus, and performing a word insertion operation and / or a word deletion operation and / or a word order reversal operation on sentences in the fluent corpus to obtain an influent corpus;

[0085] Step S2112: construct the fluency corpus based on the fluency corpus and the incoherent corpus, wherein the fluency corpus set in the fluency corpus includes the fluent corpus and the incoherent corpus.

[0086] In this embodiment, fluent corpus can be collected from external websites, search engines or the Internet. After obtaining fluent corpus, influent corpus can be determined based on the fluent corpus. The fluent corpus can be subjected to word insertion and / or word deletion and / or word order reversal operations to obtain influent corpus. The fluent corpus can be subjected to word insertion, i.e., random words are randomly inserted into the fluent sentences corresponding to the fluent corpus; the fluent corpus can be subjected to word deletion, i.e., a certain number of words are randomly deleted from the fluent sentences corresponding to the fluent corpus; the fluent corpus can be subjected to word order reversal, i.e., the order of words in the fluent sentences corresponding to the fluent corpus is randomly swapped. Therefore, at least one of the word insertion, word deletion and word order reversal operations is performed on the fluent corpus to construct influent corpus. After obtaining the influent corpus, the fluent corpus and the influent corpus are stored in a preset database to obtain a fluency corpus. Furthermore, corpora may be regularly obtained from an external database or an external server to update the fluency corpus at any time, increase the corpus diversity of the fluency corpus, and complicate the text scenarios in the fluency corpus.

[0087] Furthermore, the step of determining the semantic information of words in the text to be detected based on the text to be detected includes:

[0088] Step S23, determining a target word in the text to be detected and determining a context word corresponding to the target word in the text to be detected;

[0089] Step S24, calculating the similarity weight between the target word and the context word based on the target word vector corresponding to the target word and the context word vector corresponding to the context word;

[0090] Step S25, determining the semantic information of the words in the to-be-detected text based on the similarity weight and the target word.

[0091] In this embodiment, the unprocessed text to be detected is directly input into the bidirectional conversion coding model, so that the bidirectional conversion coding model analyzes the semantic information of the words and sentences in the text to be detected, that is, analyzes the meaning of the words and sentences in the text to be detected. Specifically, the unprocessed text to be detected is directly input into the bidirectional conversion coding model, firstly, a word in the text to be detected is determined as the target word in order, and the words other than the target word in the text to be detected are used as context words; then, in the same vector space where the target word vector corresponding to the target word and the context word vector corresponding to the context word are located, the similarity weight between the target word vector corresponding to the target word and the context word vector corresponding to the context word is calculated, and it can be understood that the farther the distance between the target word vector corresponding to the target word and the context word vector corresponding to the context word is, the smaller the similarity weight between the target word and the context word is; the closer the distance between the target word vector corresponding to the target word and the context word vector corresponding to the context word is, the greater the similarity weight between the target word and the context word is. After calculating the semantic information corresponding to the target word based on the similarity weights corresponding to the context words, for other words in the text to be detected, the other words in the text to be detected are taken as target words, and the steps of determining the target words in the text to be detected and determining the context words corresponding to the target words in the text to be detected are performed on the other words in the same manner until the semantic information of all words in the text to be detected is calculated.

[0092] The text fluency detection method proposed in this embodiment determines the part-of-speech association information of the words in the text to be detected by inputting the part-of-speech information corresponding to the text to be detected into the word vector model; the text to be detected is input into the two-way conversion coding model, and the semantic information of the words in the text to be detected is output. In this embodiment, when judging the text fluency, the part-of-speech association relationship of each word in the text to be detected is analyzed to obtain the part-of-speech association information corresponding to the text to be detected, and the sentence meaning of each sentence in the text to be detected is analyzed to obtain the semantic level information corresponding to the text to be detected, so as to make a more comprehensive judgment on whether the sentence is fluent based on the part-of-speech association information and semantic information, so that the text fluency detection result is more reliable and accurate, which is a prerequisite for improving the detection accuracy of text fluency in the future.

[0093] In addition, an embodiment of the present invention further provides a text fluency detection device, the text fluency detection device comprising:

[0094] An acquisition module is used to acquire a text to be detected, and perform word segmentation and part-of-speech analysis on the text to be detected in sequence to obtain part-of-speech information corresponding to the text to be detected;

[0095] A determination module, used to determine the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and to determine the semantic information of the words in the text to be detected based on the text to be detected;

[0096] A fusion module, used for fusing the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected;

[0097] The prediction module is used to input the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected and obtain a text fluency result of the text to be detected.

[0098] Furthermore, the determining module is also used to:

[0099] Inputting the part-of-speech information corresponding to the text to be detected into the word vector model to determine the part-of-speech association information of the words in the text to be detected;

[0100] The text to be detected is input into a bidirectional conversion coding model, and the semantic information of the words in the text to be detected is output.

[0101] Furthermore, the determining module is also used to:

[0102] Acquire a fluency corpus from a fluency corpus, perform word segmentation processing on the fluency corpus, and obtain a fluency word set corresponding to the fluency corpus;

[0103] Performing part-of-speech analysis on the fluency word set to obtain a part-of-speech information set corresponding to the fluency word set;

[0104] The part-of-speech information set is input into an initial word vector model for training, and the word vector model corresponding to the initial word vector model is obtained when the training of the initial word vector model is completed.

[0105] Furthermore, the determining module is also used to:

[0106] Acquire a fluent corpus, and perform a word insertion operation and / or a word deletion operation and / or a word order reversal operation on sentences in the fluent corpus to obtain an influent corpus;

[0107] The fluency corpus is constructed based on the fluency corpus and the incoherent corpus, wherein the fluency corpus set in the fluency corpus includes the fluent corpus and the incoherent corpus.

[0108] Furthermore, the prediction module is also used for:

[0109] Inputting the sentence feature information into different pre-stored neural network classifiers to predict the text to be detected based on the prediction models corresponding to the different neural network classifiers, and obtaining the probability prediction values ​​corresponding to the text to be detected;

[0110] The various probability prediction values ​​are fused and processed to obtain the text fluency result of the text to be detected.

[0111] Furthermore, the prediction module is also used for:

[0112] The probability prediction values ​​are averaged to obtain the target probability prediction value corresponding to the text to be detected;

[0113] The target probability prediction value is compared with a pre-stored threshold value to obtain a comparison result, and based on the comparison result, a text fluency result of the text to be detected is obtained.

[0114] Furthermore, the determining module is also used to:

[0115] Determining a target word in the text to be detected and determining a context word corresponding to the target word in the text to be detected;

[0116] Calculating a similarity weight between the target word and the context word based on a target word vector corresponding to the target word and a context word vector corresponding to the context word;

[0117] Based on the similarity weight and the target word, the semantic information of the word in the text to be detected is determined.

[0118] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a text fluency detection program is stored. When the text fluency detection program is executed by a processor, the steps of the text fluency detection method as described in any one of the above are implemented.

[0119] The specific embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the above-mentioned text fluency detection method, and will not be described in detail herein.

[0120] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0121] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0123] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting text fluency, It is characterized in that The text fluency detection method comprises the following steps: Acquire a text to be detected, perform word segmentation and part-of-speech analysis on the text to be detected in sequence, and obtain part-of-speech information corresponding to the text to be detected; Determine the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and determine the semantic information of the words in the text to be detected based on the text to be detected; The part-of-speech association information and the semantic information corresponding to the text to be detected are integrated to obtain sentence feature information corresponding to the text to be detected; Inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtaining a text fluency result of the text to be detected; The step of inputting the sentence feature information into a pre-stored neural network classifier to predict the fluency of the text to be detected and obtaining the text fluency result of the text to be detected comprises: Inputting the sentence feature information into different pre-stored neural network classifiers to predict the text to be detected based on the prediction models corresponding to the different neural network classifiers, and obtaining the probability prediction values ​​corresponding to the text to be detected; The probability prediction values ​​are averaged to obtain the target probability prediction value corresponding to the text to be detected; The target probability prediction value is compared with a pre-stored threshold value to obtain a comparison result, and based on the comparison result, a text fluency result of the text to be detected is obtained.

2. The text fluency detection method according to claim 1, It is characterized in that The steps of determining the part-of-speech association information of words in the to-be-detected text based on the part-of-speech information corresponding to the to-be-detected text, and determining the semantic information of the words in the to-be-detected text based on the to-be-detected text include: Inputting the part-of-speech information corresponding to the text to be detected into the word vector model to determine the part-of-speech association information of the words in the text to be detected; The text to be detected is input into a bidirectional conversion coding model, and the semantic information of the words in the text to be detected is output.

3. The text fluency detection method according to claim 2, It is characterized in that Before the step of inputting the part-of-speech information corresponding to the text to be detected into the word vector model to determine the part-of-speech association information of the words in the text to be detected, the method further includes: Acquire a fluency corpus from a fluency corpus, perform word segmentation processing on the fluency corpus, and obtain a fluency word set corresponding to the fluency corpus; Performing part-of-speech analysis on the fluency word set to obtain a part-of-speech information set corresponding to the fluency word set; The part-of-speech information set is input into an initial word vector model for training, and the word vector model corresponding to the initial word vector model is obtained when the training of the initial word vector model is completed.

4. The text fluency detection method according to claim 3, It is characterized in that Before the step of obtaining a fluency corpus set from a fluency corpus, performing word segmentation processing on the fluency corpus, and obtaining a fluency word set corresponding to the fluency corpus, the method further includes: Acquire a fluent corpus, and perform a word insertion operation and / or a word deletion operation and / or a word order reversal operation on sentences in the fluent corpus to obtain an influent corpus; The fluency corpus is constructed based on the fluency corpus and the incoherent corpus, wherein the fluency corpus set in the fluency corpus includes the fluent corpus and the incoherent corpus.

5. The text fluency detection method according to any one of claims 1 to 4, It is characterized in that The step of determining the semantic information of words in the text to be detected based on the text to be detected comprises: Determining a target word in the text to be detected and determining a context word corresponding to the target word in the text to be detected; Calculating a similarity weight between the target word and the context word based on a target word vector corresponding to the target word and a context word vector corresponding to the context word; Based on the similarity weight and the target word, the semantic information of the word in the text to be detected is determined.

6. A text fluency detection device, It is characterized in that The text fluency detection device comprises: An acquisition module is used to acquire a text to be detected, and perform word segmentation and part-of-speech analysis on the text to be detected in sequence to obtain part-of-speech information corresponding to the text to be detected; A determination module, used to determine the part-of-speech association information of the words in the text to be detected based on the part-of-speech information corresponding to the text to be detected, and to determine the semantic information of the words in the text to be detected based on the text to be detected; A fusion module, used for fusing the part-of-speech association information and the semantic information corresponding to the text to be detected to obtain sentence feature information corresponding to the text to be detected; A prediction module, used for inputting the sentence feature information into a pre-stored neural network classifier to perform fluency prediction on the text to be detected, and obtain a text fluency result of the text to be detected; The prediction module is also used to input the sentence feature information into different pre-stored neural network classifiers to predict the text to be detected based on the prediction models corresponding to the different neural network classifiers, and obtain the probability prediction values ​​corresponding to the text to be detected; average the probability prediction values ​​to obtain the target probability prediction value corresponding to the text to be detected; compare the target probability prediction value with the pre-stored threshold and obtain a comparison result, and based on the comparison result, obtain the text fluency result of the text to be detected.

7. A text fluency detection device, It is characterized in that The text fluency detection device comprises: a memory, a processor, and a text fluency detection program stored in the memory and executable on the processor. When the text fluency detection program is executed by the processor, the steps of the text fluency detection method as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a text fluency detection program, and when the text fluency detection program is executed by a processor, the steps of the text fluency detection method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Automatic composition scoring method based on confusion

    CN110826329A

  • Automatic composition score calculation method based on statement smoothness

    CN111581392A