A model training, corpus processing method, device and computer equipment
By training the dependency analysis model, the corpus is analyzed for dependencies, and abnormal corpus is automatically identified and filtered. This solves the problem of high labor costs in corpus processing in the existing technology and improves the efficiency and accuracy of corpus processing.
Patent Information
- Application Number
- CN202011019127.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-09-24
AI Technical Summary
There are a lot of labor and time costs in corpus processing in the existing technology, and abnormal corpus cannot be effectively screened out, resulting in low corpus processing efficiency and accuracy.
By obtaining corpus sample data with dependencies between word segmentation samples, the dependency analysis model is trained to perform dependency analysis on the corpus to be processed, and automatically identify and filter out abnormal corpus.
It realizes automated identification and screening of abnormal corpus, improves the efficiency and accuracy of corpus processing, and reduces labor costs and time costs.
Smart Images

Figure CN112052678B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of text processing technology, and in particular to a model training, corpus processing method, device and computer equipment. Background Art
[0002] Corpus processing is a technical point that is widely used in the field of text processing technology. The efficiency of corpus processing directly affects the length of text processing time.
[0003] It is understandable that many of the collected corpora to be processed inevitably include a lot of abnormal corpora, that is, corpora without practical meaning. These abnormal corpora can also be called dirty predictions. The syntactic relationship of abnormal corpora is chaotic, and the dependency relationship between each word is wrong. When processing the collected corpora to be processed, it is often necessary to screen out abnormal predictions with chaotic syntactic relationships and delete them to ensure that all the corpora in the corpora to be processed are normal corpora.
[0004] At present, most of the methods for screening abnormal corpus adopt manual processing, which requires a lot of labor and time costs. Manual screening sentence by sentence leads to low efficiency of corpus processing. Although there are models for judging the dependency relationship of corpus in the prior art, such models will perform dependency analysis on normal corpus and abnormal corpus at the same time, and cannot determine the correctness of the dependency analysis results, nor can they screen out abnormal corpus. Summary of the invention
[0005] The embodiments of the present invention provide a model training, corpus processing method, apparatus and computer equipment to improve the processing efficiency and accuracy of corpus processing.
[0006] In a first aspect, an embodiment of the present invention provides a model training method, comprising:
[0007] Obtain corpus sample data with dependency relationships between word segmentation samples;
[0008] Inputting the corpus sample data into a preset machine learning model for dependency analysis training to obtain a dependency analysis model;
[0009] The dependency analysis model is used to perform abnormal screening on abnormal corpus.
[0010] In a second aspect, an embodiment of the present invention further provides a corpus processing method, comprising:
[0011] Obtaining a corpus to be processed, and inputting the corpus to be processed into a dependency analysis model;
[0012] Performing dependency analysis on the corpus to be processed by using the dependency analysis model;
[0013] Determining abnormal corpus from the corpus to be processed according to the analysis result of the dependency analysis model;
[0014] Among them, the dependency analysis model is a model trained by the model training method described in the first aspect above.
[0015] In a third aspect, an embodiment of the present invention further provides a model training device, comprising:
[0016] A corpus sample data acquisition module is used to acquire corpus sample data in which there is a dependency relationship between word segmentation samples;
[0017] A dependency analysis training module, used to input the corpus sample data into a preset machine learning model to perform dependency analysis training to obtain a dependency analysis model;
[0018] The dependency analysis model is used to perform abnormal screening on abnormal corpus.
[0019] In a fourth aspect, an embodiment of the present invention further provides a corpus processing device, comprising:
[0020] A module for acquiring corpus to be processed, used for acquiring corpus to be processed and inputting the corpus to be processed into a dependency analysis model;
[0021] A dependency analysis module, used for performing dependency analysis on the corpus to be processed by using the dependency analysis model;
[0022] An abnormal corpus determination module, used to determine abnormal corpus from the corpus to be processed according to the analysis result of the dependency analysis model;
[0023] Among them, the dependency analysis model is a model trained by the model training method described in the first aspect above.
[0024] In a fifth aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0025] one or more processors;
[0026] A storage device for storing one or more programs;
[0027] When the one or more programs are executed by the one or more processors, the one or more processors implement the model training method or corpus processing method provided by any embodiment of the present invention.
[0028] In a sixth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the model training method or corpus processing method provided by any embodiment of the present invention is implemented.
[0029] The embodiment of the present invention obtains a dependency analysis model by performing dependency analysis training on corpus sample data, and uses the trained dependency analysis model to perform dependency analysis on the corpus to be processed, so as to determine abnormal corpus from the corpus to be processed according to the analysis results, thereby solving the problem of high labor and time costs in screening abnormal corpus from the corpus to be processed, and realizing automatic identification and abnormal screening of abnormal corpus, thereby improving the processing efficiency and accuracy of corpus processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flow chart of a model training method provided in Embodiment 1 of the present invention;
[0031] Figure 2 This is a schematic diagram of a dependency labeling result provided in the first embodiment of the present invention;
[0032] Figure 3 is a flow chart of a corpus processing method provided by Embodiment 2 of the present invention;
[0033] Figure 4 This is a schematic diagram of the effect of performing corpus processing through a dependency analysis model provided by the second embodiment of the present invention;
[0034] Figure 5 This is a schematic diagram of the effect of performing corpus processing through a dependency analysis model provided by the second embodiment of the present invention;
[0035] Figure 6 This is a schematic diagram of the effect of performing corpus processing through a dependency analysis model provided by the second embodiment of the present invention;
[0036] Figure 7 This is a schematic diagram of the effect of performing corpus processing through a dependency analysis model provided by the second embodiment of the present invention;
[0037] Figure 8 A flow chart of a corpus processing method based on dependency analysis provided in Embodiment 2 of the present invention;
[0038] Fig. 9 is a schematic diagram of a model training device provided in Embodiment 3 of the present invention;
[0039] Fig.10 is a schematic diagram of a corpus processing device provided by Embodiment 4 of the present invention;
[0040] Fig.11 A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention.
[0042] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0043] Embodiment 1
[0044] Figure 1 is a flow chart of a model training method provided in the first embodiment of the present invention. This embodiment is applicable to the case where dependency analysis training is performed using corpus sample data to obtain a dependency analysis model. The method can be executed by a model training device, which can be implemented by software and / or hardware and can generally be integrated in a computer device, such as Figure 1 As shown, the method includes the following operations:
[0045] S110, obtaining corpus sample data in which there is a dependency relationship between word segmentation samples.
[0046] The corpus sample data may be standard corpus data, which is used as sample data for model training. The word segmentation sample may be word segmentation data obtained by performing word segmentation processing on each corpus sample in the corpus sample data. There is a normal and reasonable dependency relationship between each word segmentation sample in the corpus sample data. The dependency relationship can be used to represent the syntactic structure of the word segmentation sample in the corpus sample data. For example, the dependency relationship may include structural relationships such as subject-predicate, verb-object, and indirect object. The embodiment of the present invention does not limit the specific relationship type of the dependency relationship.
[0047] In an embodiment of the present invention, corpus sample data in which there is a dependency relationship between segmentation samples can be obtained for training a dependency analysis model. There is a correct dependency relationship between the segmentation samples included in each corpus sample in the corpus sample data. Optionally, every two segmentation samples with a dependency relationship can be made into a dependency pair, in which one segmentation sample is a dominant word and the other segmentation sample is a modifier, which can also be called a subordinate word.
[0048] In an optional embodiment of the present invention, obtaining corpus sample data in which there is a dependency relationship between word segmentation samples may include: obtaining standard corpus sample data; performing word segmentation processing on the standard corpus sample data to obtain word segmentation sample data; performing part-of-speech tagging processing on the word segmentation sample data to obtain part-of-speech tagging result sample data; determining the dependency relationship between each word segmentation sample in each word segmentation sample data according to the part-of-speech tagging result sample data to obtain the corpus sample data.
[0049] Among them, the standard corpus sample data can be the standard corpus data used for training the model in the existing corpus, for example, it can be the sample data composed of the corpus such as news broadcast corpus and / or textbook corpus, and the embodiment of the present invention does not specifically limit the content of the standard corpus sample data. The standard corpus sample data can include multiple standard corpus samples. The word segmentation sample data can be the word segmentation data obtained after the standard corpus sample data is subjected to word segmentation processing, which can include multiple word segmentation samples. The part-of-speech tagging result sample data can be the part-of-speech tagging data obtained by performing part-of-speech tagging processing on the word segmentation sample data. Accordingly, the part-of-speech tagging result sample data can include multiple part-of-speech tagging result samples.
[0050] Specifically, when obtaining corpus sample data, standard corpus sample data can be first obtained, and segmentation processing can be performed on the standard corpus sample data to obtain segmentation sample data. After obtaining the segmentation sample data, part-of-speech tagging processing is performed on the segmentation sample data to obtain corresponding part-of-speech tagging result sample data. Further, the dependency relationship between each segmentation sample is determined according to the part-of-speech tagging result sample data, and finally the corpus sample data can be obtained.
[0051] At present, the two mainstream standards for part-of-speech tagging are the Pennsylvania Treebank version of the University of Pennsylvania and the word segmentation part-of-speech tagging standards of Peking University. In a specific example, the acquired news broadcast corpus is used as the standard corpus sample data for word segmentation to obtain word segmentation sample data, and the word segmentation sample data is tagged according to the word segmentation part-of-speech tagging standards of Peking University to obtain the part-of-speech tagging result sample data. Finally, the dependency relationship between each word segmentation sample is determined based on the part-of-speech tagging result sample data to obtain the corpus sample data. In order to improve the efficiency of model training, the word segmentation and part-of-speech tagging of the standard corpus samples can be automatically completed by computer software.
[0052] Table 1 is a word segmentation part-of-speech tagging standard table provided in Example 1 of the present invention. As shown in Table 1, the word segmentation part-of-speech tagging standard of Peking University includes 26 word segmentation part-of-speech tags. The word segmentation sample data corresponding to the standard corpus sample data can be processed with part-of-speech tagging according to these 26 word segmentation part-of-speech tags to obtain part-of-speech tagging result sample data. For example, one of the standard corpus sample data is "The economic development of Xiongan New Area has great potential". The word segmentation sample of the standard corpus sample is processed with part-of-speech tagging, and the obtained part-of-speech tagging result sample can be Xiongan / ns New Area / n Economy / n Development / v has / v great / a / u potential / n.
[0053] Table 1
[0054]
[0055] In an optional embodiment of the present invention, determining the dependency relationship between each word segmentation sample in each word segmentation sample data according to the part-of-speech tagging result sample data may include: determining the front-to-back order relationship and / or modification relationship of each word segmentation sample according to the part-of-speech tagging result sample data; determining the dependency relationship between each word segmentation sample according to the front-to-back order relationship and / or modification relationship of each word segmentation sample.
[0056] The order relationship may be the position relationship between the segmentation samples in the same corpus. The modification relationship may be a grammatical rhetoric between the segmentation samples. For example, the modification relationship may include adjectives modifying nouns, adverbs modifying adjectives, and adverbs modifying verbs. The embodiment of the present invention does not limit the specific type of the modification relationship.
[0057] Specifically, after part-of-speech tagging is performed on the word segmentation sample data to obtain part-of-speech tagging result sample data, the order relationship and / or modification relationship between each word segmentation sample can be determined based on the part-of-speech tagging result sample data, so as to determine the dependency relationship between each word segmentation sample based on the order relationship and / or modification relationship between each word segmentation sample.
[0058] Table 2 is a dependency label table provided in the first embodiment of the present invention. In a specific example, a dependency label table including 30 dependency labels as shown in Table 2 can be used to determine the dependency between each word segmentation sample in the word segmentation sample data for the part-of-speech tagging result sample data. The specific dependency determination rules can use the existing Penn Treebank dependency labeling system.
[0059] Table 2
[0060]
[0061] Figure 2is a schematic diagram of a dependency labeling result provided by the first embodiment of the present invention. In a specific example, Figure 2 As shown in the figure, assuming that a standard corpus sample is "Xiong'an New Area has great potential for economic development", the standard corpus sample is segmented to obtain each segmentation sample, and then the dependency relationship between the segmentation samples is annotated, and finally the dependency relationship is obtained. Figure 2 The dependency annotation results are shown in Figure 1. That is, there is an ATT dependency relationship between Xiongan and the new district, a SBV dependency relationship between development and existence, a VOB dependency relationship between existence and potential, and a RAD dependency relationship between huge and existence. Among them, the dependency relationship can be represented by a directed arc, and the directed arc used to represent the dependency relationship can also be called a dependency arc. The direction of the dependency arc can be from the subordinate term to the dominant term. For example, in the dependency pair of Xiongan and the new district, the subordinate term is the new district, and the dominant term is Xiongan. The direction of the dependency arc is from the new district to Xiongan.
[0062] In an optional embodiment of the present invention, after determining the dependency relationship between each word segmentation sample according to the sequence relationship and / or modification relationship of each word segmentation sample, it can also include: establishing a dependency relationship database according to the dependency relationship between each word segmentation sample.
[0063] The dependency database may be used to store a data set of each word segmentation sample and the dependency relationship between each word segmentation sample.
[0064] Accordingly, after the dependency relationship between the word segmentation samples is determined according to the order relationship and / or modification relationship of each word segmentation sample, the dependency relationship between the word segmentation samples can be stored to establish a dependency relationship database. The dependency relationship database can be used as a matching standard for the dependency relationship analysis model to determine abnormal corpus for the corpus to be processed.
[0065] S120, inputting the corpus sample data into a preset machine learning model for dependency analysis training to obtain a dependency analysis model; the dependency analysis model is used to perform anomaly screening on abnormal corpus.
[0066] Among them, the preset machine learning model can be any type of machine learning model, as long as it can be trained for dependency analysis, and the embodiment of the present invention does not limit the specific type of the preset machine learning model. It should be noted that the preset machine learning model can be the original model to be trained, or it can also be an existing mature model, or it can also be a model obtained by converting a phrase structure tree library model or other tree library model. The dependency analysis model can be a mature model obtained after the preset machine learning model is trained for dependency analysis. The training method can be, for example, a retention cross-validation method, a K-fold cross-validation method, or a leave-one-out cross-validation method, etc. The embodiment of the present invention does not limit the type of training method for corpus sample data. Abnormal screening processing can be a processing method for corpus classification. For example, abnormal screening processing can screen out abnormal corpus that has no practical meaning.
[0067] Specifically, after obtaining the corpus sample data, the corpus sample data can be input into a preset machine learning model for dependency analysis training, and after completing the dependency analysis training, a dependency analysis model is obtained. Among them, the dependency analysis model can be used to filter abnormal corpus according to the analyzed dependency relationship.
[0068] Exemplarily, the corpus sample data for dependency training may refer to the following scale: the corpus sample data may include 8301 news broadcast corpora and 10754 textbook corpora, wherein the average length of sentences in the news broadcast corpora is 31 words, and the average length of sentences in the textbook corpora is 14 words.
[0069] In an optional embodiment of the present invention, before inputting the corpus sample data into a preset machine learning model for dependency analysis training, it can also include: inputting the word segmentation sample data into the preset machine learning model for word segmentation training; inputting the part-of-speech tagging result sample data into the preset machine learning model for part-of-speech tagging training.
[0070] Among them, the word segmentation training can be to train the preset machine learning model according to the word segmentation samples, and after the training, the preset machine learning model has the ability to process the word segmentation of the corpus. The part-of-speech tagging training can be to train the preset machine learning model according to the part-of-speech tagging result sample data, and after the training, the preset machine learning model has the ability to process the part-of-speech tagging of the words in the corpus.
[0071] In an embodiment of the present invention, before performing dependency analysis training, it is first necessary to train the model's word segmentation processing capabilities and part-of-speech tagging processing capabilities. Specifically, the word segmentation sample data can be input into a preset machine learning model for word segmentation training. When the preset machine learning model has mastered mature word segmentation capabilities, the part-of-speech tagging result sample data is input into the preset machine learning model for part-of-speech tagging training. At this point, the preset machine learning model has both word segmentation processing capabilities and part-of-speech tagging processing capabilities. On this basis, when the preset machine learning model is subjected to dependency training, the dependency analysis model finally obtained has both word segmentation processing capabilities, part-of-speech tagging processing capabilities, and dependency analysis capabilities.
[0072] At present, although the tools for dependency analysis of corpora can make dependency judgments on abnormal corpora (that is, there is a possibility of error in dependency judgment), the accuracy rate has not reached 90%, and there is still about 10% room for error. At the same time, the existing dependency syntax analyzer will process the dependency relationship of abnormal corpora in the same way as the dependency relationship judgment of normal corpora, and both will give dependency relationships. That is, the existing dependency syntax analyzer cannot perform abnormal screening processing on abnormal corpora. The dependency analysis model of the embodiment of the present invention can screen and process abnormal corpora, greatly reducing the labor cost and time cost of manually screening abnormal corpora, and at the same time can avoid normal dependency analysis on abnormal corpora, effectively improving the accuracy of corpus dependency analysis and the efficiency of corpus dependency analysis.
[0073] The technical solution of this embodiment can obtain a dependency analysis model by performing dependency analysis training on word segmentation sample data in corpus sample data. The obtained dependency analysis model can be used to perform abnormal screening on abnormal corpus, solving the problem of high labor and time costs in the existing screening of abnormal corpus from the corpus to be processed. By using the dependency analysis model obtained by training, abnormal screening on abnormal corpus can effectively improve the accuracy and efficiency of corpus dependency analysis.
[0074] Embodiment 2
[0075] Figure 3 is a flow chart of a corpus processing method provided in the second embodiment of the present invention. This embodiment is applicable to the case where abnormal corpus is screened out from the corpus to be processed. The method can be executed by a corpus processing device, which can be implemented by software and / or hardware and can generally be integrated in a computer device, such as Figure 3 As shown, the method includes the following operations:
[0076] S210: Obtain corpus to be processed, and input the corpus to be processed into a dependency analysis model.
[0077] The corpus to be processed may be original corpus data from which abnormal corpus may be screened out, and the corpus data may be speech data collected in real time, etc. It is understandable that the corpus to be processed may include multiple sentences.
[0078] In an embodiment of the present invention, the acquired corpus to be processed may be input into a dependency analysis model, so that abnormal corpus can be automatically screened out from the corpus to be processed through the dependency analysis model.
[0079] S220: performing dependency analysis on the corpus to be processed by using a dependency analysis model.
[0080] Correspondingly, after the acquired corpus to be processed is input into the dependency analysis model, the dependency analysis model can perform dependency analysis on the corpus to be processed.
[0081] In an optional embodiment of the present invention, performing dependency analysis on the corpus to be processed by using a dependency analysis model may include: performing word segmentation processing on the corpus to be processed by using a dependency analysis model to obtain corpus word segmentations; performing part-of-speech tagging processing on the corpus word segmentations to obtain corpus part-of-speech tagging results; and determining the dependency relationship between each corpus word segmentation based on the corpus part-of-speech tagging results.
[0082] The corpus segmentation may be segmentation data obtained by performing segmentation processing on the corpus to be processed, and the corpus part-of-speech tagging result may be part-of-speech tagging data obtained by performing part-of-speech tagging processing on the corpus segmentation.
[0083] Since the dependency analysis model has the ability to process word segmentation, part-of-speech tagging and dependency analysis at the same time, when the dependency analysis model performs dependency analysis, it can first perform word segmentation on the corpus to obtain corpus segmentations, and then perform part-of-speech tagging on the obtained corpus segmentations to obtain corpus part-of-speech tagging results, and finally determine the dependency relationship between the corpus segmentations based on the corpus part-of-speech tagging results.
[0084] In order to show the processing results of the dependency analysis model on the word segmentation, part-of-speech tagging and dependency analysis between the word segments of the corpus to be processed, the dependency analysis model can be used to analyze multiple sentences in the expected processing to obtain the following example of the processing results of the corpus to be processed:
[0085] Figure 4 FIG. 1 is a schematic diagram of the effect of performing corpus processing by using a dependency analysis model provided by Embodiment 2 of the present invention. In a specific example, Figure 4As shown in the figure, suppose one of the sentences in the corpus to be processed is "He has great potential for development", and the dependency analysis model is used to perform dependency analysis on the sentence to be processed. The dependency analysis model will first perform word segmentation on the sentence to be processed, obtain each corpus word segmentation, and then perform part-of-speech tagging on the corpus word segmentation to obtain the corpus word segmentation result, and then determine the dependency relationship between the corpus word segmentations based on the corpus word segmentation result, and further tag the corpus word segmentation dependency relationship based on the dependency relationship between the corpus word segmentations, and finally obtain the following Figure 4 The dependency annotation results are shown. That is, there is an ATT dependency relationship between "this" and "people", an SBV dependency relationship between "development" and "have", a RAD dependency relationship between "huge" and "of", and a RAD dependency relationship between "people" and "of".
[0086] Figure 5 FIG. 1 is a schematic diagram of the effect of performing corpus processing by using a dependency analysis model provided by Embodiment 2 of the present invention. In a specific example, Figure 5 As shown in the figure, suppose one of the sentences in the corpus to be processed is "The economic development of Xiong'an New Area will be very good", and the dependency analysis model is used to perform dependency analysis on the sentence to be processed. The dependency analysis model will first perform word segmentation on the sentence to be processed, obtain each corpus word segmentation, and then perform part-of-speech tagging on the corpus word segmentation to obtain the corpus part-of-speech tagging result, and then determine the dependency relationship between the corpus word segmentations based on the corpus part-of-speech tagging result, and further tag the corpus word dependency relationship based on the dependency relationship between the corpus word segmentations, and finally obtain Figure 5 That is, there is an ADV dependency relationship between "very" and "not bad", an SBV dependency relationship between "development" and "not bad", and an ATT dependency relationship between "new district" and "development".
[0087] Figure 6 FIG. 1 is a schematic diagram of the effect of performing corpus processing by using a dependency analysis model provided by Embodiment 2 of the present invention. In a specific example, Figure 6 As shown in the figure, suppose one of the sentences to be processed in the corpus to be processed is "He is a very good person", and the dependency analysis model is used to perform dependency analysis on the sentence to be processed. The dependency analysis model will first perform word segmentation on the sentence to be processed, obtain each corpus word segmentation, and then perform part-of-speech tagging on the corpus word segmentation to obtain the corpus part-of-speech tagging result, and then determine the dependency relationship between the corpus word segmentations based on the corpus part-of-speech tagging result, and further tag the corpus word dependency relationship based on the dependency relationship between the corpus word segmentations, and finally obtain Figure 6That is, there is an ATT dependency relationship between "he" and "people", an ADV dependency relationship between "very" and "not bad", and an SBV dependency relationship between "people" and "not bad".
[0088] Figure 7 FIG. 1 is a schematic diagram of the effect of performing corpus processing by using a dependency analysis model provided by Embodiment 2 of the present invention. In a specific example, Figure 7 As shown in the figure, suppose one of the sentences in the corpus to be processed is "Do Beijingers like to eat roast duck?" The dependency analysis model is used to perform dependency analysis on the sentence to be processed. The dependency analysis model will first perform word segmentation on the sentence to be processed, obtain each corpus word segmentation, and then perform part-of-speech tagging on the corpus word segmentation to obtain the corpus part-of-speech tagging result, and then determine the dependency relationship between the corpus word segmentations based on the corpus part-of-speech tagging result, and further tag the corpus word dependency relationship based on the dependency relationship between the corpus word segmentations, and finally obtain Figure 7 That is, there is an ATT dependency relationship between "Beijing" and "people", a VOB dependency relationship between "eat" and "roast duck", and a SBV dependency relationship between "people" and "like".
[0089] S230: Determine abnormal corpus from the corpus to be processed according to the analysis result of the dependency analysis model.
[0090] The dependency analysis model is a model trained by the model training method of any embodiment.
[0091] The abnormal corpus may be the corpus without actual meaning in the corpus to be processed.
[0092] Specifically, after the dependency analysis model determines the dependency relationships between the corpus segmentations of each corpus to be processed, abnormal corpus can be determined from the corpus to be processed according to the analysis result of the dependency relationship.
[0093] In an optional embodiment of the present invention, determining the dependency relationship between each corpus segmentation according to the corpus part-of-speech tagging result may include: determining the front-end order relationship and / or modification relationship of each corpus segmentation according to the corpus part-of-speech tagging result; determining abnormal corpus from the corpus to be processed according to the analysis result of the dependency analysis model, including: matching the front-end order relationship and / or modification relationship of each corpus segmentation with the dependency relationship stored in the dependency database; if it is determined that the match is successful, marking the corpus to be processed as normal corpus; otherwise, marking the corpus to be processed as abnormal corpus.
[0094] Among them, normal corpus can indicate that the corpus to be processed is a corpus with correct grammar, clear semantics or practical significance. Abnormal corpus can indicate that the corpus to be processed may have problems such as grammar errors, unclear semantics or no practical significance.
[0095] Correspondingly, the dependency analysis model can first determine the sequential relationship and / or modification relationship of word segmentation of the corpus according to the part-of-speech tagging result of the corpus, and then match the sequential relationship and / or modification relationship of each word segmentation of the corpus with the dependencies stored in the dependency database. If it is determined that the sequential relationship and / or modification relationship of each word segmentation of the corpus matches the dependencies stored in the dependency database successfully, the corpus to be processed is marked as a normal corpus. For example, marking the corpus to be processed as 1 represents that the corpus to be processed is a normal corpus. Otherwise, if it is determined that the sequential relationship and / or modification relationship of each word segmentation of the corpus fails to match the dependencies stored in the dependency database, the corpus to be processed is marked as an abnormal corpus. For example, marking the corpus to be processed as 0 represents that the corpus to be processed is an abnormal corpus. Among them, the matching failure may be that the sequential relationship and / or modification relationship of each word segmentation of the corpus partially or completely does not match the dependencies stored in the dependency database.
[0096] Exemplarily, assume that the corpus to be processed is "person new area roast duck". The dependencies between "person" and "new area", "person" and "roast duck", and "new area" and "roast duck" in this corpus to be processed cannot be matched to the dependencies stored in the dependency database. That is, there is no mutual modification relationship between the word segmentations of this corpus to be processed, no dependency relationship, and the syntax is disordered. Therefore, the corpus to be processed can be marked as an abnormal corpus.
[0097] Figure 8 This is a flowchart of a corpus processing method based on dependency analysis provided in the second embodiment of the present invention. In a specific example, such as Figure 8As shown, in the training stage of the dependency analysis model, the standard corpus sample data is segmented to obtain the segmentation sample data, and then the segmentation sample data is part-of-speech tagged to obtain the part-of-speech tagged result sample data, and the dependency relationship between the segmentation samples is annotated according to the part-of-speech tagged result sample data, and the segmentation sample data, the part-of-speech tagged result sample data, and the dependency relationship between the segmentation samples are sequentially trained on the preset machine learning model to obtain the dependency analysis model. In the corpus processing stage, the corpus to be processed can be directly input into the dependency analysis model for dependency analysis to determine whether there is a situation in which the dependency relationship between a pair of corpus segmentations in the corpus to be processed does not match the dependency relationship stored in the dependency database. If it is determined that the order relationship and / or modification relationship of each corpus segmentation is successfully matched with the dependency relationship stored in the dependency database, the corpus to be processed is marked as normal corpus; otherwise, the corpus to be processed is marked as abnormal corpus. Considering that the dependency analysis model cannot achieve 100% accuracy, there may be a situation where normal corpus is marked as abnormal corpus. Therefore, after using the dependency analysis model to filter out abnormal data from all the corpus to be processed, the abnormal corpus can be manually checked to ensure that the normal corpus is not mistakenly marked as abnormal corpus.
[0098] It can be seen from this that by matching the order and / or modification relationship of the corpus segmentation words with the dependency relationships stored in the dependency database, as long as the standard corpus sample data for training are ensured to be regular and grammatically correct corpus, the dependency analysis model will not be able to give an analysis result of the dependency relationship of the abnormal corpus, because the order and / or modification relationship of the corpus segmentation words cannot match the dependency relationships stored in the dependency database, and the dependency analysis model will not be able to give the specific dependency relationship type between the corpus segmentation words of the abnormal corpus.
[0099] In an embodiment of the present invention, the corpus to be processed is input into a dependency analysis model for dependency analysis, and abnormal corpus in the corpus to be processed is found according to the analysis results of the dependency analysis model, thereby solving the problem that the existing dependency analyzer cannot effectively identify abnormal corpus, achieving the purpose of automatic screening of abnormal corpus, reducing the labor cost and time cost of corpus processing, and improving the accuracy and analysis efficiency of corpus dependency analysis.
[0100] Embodiment 3
[0101] Fig. 9 is a schematic diagram of a model training device provided in Embodiment 3 of the present invention, such as Fig. 9 As shown, the device includes: a corpus sample data acquisition module 310 and a dependency analysis training module 320, wherein:
[0102] Corpus sample data acquisition module 310, used to acquire corpus sample data having dependency relationships between word segmentation samples;
[0103] The dependency analysis training module 320 is used to input the corpus sample data into a preset machine learning model to perform dependency analysis training to obtain a dependency analysis model; the dependency analysis model is used to perform anomaly screening on abnormal corpus.
[0104] The technical solution of this embodiment can obtain a dependency analysis model by performing dependency analysis training on word segmentation sample data in corpus sample data. The obtained dependency analysis model can be used to perform abnormal screening on abnormal corpus, solving the problem of high labor and time costs in the existing screening of abnormal corpus from the corpus to be processed. By using the dependency analysis model obtained by training, abnormal screening on abnormal corpus can effectively improve the accuracy and efficiency of corpus dependency analysis.
[0105] Optionally, the corpus sample data acquisition module includes: a sample data acquisition unit, used to acquire standard corpus sample data; a sample data word segmentation processing unit, used to perform word segmentation processing on the corpus sample data to obtain word segmentation samples; a word segmentation sample data part-of-speech tagging unit, used to perform part-of-speech tagging processing on the word segmentation samples to obtain part-of-speech tagging result sample data; and a word segmentation sample dependency relationship determination unit, used to determine the dependency relationship between each of the word segmentation samples according to the part-of-speech tagging result sample data to obtain the corpus sample data.
[0106] Optionally, the word segmentation sample dependency determination unit can be specifically used to: determine the front-end sequence relationship and / or modification relationship of each of the word segmentation samples based on the part-of-speech tagging result sample data; determine the dependency relationship between each of the word segmentation samples based on the front-end sequence relationship and / or modification relationship of each of the word segmentation samples.
[0107] Optionally, the device further includes: a dependency database establishment module, configured to establish a dependency database according to the dependency relationships between the word segmentation samples.
[0108] Optionally, the dependency analysis training module 320 is specifically used to input the word segmentation data into the preset machine learning model for word segmentation training; and input the part-of-speech tagging result sample data into the preset machine learning model for part-of-speech tagging training.
[0109] The above-mentioned model training device can execute the model training method provided by any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the model training method provided by any embodiment of the present invention.
[0110] Since the model training device introduced above is a device that can execute the model training method in the embodiment of the present invention, based on the model training method introduced in the embodiment of the present invention, the technical personnel in the field can understand the specific implementation of the model training device of this embodiment and its various variations, so how the model training device implements the model training method in the embodiment of the present invention is not introduced in detail here. As long as the technical personnel in the field implement the device used in the model training method in the embodiment of the present invention, it belongs to the scope of protection of this application.
[0111] Embodiment 4
[0112] Fig.10 is a schematic diagram of a corpus processing device provided by Embodiment 4 of the present invention, such as Fig.10 As shown, the device includes: a to-be-processed corpus acquisition module 410, a dependency analysis module 420 and an abnormal corpus determination module 430, wherein:
[0113] The to-be-processed corpus acquisition module 410 is used to acquire the to-be-processed corpus and input the to-be-processed corpus into the dependency analysis model;
[0114] A dependency analysis module 420, configured to perform dependency analysis on the corpus to be processed by using the dependency analysis model;
[0115] An abnormal corpus determining module 430 is used to determine abnormal corpus from the corpus to be processed according to the analysis result of the dependency analysis model;
[0116] Wherein, the dependency analysis model is a model trained by the model training method described in any embodiment.
[0117] In an embodiment of the present invention, the corpus to be processed is input into a dependency analysis model for dependency analysis, and abnormal corpus in the corpus to be processed is found according to the analysis results of the dependency analysis model, thereby solving the problem that the existing dependency analyzer cannot effectively identify abnormal corpus, achieving the purpose of automatic screening of abnormal corpus, reducing the labor cost and time cost of corpus processing, and improving the accuracy and analysis efficiency of corpus dependency analysis.
[0118] Optionally, the dependency analysis module includes: a corpus segmentation processing unit, used to perform segmentation processing on the corpus to be processed through the dependency analysis model to obtain corpus segmentations; a part-of-speech tagging processing unit, used to perform part-of-speech tagging processing on the corpus segmentations to obtain corpus part-of-speech tagging results; and a dependency determination unit, used to determine the dependency relationship between each of the corpus segmentations based on the corpus part-of-speech tagging results.
[0119] Optionally, the dependency determination unit is specifically used to: determine the order relationship and / or modification relationship of each of the corpus segmentations according to the corpus part-of-speech tagging results; the abnormal corpus determination module 430 is specifically used to: match the order relationship and / or modification relationship of each of the corpus segmentations with the dependency relationship stored in the dependency database; if it is determined that the match is successful, mark the corpus to be processed as normal corpus; otherwise, mark the corpus to be processed as abnormal corpus.
[0120] The above-mentioned corpus processing device can execute the corpus processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the corpus processing method provided by any embodiment of the present invention.
[0121] Since the corpus processing device introduced above is a device that can execute the corpus processing method in the embodiment of the present invention, based on the corpus processing method introduced in the embodiment of the present invention, the technical personnel of the field can understand the specific implementation of the corpus processing device of the present embodiment and its various variations, so how the corpus processing device implements the corpus processing method in the embodiment of the present invention is not described in detail here. As long as the technical personnel of the field implement the device used in the corpus processing method in the embodiment of the present invention, it belongs to the scope of protection of this application.
[0122] Embodiment 5
[0123] Fig.11 A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Fig.11 A block diagram of a computer device 512 suitable for use in implementing embodiments of the present invention is shown. Fig.11 The computer device 512 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0124] like Fig.11 As shown, the computer device 512 is in the form of a general-purpose computing device. The components of the computer device 512 may include, but are not limited to: one or more processors 516, a storage device 528, and a bus 518 that connects various system components (including the storage device 528 and the processor 516).
[0125] Bus 518 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, MicroChannel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0126] The computer device 512 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 512, including volatile and non-volatile media, removable and non-removable media.
[0127] The storage device 528 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 530 and / or cache memory 532. The computer device 512 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 534 may be used to read and write non-removable, non-volatile magnetic media ( Fig.11 not shown, usually called a "hard drive"). Although Fig.11 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-ReadOnly Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 518 via one or more data medium interfaces. The storage device 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0128] A program 536 having a set (at least one) of program modules 526 may be stored, for example, in a storage device 528, such program modules 526 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 526 generally perform the functions and / or methods of the embodiments described herein.
[0129] The computer device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, camera, display 524, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 512, and / or communicate with any device that enables the computer device 512 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 522. In addition, the computer device 512 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 520. As shown, the network adapter 520 communicates with other modules of the computer device 512 through a bus 518. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computer device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0130] The processor 516 executes various functional applications and data processing by running the program stored in the storage device 528, such as implementing the model training method provided in the above embodiment of the present invention: obtaining corpus sample data with dependency relationships between word segmentation samples; inputting the corpus sample data into a preset machine learning model for dependency analysis training to obtain a dependency analysis model; the dependency analysis model is used to perform abnormal screening on abnormal corpus. Alternatively, the corpus processing method provided in the above embodiment of the present invention is implemented: obtaining the corpus to be processed, and inputting the corpus to be processed into the dependency analysis model; performing dependency analysis on the corpus to be processed through the dependency analysis model; determining abnormal corpus from the corpus to be processed according to the analysis results of the dependency analysis model; wherein the dependency analysis model is a model trained by the model training method described in any embodiment.
[0131] The embodiment of the present invention obtains a dependency analysis model by performing dependency analysis training on corpus sample data, and uses the trained dependency analysis model to perform dependency analysis on the corpus to be processed, so as to determine abnormal corpus from the corpus to be processed according to the analysis results, thereby solving the problem of high labor and time costs in screening abnormal corpus from the corpus to be processed, and realizing automatic identification and abnormal screening of abnormal corpus, thereby improving the processing efficiency and accuracy of corpus processing.
[0132] Embodiment 6
[0133] Embodiment 6 of the present invention also provides a computer storage medium storing a computer program, and the computer program, when executed by a computer processor, is used to execute the model training method described in any of the above embodiments of the present invention: obtaining corpus sample data in which there is a dependency relationship between word segmentation samples; inputting the corpus sample data into a preset machine learning model for dependency analysis training to obtain a dependency analysis model; the dependency analysis model is used to perform abnormal screening processing on abnormal corpus. Alternatively, it is used to execute the corpus processing method described in any of the above embodiments of the present invention: obtaining the corpus to be processed, and inputting the corpus to be processed into the dependency analysis model; performing dependency analysis on the corpus to be processed through the dependency analysis model; determining abnormal corpus from the corpus to be processed according to the analysis results of the dependency analysis model; wherein the dependency analysis model is a model trained by the model training method described in any embodiment of the present invention.
[0134] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0135] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0136] The program code contained in the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, radio frequency (Radio Frequency, RF) etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0137] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A model training method, It is characterized in that include: Acquire standard corpus sample data; wherein the standard corpus sample data is sample data consisting of news broadcast corpus and textbook corpus; Performing word segmentation processing on the standard corpus sample data to obtain word segmentation sample data; Performing part-of-speech tagging on the word segmentation sample data to obtain part-of-speech tagging result sample data; Determine the front-to-back order relationship and modification relationship of each word segmentation sample according to the part-of-speech tagging result sample data; wherein the front-to-back order relationship is the front-to-back position relationship between word segmentation samples in the same corpus; Determine the dependency relationship between each of the segmentation samples according to the sequence relationship and modification relationship of each of the segmentation samples to obtain corpus sample data; wherein, there is a correct dependency relationship between the segmentation samples included in each corpus sample in the corpus sample data; and every two segmentation samples with a dependency relationship constitute a dependency pair; Establishing a dependency database according to the dependency relationships between the word segmentation samples; Inputting the word segmentation sample data into a preset machine learning model for word segmentation training; Inputting the part-of-speech tagging result sample data into the preset machine learning model for part-of-speech tagging training; Inputting the corpus sample data into the preset machine learning model for dependency analysis training to obtain a dependency analysis model; wherein the dependency analysis training method is a retention cross-validation method; The dependency analysis model is used to perform anomaly screening processing on abnormal corpus; wherein the anomaly screening processing includes screening out abnormal corpus that has no practical meaning.
2. A corpus processing method, It is characterized in that include: Obtaining a corpus to be processed, and inputting the corpus to be processed into a dependency analysis model; Performing word segmentation processing on the corpus to be processed by using the dependency analysis model to obtain corpus word segmentation; Performing part-of-speech tagging on the corpus segmentation to obtain a corpus part-of-speech tagging result; Determining the front-to-back order relationship and modification relationship of each of the corpus segment words according to the corpus part-of-speech tagging results; wherein the front-to-back order relationship is the front-to-back position relationship between the segment word samples in the same corpus; Matching the order and modification relationship of each of the corpus segment words with the dependency relationship stored in the dependency relationship database; If it is determined that the match is successful, the corpus to be processed is marked as normal corpus; Otherwise, the corpus to be processed is marked as abnormal corpus; wherein the abnormal corpus includes abnormal corpus without practical meaning; Wherein, the dependency analysis model is a model trained by the model training method described in claim 1.
3. A model training device, It is characterized in that include: The corpus sample data acquisition module includes: a sample data acquisition unit, a sample data word segmentation processing unit, a word segmentation sample data part-of-speech tagging unit, and a word segmentation sample dependency determination unit; The sample data acquisition unit is used to acquire standard corpus sample data; wherein the standard corpus sample data is sample data composed of news broadcast corpus and textbook corpus; The sample data word segmentation processing unit is used to perform word segmentation processing on the standard corpus sample data to obtain word segmentation sample data; The word segmentation sample data part-of-speech tagging unit is used to perform part-of-speech tagging on the word segmentation sample data to obtain part-of-speech tagging result sample data; The word segmentation sample dependency determination unit is used to: Determine the front-to-back order relationship and modification relationship of each word segmentation sample according to the part-of-speech tagging result sample data; wherein the front-to-back order relationship is the front-to-back position relationship between word segmentation samples in the same corpus; Determine the dependency relationship between each of the segmentation samples according to the sequence relationship and modification relationship of each of the segmentation samples to obtain corpus sample data; wherein, there is a correct dependency relationship between the segmentation samples included in each corpus sample in the corpus sample data; and every two segmentation samples with a dependency relationship constitute a dependency pair; A dependency database establishment module, used to establish a dependency database according to the dependency relationship between each of the segmentation samples; Dependency analysis training module for: Inputting the word segmentation sample data into a preset machine learning model for word segmentation training; Inputting the part-of-speech tagging result sample data into the preset machine learning model for part-of-speech tagging training; Inputting the corpus sample data into the preset machine learning model for dependency analysis training to obtain a dependency analysis model; wherein the dependency analysis training method is a retention cross-validation method; The dependency analysis model is used to perform anomaly screening processing on abnormal corpus; wherein the anomaly screening processing includes screening out abnormal corpus that has no practical meaning.
4. A corpus processing device, It is characterized in that include: A module for acquiring corpus to be processed, used for acquiring corpus to be processed and inputting the corpus to be processed into a dependency analysis model; A dependency analysis module, including: a corpus segmentation processing unit, a part-of-speech tagging processing unit and a dependency determination unit; The corpus word segmentation processing unit is used to perform word segmentation processing on the corpus to be processed through the dependency analysis model to obtain corpus word segmentations; The part-of-speech tagging processing unit is used to perform part-of-speech tagging on the corpus segmentation to obtain a corpus part-of-speech tagging result; The dependency relationship determination unit is used to match the front-to-back order relationship and the modification relationship of each of the corpus segment words with the dependency relationship stored in the dependency database; if it is determined that the match is successful, the corpus to be processed is marked as normal corpus; otherwise, the corpus to be processed is marked as abnormal corpus; wherein the front-to-back order relationship is the front-to-back position relationship between the segmentation samples in the same corpus; An abnormal corpus determination module is used to determine abnormal corpus from the corpus to be processed according to the order relationship and modification relationship of each corpus segment; wherein the abnormal corpus includes abnormal corpus without practical meaning; Wherein, the dependency analysis model is a model trained by the model training method described in claim 1.
5. A computer device, It is characterized in that The computer device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model training method as described in claim 1, or implement the corpus processing method as described in claim 2.
