Text defect detection method, device, equipment and storage medium
By preprocessing and feature extraction of text data, and training neural network models, the problems of spelling errors, grammatical errors and improper wording in text data are solved, automatic identification and correction are realized, and the quality of text data is improved.
Patent Information
- Application Number
- CN202311318926.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-10-11
AI Technical Summary
In a large amount of text data, there are spelling errors, grammatical errors, and improper wording, which lead to a decrease in the quality of the text data. It is difficult for existing technology to effectively automatically identify and correct these defects.
By obtaining original text data for preprocessing, lexical analysis and entity recognition are performed, feature and attribute information are extracted, neural network models are trained based on this information, and model evaluation is performed. Finally, text defect detection and feedback are performed on the target text data.
It realizes the automatic identification and correction of spelling errors, grammatical errors and improper wording in text, improves the quality and reliability of text data, and provides convenience for text data processing.
Smart Images

Figure CN117350283B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a text defect detection method, device, equipment and storage medium. Background Art
[0002] At present, in the field of computer science and technology, text defect detection is one of the important tasks in natural language processing. In a large amount of text data, there may be spelling errors, grammatical errors, inappropriate wording and other problems, which greatly affect the quality of text data. The main purpose of text defect detection is to automatically identify and correct errors in text and facilitate text data processing.
[0003] Therefore, the present invention proposes a text defect detection method, device, equipment and storage medium. Summary of the invention
[0004] The present invention provides a text defect detection method, apparatus, device and storage medium, which obtains original text data, preprocesses the original text data, performs lexical analysis and entity recognition on the preprocessed original text data, obtains the characteristics and attribute information of the text data, trains a neural network model based on the characteristics and attribute information of the text data, and performs model evaluation on the trained neural network model, performs text defect detection on the target text data based on the evaluated model, and feeds back the detection results, thereby solving the problem of identifying spelling errors, grammatical errors and inappropriate words in a large amount of text data in the background technology.
[0005] The present invention provides a text defect detection method, which comprises:
[0006] Step 1: Obtain original text data and preprocess the original text data;
[0007] Step 2: Perform lexical analysis and entity recognition on the preprocessed raw text data to obtain the features of the text data and extract attribute information from the text data;
[0008] Step 3: Train a neural network model based on the features and attribute information of the text data, and
[0009] The trained neural network model is used for model evaluation;
[0010] Step 4: Perform text defect detection on the target text data based on the evaluated model and provide feedback on the detection results.
[0011] Preferably, obtaining original text data and preprocessing the original text data includes:
[0012] Use crawler tools to crawl the required raw text data from the specified website;
[0013] The raw text data is cleaned, merged and converted using preprocessing tools.
[0014] Preferably, after obtaining the original text data and preprocessing the original text data, the method further includes:
[0015] Checking the integrity of the target text data;
[0016] After the check is completed, the complete target text is divided into sentences to obtain multiple first word segmentation sets of sentences that constitute the complete target text;
[0017] Filter the first word segmentation set to obtain the second word segmentation set;
[0018] The plurality of second word segmentation sets are sorted and displayed according to the sequence of constituting the sentences to obtain a target word segmentation list.
[0019] Preferably, the preprocessed original text data is subjected to lexical analysis and entity recognition, the features of the text data are obtained, and the attribute information in the text data is extracted, including:
[0020] Use word segmentation algorithm to perform word segmentation on the preprocessed raw text data;
[0021] Acquire keywords and phrases in the text data based on the word segmentation processing;
[0022] Performing lexical analysis on the original text data based on the keywords and phrases, and obtaining features of the text data according to the analysis results;
[0023] Perform entity recognition on the original text data according to the entity recognition method to obtain entities in the text;
[0024] Attribute information in the text data is extracted based on the entities in the text.
[0025] Preferably, training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model, includes:
[0026] Use deep learning frameworks to build neural network models;
[0027] Inputting the features and attribute information of the text data into a neural network model to train the neural network model;
[0028] Get the accuracy and recall of the trained neural network model;
[0029] The neural network model is evaluated based on the accuracy and recall.
[0030] Preferably, the target text data is tested for text defects based on the evaluated model, and the test results are fed back, including:
[0031] Perform text defect detection on the target text data based on the evaluated model to obtain the type and degree of text defects;
[0032] Determining a defect feedback method based on the defect type and degree;
[0033] The detection result is fed back based on the defect feedback method.
[0034] Preferably, after checking the integrity of the target text data, the method further comprises:
[0035] Enter the full target text into the task bar to build a buffered task;
[0036] Sending the buffer task into a data packet buffer for data pre-reading;
[0037] Confirm the working progress of the network node corresponding to the data packet buffer according to the pre-read result;
[0038] Setting a pre-caching interval for a buffering task and setting a pre-caching value for the pre-caching interval according to the working progress of the network node;
[0039] Selecting a target preset processing thread from a plurality of preset processing threads according to the pre-cache value to perform pre-buffer processing on the target text data;
[0040] collecting processing data of a target preset processing thread in real time, and analyzing the processing data to determine unbuffered data therein;
[0041] Constructing a preset information table item according to the data resources corresponding to the complete target text;
[0042] Determine the data frame sequence information of each sub-data in the preset information table;
[0043] Determine the target sub-data corresponding to the unbuffered data, and obtain sequence breakpoint information of the target sub-data;
[0044] Determine whether the sequence breakpoint information of the target sub-data is an intermediate data frame in the complete target text, and if so, determine whether there is out-of-order data in the complete target text;
[0045] Perform a logical check on the complete target text, and correct and adjust the disordered data according to the check results to obtain the processed target text;
[0046] The processed target text is used as reference data for word segmentation checking.
[0047] Preferably, a text defect detection device comprises:
[0048] Acquisition module: acquires original text data and preprocesses the original text data;
[0049] Extraction module: performs lexical analysis and entity recognition on the preprocessed raw text data, obtains the features of the text data, and extracts attribute information from the text;
[0050] Evaluation module: training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model;
[0051] Feedback module: Detect text defects on the target text data based on the evaluated model and provide feedback on the detection results.
[0052] A text defect detection device comprises a memory and a processor, wherein the memory stores a text defect detection program, and when the text defect detection program is executed by the processor, the processor executes the steps of any one of the methods.
[0053] A text defect detection storage medium stores a text defect detection program. When the text defect detection program is executed by a processor, the processor is caused to execute the steps of any one of the methods.
[0054] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0055] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] 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:
[0057] Figure 1 is a flowchart of a text defect detection method according to an embodiment of the present invention;
[0058] Figure 2 4 is a structural diagram of a text defect detection device in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. 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.
[0060] Embodiment 1:
[0061] The present invention provides a text defect detection method, such as Figure 1 As shown, the method includes:
[0062] Step 1: Obtain original text data and preprocess the original text data;
[0063] Step 2: Perform lexical analysis and entity recognition on the preprocessed raw text data to obtain the features of the text data and extract attribute information from the text data;
[0064] Step 3: training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model;
[0065] Step 4: Perform text defect detection on the target text data based on the evaluated model and provide feedback on the detection results.
[0066] In this embodiment, the original text data refers to original text information that has not been processed or converted in any way, and may come from various sources, such as text files, press releases, and novels.
[0067] In this embodiment, preprocessing refers to the operations of cleaning, converting and integrating raw data.
[0068] In this embodiment, lexical analysis refers to splitting and parsing words, such as splitting a phrase into its constituent words, obtaining keywords and phrases, and using the analysis results of the keywords and phrases to understand the meaning and content of the text.
[0069] In this embodiment, entity recognition refers to identifying people, places, and organization entities in the text.
[0070] In this embodiment, the characteristics of the text data include: text length, text format, text content, text quality, and text source.
[0071] In this embodiment, the attribute information is, for example, whether the text length is long or short.
[0072] In this embodiment, the neural network model refers to a type of computing model that imitates a biological neural network. It is mainly composed of multiple layers of neurons, and each layer of neurons includes a feature or attribute of text data.
[0073] In this embodiment, model evaluation is the process of measuring model performance, which usually includes testing or training the model. Commonly used model evaluation indicators include accuracy, recall rate, and precision rate.
[0074] In this embodiment, text defect detection refers to identifying and repairing spelling, grammar, punctuation and other errors in the text.
[0075] The beneficial effects of the above technical solution are: by preprocessing the original text data, the quality and reliability of the data can be improved. Furthermore, the preprocessed original text data can be subjected to feature extraction and text attribute information acquisition, a neural network model can be trained and the model evaluated based on the features and attribute information of the text data, and the evaluated model can be used to detect defects in the text data, so that errors in the text can be automatically identified and corrected, providing convenience for text data processing.
[0076] Embodiment 2:
[0077] The present invention provides a text defect detection method, which obtains original text data and preprocesses the original text data, including:
[0078] Use crawler tools to crawl the required raw text data from the specified website;
[0079] The raw text data is cleaned, merged and converted using preprocessing tools.
[0080] In this embodiment, the crawler tool is a software tool for crawling data from a website, usually used to obtain web page data or extract text data, such as: Python crawler, Ruby crawler tool, Java crawler tool.
[0081] In this embodiment, the original text data refers to original text information that has not been processed or converted in any way, and may come from various sources, such as text files, press releases, and novels.
[0082] In this embodiment, data cleaning refers to operations such as deduplication, noise removal, deformatting, and filling missing values on data during data collection, storage, or transmission to improve data quality for subsequent data analysis and application.
[0083] In this embodiment, data merging refers to a process of merging two or more data sets into one data set, and creating a new data set based on the merged data set.
[0084] In this embodiment, data conversion refers to converting one data type into another data type. Data conversion involves conversion of data format, data type, and value range, for example, converting a value in Excel into an integer in Python.
[0085] The beneficial effect of the above technical solution is: by obtaining the original text data through the crawler tool and preprocessing the original text data using the preprocessing tool, it is possible to eliminate duplicate data in the data set and improve the data quality of the text data, so as to facilitate effective data analysis and mining.
[0086] Embodiment 3:
[0087] The present invention provides a text defect detection method, which obtains original text data and preprocesses the original text data, and further comprises:
[0088] Checking the integrity of the target text data;
[0089] After the check is completed, the complete target text is divided into sentences to obtain multiple first word segmentation sets of sentences that constitute the complete target text;
[0090] Filter the first word segmentation set to obtain the second word segmentation set;
[0091] The plurality of second word segmentation sets are sorted and displayed according to the sequence of constituting the sentences to obtain a target word segmentation list.
[0092] In this embodiment, filtering the first word segmentation set to obtain the second word segmentation set includes:
[0093] Obtain the characteristic factor of each first word segmentation set corresponding to each sentence;
[0094] The dependency of each sentence on the characteristic factor of each first word segmentation set corresponding to each sentence is calculated using the characteristic factor of each first word segmentation set corresponding to each sentence:
[0095] ;in, It is expressed as the dependency of the i-th sentence on the characteristic factor of the q-th first word set in the i-th sentence. It is expressed as the fuzzy similarity of the characteristic factor of the qth first word set in the ith sentence to the parameter of the target label attribute of the ith sentence, It is represented as the target correlation between the qth first word set in the ith sentence and the target label attribute of the ith sentence. It is expressed as the knowledge expansion coefficient of the characteristic factor of the qth first word set in the ith sentence, Expressed as a sentence content scoring function, It is represented as the richness of the text content in the i-th paragraph whose importance is greater than or equal to the first preset threshold, It is represented as the richness of the text content in the i-th paragraph whose importance is less than the first preset threshold;
[0096] The second word segmentation set is formed by screening out the dependencies of each sentence on the characteristic factors of each corresponding first word segmentation set whose dependencies are greater than or equal to a first preset threshold.
[0097] In this embodiment, the characteristic factor refers to the factors that need to be considered in the word segmentation process to determine whether a word should be segmented, such as:
[0098] Part of speech of vocabulary: For a word, you need to consider its part of speech, such as noun, verb or adjective.
[0099] The meaning of words: It is necessary to consider whether the meaning of words is relevant to the context.
[0100] Vocabulary position: It is necessary to consider whether the position of the vocabulary in the sentence is reasonable and whether it conforms to grammatical rules.
[0101] Similarity of vocabulary: It is necessary to consider the similarity between words, that is, whether there are similar words that can replace it.
[0102] In this embodiment, the dependency refers to the degree of dependency of the sentence on the first participle. If deleting a participle has no effect on the meaning of the sentence, then it is proved that the dependency of the sentence on this participle is 0.
[0103] In this embodiment, the integrity of text data refers to ensuring the correctness, accuracy and consistency of data when storing, transmitting and using text data. For example, text data may contain spelling errors, grammatical errors, punctuation errors and other problems, which will lead to a decrease in data accuracy.
[0104] In this embodiment, the first word segmentation set refers to segmenting a text into individual words and removing the punctuation marks in the middle, for example:
[0105] Space-based word segmentation set: separate each word in the text with a space, then remove the space to get a word segmentation result. For example, the text "My favorite color is red" is segmented by space to get the word segmentation result "My favorite color is red".
[0106] Part-of-speech segmentation set: According to the part of speech of the vocabulary (such as noun, verb, adjective, etc.), the text is divided into individual words. For example, after the text "He went to school" is segmented by part of speech, the segmentation result is "He went to school".
[0107] In this embodiment, the second word segmentation set refers to a set after repeated word segmentations are deleted.
[0108] In this embodiment, the purpose of obtaining the target word segmentation list is to segment the text in a specific scenario to facilitate subsequent more in-depth processing. Word segmentation is to decompose a piece of text into individual words, thereby making the text easier to process and manage. In natural language processing, word segmentation is the basis for implementing key steps such as lexical analysis and syntactic analysis.
[0109] The beneficial effect of the above technical solution is: by taking the complete target text as a sentence unit, obtaining multiple first segmentation sets of sentences that constitute the complete target text, performing a uniqueness check, deleting repeated segmentations, obtaining a second segmentation set, and sorting and displaying them in the sequence of the sentence composition to obtain a target segmentation list, the vocabulary in the text can be quickly found, and useful information can be extracted, which facilitates subsequent text processing.
[0110] Embodiment 4:
[0111] The present invention provides a text defect detection method, which performs lexical analysis and entity recognition on preprocessed original text data, obtains the features of the text data, and extracts attribute information in the text data, including:
[0112] Use word segmentation algorithm to perform word segmentation on the preprocessed raw text data;
[0113] Acquire keywords and phrases in the text data based on the word segmentation processing;
[0114] Performing lexical analysis on the original text data based on the keywords and phrases, and obtaining features of the text data according to the analysis results;
[0115] Perform entity recognition on the original text data according to the entity recognition method to obtain entities in the text;
[0116] Attribute information in the text data is extracted based on the entities in the text.
[0117] In this embodiment, the word segmentation algorithm generally includes two main steps: word segmentation and part-of-speech tagging. Word segmentation is to decompose the text into individual words, while part-of-speech tagging is to assign one or more part-of-speech tags to these words to facilitate subsequent language processing tasks. Commonly used word segmentation algorithms include rule-based word segmentation, statistical-based word segmentation, and deep learning-based word segmentation.
[0118] In this embodiment, lexical analysis is used to analyze the grammatical structure of each sentence or word in a statement or text, including the components of a sentence, the relationship between sentences, and the attributes of a word.
[0119] In this embodiment, the characteristics of the text data include: text length, text format, text content, text quality, and text source.
[0120] In this embodiment, entities in the text generally refer to words or phrases that have certain meanings and grammatical relationships in the text, and may be names of people, places, organizations, or products.
[0121] In this embodiment, the attribute information is, for example, whether the text length is long or short.
[0122] The beneficial effects of the above technical solution are: the original text data is segmented through the word segmentation algorithm, the keywords and phrases in the text data are obtained, and the text is lexically analyzed based on the keywords and phrases, so as to further perform the tasks of text analysis, information extraction, and sentiment analysis. Furthermore, the text data features and the attribute information of the text data are extracted, which can deeply understand the characteristics of the text data and facilitate defect detection of the text data.
[0123] Embodiment 5:
[0124] The present invention provides a text defect detection method, which trains a neural network model based on the characteristics and attribute information of the text data, and performs model evaluation on the trained neural network model, including:
[0125] Use deep learning frameworks to build neural network models;
[0126] Inputting the features and attribute information of the text data into a neural network model to train the neural network model;
[0127] Get the accuracy and recall of the trained neural network model;
[0128] The neural network model is evaluated based on the accuracy and recall.
[0129] In this embodiment, the deep learning framework is a software library for building, training, and deploying deep learning models.
[0130] In this embodiment, the accuracy of the neural network model refers to the proportion of correct prediction results when the neural network is predicted on the test set. For example, if there are 100 predictions in total and 50 are correct, then the accuracy is 50%.
[0131] In this embodiment, the recall rate of the neural network model refers to the proportion of actual positive samples when predicting positive samples.
[0132] The beneficial effect of the above technical solution is: by inputting text data features and attribute information into the constructed neural network model, the accuracy and recall rate of the trained neural network model are obtained, and the model is evaluated based on the accuracy and recall rate to determine the performance of the model.
[0133] Embodiment 6:
[0134] The present invention provides a text defect detection method, which performs text defect detection on target text data based on an evaluated model and feeds back the detection result, including:
[0135] Perform text defect detection on the target text data based on the evaluated model to obtain the type and degree of text defects;
[0136] Determining a defect feedback method based on the defect type and degree;
[0137] The detection result is fed back based on the defect feedback method.
[0138] In this embodiment, the text defect types include:
[0139] Grammatical errors, such as misspellings, confusing grammatical structures, etc.
[0140] Unclear language expression, such as inappropriate vocabulary choice, confusing sentence structure, etc.
[0141] Logical errors, such as wrong premises, faulty reasoning, etc.
[0142] Missing information, such as lack of necessary information, insufficient information, etc.
[0143] Ambiguity, such as inappropriate wording, inappropriate tone, etc.
[0144] In this embodiment, the degree of text defects depends on the type and impact of the defects, including:
[0145] Very serious means that there are serious grammatical errors, logical errors or missing information in the text, which makes it difficult to understand or lead to misunderstanding.
[0146] Serious means that there are multiple grammatical errors, logical errors or missing information in the text, which makes it difficult to understand or lead to misunderstanding.
[0147] Generally, it means that there are some grammatical errors, logical errors or missing information in the text, but it is still understandable.
[0148] Mild means that there are some grammatical errors, logical errors or missing information in the text, but it is not difficult to understand.
[0149] In this embodiment, the defect feedback method refers to providing feedback on the found text defect information, such as: email feedback, and highlighting with different colors.
[0150] The beneficial effect of the above technical solution is: the target text data is tested for text defects by using the evaluated model to determine the defect type and degree. The defect feedback method is determined in this way, and the text defect detection results are fed back using the defect feedback method, so that the degree of text defects can be observed, and defects can be modified in a timely manner to ensure the integrity of the text.
[0151] Embodiment 7:
[0152] The present invention provides a text defect detection method, which includes, after the target text data is complete, the following steps:
[0153] Enter the full target text into the task bar to build a buffered task;
[0154] Sending the buffer task into a data packet buffer for data pre-reading;
[0155] Confirm the working progress of the network node corresponding to the data packet buffer according to the pre-read result;
[0156] Setting a pre-caching interval for a buffering task and setting a pre-caching value for the pre-caching interval according to the working progress of the network node;
[0157] Selecting a target preset processing thread from a plurality of preset processing threads according to the pre-cache value to perform pre-buffer processing on the target text data;
[0158] collecting processing data of a target preset processing thread in real time, and analyzing the processing data to determine unbuffered data therein;
[0159] Constructing a preset information table item according to the data resources corresponding to the complete target text;
[0160] Determine the data frame sequence information of each sub-data in the preset information table;
[0161] Determine the target sub-data corresponding to the unbuffered data, and obtain sequence breakpoint information of the target sub-data;
[0162] Determine whether the sequence breakpoint information of the target sub-data is an intermediate data frame in the complete target text, and if so, determine whether there is out-of-order data in the complete target text;
[0163] Perform a logical check on the complete target text, and correct and adjust the disordered data according to the check results to obtain the processed target text;
[0164] The processed target text is used as reference data for word segmentation checking.
[0165] In this embodiment, the task bar refers to a task bar in a computer system that can be used for management in order to store temporary data or results.
[0166] In this embodiment, the buffering task refers to a temporary delay or uncertainty in the data processing process in the software or system, which causes some tasks to be temporarily shelved or cached, waiting for a critical time or condition to be met before being processed.
[0167] In this embodiment, data pre-reading means that when processing a large amount of data, in order to improve data processing efficiency, part of the data is read in advance and stored in the memory so that it can be directly used in subsequent processing, thereby avoiding repeated reading of data.
[0168] In this embodiment, the network node refers to a network interface connecting multiple devices in a computer network.
[0169] In this embodiment, the working progress of the network node is determined according to the pre-reading result. The faster the pre-reading speed is, the faster the working progress is, and the slower the pre-reading speed is, the slower the working progress is.
[0170] In this embodiment, the pre-cache interval may include:
[0171] Precaching strategy: Determines the strategy for precaching data, such as time-based, content-based, or frequency-based caching strategy.
[0172] Pre-cache storage location: Select an appropriate pre-cache storage location, such as memory, disk, or network cache.
[0173] Pre-cache capacity: Determines the capacity of the cache interval.
[0174] In this embodiment, the pre-cache value means, for example, that the storage capacity of a pre-cache interval cannot exceed 10 cache tasks, and the specific determination process is as follows:
[0175] Parsing the read format type of the pre-read result and the read sets under each read format type, wherein each read set includes the read amounts of different individual read segments under the same read format type;
[0176] Extracting the largest read amount and the second largest read amount from each read set, normalizing the extracted read results, and matching the adjustment factor of each read set from the result-factor mapping table;
[0177] Determine the pre-cache value based on all adjustment factors and combined with the work progress and pre-cache interval;
[0178] ; Wherein, C1 represents the pre-cache value; C0 represents the initial cache value determined based on the work progress and the pre-cache interval; Represents the maximum adjustment coefficient among all adjustment factors; represents the average adjustment coefficient of all adjustment factors corresponding to the j01th reading set under the m01 reading set; Indicates the coefficient threshold; [ ] indicates the rounding symbol; n01 indicates the number of sets with only one adjustment factor in the read set; n02 indicates the number of sets with 2 or more adjustment factors in the read set; n03 indicates the average number of all factors in each read set under n02.
[0179] In this embodiment, the read format type refers to the fact that different types of data may exist in the data packet buffer during the reading process, so different read format types may exist during the reading process. Because different data under different data types may be randomly arranged, there may be multiple separate sorting situations of the same type during reading, and each separate sorting situation is regarded as a separate read segment, and the amount of data in the separate read segment is regarded as the read amount.
[0180] In this embodiment, the result-factor mapping table includes standardized reading results under different types of reading sets and adjustment factors that match the reading results, and the adjustment factors are mainly used to correct the progress to facilitate direct matching, that is, the number of adjustment factors under each reading set is at least 1.
[0181] In this embodiment, processing threads refers to allowing a program to execute multiple tasks at the same time.
[0182] In this embodiment, unbuffered data refers to data that has not been temporarily stored in the computer's memory.
[0183] In this embodiment, the preset information table items refer to information table items that are pre-set in the computer, including information such as text, images, sounds, etc. input by the user, as well as information such as variables and function calls that need to be used in the calculation process.
[0184] In this embodiment, the data frame sequence information refers to the sequence information of the data frame in the computer network protocol. The data frame sequence information refers to the sequence, timing, group number and other information of the data frame, which is used to ensure the transmission sequence and quality of the data frame.
[0185] In this embodiment, the sequence breakpoint information generally refers to information used to identify the sequence position of a data frame in a computer network protocol. This information is used to determine the starting position and the ending position of the data frame to ensure that there will be no packet loss, retransmission, or other problems during the transmission of the data frame.
[0186] In this embodiment, the middle data frame refers to a data frame in the middle of the text data.
[0187] In this embodiment, out-of-order data refers to data in which the order relationship does not appear in the usual logical order, and there may be missing, inserted, deleted, repeated and erroneous data.
[0188] In this embodiment, the word segmentation check reference data refers to using the word segmentation check reference data to determine whether there is disordered data in the segmented text after determining the integrity of the text and performing adjustments after segmenting the text data using the word segmentation algorithm.
[0189] The beneficial effects of the above technical solution are: by inputting the complete target text, constructing a buffer task, pre-reading data for the buffer task, confirming the progress of the network node, presetting the pre-cache interval and value, selecting a target preset processing thread from multiple preset processing threads according to the pre-cache value to pre-buffer the target text data, analyzing the unbuffered data in real time, constructing an information table item, determining the sequence breakpoint information of the target sub-data, judging whether the target sub-data is an intermediate data frame, and if so, judging whether there is disordered data in the target text, correcting the disordered data of the target text, which can ensure that the logic of the data is reasonable, and further, using the processed target text as reference data for word segmentation inspection, which can ensure that the data after word segmentation has reference data and that there is no logical problem in the data after word segmentation.
[0190] Embodiment 8:
[0191] The present invention provides a text defect detection device, such as Figure 2 As shown, including:
[0192] Acquisition module: acquires original text data and preprocesses the original text data;
[0193] Extraction module: performs lexical analysis and entity recognition on the preprocessed raw text data, obtains the features of the text data, and extracts attribute information from the text;
[0194] Evaluation module: training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model;
[0195] Feedback module: Detect text defects on the target text data based on the evaluated model and provide feedback on the detection results.
[0196] The beneficial effect of the above technical solution is that by preprocessing the original text data, the
[0197] The quality and reliability of the data. Further, the preprocessed raw text data is subjected to feature extraction and text attribute information acquisition. The neural network model is trained and the model is evaluated based on the features and attribute information of the text data. The evaluated model is used to detect defects in the text data. It can automatically identify and correct errors in the text, thus facilitating text data processing.
[0198] The present invention provides a text defect detection device, comprising a memory and a processor, wherein the memory stores a text defect detection program, and when the text defect detection program is executed by the processor, the processor executes the steps of any one of the methods.
[0199] The present invention provides a text defect detection storage medium storing a text defect detection program. When the text defect detection program is executed by a processor, the processor executes the steps of any one of the methods.
[0200] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A text defect detection method, It is characterized in that The method includes: Step 1: Obtain original text data and preprocess the original text data; Step 2: Perform lexical analysis and entity recognition on the preprocessed raw text data to obtain the features of the text data and extract attribute information from the text data; Step 3: training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model; Step 4: Detect text defects on the target text data based on the evaluated model and provide feedback on the detection results; Wherein, after obtaining the original text data and preprocessing the original text data, the method further includes: Checking the integrity of the target text data; After the check is completed, the complete target text is divided into sentences to obtain multiple first word segmentation sets of sentences that constitute the complete target text; Filter the first word segmentation set to obtain the second word segmentation set; Arrange the plurality of second word segmentation sets in order according to the sequence of the sentences to obtain a target word segmentation list; Wherein, after checking the integrity of the target text data, it also includes: Enter the full target text into the task bar to build a buffered task; Sending the buffer task into a data packet buffer for data pre-reading; Confirm the working progress of the network node corresponding to the data packet buffer according to the pre-read result; Setting a pre-caching interval for a buffering task and setting a pre-caching value for the pre-caching interval according to the working progress of the network node; Selecting a target preset processing thread from a plurality of preset processing threads according to the pre-cache value to perform pre-buffer processing on the target text data; collecting processing data of a target preset processing thread in real time, and analyzing the processing data to determine unbuffered data therein; Constructing a preset information table item according to the data resources corresponding to the complete target text; Determine the data frame sequence information of each sub-data in the preset information table; Determine the target sub-data corresponding to the unbuffered data, and obtain sequence breakpoint information of the target sub-data; Determine whether the sequence breakpoint information of the target sub-data is an intermediate data frame in the complete target text, and if so, determine whether there is out-of-order data in the complete target text; Perform a logical check on the complete target text, and correct and adjust the disordered data according to the check results to obtain the processed target text; Use the processed target text as reference data for word segmentation checking; The process of determining the pre-cache value is as follows: Parsing the read format type of the pre-read result and the read sets under each read format type, wherein each read set includes the read amounts of different individual read segments under the same read format type; Extracting the largest read amount and the second largest read amount from each read set, normalizing the extracted read results, and matching the adjustment factor of each read set from the result-factor mapping table; Determine the pre-cache value based on all adjustment factors and combined with the work progress and pre-cache interval; ; Wherein, C1 represents the pre-cache value; C0 represents the initial cache value determined based on the work progress and the pre-cache interval; Represents the maximum adjustment coefficient among all adjustment factors; represents the average adjustment coefficient of all adjustment factors corresponding to the j01th reading set under the m01th reading set; Indicates the coefficient threshold; [ ] indicates the rounding symbol; n01 indicates the number of sets with only one adjustment factor in the read set; n02 indicates the number of sets with 2 or more adjustment factors in the read set; n03 indicates the average number of all factors in each read set under n02.
2. A text defect detection method according to claim 1, It is characterized in that Acquiring original text data and preprocessing the original text data includes: Use crawler tools to crawl the required raw text data from the specified website; The raw text data is cleaned, merged and converted using preprocessing tools.
3. A text defect detection method according to claim 1, It is characterized in that Perform lexical analysis and entity recognition on the preprocessed raw text data to obtain the features of the text data and extract attribute information from the text data, including: Use word segmentation algorithm to perform word segmentation on the preprocessed raw text data; Acquire keywords and phrases in the text data based on the word segmentation processing; Performing lexical analysis on the original text data based on the keywords and phrases, and obtaining features of the text data according to the analysis results; Perform entity recognition on the original text data according to the entity recognition method to obtain entities in the text; Attribute information in the text data is extracted based on the entities in the text.
4. A text defect detection method according to claim 1, It is characterized in that Training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model, including: Use deep learning frameworks to build neural network models; Inputting the features and attribute information of the text data into a neural network model to train the neural network model; Get the accuracy and recall of the trained neural network model; The neural network model is evaluated based on the accuracy and recall.
5. A text defect detection method according to claim 1, It is characterized in that Based on the evaluated model, the target text data is tested for text defects and the test results are fed back, including: Perform text defect detection on the target text data based on the evaluated model to obtain the type and degree of text defects; Determining a defect feedback method based on the defect type and degree; The detection result is fed back based on the defect feedback method.
6. A text defect detection device, It is characterized in that include: Acquisition module: acquires original text data and preprocesses the original text data; Extraction module: performs lexical analysis and entity recognition on the preprocessed raw text data, obtains the features of the text data, and extracts attribute information from the text; Evaluation module: training a neural network model based on the features and attribute information of the text data, and performing model evaluation on the trained neural network model; Feedback module: Detect text defects in the target text data based on the evaluated model and provide feedback on the detection results; Wherein, after obtaining the original text data and preprocessing the original text data, the method further includes: Checking the integrity of the target text data; After the check is completed, the complete target text is divided into sentences to obtain multiple first word segmentation sets of sentences that constitute the complete target text; Filter the first word segmentation set to obtain the second word segmentation set; Arrange the plurality of second word segmentation sets in order according to the sequence of the sentences to obtain a target word segmentation list; Wherein, after checking the integrity of the target text data, it also includes: Enter the full target text into the task bar to build a buffered task; Sending the buffer task into a data packet buffer for data pre-reading; Confirm the working progress of the network node corresponding to the data packet buffer according to the pre-read result; Setting a pre-caching interval for a buffering task and setting a pre-caching value for the pre-caching interval according to the working progress of the network node; Selecting a target preset processing thread from a plurality of preset processing threads according to the pre-cache value to perform pre-buffer processing on the target text data; collecting processing data of a target preset processing thread in real time, and analyzing the processing data to determine unbuffered data therein; Constructing a preset information table item according to the data resources corresponding to the complete target text; Determine the data frame sequence information of each sub-data in the preset information table; Determine the target sub-data corresponding to the unbuffered data, and obtain sequence breakpoint information of the target sub-data; Determine whether the sequence breakpoint information of the target sub-data is an intermediate data frame in the complete target text, and if so, determine whether there is out-of-order data in the complete target text; Perform a logical check on the complete target text, and correct and adjust the disordered data according to the check results to obtain the processed target text; Use the processed target text as reference data for word segmentation checking; The process of determining the pre-cache value is as follows: Parsing the read format type of the pre-read result and the read sets under each read format type, wherein each read set includes the read amounts of different individual read segments under the same read format type; Extracting the largest read amount and the second largest read amount from each read set, normalizing the extracted read results, and matching the adjustment factor of each read set from the result-factor mapping table; Determine the pre-cache value based on all adjustment factors and combined with the work progress and pre-cache interval; ; Wherein, C1 represents the pre-cache value; C0 represents the initial cache value determined based on the work progress and the pre-cache interval; Represents the maximum adjustment coefficient among all adjustment factors; represents the average adjustment coefficient of all adjustment factors corresponding to the j01th reading set under the m01 reading set; Indicates the coefficient threshold; [ ] indicates the rounding symbol; n01 indicates the number of sets with only one adjustment factor in the read set; n02 indicates the number of sets with 2 or more adjustment factors in the read set; n03 indicates the average number of all factors in each read set under n02.
7. A text defect detection device, comprising a memory and a processor, It is characterized in that The memory stores a text defect detection program, and when the text defect detection program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 5.
8. A text defect detection storage medium storing a text defect detection program, It is characterized in that When the text defect detection program is executed by a processor, the processor is caused to perform the steps of the method as claimed in any one of claims 1 to 5.
