Data source detection method, device and electronic device

By detecting the quality of parallel corpus data from network data sources and determining whether it meets preset standards, the problem of uneven parallel corpus data quality is solved, and the quality of training samples of the translation model and the overall performance of the translation model are improved.

CN114881049BActive Publication Date: 2024-09-06ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210483918.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2024-09-06
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

The quality of existing parallel corpus data is uneven, resulting in poor quality of trained machine translation models and a lack of high-quality data sources for translation model training.

Method used

By obtaining multiple parallel corpus data from network data sources, the proportion of data that meets the preset quality requirements is determined, and the quality level of the network data source is determined based on this ratio. If the level is greater than the threshold, it is used as data for training the translation model. source.

Benefits of technology

It implements quality inspection of network data sources to ensure the high quality of training samples, thereby improving the quality and coverage capabilities of the translation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881049B
    Figure CN114881049B
Patent Text Reader

Abstract

The present application provides a data source detection method, device and electronic device, the data source detection method includes: obtaining multiple parallel corpus data from a network data source, the parallel corpus data includes: a first language text and a second language text, the first language text and the second language text are in a mutually translated relationship; determining the target quantity ratio of parallel corpus data that meet preset quality requirements among the multiple parallel corpus data; determining the quality level of the network data source according to the target quantity ratio, the target quantity ratio and the quality level are positively correlated; if the quality level is greater than the level threshold, determining the network data source as a data source for training a translation model. The present application detects the quality of the parallel corpus data from the network data source, and can accurately detect whether the network data source is a data source that can provide training samples for the translation model, thereby improving the quality of the training samples and the quality of the translation model obtained by training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data source detection method, device and electronic device. Background Art

[0002] There are many application scenarios for multilingual technical services. For example, in e-commerce scenarios and instant messaging scenarios, the language input by the user is translated to serve users and enable them to communicate with other users who speak different languages.

[0003] At present, by using parallel corpus data to train machine translation models, the obtained machine translation models can achieve the function of translation. However, due to the uneven quality of the current parallel corpus data, the quality of the trained machine translation models is poor, so there is an urgent need for data sources that can provide high-quality parallel corpus data. Summary of the invention

[0004] Multiple aspects of the present application provide a data source detection method, apparatus, and electronic device to determine a data source that can provide high-quality parallel statements.

[0005] A first aspect of an embodiment of the present application provides a data source detection method, including: obtaining multiple parallel corpus data from a network data source, the parallel corpus data including: a first language text and a second language text, the first language text and the second language text being in a mutually translated relationship; determining a target quantity ratio of parallel corpus data that meets preset quality requirements among the multiple parallel corpus data; determining a quality level of the network data source based on the target quantity ratio, the target quantity ratio being positively correlated with the quality level; if the quality level is greater than a level threshold, determining the network data source as a data source for training a translation model.

[0006] A second aspect of an embodiment of the present application provides a data source detection device, including:

[0007] An acquisition module is used to acquire a plurality of parallel corpus data from a network data source, wherein the parallel corpus data includes: a first language text and a second language text, wherein the first language text and the second language text are mutually translated;

[0008] A first determination module is used to determine a target quantity ratio of parallel corpus data that meets a preset quality requirement among a plurality of parallel corpus data;

[0009] The second determination module is used to determine the quality level of the network data source according to the target quantity ratio, and the target quantity ratio is positively correlated with the quality level;

[0010] The third determination module is used to determine the network data source as a data source for training the translation model if the quality level is greater than the level threshold.

[0011] A third aspect of an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data source detection method of the first aspect is implemented.

[0012] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the data source detection method of the first aspect.

[0013] The embodiment of the present application is applied to the machine translation scenario, and is used for the detection of data sources. The data source detection method provided includes: obtaining multiple parallel corpus data from a network data source, and the parallel corpus data includes: a first language text and a second language text, and the first language text and the second language text are in a mutually translated relationship; determining the target quantity ratio of parallel corpus data that meet the preset quality requirements among the multiple parallel corpus data; determining the quality level of the network data source according to the target quantity ratio, and the target quantity ratio is positively correlated with the quality level; if the quality level is greater than the level threshold, the network data source is determined to be a data source for training the translation model. The embodiment of the present application detects the quality of the parallel corpus data from the network data source, and can then accurately detect whether the network data source is a data source that can provide training samples for the translation model, thereby improving the quality of the training samples, and further improving the quality of the translation model obtained by training. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0015] Figure 1 An application scenario diagram of a data source detection method provided for an exemplary embodiment of the present application;

[0016] Figure 2 A flowchart of a method for detecting a data source provided by an exemplary embodiment of the present application;

[0017] Figure 3 A schematic diagram of a network data source provided for an exemplary embodiment of the present application;

[0018] Figure 4 A flowchart of another data source detection method provided for an exemplary embodiment of the present application;

[0019] Figure 5 A structural block diagram of a level detection model provided for an exemplary embodiment of the present application;

[0020] Figure 6 A structural block diagram of a data source detection device provided for an exemplary embodiment of the present application;

[0021] Figure 7 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0023] At present, for the translation model based on neural network (NMT, Neural Machine Translation), parallel corpus data as training samples is the basis of the translation model. A large number of training samples can allow the translation model to learn enough knowledge, and then the translation model obtained by training can achieve accurate translation. Since all the knowledge of the translation model comes from the training samples, if the training samples include noise data, it will affect the quality of the translation model obtained by training. Therefore, the quality of the training samples is very important for the translation model. Further, at present, the largest source of training samples is parallel corpus data mined from the Internet. Compared with traditional manual translation corpus data and United Nations corpus data, the parallel corpus data mined from the Internet has the following advantages: First, since many cross-language parallel websites are added every year, the content of these websites is described in multiple languages. This type of website continues to increase, and the content of the website also continues to increase, which can provide enough training samples. Secondly, compared with traditional data sources, the parallel corpus data of the Internet network data source (website) covers a wide range of fields, such as the Internet field, the manufacturing field, the life field and almost all other fields, and can obtain parallel corpus data in enough fields, so as to train training models suitable for various fields. Finally, the parallel corpus data of the Internet network data sources are continuously updated. For example, multilingual news websites update the latest news information almost every day. Therefore, the latest parallel corpus data can be continuously obtained through network data sources, which helps the translation model adopt the latest parallel corpus data and continuously learn the latest knowledge.

[0024] However, because the number of network data sources is huge, the quality levels of parallel corpus data from different network data sources are uneven. Therefore, it is necessary to detect the network data source to ensure the quality of the training samples used for the translation model. In this regard, the embodiment of the present application provides a data source detection method including: obtaining multiple parallel corpus data from a network data source, the parallel corpus data including: a first language text and a second language text, the first language text and the second language text being a mutual translation relationship; determining the target quantity ratio of parallel corpus data that meets the preset quality requirements among multiple parallel corpus data; determining the quality level of the network data source according to the target quantity ratio, the target quantity ratio is positively correlated with the quality level; if the quality level is greater than the level threshold, the network data source is determined to be the data source for training the translation model. Among them, since the parallel corpus data of the same network data source has the characteristics of high aggregation and many commonalities, the embodiment of the present application can determine the quality level of the network data source by automatically detecting the quality of part of the parallel corpus data of the network data source, so as to achieve high quality and high coverage of the training samples of the translation model.

[0025] In this embodiment, the execution device of the data source detection method is not limited. Optionally, the data source detection method can implement the overall data source detection method with the help of a cloud computing system. For example, the data source detection method can be applied to a cloud server so as to run various modules to execute corresponding steps with the advantage of cloud resources; in contrast to being applied to the cloud, the data source detection method can also be applied to server-side devices such as conventional servers, cloud servers, or server arrays.

[0026] In addition, refer to Figure 1 The Internet has multiple network data sources, such as network data source 1 to network data source n. Multiple parallel corpus data are randomly captured from each network data source, such as capturing multiple parallel corpus data 1 from network data source 1, capturing multiple parallel corpus data 2 from network data source 2, and capturing multiple parallel corpus data n from network data source n. Then, the quality level of the network data source corresponding to the parallel corpus data of each network data source is determined. If it is determined that the quality level of multiple network data sources x (x is one of 1 to n) is greater than the level threshold, parallel corpus data can be obtained from the multiple network data sources x as training samples to train the translation model, thereby improving the quality of the translation model.

[0027] The embodiment of the present application provides a data source detection method which detects the quality of parallel corpus data from a network data source, thereby being able to accurately detect whether the network data source is a data source that can provide training samples for a translation model, thereby improving the quality of the training samples and further being able to improve the quality of the translation model obtained through training.

[0028] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0029] Figure 2 The following is a flow chart of a method for detecting a data source provided by an exemplary embodiment of the present application. Figure 2 The data source detection method shown specifically includes the following steps:

[0030] S201, obtaining a plurality of parallel corpus data from a network data source.

[0031] The parallel corpus data includes: first language text and second language text, and the first language text and the second language text are in a mutually translated relationship.

[0032] In the embodiment of the present application, the network data source is a website on the Internet, such as a shopping website, a flight information website, a weather forecast website, a scientific magazine website, etc. These network data sources are all multilingual, and the content of the network data source is described using parallel corpus data. Figure 3 , where 31 is a Chinese page of the "Today's News" website, and 32 is the English page corresponding to the Chinese page 31, wherein the Chinese page 31 and the English page 32 are mutually translated.

[0033] Further, Figure 3 It includes five parallel corpus data, namely "Today's Information", "Chinese / English", "Healthy life is an attitude", "The lovely stars are dancing", and "Large scale warming will begin tomorrow". Among them, the Chinese text in each parallel corpus data can be used as the first language text, and the English text as the second language text. In the embodiment of the present application, the first language text is in one language, and the second language text is in another language. Among them, in the network data source, the first language text is a translation of the second language text, and the second language text is a translation of the first language text.

[0034] In addition, the network data source includes multiple web pages, each of which has a large amount of parallel corpus data, and the parallel corpus data of each web page is updated, so the network data source can provide a large amount of parallel corpus data. Furthermore, in an embodiment of the present application, multiple parallel corpus data can be randomly obtained from the network data source, such as one thousand, ten thousand or one hundred thousand. It is also possible to randomly obtain multiple parallel corpus data from different web pages of the network data source at different times to ensure the stability of the detected network data source.

[0035] S202, determining a target quantity ratio of parallel corpus data that meets a preset quality requirement among a plurality of parallel corpus data.

[0036] In the embodiment of the present application, the preset quality requirements include: meeting at least one of the inter-translatability quality requirements, the fluency quality requirements, the diversity quality requirements, and the health quality requirements. Figure 3 In the example, the parallel corpus data “The lovely stars are dancing” does not meet the inter-translatability quality requirement, and therefore does not meet the preset quality requirement. The parallel corpus data “Large scale warming will begin tomorrow” does not meet the fluency quality requirement, and therefore does not meet the preset quality requirement.

[0037] In an embodiment of the present application, the target quantity ratio of parallel corpus data that meets the preset quality requirements may be parallel corpus data that all meet the inter-translatability quality requirements, fluency quality requirements, diversity quality requirements, and health quality requirements, or may be a first quantity ratio that meets the inter-translatability quality requirements, a second quantity ratio that meets the fluency quality requirements, a third quantity ratio that meets the diversity quality requirements, and a fourth quantity ratio that meets the health quality requirements among multiple parallel corpus data. The target quantity ratio may include one or more of these.

[0038] S203: Determine the quality level of the network data source according to the target quantity ratio.

[0039] Among them, the target quantity ratio and the quality grade are positively correlated. In an embodiment of the present application, the quality grade can be determined in a variety of ways, wherein if the target quantity ratio of parallel corpus data that meets the preset quality requirements is parallel corpus data that meets the inter-translatability quality requirements, fluency quality requirements, diversity quality requirements, and health quality requirements. Then the target quantity ratio and the quality grade can be positively correlated. If the target quantity ratio is less than 50%, the quality grade of the network data source is poor; if the target quantity ratio is greater than or equal to 50% and less than 70%, the quality grade of the network data source is medium; if the target quantity ratio is greater than or equal to 70%, the quality grade of the network data source is excellent.

[0040] In an optional embodiment, if the target quantity ratio can include multiple items of the first quantity ratio, the second quantity ratio, the third quantity ratio and the fourth quantity ratio, the quality level corresponding to the target quantity ratio can be determined according to the pre-set weights, wherein if the weight of the first quantity ratio is 0.5, the weight of the second quantity ratio is 0.2, the weight of the third quantity ratio is 0.2, and the weight of the fourth quantity ratio is 0.1, if the first quantity ratio is 80%, the second quantity ratio is 90%, the third quantity ratio is 50%, and the fourth quantity ratio is 50%, then the calculated result is: 73%, then it can be determined that the quality level of the network data source is excellent.

[0041] In the embodiment of the present application, the quality level of the network data source can be determined according to the target quantity ratio in a variety of ways, which are not limited here. In addition, by determining the quality level of the network data source, it can be determined whether the network data source can be used as the data source of the translation model.

[0042] S204: If the quality level is greater than the level threshold, determining the network data source as a data source for training the translation model.

[0043] In the embodiment of the present application, for example, if the quality level is greater than the poor level, the network data source is determined to be the data source for training the translation model.

[0044] Furthermore, in the actual training process of the translation model, it is necessary to use parallel corpus data from different types of network data sources. When training the translation model, it is also necessary to screen the parallel corpus data from the network data source to determine the parallel corpus data that ultimately meets the requirements of the training sample. Through the above-mentioned determination of the quality level of the network data source in the present application, the network data source that is less than the level threshold can be discarded, and the parallel corpus data of the network data source is not used to train the translation model. Among them, for network data sources greater than the level threshold, as the quality level increases, the filtering method adopted is gradually loosened. For example, a stricter filtering method is configured for a medium-level network data source to filter the parallel corpus data in the medium-level network data source, so as to avoid filtering out parallel corpus data of poor quality and affecting the training of the translation model. A looser filtering method is configured for a superior-level network data source to filter the parallel corpus data in the superior-level network data source, so as to avoid the loss of parallel corpus data with better quality and waste of training samples.

[0045] In the embodiments of the present application, by detecting the network data source, the translation model's demand for a large number of high-quality training samples can be solved, and better support can be provided for later filtering in the parallel corpus data dimension, ultimately enabling the translation model to learn better knowledge and improve translation quality.

[0046] The embodiment of the present application is applied to the machine translation scenario, and is used for the detection of data sources. The data source detection method provided includes: obtaining multiple parallel corpus data from a network data source, and the parallel corpus data includes: a first language text and a second language text, and the first language text and the second language text are in a mutually translated relationship; determining the target quantity ratio of parallel corpus data that meet the preset quality requirements among the multiple parallel corpus data; determining the quality level of the network data source according to the target quantity ratio, and the target quantity ratio is positively correlated with the quality level; if the quality level is greater than the level threshold, the network data source is determined to be a data source for training the translation model. The embodiment of the present application detects the quality of the parallel corpus data from the network data source, and can then accurately detect whether the network data source is a data source that can provide training samples for the translation model, thereby improving the quality of the training samples, and further improving the quality of the translation model obtained by training.

[0047] Reference Figure 4 , is a step flow chart of another data source detection method provided in an exemplary embodiment of the present application.

[0048] like Figure 4 The data source detection method shown specifically includes the following steps:

[0049] S401, obtaining a plurality of parallel corpus data from a network data source.

[0050] S402, determining a target quantity ratio of parallel corpus data that meets a preset quality requirement among a plurality of parallel corpus data.

[0051] In the embodiments of this application, refer to Figure 5 , the level detection model can be pre-trained, and multiple parallel corpus data can be input into the level detection model to obtain the corresponding quality level. The level detection model combines the inter-translatability detection model, the diversity detection model, the fluency detection model and the healthiness detection model.

[0052] Specifically, in the embodiment of the present application, for each quality requirement, a corresponding number of parallel corpus data is randomly obtained from the network data source. For example, the inter-translatability quality requirement corresponds to the random acquisition of one thousand parallel corpus data, the fluency quality requirement corresponds to the random acquisition of ten thousand parallel corpus data, the diversity quality requirement corresponds to the acquisition of ten thousand parallel corpus data, and the health quality requirement corresponds to the acquisition of one thousand parallel corpus data. In the embodiment of the present application, it can be determined whether the inter-translatability quality requirement is met first, and on the premise of meeting the inter-translatability quality requirement, the fluency quality requirement, the diversity quality requirement and the health quality requirement are determined.

[0053] Among them, the following method is used to determine whether the mutual translation quality requirement is met, specifically, determining a target quantity ratio of parallel corpus data that meets the preset quality requirement among multiple parallel corpus data, including: for each parallel corpus data, translating a first language text to obtain a first translation text, the first translation text and the second language text are in the same language, and the first translation text is an accurate translation text corresponding to the first language text; determining a first text similarity between the first translation text and the second language text; translating a second language text to obtain a second translation text, the second translation text and the first language text are in the same language, and the second translation text is an accurate translation text corresponding to the second language text; determining a second text similarity between the second translation text and the first language text; determining a similarity score of the parallel corpus data based on the first text similarity and the second text similarity; if the similarity score is greater than a score threshold, determining the corresponding parallel corpus data as an accurate mutual translation sentence pair; in multiple parallel corpus data, determining a first quantity ratio of accurate mutual translation sentence pairs, the target quantity ratio includes the first quantity ratio.

[0054] In the embodiments of this application, refer to Figure 5 , a mutual translation detection model can be pre-trained, and a translation tool is embedded in the mutual translation detection model, wherein multiple parallel corpus data are input into the mutual translation detection model, and the corresponding first quantity ratio is output.

[0055] In an optional embodiment, the first language text and the second language text can be translated using a professional translation tool. In addition, manual translation can also be used, or manual correction can be used after the translation tool completes the translation, so as to obtain a corresponding accurate translation text. Figure 3 , translate the first language text "Healthy life is an attitude", and obtain the first translated text "Healthy life is an attitude", translate the second language text "Healthy lifeis attitude", and obtain the second translated text "Healthy life is attitude", and then calculate the first similarity between the first translated text "Healthy life is an attitude" and the second language text "Healthy life is attitude", and the second similarity between the second translated text "Healthy life is attitude" and the first language text "Healthy life is an attitude".

[0056] In an embodiment of the present application, the first similarity and the second similarity can be calculated using a bleu algorithm (Bilingual evaluation under study, text evaluation algorithm). The similarity score can be an average of the first similarity and the second similarity. In addition, the score threshold can be set to a value greater than or equal to 10.

[0057] Exemplarily, in the embodiment of the present application, there are 1000 parallel corpus data, of which 800 parallel corpus data have a similarity score greater than 10, and the first quantity ratio is determined to be 80%. In the embodiment of the present application, good mutual translation is the basis for the network data source as the data source of the translation model, the training sample has good mutual translation, and the translation model obtained by training has good translation ability.

[0058] In an optional embodiment, the following method is used to determine whether the diversity quality requirements are met, and the target quantity ratio of parallel corpus data that meet the preset quality requirements among multiple parallel corpus data is determined, which also includes: determining the third text similarity of any two parallel corpus data, the third text similarity is the text similarity between the first language texts of the two parallel corpus data, or the text similarity between the second language texts of the two parallel corpus data; if the third text similarity is less than the similarity threshold, the two parallel corpus data are determined to be non-similar sentence pairs; among the multiple parallel corpus data, a second quantity ratio of non-similar sentence pairs is determined, and the target quantity ratio includes the second quantity ratio.

[0059] Among them, if N parallel corpus data are obtained, the calculation of the third text similarity of any two parallel corpus data requires N×(N-1) / 2 times, and the number of times the third text similarity is determined to be less than the similarity threshold is M times, then the second quantity ratio is M / {N×(N-1) / 2}.

[0060] In the embodiments of this application, refer to Figure 5 , a diversity detection model can be pre-trained, and the diversity detection model can use the PPJoin (massive text similarity) algorithm or the Cartesian product to calculate the third text similarity of any two parallel corpus data, and the similarity threshold can be set to 0.7. Specifically, multiple parallel corpus data are input into the diversity detection model, and the corresponding second quantity ratio is output. Among them, the larger the second quantity ratio, the smaller the similarity ratio of any two parallel corpus data is, and the parallel corpus data of the network data source has diversity, which can improve the translation diversity of the translation model. Under normal circumstances, for network data sources similar to weather forecast websites, the only information updated daily is temperature and date data, the types of parallel corpus data are relatively single, and the amount of parallel corpus data of this type of network data source is also very large. If this type of network data source is used as the data source of the translation model, the quality of the translation model will be reduced, and it is not suitable as a data source for training the translation model.

[0061] For example, refer to Figure 3 For the three parallel corpus data of “Healthy life is an attitude”, “The lovely stars are dancing”, and “Large scale warming will begin tomorrow”, the third text similarity of “Healthy life is attitude” and “The lovely stars are dancing” can be determined. The text similarity of “The lovely stars are dancing” and “Large scale warming will begin tomorrow” can be determined as the third text similarity, and the text similarity of “The lovely stars are dancing” and “Large scale warming will begin tomorrow” can also be determined as the third text similarity.

[0062] In an optional embodiment, the following method is used to determine whether the fluency quality requirement is met, wherein a target quantity ratio of parallel corpus data that meets the preset quality requirement is determined among multiple parallel corpus data, and the method also includes: for each parallel corpus data, determining a first fluency of the corresponding first language text and a second fluency of the second language text; if the average value of the first fluency and the second fluency is greater than a fluency threshold, determining that the corresponding parallel corpus data is a fluent sentence pair; and determining a third quantity ratio of fluent sentence pairs among multiple parallel corpus data, wherein the target quantity ratio includes the third quantity ratio.

[0063] In the embodiments of this application, refer to Figure 5 , a fluency detection model can be pre-trained, and the fluency translation model is GPT2 (a large-scale unsupervised natural language processing model), wherein multiple parallel corpus data are input into the fluency detection model, and the corresponding third quantity ratio is output. Specifically, the fluency detection model can obtain the corresponding first fluency and second fluency for the first language text and the second language text respectively, wherein GPT2 uses a perplexity score to represent the first fluency and the second fluency.

[0064] For example, in Figure 3 The sentence “begins to heat up in a large area, tomorrow” is a poorly fluent first language text. The corresponding expression with better fluency should be “begins to heat up in a large area tomorrow”.

[0065] In an embodiment of the present application, it is also possible to determine the average of the first fluency and the second fluency as a first average value, and then determine the average of the first average values ​​of multiple parallel corpus data as a way to measure whether the network data source meets the fluency quality requirements. For example, if the average of the first average value is 90 points, the network data source meets the fluency quality requirements.

[0066] In an optional embodiment, the following method is used to determine whether the healthy quality requirements are met, wherein a target quantity ratio of parallel corpus data that meet preset quality requirements among multiple parallel corpus data is determined, and the method also includes: for each parallel corpus data, determining whether the corresponding first language text and / or second language text contains bad text information; if not, determining that the corresponding parallel corpus data is a healthy sentence pair; and determining a fourth quantity ratio of healthy sentence pairs among multiple parallel corpus data, wherein the target quantity ratio includes the fourth quantity ratio.

[0067] In an embodiment of the present application, a healthiness detection model can be pre-trained, and the healthiness detection model is a combination of a BERT (a large-scale pre-training model) model and a classifier. Inputting parallel corpus data into the healthiness detection model can output the result of whether the parallel corpus data is a healthy sentence pair. If the parallel corpus data does not include bad text information, the parallel corpus data is determined to be a healthy sentence pair, otherwise it is an unhealthy sentence pair. Among them, the bad text information in the parallel corpus data includes pornographic text, violent text, etc.

[0068] In the embodiment of the present application, by combining the detection of inter-translatability, fluency, diversity and health, the quality of the network data source can be accurately detected.

[0069] S403: If any target quantity ratio of at least two target quantity ratios is less than a preset ratio threshold, determine that the quality level of the network data source is a level threshold.

[0070] Among them, at least two target quantity ratios are included, for example, a first quantity ratio, a second quantity ratio, a third quantity ratio and a fourth quantity ratio. Among them, if any target quantity ratio is less than a preset ratio threshold, it is determined that the quality level of the network data source is a poor level, and the data source cannot be used to train the translation model. In an embodiment of the present application, the preset ratio threshold can also be set differently according to different aspects. For example, if the preset ratio threshold corresponding to intertranslatability is 50%, then when the first quantity ratio is less than 50%, the quality level of the network data source is determined to be a poor level. If the preset ratio threshold corresponding to fluency is 70%, then when the second quantity ratio is less than 70%, the quality level of the network data source is determined to be a poor level. If the preset ratio threshold corresponding to diversity is 30%, then when the third quantity ratio is less than 30%, the quality level of the network data source is determined to be a poor level. If the preset ratio threshold corresponding to healthiness is 20%, then when the fourth quantity ratio is less than 20%, the quality level of the network data source is determined to be a poor level.

[0071] In the embodiment of the present application, when any target quantity ratio is less than a preset ratio threshold, the quality level of the network data source is determined to be the level threshold, which can efficiently detect network data sources with poor quality levels.

[0072] S404, inputting the target quantity ratio into a pre-trained classification model for grade classification to obtain the quality grade of the network data source.

[0073] In the embodiments of this application, refer to Figure 5 ,The classification model is pre-trained, and the classifier technology is used to ,determine the quality level.

[0074] S405: If the quality level is greater than the level threshold, determine the network data source as the data source for training the translation model.

[0075] In an embodiment of the present application, multiple indicators are used to determine the quality of a network data source, such as inter-translatability, diversity, fluency, and health, etc., to comprehensively consider the quality of a network data source. And a set of automated quality assessment solutions is proposed for each indicator, and finally, combined with various automated detection models, the comprehensive quality level of each network data source can be obtained. Compared with manual labeling to determine the quality of the source, the embodiment of the present application improves the detection speed of the network data source quality, reduces the detection cost, and also reduces the distortion rate caused by human subjective judgment, thereby improving the translation accuracy of the translation model and improving the user experience.

[0076] In the embodiment of the present application, in addition to providing a data source detection method, a data source detection device is also provided. Figure 6 As shown, the data source detection device 60 includes:

[0077] An acquisition module 61 is used to acquire a plurality of parallel corpus data from a network data source, wherein the parallel corpus data includes: a first language text and a second language text, wherein the first language text and the second language text are mutually translated;

[0078] A first determination module 62 is used to determine a target quantity ratio of parallel corpus data that meets a preset quality requirement among a plurality of parallel corpus data;

[0079] A second determination module 63 is used to determine the quality level of the network data source according to the target quantity ratio, and the target quantity ratio is positively correlated with the quality level;

[0080] The third determination module 64 is configured to determine the network data source as a data source for training the translation model if the quality level is greater than the level threshold.

[0081] In an optional embodiment, the first determination module 62 is specifically used to: for each parallel corpus data, translate the first language text to obtain a first translation text, the first translation text and the second language text are in the same language, and the first translation text is an accurate translation text corresponding to the first language text; determine the first text similarity between the first translation text and the second language text; translate the second language text to obtain a second translation text, the second translation text and the first language text are in the same language, and the second translation text is an accurate translation text corresponding to the second language text; determine the second text similarity between the second translation text and the first language text; determine the similarity score of the parallel corpus data based on the first text similarity and the second text similarity; if the similarity score is greater than the score threshold, determine the corresponding parallel corpus data as an accurate mutual translation sentence pair; among multiple parallel corpus data, determine a first quantity ratio of accurate mutual translation sentence pairs, and the target quantity ratio includes the first quantity ratio.

[0082] In an optional embodiment, the first determination module 62 is further specifically used to: determine a third text similarity of any two parallel corpora, where the third text similarity is the text similarity between the first language texts of the two parallel corpora, or the text similarity between the second language texts of the two parallel corpora; if the third text similarity is less than a similarity threshold, the two parallel corpora are determined to be non-similar sentence pairs; and in multiple parallel corpora, determine a second quantity ratio of non-similar sentence pairs, where the target quantity ratio includes the second quantity ratio.

[0083] In an optional embodiment, the first determination module 62 is further specifically used to: for each parallel corpus data, determine the first fluency of the corresponding first language text and the second fluency of the second language text; if the average of the first fluency and the second fluency is greater than the fluency threshold, determine that the corresponding parallel corpus data is a fluent sentence pair; in multiple parallel corpus data, determine a third quantity ratio of fluent sentence pairs, and the target quantity ratio includes the third quantity ratio.

[0084] In an optional embodiment, the first determination module 62 is further specifically used to: for each parallel corpus data, determine whether the corresponding first language text and / or second language text contains bad text information; if not, determine that the corresponding parallel corpus data is a healthy sentence pair; in multiple parallel corpus data, determine a fourth quantity ratio of healthy sentence pairs, and the target quantity ratio includes the fourth quantity ratio.

[0085] In an optional embodiment, the second determination module 63 is specifically used to: input the target quantity ratio into a pre-trained classification model for grade classification to obtain the quality grade of the network data source.

[0086] In an optional embodiment, the second determination module 63 is specifically configured to: if any target quantity ratio of at least two target quantity ratios is less than a preset ratio threshold, determine that the quality level of the network data source is a level threshold.

[0087] The data source detection device provided in the embodiment of the present application can accurately detect whether the network data source is a data source that can provide training samples for the translation model by detecting the quality of the parallel corpus data from the network data source, thereby improving the quality of the training samples and further improving the quality of the translation model obtained by training.

[0088] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to different types.

[0089] Figure 7 The following is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device is used to run the above-mentioned data source detection method and data source detection method. Figure 7 As shown, the electronic device includes: a memory 74 and a processor 75.

[0090] The memory 74 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. The memory 74 can be an object storage service (OSS).

[0091] The memory 74 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0092] The processor 75 is coupled to the memory 74 and is used to execute the computer program in the memory 74 to obtain multiple parallel corpus data from a network data source, the parallel corpus data including: a first language text and a second language text, the first language text and the second language text being in a mutually translated relationship; determining a target quantity ratio of parallel corpus data that meets preset quality requirements among the multiple parallel corpus data; determining a quality level of the network data source based on the target quantity ratio, the target quantity ratio being positively correlated with the quality level; if the quality level is greater than a level threshold, determining the network data source as a data source for training a translation model.

[0093] Further optionally, when determining the target quantity ratio of parallel corpus data that meet preset quality requirements among multiple parallel corpus data, the processor 75 is specifically used to: translate the first language text for each parallel corpus data to obtain a first translation text, the first translation text and the second language text are in the same language, and the first translation text is an accurate translation text corresponding to the first language text; determine a first text similarity between the first translation text and the second language text; translate the second language text to obtain a second translation text, the second translation text and the first language text are in the same language, and the second translation text is an accurate translation text corresponding to the second language text; determine a second text similarity between the second translation text and the first language text; determine a similarity score of the parallel corpus data based on the first text similarity and the second text similarity; if the similarity score is greater than a score threshold, determine the corresponding parallel corpus data as an accurate mutual translation sentence pair; determine a first quantity ratio of accurate mutual translation sentence pairs among multiple parallel corpus data, and the target quantity ratio includes the first quantity ratio.

[0094] Further optionally, when determining the target quantity ratio of parallel corpus data that meet preset quality requirements among multiple parallel corpus data, the processor 75 is also used to: determine a third text similarity between any two parallel corpus data, the third text similarity being the text similarity between the first language texts of the two parallel corpus data, or the text similarity between the second language texts of the two parallel corpus data; if the third text similarity is less than a similarity threshold, determine that the two parallel corpus data are non-similar sentence pairs; and determine a second quantity ratio of non-similar sentence pairs among multiple parallel corpus data, the target quantity ratio including the second quantity ratio.

[0095] Further optionally, when determining the target quantity ratio of parallel corpus data that meet preset quality requirements among multiple parallel corpus data, the processor 75 is also used to: determine, for each parallel corpus data, a first fluency of the corresponding first language text and a second fluency of the second language text; if the average of the first fluency and the second fluency is greater than a fluency threshold, determine that the corresponding parallel corpus data is a fluent sentence pair; and determine a third quantity ratio of fluent sentence pairs among multiple parallel corpus data, the target quantity ratio including the third quantity ratio.

[0096] Further optionally, when determining the target quantity ratio of parallel corpus data that meet preset quality requirements among multiple parallel corpus data, the processor 75 is also used to: determine, for each parallel corpus data, whether the corresponding first language text and / or second language text contains bad text information; if not, determine that the corresponding parallel corpus data is a healthy sentence pair; and determine a fourth quantity ratio of healthy sentence pairs among multiple parallel corpus data, the target quantity ratio including the fourth quantity ratio.

[0097] In an optional embodiment, when the processor 75 determines the quality level of the network data source according to the target quantity ratio, it is specifically used to: input the target quantity ratio into a pre-trained classification model for grade classification to obtain the quality level of the network data source.

[0098] In an optional embodiment, when the processor 75 determines the quality level of the network data source based on the target quantity ratio, it is specifically used to: if any target quantity ratio of at least two target quantity ratios is less than a preset ratio threshold, then determine that the quality level of the network data source is the level threshold.

[0099] Further, if Figure 7 As shown, the electronic device also includes: a firewall 71, a load balancer 72, a communication component 76, a power supply component 78 and other components. Figure 7 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 7 Components shown.

[0100] The electronic device provided in the embodiment of the present application can accurately detect whether the network data source is a data source that can provide training samples for the translation model by detecting the quality of parallel corpus data from the network data source, thereby improving the quality of the training samples and further improving the quality of the translation model obtained by training.

[0101] Accordingly, the embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when the computer program / instruction is executed by a processor, causes the processor to implement Figure 2 or Figure 4 Steps in the method shown.

[0102] Accordingly, the embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, causes the processor to implement Figure 2 or Figure 4 Steps in the method shown.

[0103] Above Figure 7The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related text from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0104] Above Figure 7 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0105] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0109] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0110] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0111] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store text. The text can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store text that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

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

[0113] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A data source detection method, characterized in that: include: Acquire a plurality of parallel corpus data from a network data source, wherein the parallel corpus data includes: a first language text and a second language text, wherein the first language text and the second language text are in a mutually translated relationship; Determining a target quantity ratio of parallel corpus data that meets preset quality requirements among the plurality of parallel corpus data; Determining the quality level of the network data source according to the target quantity ratio, wherein the target quantity ratio is positively correlated with the quality level; If the quality level is greater than the level threshold, the network data source is determined to be a data source for training a translation model.

2. The data source detection method according to claim 1, characterized in that: The determining of a target quantity ratio of parallel corpus data that meets preset quality requirements among the plurality of parallel corpus data includes: For each of the parallel corpus data, the first language text is translated to obtain a first translation text, the first translation text and the second language text are in the same language, and the first translation text is an accurate translation text corresponding to the first language text; Determining a first text similarity between the first translated text and the second language text; Translating the second language text to obtain a second translated text, wherein the second translated text and the first language text are in the same language, and the second translated text is an accurate translated text corresponding to the second language text; Determining a second text similarity between the second translated text and the first language text; Determining a similarity score of the parallel corpus data according to the first text similarity and the second text similarity; If the similarity score is greater than the score threshold, the corresponding parallel corpus data is determined to be an accurate mutually translated sentence pair; In the plurality of parallel corpus data, a first quantity ratio of the accurate mutually translated sentence pairs is determined, and the target quantity ratio includes the first quantity ratio.

3. The data source detection method according to claim 2, characterized in that: The determining of a target quantity ratio of parallel corpus data that meets a preset quality requirement among the plurality of parallel corpus data further includes: Determine a third text similarity between any two parallel corpora, where the third text similarity is the text similarity between the first language texts of the two parallel corpora, or the text similarity between the second language texts of the two parallel corpora; If the third text similarity is less than the similarity threshold, determining that the two parallel corpus data are non-similar sentence pairs; In the plurality of parallel corpus data, a second quantity ratio of the non-similar sentence pairs is determined, and the target quantity ratio includes the second quantity ratio.

4. The data source detection method according to claim 2, characterized in that: The determining of a target quantity ratio of parallel corpus data that meets a preset quality requirement among the plurality of parallel corpus data further includes: For each of the parallel corpus data, determining a first fluency of the corresponding first language text and a second fluency of the corresponding second language text; If the average of the first fluency and the second fluency is greater than the fluency threshold, determining that the corresponding parallel corpus data is a fluent sentence pair; In the plurality of parallel corpus data, a third quantity ratio of the fluent sentence pairs is determined, and the target quantity ratio includes the third quantity ratio.

5. The data source detection method according to claim 2, characterized in that: The determining of a target quantity ratio of parallel corpus data that meets a preset quality requirement among the plurality of parallel corpus data further includes: For each parallel corpus data, determining whether the corresponding first language text and / or second language text contains bad text information; If not, the corresponding parallel corpus data is determined to be a healthy sentence pair; In the plurality of parallel corpus data, a fourth quantity ratio of the healthy sentence pairs is determined, and the target quantity ratio includes the fourth quantity ratio.

6. The data source detection method according to any one of claims 2 to 5, characterized in that: Determining the quality level of the network data source according to the target quantity ratio includes: The target quantity ratio is input into a pre-trained classification model for grade classification to obtain the quality grade of the network data source.

7. The data source detection method according to any one of claims 2 to 5, characterized in that: The number of the target quantity ratios is at least two, and determining the quality level of the network data source according to the target quantity ratios includes: If any target quantity ratio of the at least two target quantity ratios is less than a preset ratio threshold, it is determined that the quality level of the network data source is the level threshold.

8. A data source detection device, characterized in that: include: An acquisition module is used to acquire a plurality of parallel corpus data from a network data source, wherein the parallel corpus data includes: a first language text and a second language text, wherein the first language text and the second language text are mutually translated; A first determination module is used to determine a target quantity ratio of parallel corpus data that meets a preset quality requirement among the plurality of parallel corpus data; A second determination module is used to determine the quality level of the network data source according to the target quantity ratio, and the target quantity ratio is positively correlated with the quality level; The third determination module is used to determine that the network data source is a data source for training a translation model if the quality level is greater than a level threshold.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data source detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the data source detection method according to any one of claims 1 to 7.