Media data correction method, device, computer, storage medium and program product

By obtaining the initial string and character correlation of irregular text and using feature attention to character prediction, the problem of insufficient accuracy and applicability of data correction in the prior art is solved, and more efficient text correction is achieved.

CN114611493BActive Publication Date: 2025-04-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210212423.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-04
Publication Date
2025-04-25
Estimated Expiration
2042-03-04

AI Technical Summary

Technical Problem

When correcting irregular texts, the prior art has poor accuracy and applicability, making it difficult to detect and correct diverse syntax errors.

Method used

By obtaining the initial string and character correlation of the media data to be corrected, data prediction is performed using feature attention, character-by-character prediction and reference media data are generated to improve the accuracy and universality of the correction.

Benefits of technology

Improves the accuracy and versatility of data corrections, and can more effectively process complex text data and maintain semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114611493B_ABST
    Figure CN114611493B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method, device, computer, storage medium and program product for media data correction, which relates to machine learning technology in the field of artificial intelligence. The method includes: obtaining the initial character string constituting the media data to be corrected and the character association between the initial character strings, and determining the data features to be corrected of the media data to be corrected based on the initial character string and the character association; obtaining the feature attention between the input character in the i-th round of prediction and the data features to be corrected, and performing data prediction on the data features to be corrected based on the feature attention, and obtaining the predicted character that is located after and adjacent to the input character in the i-th round of prediction, and when the predicted character is not the end character, determining the predicted character as the input character in the i+1th round of prediction; when the predicted character is the end character, forming the predicted character into reference media data. The present application can improve the accuracy and versatility of data correction.
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 media data correction method, device, computer, storage medium and program product. Background Art

[0002] Non-standard text refers to a paragraph or sentence whose expression does not conform to conventional grammar, such as informal text with omissions and redundancy, text with typos, or other online text containing special characters. Such non-standard text often affects the reading of users or machines. Therefore, it is necessary to correct the non-standard text to improve its readability. At present, in general, common grammatical error types are enumerated, and the erroneous parts of the text are corrected based on the correction rules corresponding to the grammatical error types to obtain normal text. However, due to the complexity of the text and the diversity of grammatical error types, some errors may not be detected or corrected, thereby reducing the accuracy of text correction and the applicability of text correction is poor. Summary of the invention

[0003] The embodiments of the present application provide a media data correction method, device, computer, storage medium and program product, which can improve the accuracy and versatility of data correction.

[0004] On the one hand, an embodiment of the present application provides a data correction method, the method comprising:

[0005] Obtaining media data to be modified;

[0006] Acquire initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determine data features of the media data to be corrected based on the initial character strings and the character associations;

[0007] Obtain feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, perform data prediction on the feature of the data to be corrected based on the feature attention, obtain a predicted character that is adjacent to and after the input character in the i-th round of prediction, and when the predicted character is not the end character, determine the predicted character as the input character in the i+1-th round of prediction; i is a positive integer;

[0008] When the predicted character is an end character, each predicted character is composed into reference media data for correcting the media data to be corrected.

[0009] On the one hand, an embodiment of the present application provides a data correction method, the method comprising:

[0010] Acquire a reference data sample, perform noise processing on the reference data sample, and obtain a data sample to be corrected corresponding to the reference data sample;

[0011] Inputting the data sample to be corrected into the initial data correction model, obtaining the initial character string samples constituting the data sample to be corrected and the sample character association degree between the initial character string samples, and determining the correction sample data feature of the data sample to be corrected based on the initial character string samples and the sample character association degree;

[0012] In the initial data correction model, the sample feature attention between the sample input character in the i-th round prediction and the corrected sample data feature is obtained, and the corrected sample data feature is predicted based on the sample feature attention to obtain the sample prediction character that is located after and adjacent to the sample input character in the i-th round prediction. When the sample prediction character is not the end character, the sample prediction character is determined as the sample input character in the (i+1)th round prediction; i is a positive integer;

[0013] When the sample prediction character is the end character, each predicted sample prediction character is formed into prediction sample correction data for correcting the data sample to be corrected;

[0014] Based on the reference data samples and the predicted sample correction data, the parameters of the initial data correction model are adjusted to obtain a data correction model for media data correction.

[0015] In one aspect, an embodiment of the present application provides a data correction device, the device comprising:

[0016] A data acquisition module, used for acquiring media data to be corrected;

[0017] A feature acquisition module, used to acquire initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determine data features of the media data to be corrected based on the initial character strings and the character associations;

[0018] A character prediction module is used to obtain the feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, and perform data prediction on the feature of the data to be corrected based on the feature attention to obtain a predicted character that is located after and adjacent to the input character in the i-th round of prediction; i is a positive integer;

[0019] An input determination module, used for determining the predicted character as an input character in the (i+1)th round of prediction when the predicted character is not the end character;

[0020] The data generating module is used for, when the predicted character is an ending character, forming each predicted character into reference media data for correcting the media data to be corrected.

[0021] Wherein, the data acquisition module includes:

[0022] An initial acquisition unit, used to acquire initial detection media data;

[0023] A format detection unit, used for performing data format detection on the initial detection media data;

[0024] The pre-correction unit is used to perform format pre-correction processing on the initial detection media data based on the pre-correction format if the pre-correction format exists in the initial detection media data to obtain the media data to be corrected.

[0025] Wherein, the format detection unit includes:

[0026] The data word segmentation subunit is used to perform word segmentation processing on the initial detection media data to obtain N word segmentation phrases; N is a positive integer;

[0027] The word segmentation detection subunit is used to perform data format detection on the N word segmentation phrases respectively to obtain the phrase data formats corresponding to the N word segmentation phrases respectively;

[0028] The pre-correction determination subunit is used to determine whether the pre-correction format exists in the initial detection media data if the pre-correction format exists in the phrase data formats corresponding to the N segmented phrases.

[0029] Wherein, the pre-correction unit comprises:

[0030] A phrase acquisition subunit, for acquiring a phrase to be corrected corresponding to the pre-corrected format if the pre-corrected format exists in the initially detected media data;

[0031] a font conversion subunit, configured to obtain a first associated phrase of the phrase to be corrected in a second writing font if the pre-corrected format of the phrase to be corrected is a first writing font, and replace the phrase to be corrected in the initial detection media data with the first associated phrase to obtain the media data to be corrected;

[0032] The character conversion subunit is used for obtaining a first standard code corresponding to the phrase to be corrected in the first character format if the pre-correction format of the phrase to be corrected is the first character format, determining a second standard code corresponding to the phrase to be corrected in the second character format based on the first standard code, determining a second associated phrase of the phrase to be corrected based on the second standard code, replacing the phrase to be corrected in the initial detection media data with the second associated phrase, and obtaining the media data to be corrected.

[0033] The pre-correction format includes a format in which the number of characters is greater than a threshold; the pre-correction unit includes:

[0034] The data splitting subunit is used to obtain the sentence separator in the initial detection media data based on the pre-correction format if there is a pre-correction format in the initial detection media data, and split the initial detection media data based on the sentence separator to obtain the media data to be corrected.

[0035] Among them, the number of initial character strings is M, and M is a positive integer;

[0036] The feature acquisition module includes:

[0037] A character string acquisition unit, used to acquire M initial character strings constituting the media data to be modified;

[0038] A correlation acquisition unit, used to obtain the character correlation between the M initial character strings through a self-attention mechanism;

[0039] A feature enhancement unit, configured to enhance the initial data features of the M initial character strings based on the character associations between the M initial character strings, to obtain enhanced data features of the M initial character strings;

[0040] The feature fusion unit is used to fuse the enhanced data features of the M initial character strings to obtain the data features to be corrected of the media data to be corrected.

[0041] The association acquisition unit includes:

[0042] The similarity determination subunit is used to perform dot product processing on the initial data features of the jth initial string and the initial data features of other initial strings through a self-attention mechanism to obtain the character similarity between the jth initial string and other initial strings; j is a positive integer less than or equal to M; other initial strings refer to initial strings other than the jth initial string among the M initial strings;

[0043] A normalization processing subunit is used to perform normalization processing on the character similarities between the jth initial character string and other initial character strings to obtain the character association degree between the jth initial character string and other initial character strings;

[0044] The feature enhancement unit comprises:

[0045] The enhancement acquisition subunit is used to perform weighted processing on the initial data features of other initial character strings based on the character association between the j-th initial character string and other initial character strings, so as to obtain the features to be enhanced of the j-th initial character string;

[0046] The enhancement processing subunit is used to enhance the initial data features of the jth initial character string based on the features to be enhanced of the jth initial character string to obtain the enhanced data features of the jth initial character string.

[0047] Among them, the number of initial character strings is M, and M is a positive integer;

[0048] The feature acquisition module includes:

[0049] The character string acquisition unit is used to acquire M initial character strings constituting the media data to be modified;

[0050] a hidden acquisition unit, used to acquire the initial data features of the jth initial string, acquire the character association degree between the jth initial string and the (j+1)th initial string, and based on the character association degree between the jth initial string and the (j+1)th initial string and the initial data features of the jth initial string, perform feature enhancement on the initial data features of the (j+1)th initial string to obtain the hidden features of the (j+1)th initial string, until the hidden features of the Mth initial string are obtained; j is a positive integer less than M;

[0051] The feature determination unit is used to determine the hidden feature of the Mth initial character string as the data feature to be corrected of the media data to be corrected.

[0052] Among them, the number of initial character strings is M, and M is a positive integer;

[0053] The feature acquisition module includes:

[0054] A feature analysis unit, used to obtain M initial character strings constituting the media data to be corrected, and obtain initial data features corresponding to the M initial character strings respectively;

[0055] A semantic extraction unit, used to extract semantic information from initial data features corresponding to the M initial character strings, to obtain semantic features corresponding to the M initial character strings;

[0056] The feature pooling unit is used to perform pooling processing on the semantic features corresponding to the M initial character strings respectively, so as to obtain the data features to be corrected of the media data to be corrected.

[0057] The device further comprises:

[0058] a data merging module, configured to, if the number of the media data to be corrected is at least two, merge the reference media data corresponding to the at least two media data to be corrected to obtain target media data corresponding to the media data to be corrected; or

[0059] a deduplication module, configured to perform deduplication processing on the at least two consecutive character strings in the reference media data if there are at least two consecutive character strings in the reference media data, so as to obtain target media data corresponding to the media data to be corrected; or

[0060] The abnormality output module is used to output a data correction abnormality message if the data scale difference between the reference media data and the media data to be corrected is greater than or equal to the abnormality difference threshold.

[0061] Wherein, the data acquisition module includes:

[0062] A request response unit, used to respond to the data translation request and obtain the media data to be modified associated with the data translation request;

[0063] The device also includes:

[0064] A data translation module, used to obtain a translation language type requested by a data translation request, translate the reference media data, and obtain translation data of the reference media data under the translation language type;

[0065] The translation output module is used to output translation data.

[0066] In one aspect, an embodiment of the present application provides a data correction device, the device comprising:

[0067] A sample acquisition module is used to acquire reference data samples;

[0068] A sample noise adding module is used to perform noise adding processing on the reference data sample to obtain the data sample to be corrected corresponding to the reference data sample;

[0069] A sample feature acquisition module is used to input the data sample to be corrected into the initial data correction model, obtain the initial string samples constituting the data sample to be corrected and the sample character association degree between the initial string samples, and determine the correction sample data feature of the data sample to be corrected based on the initial string samples and the sample character association degree;

[0070] The sample prediction module is used to obtain the sample feature attention between the sample input character in the i-th round of prediction and the corrected sample data feature in the initial data correction model, and perform data prediction on the corrected sample data feature based on the sample feature attention to obtain the sample prediction character that is located after and adjacent to the sample input character in the i-th round of prediction; i is a positive integer;

[0071] A sample input determination module, used for determining the sample prediction character as the sample input character in the (i+1)th round of prediction when the sample prediction character is not the end character;

[0072] A sample generating module, used for forming predicted sample correction data for correcting the data sample to be corrected by combining each predicted sample prediction character into corrected data when the sample prediction character is an end character;

[0073] The model adjustment module is used to adjust the parameters of the initial data correction model based on the reference data sample and the predicted sample correction data to obtain the data correction model for media data correction.

[0074] The sample noise adding module includes:

[0075] A character deletion unit is used to delete one or at least two characters in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or

[0076] A character exchange unit, used to exchange the positions of at least two characters in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or

[0077] A placeholder adding unit is used to add a placeholder to the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or

[0078] The character replacement unit is used to replace one or at least two characters in the reference data sample with placeholders to obtain the data sample to be corrected corresponding to the reference data sample.

[0079] On the one hand, an embodiment of the present application provides a computer device, including a processor, a memory, and an input and output interface;

[0080] The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that a computer device including the processor executes the data correction method in one aspect of an embodiment of the present application.

[0081] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the data correction method in one aspect of the embodiment of the present application.

[0082] In one aspect, an embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional ways in one aspect of the embodiment of the present application. In other words, when the computer instruction is executed by the processor, the method provided in various optional ways in one aspect of the embodiment of the present application is implemented.

[0083] Implementing the embodiments of the present application will have the following beneficial effects:

[0084] In an embodiment of the present application, media data to be corrected is obtained; an initial character string constituting the media data to be corrected and the character association between the initial character strings are obtained, and based on the initial character string and the character association, data features to be corrected of the media data to be corrected are determined; feature attention between the input character in the i-th round of prediction and the data features to be corrected is obtained, and data prediction is performed on the data features to be corrected based on the feature attention to obtain a predicted character that is adjacent to and after the input character in the i-th round of prediction, and when the predicted character is not an end character, the predicted character is determined to be the input character in the (i+1) round of prediction; i is a positive integer; when the predicted character is an end character, each predicted character is composed of reference media data for correcting the media data to be corrected. Through the above process, character string detection can be performed on the media data to be corrected that needs to be corrected, and the initial character strings that constitute the media data to be corrected and the character associations between the initial character strings can be determined, so that the obtained features of the data to be corrected can represent the basic semantic information of the media data to be corrected, as well as the associations between different initial character strings. Character-by-character prediction can be performed based on the features of the data to be corrected. Since the features of the data to be corrected can represent the character associations between the initial character strings, when performing character-by-character prediction, the order of each character can be affected based on the character associations, and the character-by-character prediction can complete and correct missing characters, etc., thereby improving the accuracy and versatility of data correction. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0086] Figure 1 This is a network interaction architecture diagram of media data correction provided by an embodiment of the present application;

[0087] Figure 2 is a schematic diagram of a media data correction scenario provided by an embodiment of the present application;

[0088] Figure 3 is a flow chart of a method for correcting media data provided by an embodiment of the present application;

[0089] Figure 4 is a flow chart of a specific method for media data correction provided by an embodiment of the present application;

[0090] Figure 5 The embodiment of the present application provides a schematic diagram of a model structure;

[0091] Figure 6 This is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0092] Figure 7 It is a schematic diagram of a media data correction architecture provided by an embodiment of the present application;

[0093] Figure 8 It is a partial schematic diagram of a full-half-width format encoding provided by an embodiment of the present application;

[0094] Fig. 9 It is a partial schematic diagram of a special character mapping provided in an embodiment of the present application;

[0095] Fig.10 It is a schematic diagram of a model training scenario provided in an embodiment of the present application;

[0096] Fig.11 This is a schematic diagram of a data noise adding scenario provided in an embodiment of the present application;

[0097] Fig.12 is a schematic diagram of a media data correction device provided in an embodiment of the present application;

[0098] Fig.13 is a schematic diagram of a model training device provided in an embodiment of the present application;

[0099] Fig.14 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0100] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 creative work are within the scope of protection of this application.

[0101] Among them, the present application relates to machine learning technology in the field of artificial intelligence. Among them, the machine learning technology can be considered to use neural networks to perform some mapping tasks. For example, in the mapping process from the media data to be corrected (such as non-standard text) to the reference media data (such as reference text), there will be a large number of known paired sample pairs <non-standard text, reference text> data. The mapping task of the above neural network is equivalent to a mathematical mapping process, which is to simulate the calculation process of a neural synapse in the human brain. From these large amounts of known data, a set of regular mapping processes can be learned. Through a parameter correction fitting (i.e. parameter adjustment) process, the model is adapted to these known data, so that the correction mapping of data anomaly information from non-standard text to reference text can be better completed, so as to summarize some change relationships from non-standard text to reference text, so that the correction parameters obtained after adjustment can be used to correct a large amount of data anomaly information.

[0102] In the examples of this application, see Figure 1 , Figure 1 1 is a network interaction architecture diagram of media data correction provided by an embodiment of the present application. Among them, the computer device 101 can exchange data with one or at least two business devices. For example, three business devices, such as Figure 1 The business device 102a, business device 102b and business device 102c in the computer device 101 can be used to directly obtain the media data to be corrected, or can obtain the media data to be corrected from the business device, perform data correction processing on the media data to be corrected, and obtain reference media data obtained after the media data to be corrected is corrected. For example, the computer device 101 can respond to a data correction request for the business device 102b, obtain the media data to be corrected for the data correction request, perform data correction processing on the media data to be corrected, and obtain reference media data corresponding to the media data to be corrected. Optionally, the computer device 101 can send the reference media data to the business device 102b.

[0103] For details, see Figure 2 , Figure 2 Schematic diagram of a media data correction scenario provided by an embodiment of the present application. Figure 2As shown, the computer device can obtain the media data 201 to be corrected, obtain the initial character strings 202 constituting the media data 201 to be corrected, and the character associations between the initial character strings 202, and determine the data features 203 to be corrected of the media data 201 to be corrected based on the initial character strings 202 and the character associations between the initial character strings 202. For example, assuming that the number of the initial character strings 202 is M, where M is a positive integer, the computer device can obtain the character associations between the initial character string and any one or more of the other initial character strings, perform feature enhancement processing on the initial character string based on the character associations, and obtain the initial character features corresponding to the initial character string. Similarly, the initial character features corresponding to the M initial character strings can be obtained, and the data features 203 to be corrected of the media data 201 to be corrected can be determined based on the initial character features corresponding to the M initial character strings. Among them, the other initial character strings of the initial character string refer to the initial character strings other than the initial character string among the M initial character strings.

[0104] Furthermore, the computer device can obtain the input character, and perform data prediction based on the input character and the feature 203 of the data to be corrected. Specifically, the computer device can predict the next character after the input character based on the input character and the feature 203 of the data to be corrected to obtain the predicted character. If the predicted character is not the end character, the predicted character is determined as the next input character, and the character prediction continues; if the predicted character is the end character, it means that the complete media data has been predicted based on the media data to be corrected, and the predicted characters can be composed of the reference media data corresponding to the media data to be corrected. Among them, it can be considered that the feature 203 of the data to be corrected can be used to characterize the character association between the initial character strings, so that when predicting character by character, the order of each initial character string can be adjusted and corrected based on the character association, and character prediction is performed on the basis of the feature of the data to be corrected corresponding to the media data to be corrected, so as to retain the semantic information of the media data to be corrected, and the characters can be adjusted during the character prediction process, thereby improving the accuracy and versatility of data correction.

[0105] It is understandable that the business equipment mentioned in the embodiments of the present application may be a computer device, and the computer equipment in the embodiments of the present application includes but is not limited to a terminal device or a server. In other words, the computer device may be a server or a terminal device, or it may be a system composed of a server and a terminal device. Among them, the terminal device mentioned above may be an electronic device, including but not limited to mobile phones, tablet computers, desktop computers, laptop computers, PDAs, vehicle-mounted equipment, augmented reality / virtual reality (AR / VR) equipment, helmet displays, smart TVs, wearable devices, smart speakers, digital cameras, cameras and other mobile Internet devices (mobile internet device, MID) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights. Such as Figure 1 As shown in , the terminal device may be a laptop computer (as shown in the service device 102b), a mobile phone (as shown in the service device 102c), or a vehicle-mounted device (as shown in the service device 102a), etc. Figure 1 Only some of the devices are listed, and optionally, the business device 102a refers to a device located in the vehicle 103, and the business device 102a can be used to interact with other business devices and interact with the computer device 101. The server mentioned above can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, vehicle-road collaboration, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0106] Optionally, the data involved in the embodiments of the present application can be stored in a computer device, or the data can be stored based on cloud storage technology, which is not limited here.

[0107] For further information, see Figure 3 , Figure 3 1 is a flow chart of a method for correcting media data provided by an embodiment of the present application. Figure 3 As shown, the data correction process includes the following steps:

[0108] Step S301: obtaining media data to be corrected.

[0109] In an embodiment of the present application, a computer device may respond to a data correction request and obtain the media data to be corrected indicated by the data correction request. Optionally, the computer device may directly respond to the data correction request, or may receive a data correction request sent by a business device, respond to the received data correction request, etc., without limitation here, that is, the generating subject of the data correction request is not limited. Optionally, the computer device may obtain the initial detection media data, perform data format detection on the initial detection media data, and if there is a pre-correction format in the initial detection media data, perform format pre-correction processing on the initial detection media data based on the pre-correction format to obtain the media data to be corrected; if there is no pre-correction format in the initial detection media data, the initial detection media data is determined as the media data to be corrected. Optionally, the media data to be corrected may be text data or image data, etc., without limitation here, that is, the media data type (such as text data type or image data type, etc.) of the media data to be corrected is not limited. By performing format pre-correction processing on the initial detection media data, the applicability of the media data to be corrected obtained after correction can be improved, thereby improving the correction efficiency of the media data to be corrected.

[0110] Among them, the pre-correction format refers to the data format in the media data that needs to be pre-corrected, that is, the data format that can be directly detected and needs to be corrected. The number of the pre-correction formats can be one or at least two, which can include but are not limited to the first writing font, the first character format, the format with the number of characters greater than a threshold, or the format with a data size greater than a threshold. For example, the computer device can perform data format detection on the initially detected media data. If the pre-correction format exists in the initially detected media data, the phrase to be corrected corresponding to the pre-correction format is obtained; the phrase to be corrected is format-corrected to obtain the media data to be corrected. Optionally, different media data types can correspond to different pre-correction formats. In this case, the computer device can obtain the media data type of the initially detected media data, obtain the pre-correction format corresponding to the media data type of the initially detected media data, and perform data format detection on the initially detected media data based on the obtained pre-correction format. For example, for a text data type, the media characters included in the media data of the text data type are of text type, having attributes such as a writing font, a character format, and the number of characters. Therefore, the pre-correction format corresponding to the text data type may include but is not limited to one or more of a first writing font, a first character format, a format in which the number of characters is greater than a threshold, etc.; for an image data type, the media characters included in the media data of the image data type are image pixels, having attributes such as a format of color value information or a data size. Therefore, the pre-correction format corresponding to the image data type may include but is not limited to any one or more of a first color value format and a data size greater than a threshold, etc.; that is, it can be considered that different media data types may be associated with different attributes, and a computer device can obtain the attributes associated with the media data type, and based on the attributes associated with the media data type, determine the pre-correction format corresponding to the media data type, etc., that is, the pre-correction format corresponding to any media data type can be obtained. Optionally, when the initial detection media data is obtained, the media data type of the initial detection media data can be obtained, the pre-correction format corresponding to the media data type of the initial detection media data can be obtained, and data format detection can be performed on the initial detection media data; if the initial detection media data contains a pre-correction format corresponding to the media data type of the initial detection media data, format pre-correction processing is performed on the initial detection media data based on the obtained pre-correction format to obtain the media data to be corrected.

[0111] Specifically, the computer device can obtain the media data type of the initial detection media data, obtain the pre-correction format corresponding to the media data type of the initial detection media data, etc. Among them, the above-mentioned attributes, media data types and pre-correction formats are all exemplified partial values, and are not limited to the above-mentioned possibilities. That is, the attributes are not limited to the above-mentioned writing fonts, character formats, character numbers, color value information and data size formats, etc., and can also include language formats (including but not limited to Chinese formats, English formats and French formats, etc.), etc., which are not limited here. Among them, an initial detection media data may include one or at least two pre-correction formats.

[0112] Specifically, the computer device can perform data format detection on the initial detection media data. If the pre-correction format exists in the initial detection media data, the phrase to be corrected corresponding to the pre-correction format is obtained. If the pre-correction format of the phrase to be corrected is a first writing font, the first associated phrase of the phrase to be corrected under the second writing font is obtained, and the phrase to be corrected in the initial detection media data is replaced with the first associated phrase to obtain the media data to be corrected. The first writing font may refer to a universal font, or the first writing font may be determined based on the format of the media characters constituting the initial detection media data, etc.; the second writing font may refer to a universal font, or the second writing font may be determined based on the format of the media characters constituting the initial detection media data.

[0113] Optionally, the computer device may obtain a first universal font, determine the first universal font as the first writing font, obtain a second universal font, determine the second universal font as the second writing font; or, the computer device may obtain a third universal font, determine the third universal font as the second writing font, determine the writing fonts other than the second writing font as the first writing font, etc. The meanings of the first universal font, the second universal font, and the third universal font, etc. may all refer to the meanings of the universal fonts described above, and the first, second, and third, etc., are only used to distinguish universal fonts in different scenarios. The universal font may be a font structure, such as Songti, Fangsong, Kaiti, or Roman font, etc. The universal font may also be a writing font, such as traditional or simplified Chinese, etc., which is not limited here. For example, assuming that the first font is simplified, the computer device determines the universal font "Traditional" as the first writing font, and performs data format detection on the initial detection media data. If there is a phrase to be corrected in the first writing font "Traditional" in the initial detection media data, the phrase to be corrected is converted into a first associated phrase under the second writing font to obtain the media data to be corrected. Assuming that the second writing font is "Simplified", if the phrase to be corrected is "Simplified", the phrase to be corrected in the initial detection media data is replaced with the first associated phrase "Simplified" under the second writing font to obtain the media data to be corrected. If the initial detection media data is "...Simplified XX", the media data to be corrected is "...Simplified XX".

[0114] Optionally, the computer device can obtain character fonts of the media characters constituting the initial detection media data, determine the character font with the largest number as the second writing font, and determine the character fonts of the media characters constituting the initial detection media data except the second writing font as the first writing font. Alternatively, the computer device may obtain the character fonts of the media characters constituting the initial detected media data, obtain the character type of the media characters constituting the initial detected media data, cluster the media characters of the initial detected media data based on the character type to obtain h character sets, where h is a positive integer, determine the target character fonts corresponding to the h character sets based on the character fonts of the media characters included in the h character sets, determine the target character fonts corresponding to the h character sets as the second writing fonts corresponding to the h character sets, and determine the first writing fonts corresponding to the h character sets based on the second writing fonts corresponding to the h character sets; for example, if the second writing font corresponding to the kth character set is Songti, then the character fonts other than the second writing font "Songti" are determined as the first writing font corresponding to the kth character set, where k is a positive integer less than or equal to h; for example, the character type may refer to the type of media character, such as Chinese type or English type, etc. Since media characters of different character types may be displayed using different character fonts when displaying media data, the writing font may be updated and corrected based on the character type to improve the accuracy and flexibility of pre-correction.

[0115] Among them, Traditional Chinese may also be applied in some scenarios, such as regular Traditional Chinese content, and Traditional Chinese content mixed in online texts such as Martian text. Since Traditional Chinese has a complete Traditional-Simplified Chinese mapping dictionary that can be used, in scenarios where simplified Chinese is required for expression, the Traditional-Simplified Chinese mapping dictionary can be called to perform format pre-correction processing on the initial detected media data, converting the Traditional Chinese characters in the media data (i.e., the media characters corresponding to the Traditional Chinese writing font) into Simplified Chinese characters, and then executing step S302 to improve the recognition and parsing efficiency of the media data to be corrected.

[0116] Optionally, if the pre-correction format of the phrase to be corrected is the first character format, the second associated phrase of the phrase to be corrected in the second character format can be obtained, and the phrase to be corrected in the initial detection media data can be replaced with the second associated phrase to obtain the media data to be corrected. Optionally, if the pre-correction format of the phrase to be corrected is the first character format, the second associated phrase of the phrase to be corrected in the second character format can be obtained from the character mapping table; or, if the pre-correction format of the phrase to be corrected is the first character format, the first standard code corresponding to the phrase to be corrected in the first character format can be obtained, and based on the first standard code, the second standard code corresponding to the phrase to be corrected in the second character format can be determined, and the second associated phrase of the phrase to be corrected can be determined based on the second standard code. Further, the phrase to be corrected in the initial detection media data is replaced with the second associated phrase to obtain the media data to be corrected.

[0117] Optionally, the pre-correction format includes a format in which the number of characters is greater than a threshold. If the pre-correction format exists in the initial detection media data, based on the pre-correction format, the sentence separators in the initial detection media data are obtained, and the initial detection media data is split based on the sentence separators to obtain the media data to be corrected.

[0118] Optionally, the pre-correction format includes a format whose data size is greater than a threshold value, where the threshold value can be considered as a size threshold value. If the pre-correction format whose data size is greater than the threshold value exists in the initial detection media data, the media size of the initial detection media data is obtained, and the initial detection media data is segmented based on the media size of the initial detection media data to obtain the media data to be corrected, and the size of the media data to be corrected is less than or equal to the size threshold value. For example, the initial detection media data is 500*500 image data, and the size threshold value is 200*200. Based on the media size of the initial detection media data, the initial detection media data is segmented to obtain the media data to be corrected, such as obtaining 4 200*200 media data to be corrected, 2 100*200 media data to be corrected, 2 200*100 media data to be corrected and one 100*100 media data to be corrected, or the width and height of the initial detection media data are divided into three equal parts, etc. There is no restriction on the specific segmentation method of the initial detection media data.

[0119] Optionally, the pre-correction format includes a first color value format. If the first color value format exists in the initial detection media data, the media characters to be corrected corresponding to the first color value format are obtained from the initial detection media data, and the color value format of the media characters to be corrected in the initial detection media data is converted into a second color value format to obtain the media data to be corrected. Optionally, the computer device can obtain the color value format of the media characters in the initial detection media data, determine the color value format with the largest number of corresponding media characters as the second color value format, and determine the color value format other than the second color value format as the first color value format. Among them, the color value format can include but is not limited to red, green, blue (RedGreenBlue, RGB) format, CMYK format and Lab format, etc., wherein the CMYK format refers to a color value format composed of cyan (Cyan), magenta (Magenta), yellow (Yellow), black (Black), etc., and the Lab format is a color value format that represents color with a brightness component L and two color components a and b, etc. By pre-correcting the color value format, the abnormal media characters in the initial detection media data can be changed, thereby ensuring subsequent use.

[0120] Optionally, the pre-correction format may include an invalid area. If the initially detected media data includes an invalid area, the invalid area in the initially detected media data is deleted to obtain the media data to be corrected. The invalid area may refer to an area without actual information, such as a white edge or a black edge of the media data, and a continuous blank area of ​​the media data. Through the above process, the invalid area in the initially detected media data is deleted to reduce the amount of data that needs to be detected later.

[0121] Among them, the above are only several pre-correction formats cited as examples, and other pre-correction formats can be added as needed. Optionally, when performing data format detection on the initial detection media data, d pre-correction formats that need to be detected can be obtained, and whether the d pre-correction formats exist in the initial detection media data can be detected. If any one or more of the d pre-correction formats exist in the initial detection media data, it can be determined that the pre-correction format exists in the initial detection media data, and d is a positive integer. In other words, there can be many pre-correction formats. When detecting the initial detection media data, the pre-correction formats that need to be detected can be obtained based on needs, without having to detect all pre-correction formats all the time, thereby improving the efficiency of data format detection.

[0122] Optionally, the computer device may perform word segmentation processing on the initial detection media data to obtain N word segmentation phrases; N is a positive integer. Data format detection is performed on the N word segmentation phrases to obtain the phrase data formats corresponding to the N word segmentation phrases. If there is a pre-correction format in the phrase data formats corresponding to the N word segmentation phrases, it is determined that there is a pre-correction format in the initial detection media data. Optionally, data format detection is performed on the N word segmentation phrases to obtain the phrase data formats corresponding to the N word segmentation phrases based on the pre-correction format. For example, if the pre-correction format is a first writing font, the phrase data formats corresponding to the N word segmentation phrases obtained may be the writing fonts corresponding to the N word segmentation phrases (i.e., the above-mentioned character fonts); if the pre-correction format is a first character format, the phrase data formats corresponding to the N word segmentation phrases obtained may be the character formats corresponding to the N word segmentation phrases, etc.

[0123] Step S302, obtaining initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determining data features of the media data to be corrected based on the initial character strings and the character associations.

[0124] In an embodiment of the present application, a computer device may obtain an initial string of media data to be corrected, wherein the initial string may include one or at least two characters. Optionally, if the media data to be corrected is text data, the initial string may include one or at least two text characters; if the media data to be corrected is image data, the initial string may include one or at least two pixel characters, etc. Further, the computer device may obtain the character association between the initial strings, and determine the data features to be corrected of the media data to be corrected based on the initial strings and the character association, so that the data features to be corrected can represent the relevant information of the character association in the media data to be corrected, and the character association can represent the association between the initial strings and the initial strings. The stronger the association, the stronger the possibility of being adjacent. Therefore, correction can be made based on the above-obtained data features to be corrected to adjust the arrangement order between the initial strings, etc. In addition, the data features to be corrected can represent the relevant information of the media data to be corrected (such as semantic information, etc.), so that correction based on the data features to be corrected can also correct the semantics or abnormal characters of the media data to be corrected, thereby improving the accuracy and versatility of data correction.

[0125] Optionally, the number of initial strings is M, where M is a positive integer.

[0126] In a feature acquisition method ①, the computer device can obtain M initial character strings that constitute the media data to be corrected, and obtain the character association between the M initial character strings through the self-attention mechanism. Based on the character association between the M initial character strings, the initial data features of the M initial character strings are enhanced to obtain enhanced data features of the M initial character strings. At this time, the enhanced data features of the M initial character strings can be considered as the above Figure 2 The enhanced data features of the M initial character strings are fused to obtain the data features to be corrected of the media data to be corrected.

[0127] Among them, when obtaining the character correlation degree between M initial strings through the self-attention mechanism, the computer device can perform a dot product operation on the initial data features of the j-th initial string and the initial data features of other initial strings through the self-attention mechanism to obtain the character similarity between the j-th initial string and other initial strings; j is a positive integer less than or equal to M; other initial strings refer to the initial strings other than the j-th initial string among the M initial strings. Through this process, the importance of each initial string in the media data to be corrected can be distinguished. The larger the dot product value obtained by the dot product operation, the greater the similarity between the corresponding two vectors, and the more similar the initial strings corresponding to these two vectors are. That is to say, the character similarity between the initial strings can be determined based on the result of the dot product operation. Further, the character similarity between the j-th initial string and other initial strings can be normalized to obtain the character correlation degree between the j-th initial string and other initial strings. At this time, the sum of the character correlation degrees between the j-th initial string and other initial strings can be considered as 1, which constitutes the attention value (or can be considered as the attention degree) of the j-th initial string to other initial strings. When enhancing the initial data features of the M initial strings based on the character correlation degree between the M initial strings to obtain the enhanced data features of the M initial strings, the computer device can perform a weighted operation on the initial data features of other initial strings based on the character correlation degree between the j-th initial string and other initial strings to obtain the feature to be enhanced of the j-th initial string. The initial data features of the j-th initial string are enhanced based on the feature to be enhanced of the j-th initial string to obtain the enhanced data features of the j-th initial string. Optionally, the feature to be enhanced of the j-th initial string can be determined as the enhanced data features of the j-th initial string; or, the feature to be enhanced of the j-th initial string and the initial data features of the j-th initial string can be feature fused to obtain the enhanced data features of the j-th initial string. For example, the media data to be corrected is "I love traveling". Assuming that the character correlation degree between "travel" and "tour" is relatively high, because "travel" and "tour" often appear together to form a regular phrase, the semantic correlation degree is very high, so that the similarity between the initial data features of "travel" and the initial data features of "tour" is relatively high.

[0128] In a feature acquisition method ②, the computer device can obtain M initial character strings that constitute the media data to be corrected. The initial data features of the j-th initial character string are obtained, and the character association degree between the j-th initial character string and the (j+1)-th initial character string is obtained. Based on the character association degree between the j-th initial character string and the (j+1)-th initial character string and the initial data features of the j-th initial character string, the initial data features of the (j+1)-th initial character string are enhanced to obtain the hidden features of the (j+1)-th initial character string, until the hidden features of the M-th initial character string are obtained; j is a positive integer less than M. At this time, the hidden features of the M initial character strings can be considered as the above-mentioned Figure 2 The initial character features of the initial string in . The hidden features of the Mth initial string are determined as the data features to be corrected of the media data to be corrected. Among them, the hidden layer features can be considered as each calculation in the calculation process of the neural network model is called a layer of network, which may be linear Y=kX+b, or nonlinear Y=1 / (e^(-x)+1), etc. The output of each calculation can be called the hidden features obtained by the layer of network, or can be called a hidden state. In simple terms, it is equivalent to taking each initial string in the media data to be corrected as input in turn, inputting the first initial string into the feature acquisition network, and obtaining an output, namely, the hidden feature of the first initial string; then inputting the second initial string into the feature acquisition network, at this time, the hidden feature of the output of the previous initial string (this time it refers to the first initial string) and the initial data feature of the second initial string are input into the feature acquisition network together, so that when the second initial string is calculated, the meaning of the previous initial string can be obtained, so that the hidden layer feature obtained by the second initial string can contain the relevant information of the first initial string; ...; until the last initial string (namely the Mth initial string) is input, and the hidden feature of the Mth initial string is obtained, at this time, the hidden feature of the Mth initial string contains the meaning of each initial string in the media data to be corrected, and thus a meaning of the media data to be corrected as a whole is obtained, therefore, the hidden feature of the Mth initial string can be determined as the data feature to be corrected of the media data to be corrected.

[0129] In a feature acquisition method ③, the computer device can obtain M initial character strings constituting the media data to be modified, and obtain the initial data features corresponding to the M initial character strings. Semantic information is extracted from the initial data features corresponding to the M initial character strings to obtain the semantic features corresponding to the M initial character strings. At this time, the semantic features corresponding to the M initial character strings can be considered as Figure 2The initial character features respectively correspond to the M initial strings in . Pooling processing is performed on the semantic features respectively corresponding to the M initial strings to obtain the data features to be corrected of the media data to be corrected. Optionally, taking the j-th initial string as an example, the character vector of the characters included in the j-th initial string can be obtained, and the character vectors of the characters included in the j-th initial string can be vector-fused to obtain the initial data features of the j-th initial string. Among them, the vector fusion method includes but is not limited to vector addition, splicing and combination; pooling processing includes but is not limited to feature bit addition, maximum, minimum or average, etc. For example, the media data to be corrected is "I love spicy lion head", which will be divided into " <s>I love" "I love spicy" "I love spicy" "spicy lion" "spicy lion" "lion head" "sub head <e>"These seven initial strings, <s> <e>Represent the start and end symbols respectively. The character vectors corresponding to the characters in each initial string are added, concatenated, combined into a two-dimensional matrix, and then input into the feature acquisition network for calculation to obtain the semantic information represented by the characters of the initial string, and a semantic feature is output for each initial string. All the semantic features of these initial strings are then pooled to obtain a feature representing the semantic information of the media data to be corrected, that is, the feature of the data to be corrected. The pooling process can be: adding each bit corresponding to the seven semantic features, taking the maximum, taking the minimum, taking the average, etc., and merging them into a vector.

[0130] In a feature acquisition method ④, the computer device can obtain the initial character strings constituting the media data to be corrected, and the character associations between the initial character strings. When the media data to be corrected is image data, the continuous pixel points in the media data to be corrected can form a meaningful fragment or a stroke in a text image, etc. Assuming that the number of initial character strings is M, the pixel features corresponding to the M initial character strings can be obtained based on the character associations between the M initial character strings. At this time, the pixel features corresponding to the M initial character strings are Figure 2 Further, based on the pixel features corresponding to the M initial character strings, the data features of the media data to be corrected can be determined, so that the data features can represent the continuity characteristics between the pixels in the media data to be corrected.

[0131] Furthermore, multiple rounds of predictions may be performed based on the features of the data to be corrected to achieve correction of the media data to be corrected. Taking the i-th round of prediction as an example, i is a positive integer, the specific process is as follows:

[0132] Step S303, obtaining feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, performing data prediction on the feature of the data to be corrected based on the feature attention, and obtaining a predicted character that is adjacent to and after the input character in the i-th round of prediction.

[0133] In an embodiment of the present application, a computer device can obtain an input character in the i-th round of prediction, obtain a feature attention between the input character in the i-th round of prediction and the data feature to be corrected, perform data prediction, and obtain a predicted character that is located after and adjacent to the input character in the i-th round of prediction. Optionally, if i is 1, the input character in the i-th round of prediction can be considered as the starting character. Since there is no information when the prediction is started, the starting character can be used as the input character of the first round of prediction, etc.

[0134] Step S304: when the predicted character is not the end character, the predicted character is determined as the input character in the (i+1)th round of prediction.

[0135] In an embodiment of the present application, when the predicted character in the i-th round of prediction is not the end character, it indicates that the prediction of the media data to be corrected is not completed, and therefore, the prediction of subsequent characters can continue, that is, the predicted character in the i-th round of prediction is determined as the input character in the (i+1)-th round of prediction.

[0136] Step S305 , when the predicted character is an end character, each predicted character is composed into reference media data for correcting the media data to be corrected.

[0137] In the embodiment of the present application, when the predicted character is an end character, it indicates that the prediction of the media data to be corrected is completed. Therefore, each predicted character can be composed into reference media data for correcting the media data to be corrected.

[0138] In an embodiment of the present application, media data to be corrected is obtained; an initial character string constituting the media data to be corrected and the character association between the initial character strings are obtained, and based on the initial character string and the character association, data features to be corrected of the media data to be corrected are determined; feature attention between the input character in the i-th round of prediction and the data features to be corrected is obtained, and data prediction is performed on the data features to be corrected based on the feature attention to obtain a predicted character that is adjacent to and after the input character in the i-th round of prediction, and when the predicted character is not an end character, the predicted character is determined to be the input character in the (i+1) round of prediction; i is a positive integer; when the predicted character is an end character, each predicted character is composed of reference media data for correcting the media data to be corrected. Through the above process, character string detection can be performed on the media data to be corrected that needs to be corrected, and the initial character strings that constitute the media data to be corrected and the character associations between the initial character strings can be determined, so that the obtained features of the data to be corrected can represent the basic semantic information of the media data to be corrected, as well as the associations between different initial character strings. Character-by-character prediction can be performed based on the features of the data to be corrected. Since the features of the data to be corrected can represent the character associations between the initial character strings, when performing character-by-character prediction, the order of each character can be affected based on the character associations, and the character-by-character prediction can complete and correct missing characters, etc., thereby improving the accuracy and versatility of data correction.

[0139] For details, see Figure 4 , Figure 4 1 is a flow chart of a specific method for media data correction provided by an embodiment of the present application. Figure 4 As shown, the data correction process includes the following steps:

[0140] Step S401: obtaining media data to be corrected.

[0141] In the embodiments of this application, please refer to Figure 3 The specific description of step S301 in will not be repeated here. Optionally, when the media data to be corrected is text data, the computer device can obtain source image data or source video data, and can perform optical character recognition (OCR) on the source image data or source video data to obtain recognized text data. The recognized text data is determined as the media data to be corrected; or the recognized text data is determined as the initial detection media data, and data pre-correction processing is performed on the initial detection media data to obtain the media data to be corrected.

[0142] Optionally, the computer device may obtain audio data, perform audio conversion processing on the audio data, and obtain text data after audio conversion, wherein the audio conversion processing is used to convert the audio data into text data, such as automatic speech recognition technology (Automatic Speech Recognition, ASR), etc. The text data after audio conversion is determined as the media data to be corrected; or the text data after audio conversion is determined as the initial detection media data, and the initial detection media data is subjected to data pre-correction processing to obtain the media data to be corrected.

[0143] Optionally, the computer device can obtain application push data of the application, obtain text data from the application push data, and determine the text data included in the application push data as media data to be corrected; or determine the text data included in the application push data as initial detection media data, perform data pre-correction processing on the initial detection media data, and obtain the media data to be corrected.

[0144] The above are merely several examples of ways to obtain the media data to be corrected. The media data to be corrected may also be obtained by other ways that can obtain text data or image data, and are not limited here.

[0145] Step S402, obtaining initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determining data features of the media data to be corrected based on the initial character strings and the character associations.

[0146] In the embodiments of this application, please refer to Figure 3 Detailed description of step S302 in . Optionally, see Figure 5 As shown, Figure 5 is a schematic diagram of a model structure provided in an embodiment of the present application, such as Figure 5 As shown, the computer device can encode M initial strings respectively to obtain the encoding vectors corresponding to the M initial strings respectively, and perform position encoding on the position information corresponding to the M initial strings respectively to obtain the position vectors corresponding to the M initial strings respectively. Among them, the position vector can be used to represent the position information of the M initial strings in the media data to be corrected, etc. Vector fusion is performed on the encoding vectors corresponding to the M initial strings respectively and the position vectors corresponding to the M initial strings respectively to obtain the initial data features corresponding to the M initial strings respectively. Among them, the encoding vector can be considered to represent information such as a word, phrase or sentence as a vector, and the vectors of synonyms have a high degree of similarity. In this application, the higher the similarity between the initial data features obtained for the initial strings with higher correlation. Further, the initial data features corresponding to the M initial strings can be input into the feature acquisition network 501. Through the self-attention layer and the normalization layer, the character correlation degree between the M initial strings is obtained, and the initial character features of the M initial strings are obtained based on the character correlation degree. For example, for the media data to be corrected "I love malashizitou", what is input are four Chinese characters or pinyin. Through the self-attention mechanism, the character correlation degree can be calculated with each other to obtain a vector representing each character based on the character correlation degree. That is, in the intermediate output part of the feature acquisition network 501, there are enhanced data features representing "I", "love", "mala", and "shizitou" respectively. Further, through the feed-forward network and the normalization layer in the feature acquisition network 501, the initial character features of the M initial strings are fused to obtain the data features to be corrected of the media data to be corrected. Among them, the feed-forward network and the normalization layer are a structure in the model used to represent some ways of mathematical calculation, which may include but are not limited to linear layers, non-linear layers, bitwise addition of output vectors of different layers, and normalization of the obtained results, etc. It can be considered as an empirical combination method of the mapping relationship that composes the entire neural network structure. Optionally, the feed-forward network can be composed of linear calculations and non-linear calculations, etc.; the normalization layer can be considered to normalize the corresponding vector. For example, scale each bit value proportionally (scale), or add or subtract the same value to each bit (displacement), etc., which is not limited here.

[0147] Step S403, obtain the input character for the i-th round of prediction.

[0148] In the embodiment of the present application, the computer device can obtain the input character for the i-th round of prediction. Optionally, when i is 1, it can be considered that the input character for the i-th round of prediction is the start character, and the start character can be a default start character or a character set to indicate the start of prediction, such as " <s>", etc., are not limited here; when i is not 1, the input character of the i-th round of prediction can be considered as the predicted character in the (i-1)-th round of prediction.

[0149] Step S404, obtaining the feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, performing data prediction on the feature of the data to be corrected based on the feature attention, and obtaining a predicted character that is adjacent to and after the input character in the i-th round of prediction.

[0150] In an embodiment of the present application, a computer device may obtain feature attention between an input character in the i-th round of prediction and features of the data to be corrected, and perform data prediction on the features of the data to be corrected based on the feature attention to obtain predicted characters in the i-th round of prediction. Optionally, the computer device may obtain input initial features of the input characters in the i-th round of prediction, position encode the input characters in the i-th round of prediction to obtain input position features, and feature fuse the input initial features and input position features of the input characters in the i-th round of prediction to obtain input features of the input characters in the i-th round of prediction. Optionally, correction parameters may be obtained, and based on the correction parameters and features of the data to be corrected, data prediction may be performed on the input features of the input characters in the i-th round of prediction to obtain predicted characters in the i-th round of prediction. For details, please refer to Figure 5 As shown, the computer device can input the input features in the i-th round of prediction into the data correction network 502, and perform semantic information analysis on the input features in the i-th round of prediction based on the self-attention layer and the normalization layer to obtain the input semantic vector of the input character in the i-th round of prediction. Further, based on the cross-attention layer and the normalization layer, the input semantic vector of the input character in the i-th round of prediction and the data features to be corrected are cross-correlated predicted, and the feature attention between the input character in the i-th round of prediction and the data features to be corrected is determined. Based on the feature attention between the input character in the i-th round of prediction and the data features to be corrected, the cross-correlation features of the input character in the i-th round of prediction are obtained; based on the feedforward network and the normalization layer, the cross-correlation features of the input character in the i-th round of prediction are feature converted to obtain the associated prediction features of the input character in the i-th round of prediction. Based on the associated prediction features of the input character in the i-th round of prediction, the predicted character in the i-th round of prediction is predicted. Optionally, when performing semantic information analysis on the input features in the i-th round of prediction to obtain the input semantic vector of the input character in the i-th round of prediction, if i is not 1, that is, there is a predicted character that has been predicted, the computer device can perform feature attention detection on the input characters in the first round of prediction to the input characters in the i-th round of prediction to obtain the predicted attention corresponding to the input characters in the i-th round of prediction, and perform semantic information analysis based on the predicted attention corresponding to the input characters in the i-th round of prediction to obtain the input semantic vector corresponding to the input characters in the i-th round of prediction.

[0151] Step S405, detect whether the predicted character in the i-th round of prediction is an end character.

[0152] In the embodiment of the present application, the computer device can detect whether the predicted character in the i-th round of prediction is an end character. If the predicted character in the i-th round of prediction is an end character, then execute step S407; if the predicted character in the i-th round of prediction is not an end character, then execute step S406 to perform the next round of prediction.

[0153] Step S406, i++.

[0154] In the embodiment of the present application, increment the value of i by one and return to execute step S403. For example, if i is 5 and it is obtained that the predicted character in the 5th round of prediction is not an end character, then the value of i can be incremented by one, that is, i is 6 at this time, and step S403 is executed to determine the predicted character in the 5th round of prediction as the input character in the 6th round of prediction.

[0155] For steps S403 to S406, for example, assume that the computer device obtains the data feature to be corrected composed of the initial character features corresponding to "I", "love", "mala", and "shizitou" respectively. Optionally, a start character can be input first, such as " <s>", etc. The start character is used to indicate the start of the prediction, that is, there is no other character before the start character. Therefore, at this time, the semantic information of the start character is parsed based on the self-attention layer, etc., to obtain the input semantic vector of the input character in the i-th round of prediction, and the input semantic vector only contains its own semantics. Further, the input semantic vector of the input character in the i-th round of prediction and the data feature to be corrected are cross-correlated predicted to determine the feature attention between the input character in the i-th round of prediction and the data feature to be corrected. It is assumed that based on the feature attention, the next predicted character is predicted to be "I". For example, the computer device can project the cross-correlated features to the character vocabulary dimension, normalize the projected cross-correlated features based on the normalization layer, obtain t mapping probabilities, determine the associated prediction features in the i-th round of prediction based on the t mapping probabilities, and determine the predicted character in the i-th round of prediction based on the associated prediction features. Among them, t is a positive integer, t is the character vocabulary dimension, and the character vocabulary dimension is used to represent the number of characters, that is, the number of words, pinyin and symbols. Assuming that The cross-correlation feature is a 2048-dimensional vector, and the character vocabulary size is 22400 (i.e., assuming that there are 22400 characters, pinyins, and symbols, etc.). Each dimension in the character vocabulary is used to map to a character, a pinyin, or a symbol, etc., then it can be considered that there is a 2048*22400 vector mapping matrix. The computer device can map the cross-correlation feature value to the vector mapping matrix to realize the projection of the cross-correlation feature to the character vocabulary dimension. The projected cross-correlation feature is normalized based on the normalization layer to obtain t mapping probabilities. At this time, t is 22400. Assuming that the mapping probability of the 4500th position among the t mapping probabilities is the largest, such as 0.9, the character corresponding to the 4500th position is obtained and determined as the predicted character in the i-th round of prediction. Assuming that the predicted character here is "I". Further, taking "I" as the input character, feature attention detection is performed on the input character in the first round of prediction to the input character in the i-th round of prediction, and the predicted attention corresponding to the input character in the i-th round of prediction is obtained. At this time, "I" <s>Perform feature attention detection with "me" to obtain the predicted attention corresponding to "me". Based on the predicted attention corresponding to "me", determine the input semantic vector of "me". Obtain the feature attention between the input semantic vector of "me" and the feature of the data to be corrected. Based on the feature attention, perform data prediction on the data to be corrected. Assume that the predicted character at this time is "love". This predicted character "love" is not the end character.

[0156] Further, use "love" as the input character to perform feature attention detection on the input character in the first-round prediction to the input character in the i-th round prediction, and obtain the predicted attention corresponding to the input character in the i-th round prediction. At this time, that is, for " <s>"I" and "love" are subjected to feature attention detection to obtain the predicted attention corresponding to "love". Based on the predicted attention corresponding to "love", the input semantic vector of "love" is determined. The feature attention between the input semantic vector of "love" and the feature of the data to be corrected is obtained, and data prediction is performed on the data to be corrected based on the feature attention. Suppose the initial prediction result "mala" is obtained, and parameter mapping is performed on the initial prediction result to obtain the predicted character "ma". … Similarly, until the predicted character obtained is the end character, such as " <e>"wait.

[0157] The above process can be considered as a character-by-character prediction. Generally speaking, the predicted characters output in sequence can constitute the reference media data corresponding to the media data to be corrected.

[0158] Step S407: Each predicted character is composed into reference media data for correcting the media data to be corrected.

[0159] In the embodiment of the present application, the computer device may form each predicted character into reference media data for correcting the media data to be corrected. Figure 5 As shown, the computer device can perform linear processing on the associated prediction features of the input characters in each round of prediction based on the linear layer to obtain reference media data.

[0160] Optionally, the above steps S402 to S407 may be implemented through a data correction model.

[0161] Optional, see Figure 6 , Figure 6 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 6 As shown, the solution implemented by the present application can be provided to the terminal product directly or indirectly. For example, the solution in the present application can be directly provided to the terminal product as a complete service (direct service), that is, the terminal product can be a product that includes the function of providing media data; or, the solution in the present application can be provided to the terminal product as a basic service in series with other services (indirect service), that is, the terminal product can be a product that includes the function of performing business processing based on media data.

[0162] In the direct service, the computer device may respond to the data correction request, obtain the media data to be corrected targeted by the data correction request, and perform the above-mentioned steps on the media data to be corrected. Figure 3 or Figure 4 In the steps, the media data to be corrected is processed to obtain the reference media data corresponding to the media data to be corrected, and the reference media data is sent to the terminal product that initiates the data correction request. The application scenarios of this direct service may include but are not limited to downstream tasks of services such as automatic conference shorthand, film and television subtitle generation, and product image description generation, providing data correction services for existing media data generation scenarios. Such terminal products can directly call the service interface of the solution in this application and directly output the corrected reference media data in the terminal product. For example, in application scenarios such as automatic conference shorthand and film and television subtitle generation, voice data generated in meetings or film and television dubbing is generally collected and converted into text data to be output. However, the data obtained by converting voice into text may often contain errors, such as erroneous characters and partial garbled characters (such as unrecognizable voices, which may produce partial garbled characters), resulting in low readability and accuracy of the final result. Therefore, the scheme in the present application can be used to determine the text data to be output as media data to be corrected, or to perform data format detection on the text data to be output, obtain media data to be corrected based on the detection result, perform data correction processing on the media data to be corrected, obtain reference media data, and output the reference media data, so that the obtained media data can generally be used directly; for example, in the automatic conference shorthand scenario, the obtained reference media data can be used as meeting records; in the film and television subtitle generation scenario, the obtained reference media data can be used as film and television subtitles, etc. For example, in the automatic shorthand scenario of a conference, the computer device can obtain the conference voice data, convert the conference voice data into conference text data, obtain the media data to be corrected according to the conference text data, perform data correction processing on the media data to be corrected, obtain the reference media data corresponding to the media data to be corrected, and determine the reference media data as the conference record. In other words, under direct service, the corrected reference media data can be used as the output or result of the final terminal product.

[0163] In the indirect service, it can be to perform data correction processing on the media data to be corrected, obtain the reference media data corresponding to the media data to be corrected, further process the reference media data based on other services, obtain the business data results, and send the business data results to the terminal product. Among them, the application scenarios of this indirect service may include but are not limited to upstream tasks of services such as web search result summaries and complex text translation, providing high-quality input media data for existing services. Among them, such terminal products will preferentially call the service interface of the scheme in this application, perform data correction processing on the input media data to be corrected, and provide the corrected media data to other services, such as classification, summary or translation, so that other services can better complete the overall task objectives of the terminal product and enhance the user experience. For example, a computer device can respond to a data translation request to obtain the media data to be corrected associated with the data translation request. Optionally, a computer device can respond to a data translation request, obtain the initial detection media data associated with the data translation request, perform data format detection on the initial detection media data, and determine the media data to be corrected based on the detection results. The computer device can perform data correction processing on the media data to be corrected to obtain reference media data. Further, it can obtain the translation language type requested by the data translation request, perform translation processing on the reference media data, and obtain translation data of the reference media data under the translation language type; output the translation data, at which point the translation data can be considered as a business data result. Optionally, the computer device can respond to a data search request, obtain the media data to be corrected based on the data search request, perform data correction processing on the media data to be corrected to obtain reference media data; further, perform data search based on the reference media data to obtain search results associated with the reference media data, and output the search results, at which point the search results can be considered as a business data result.

[0164] Among them, the above are only a few examples of application scenarios to which the present application may be applicable. Other application scenarios that require media data correction can also be implemented based on the solutions in the present application and are not limited here.

[0165] For further information, see Figure 7 , Figure 7 Schematic diagram of a media data correction architecture provided by an embodiment of the present application. Figure 7 As shown, the data correction in this application may include several parts such as data pre-processing, model generation and data post-processing. The specific process is as follows:

[0166] 1. Data pre-processing

[0167] Specifically, the data pre-processing can be considered as pre-correcting the acquired data that needs to be corrected, so as to reduce the amount of data and data complexity that need to be processed later, and improve the efficiency of subsequent data processing. Specifically, the computer device can obtain the initial detection media data, perform data format detection on the initial detection media data, and if a pre-correction format exists in the initial detection media data, then perform format pre-correction processing on the initial detection media data based on the pre-correction format to obtain the media data to be corrected; if the pre-correction format does not exist in the initial detection media data, then the initial detection media data is determined as the media data to be corrected. Specifically, the process of format pre-correction processing can be referred to. Figure 3 The format pre-correction process may include but is not limited to converting traditional Chinese to simplified Chinese, converting full-width to half-width, cutting long sentences into short sentences, and mapping special characters.

[0168] Among them, Traditional to Simplified: Traditional Chinese will be used in some scenarios. There is a complete Traditional to Simplified mapping dictionary. In scenarios where simplified Chinese is needed for expression, the Traditional to Simplified mapping dictionary can be called to perform format pre-correction processing on the initial detected media data, and convert the Traditional Chinese characters in the media data (that is, the media characters corresponding to the Traditional Chinese writing font) into Simplified characters.

[0169] Optional, in Figure 3 In step S301, assuming that the first character format is a full-width character format and the second character format is a half-width character format, the initial detection media data can be converted from full-width to half-width. The full-width character format usually includes text and symbols in Chinese, Japanese, Korean and other languages, and the half-width character format usually represents English letters, Arabic numerals and English symbols. Full-width characters occupy two bytes, and half-width characters occupy one byte. English letters, Arabic numerals and English symbols all have full-width symbols of the same shape that occupy two bytes. At this time, the full-width character format can be converted to the half-width character format to reduce the amount of data that needs to be processed. For example, see Figure 8 , Figure 8 1 is a partial schematic diagram of a full-width and half-width format encoding provided by an embodiment of the present application. Figure 8 As shown, there is a certain mapping relationship between the half-width standard code 802 of the half-width format character 801 and the full-width standard code 804 of the full-width format character 803. Generally, the difference between the corresponding half-width format characters and the full-width format characters is fixed. Therefore, assuming that the first character format is the full-width character format and the second character format is the half-width character format, the computer device can obtain the first standard code corresponding to the phrase to be corrected in the first character format, determine the second standard code corresponding to the phrase to be corrected in the second character format based on the first standard code, and determine the second associated phrase of the phrase to be corrected based on the second standard code. For example, assuming that the phrase to be corrected is a full-width character "a", obtain the first standard code corresponding to the phrase to be corrected in the first character format, that is, the first standard code "U+FF41" of the full-width character "a" in the full-width character format, and determine the second standard code "U+0061" corresponding to the phrase to be corrected in the second character format based on the first standard code "U+FF41". Based on the second standard code "U+0061", determine the second associated phrase of the phrase to be corrected, that is, the half-width character "a". Among them, each number, letter, symbol, Chinese character, etc. that can be displayed by the computer device will correspond to a standard code, such as the half-width standard code 802 and the full-width standard code 804. The commonly used range of standard codes is generally 65536 when converted to decimal (optional, with the development, this number may also change, this is just an example), and the numbers of the standard codes corresponding to consecutive letters or numbers are generally continuous. Therefore, the mapping from full-width characters to half-width characters can be achieved through the addition and subtraction of standard codes, such as Figure 8 As shown in the letters shown in , the encoding difference between the full-width standard encoding and the half-width standard encoding of the same letter is fixed, such as Figure 8 The code difference shown in is 65248, then the full-width standard code can be subtracted from the code difference to obtain the half-width standard code of the corresponding character, thereby realizing the conversion from full-width to half-width. For example, the full-width standard code of the full-width format character "b" is "U+FF42", and the full-width standard code is "U+FF42" minus the code difference to obtain the half-width standard code "U+0062", and the character corresponding to the half-width standard code "U+0062" is obtained to obtain the half-width format character "b". Similarly, the half-width standard encoding of the half-width format character "c" is "U+0063", and the corresponding full-width standard encoding of the full-width format character "c" is "U+FF43"; the half-width standard encoding of the half-width format character "d" is "U+0064", and the corresponding full-width standard encoding of the full-width format character "d" is "U+FF44"; the half-width standard encoding of the half-width format character "e" is "U+0065", and the corresponding full-width standard encoding of the full-width format character "e" is "U+FF45" ; The half-width standard encoding of the half-width format character "f" is "U+0066", and the corresponding full-width standard encoding of the full-width format character "f" is "U+FF46"; the half-width standard encoding of the half-width format character "g" is "U+0067", and the corresponding full-width standard encoding of the full-width format character "g" is "U+FF47"; the half-width standard encoding of the half-width format character "h" is "U+0068", and the corresponding full-width standard encoding of the full-width format character "h" is "U+FF48", etc.

[0170] Optional, in Figure 3 In step S301, assuming that the first character format is a special character format and the second character format is a regular character format, the initial detection media data can be mapped to a special character. Optionally, the special character format includes but is not limited to special forms of numbers and letters, and emoticons with clear information. For example, the standard encoding of the special character "①" is "U+2460". For example, see Fig. 9 , Fig. 9 1 is a partial schematic diagram of a special character mapping provided in an embodiment of the present application. Fig. 9 As shown, it is assumed that the standard code of the regular format character 901 of the regular character format is the regular standard code 902; the standard code of the special format character corresponding to the regular format character 901 is recorded as the special standard code. Optionally, it is assumed that Fig. 9 In the example shown, the type of special format characters corresponding to the regular format characters 901 (i.e., the type of special character formats) is one or at least two, such as first-type special format characters 903, second-type special format characters 905, and third-type special format characters 907, etc., wherein the standard code of the first-type special format characters 903 is the first-type special standard code 904; the standard code of the second-type special format characters 905 is the second-type special standard code 906; the standard code of the third-type special format characters 907 is the first-type special standard code 908, etc., wherein it can be considered that the character format of the first-type special format characters is the first-type special character format; the character format of the second-type special format characters is the second-type special character format; the character format of the third-type special format characters is the third-type special character format, etc. Specifically, if it is detected that the pre-correction format of the phrase to be corrected is the first character format, the phrase to be corrected can be replaced with the second associated phrase under the second character format. For example, assuming that the phrase to be corrected is the first type of special format character "①", obtain the first standard code "U+2460" of the first type of special format character "①", obtain the second standard code "U+0031" based on the first standard code "U+2460", and determine the second associated phrase of the phrase to be corrected based on the second standard code "U+0031", that is, the regular format character "1". Similarly, the regular format character "1" can also correspond to the second type of special format character "⑴" and the third type of special format character "⒈", etc., and can also correspond to the fourth type of special format character Etc., among which, the standard code of the second category special format character "⑴" is "U+2474", the standard code of the third category special format character "⒈" is "U+2488", etc. The regular format character "2" can correspond to the first category special format character "②", the second category special format character "⑵" and the third category special format character "⒉", etc. The standard code of the first category special format character "②" is "U+2461", the standard code of the second category special format character "⑵" is "U+2475", the standard code of the third category special format character "⒉" is "U+2489", etc. Specifically, the standard codes of some regular format characters and corresponding special format characters can be found in Fig. 9 , no further explanation is given here.

[0171] Optional, Figure 3 In step S301 in, the pre-correction format that will not have much impact on the data correction process, that is, the pre-correction format that will not affect the data correction process or the impact it has is less than the impact threshold, can be recorded as a common correction format, and can be adjusted in data post-processing, such as the font structure in the first writing font, for example, the font structure of the media characters in the media data to be corrected is Songti, Kaiti or Heiti, etc., which will only affect the display effect of the media data to be corrected, and the content and shape of the media data to be corrected will not change. Therefore, in the subsequent data correction process of the media data to be corrected, no matter what the font structure of the media characters in the media data to be corrected is, the correction process and effect will not change. Therefore, the font structure in the first writing font can also be adjusted in data post-processing. In other words, for the common correction format, pre-correction processing can be performed in data pre-processing, and adjustment can also be performed in data post-processing.

[0172] 2. Generate model.

[0173] For details, see Figure 3 The specific descriptions of step S302 to step S305 in the above are not repeated here. Optionally, the generation model can be considered as a data correction model, which can include a feature acquisition network (ie, an encoder) and a data correction network (ie, a decoder).

[0174] 3. Data post-processing.

[0175] Further optionally, the acquired reference media data may be subjected to data anomaly adjustment to obtain the target media data corresponding to the reference media data. For example, the reference media data may be subjected to sentence merging, anomaly detection, and anomaly repair. Specifically, if the number of media data to be corrected is at least two, the reference media data corresponding to the at least two media data to be corrected are subjected to data merging to obtain the target media data corresponding to the media data to be corrected; wherein, when the initial detection media data is obtained, the initial detection media data may be split to obtain the media data to be corrected, resulting in the number of media data to be corrected being at least two. At this time, the reference media data obtained after correcting each media data to be corrected may be subjected to sentence merging to obtain the target media data. Alternatively, if there are at least two consecutive character strings in the reference media data, at least two consecutive character strings in the reference media data are subjected to deduplication processing to obtain the target media data corresponding to the media data to be corrected. For example, if "...continuous characters" appear, deduplication processing may be performed to obtain "...continuous characters". Alternatively, if the data scale difference between the reference media data and the media data to be corrected is greater than or equal to the abnormal difference threshold, it means that there is a large difference between the reference media data obtained by data correction and the media data to be corrected, and a lot of information may be missing or added, etc., and a data correction abnormal message is output. Optionally, the reference media data can also be tested for data logical structure. If the data logical structure of the reference media data conforms to the media data expression method, the reference media data can be determined as the target media data; if the data logical structure of the reference media data does not conform to the media data expression method, the reference media data can be fine-tuned based on the media data expression method to obtain the target media data, etc. Optionally, other data post-processing methods can be added based on needs. Optionally, when the reference media data is post-processed, there may be no abnormal data in the reference media data, or there may be one or at least two abnormal data. In this case, the abnormal data in the reference media data needs to be adjusted to obtain the target media data. The abnormal data includes but is not limited to the number of the media data to be corrected is not one, there are continuous character strings, and the data scale difference is too large. For example, if the number of media data to be corrected is at least two, and there are at least two consecutive character strings in the reference media data, the reference media data corresponding to the at least two media data to be corrected are merged, and at least two consecutive character strings in the at least two reference media data are deduplicated to obtain the target media data.

[0176] Optionally, if data post-processing is performed on the reference media data, Figure 6 In the application scenario shown, services can be provided to terminal products based on target media data. For example, in direct services, a computer device can respond to a data correction request, obtain the media data to be corrected for the data correction request, and perform the above-mentioned Figure 3 or Figure 4 In the steps, data correction processing is performed on the media data to be corrected to obtain the reference media data corresponding to the media data to be corrected, data post-processing is performed on the reference media data to obtain the target media data, and the target media data is sent to the terminal product that initiates the data correction request. In other words, the target media data is used as the output or result of the final terminal product. In the indirect service, data correction processing may be performed on the media data to be corrected to obtain the reference media data corresponding to the media data to be corrected, data post-processing is performed on the reference media data to obtain the target media data, and the target media data is further processed based on other services to obtain the business data result, and the business data result is sent to the terminal product. Taking the translation scenario as an example, the computer device can respond to the data translation request, obtain the initial detection media data associated with the data translation request, perform data format detection on the initial detection media data, and determine the media data to be corrected based on the detection result. The computer device can perform data correction processing on the media data to be corrected to obtain reference media data, and perform data post-processing on the reference media data to obtain target media data; further, it can obtain the translation language type requested by the data translation request, perform translation processing on the target media data, and obtain translation data of the target media data under the translation language type; output the translation data, at this time, the translation data can be considered as the business data result.

[0177] Further, see Fig.10 , Fig.10 Schematic diagram of a model training scenario provided by an embodiment of the present application. Fig.10 As shown, the process may include the following steps:

[0178] Step S1001, obtain a reference data sample, perform noise processing on the reference data sample, and obtain a data sample to be corrected corresponding to the reference data sample.

[0179] In an embodiment of the present application, a computer device may obtain a reference data sample, perform noise processing on the reference data sample, and obtain a data sample to be corrected corresponding to the reference data sample, wherein the noise processing does not include but is not limited to: masking characters and adding placeholders, disrupting the order of data, moving the end of a paragraph to the beginning, deleting characters, and adding placeholders immediately after deleting characters, etc. The computer device may delete one or at least two characters (or sample characters) in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, swap the positions of at least two characters (or sample characters) in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, add a placeholder to the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, replace one or at least two characters (or sample characters) in the reference data sample with a placeholder to obtain a data sample to be corrected corresponding to the reference data sample.

[0180] For example, see Fig.11 As shown, Fig.11 is a schematic diagram of a data noise adding scenario provided in an embodiment of the present application, such as Fig.11 As shown, assuming that a reference data sample 1101 is obtained, and the reference data sample 1101 is "ABC.DE.", in a noise adding method, a first masking character is obtained from the reference data sample 1101, and the first masking character is replaced with a placeholder to obtain a data sample 1102 to be corrected corresponding to the reference data sample 1101. If the first masking character obtained is "B" and "D", the obtained data sample 1102 to be corrected is "A_C._E.". In a noise adding method, a first arrangement order of sample characters constituting the reference data sample 1101 can be obtained, and the sample characters of the reference data sample 1101 are adjusted in order to obtain a data sample 1103 to be corrected of the reference data sample 1101 in a second arrangement order, as shown in FIG. Fig.11 In one noise adding mode, the computer device can obtain the first sample character and the last sample character in the reference data sample 1101, swap the first sample character and the last sample character in the reference data sample 1101, and obtain the data sample 1104 to be corrected corresponding to the reference data sample 1101. Assuming that the first sample character in the reference data sample 1101 is "AB" and the last sample character in the reference data sample 1101 is "C.DE.", the obtained data sample 1104 to be corrected is "C.DE.AB". In one noise adding method, a computer device can obtain the second masked character in a reference data sample 1101, delete the second masked character in the reference data sample 1101, obtain a placeholder adding position, add a placeholder at the placeholder adding position in the reference data sample after deletion, and obtain a data sample 1105 to be corrected corresponding to the reference data sample 1101. Assuming that the second masked character in the reference data sample 1101 is the sample character "B" and the sample character "C", the reference data sample after deletion is "A.DE.", assuming that the placeholder adding position is after and adjacent to the sample character "A", and between the sample character "D" and the sample character "E", a placeholder is added at the placeholder adding position in the reference data sample after deletion, and the obtained data sample 1105 to be corrected is "A_.D_E.". In one noise adding method, the computer device can obtain the characters to be deleted in the reference data sample 1101, delete the characters to be deleted in the reference data sample 1101, and obtain the data sample 1106 to be corrected corresponding to the reference data sample 1101. Assuming that the characters to be deleted are sample characters "B" and sample characters "D", the data sample 1106 to be corrected is "AC.E.", etc. The above are only several examples of noise adding methods, and the present application does not limit the use of other noise adding methods. Optionally, the computer device can obtain one or at least two data samples to be corrected based on a reference data sample, and the reference data sample and each data sample to be corrected obtained based on the reference data sample can be considered as a sample pair.

[0181] Step S1002, input the data sample to be corrected into the initial data correction model, obtain the initial string samples constituting the data sample to be corrected and the sample character associations between the initial string samples, and determine the correction sample data features of the data sample to be corrected based on the initial string samples and the sample character associations.

[0182] In the embodiments of this application, please refer to Figure 3 The specific description of step S302 in will not be repeated here.

[0183] Step S1003, in the initial data correction model, obtain the sample feature attention between the sample input character in the i-th round of prediction and the corrected sample data feature, perform data prediction on the corrected sample data feature based on the sample feature attention, and obtain the sample predicted character that is located after and adjacent to the sample input character in the i-th round of prediction.

[0184] In the embodiments of this application, please refer to Figure 3 The specific description of step S303 in will not be repeated here.

[0185] Step S1004: when the sample predicted character is not the end character, the sample predicted character is determined as the sample input character in the (i+1)th round of prediction.

[0186] In the embodiments of this application, please refer to Figure 3 The specific description of step S304 in will not be repeated here.

[0187] Step S1005, when the sample prediction character is the end character, each predicted sample prediction character is formed into prediction sample correction data for correcting the data sample to be corrected.

[0188] In the embodiments of this application, please refer to Figure 3 The specific description of step S305 in the above is not repeated here. Optionally, the computer device may perform data post-processing on the prediction sample correction data, see Figure 7 According to the description of data post-processing in , target sample correction data is obtained, and step S1006 is executed to adjust the parameters of the initial data correction model based on the reference data sample and the target sample correction data to obtain a data correction model for media data correction.

[0189] Step S1006, based on the reference data sample and the prediction sample correction data, the parameters of the initial data correction model are adjusted to obtain a data correction model for media data correction.

[0190] In an embodiment of the present application, a computer device can adjust the parameters of an initial data correction model based on reference data samples and predicted sample correction data to obtain a data correction model for media data correction. Optionally, the adjusted parameters of the data correction model may include correction parameters. Through the above process, the parameters of the initial data correction model are adjusted, and the correction parameters obtained can be used to learn various data anomaly information. This process is based on the diversity of the generation methods of the above-mentioned data samples to be corrected, so that the correction parameters can be used to adjust various data anomaly information. Figure 3 When the data correction model is used in the illustrated embodiment, various data anomaly information in the data to be corrected can be identified and corrected based on the correction parameters, thereby improving the versatility and accuracy of data correction.

[0191] Optionally, a computer device for performing data correction processing (i.e., executing Figure 3 or Figure 4 The computer device for performing the steps shown in the figure) and the computer device for model training (i.e., executing Fig.10 The computer devices used in the steps shown in the figure) may be the same device or different devices.

[0192] For further information, see Fig.12 , Fig.12 Schematic diagram of a media data correction device provided in an embodiment of the present application. The data correction device may be a computer program (including program code, etc.) running in a computer device, for example, the data correction device may be an application software; the device may be used to execute the corresponding steps in the method provided in an embodiment of the present application. Fig.12 As shown, the data correction device 1200 can be used for Figure 3 or Figure 4 The computer device in the corresponding embodiment, specifically, the device may include: a data acquisition module 11, a feature acquisition module 12, a character prediction module 13, an input determination module 14 and a data generation module 15.

[0193] A data acquisition module 11 is used to acquire the media data to be corrected;

[0194] A feature acquisition module 12, configured to acquire initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determine data features of the media data to be corrected based on the initial character strings and the character associations;

[0195] The character prediction module 13 is used to obtain the feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, and perform data prediction on the feature of the data to be corrected based on the feature attention to obtain a predicted character that is located after and adjacent to the input character in the i-th round of prediction; i is a positive integer;

[0196] An input determination module 14, configured to determine the predicted character as an input character in the (i+1)th round of prediction when the predicted character is not the end character;

[0197] The data generating module 15 is used for, when the predicted character is an ending character, combining each predicted character into reference media data for correcting the media data to be corrected.

[0198] The data acquisition module 11 includes:

[0199] An initial acquisition unit 111, used to acquire initial detection media data;

[0200] The format detection unit 112 is used to perform data format detection on the initial detection media data;

[0201] The pre-correction unit 113 is configured to perform format pre-correction processing on the initially detected media data based on the pre-correction format to obtain the media data to be corrected if the pre-correction format exists in the initially detected media data.

[0202] The format detection unit 112 includes:

[0203] The data word segmentation subunit 1121 is used to perform word segmentation processing on the initial detection media data to obtain N word segmentation phrases; N is a positive integer;

[0204] The word segmentation detection subunit 1122 is used to perform data format detection on the N word segmentation phrases respectively to obtain the phrase data formats corresponding to the N word segmentation phrases respectively;

[0205] The pre-correction determination subunit 1123 is used to determine whether the pre-correction format exists in the initial detection media data if the pre-correction format exists in the phrase data formats corresponding to the N segmented phrases.

[0206] The pre-correction unit 113 includes:

[0207] The phrase acquisition subunit 1131 is used to acquire the phrase to be corrected corresponding to the pre-corrected format if the pre-corrected format exists in the initially detected media data;

[0208] The font conversion subunit 1132 is configured to obtain a first associated phrase of the phrase to be corrected in a second writing font if the pre-corrected format of the phrase to be corrected is a first writing font, and replace the phrase to be corrected in the initial detected media data with the first associated phrase to obtain the media data to be corrected;

[0209] The character conversion subunit 1133 is used to obtain a first standard code corresponding to the phrase to be corrected in the first character format if the pre-correction format of the phrase to be corrected is the first character format, determine a second standard code corresponding to the phrase to be corrected in the second character format based on the first standard code, determine a second associated phrase of the phrase to be corrected based on the second standard code, replace the phrase to be corrected in the initial detected media data with the second associated phrase, and obtain the media data to be corrected.

[0210] The pre-correction format includes a format in which the number of characters is greater than a threshold value; the pre-correction unit 113 includes:

[0211] The data splitting subunit 1134 is used to obtain the sentence separators in the initial detection media data based on the pre-correction format if there is a pre-correction format in the initial detection media data, and split the initial detection media data based on the sentence separators to obtain the media data to be corrected.

[0212] Among them, the number of initial character strings is M, and M is a positive integer;

[0213] The feature acquisition module 12 includes:

[0214] The character string acquisition unit 121 is used to acquire M initial character strings constituting the media data to be modified;

[0215] The association acquisition unit 122 is used to obtain the character association between the M initial character strings through a self-attention mechanism;

[0216] A feature enhancement unit 123 is used to enhance the initial data features of the M initial character strings based on the character associations between the M initial character strings to obtain enhanced data features of the M initial character strings;

[0217] The feature fusion unit 124 is used to fuse the enhanced data features of the M initial character strings to obtain the data features to be corrected of the media data to be corrected.

[0218] The association acquisition unit 122 includes:

[0219] The similarity determination subunit 1221 is used to perform dot product processing on the initial data features of the j-th initial string and the initial data features of other initial strings through a self-attention mechanism to obtain the character similarity between the j-th initial string and the other initial strings; j is a positive integer less than or equal to M; the other initial strings refer to the initial strings other than the j-th initial string in the M initial strings;

[0220] The normalization processing subunit 1222 is used to perform normalization processing on the character similarities between the j-th initial character string and other initial character strings to obtain the character association between the j-th initial character string and other initial character strings;

[0221] The feature enhancement unit 123 includes:

[0222] The enhancement acquisition subunit 1231 is used to perform weighted processing on the initial data features of other initial strings based on the character associations between the j-th initial string and other initial strings, so as to obtain the features to be enhanced of the j-th initial string;

[0223] The enhancement processing subunit 1232 is configured to perform feature enhancement on the initial data feature of the jth initial character string based on the feature to be enhanced of the jth initial character string to obtain the enhanced data feature of the jth initial character string.

[0224] Among them, the number of initial character strings is M, and M is a positive integer;

[0225] The feature acquisition module 12 includes:

[0226] The character string acquisition unit 121 is used to acquire M initial character strings constituting the media data to be modified;

[0227] The hidden acquisition unit 125 is used to acquire the initial data feature of the jth initial string, acquire the character association degree between the jth initial string and the (j+1)th initial string, and based on the character association degree between the jth initial string and the (j+1)th initial string and the initial data feature of the jth initial string, perform feature enhancement on the initial data feature of the (j+1)th initial string to obtain the hidden feature of the (j+1)th initial string, until the hidden feature of the Mth initial string is obtained; j is a positive integer less than M;

[0228] The feature determination unit 126 is configured to determine the hidden feature of the Mth initial character string as the data feature to be corrected of the media data to be corrected.

[0229] Among them, the number of initial character strings is M, and M is a positive integer;

[0230] The feature acquisition module 12 includes:

[0231] A feature analysis unit 127 is used to obtain M initial character strings constituting the media data to be corrected, and obtain initial data features corresponding to the M initial character strings respectively;

[0232] A semantic extraction unit 128, configured to extract semantic information from initial data features corresponding to the M initial character strings, to obtain semantic features corresponding to the M initial character strings;

[0233] The feature pooling unit 129 is used to perform pooling processing on the semantic features corresponding to the M initial character strings respectively, so as to obtain the data features to be corrected of the media data to be corrected.

[0234] The device 1200 further includes:

[0235] The data merging module 16 is configured to merge the reference media data corresponding to the at least two media data to be corrected to obtain the target media data corresponding to the media data to be corrected if the number of the media data to be corrected is at least two; or

[0236] A deduplication module 17 is used to perform deduplication processing on the at least two consecutive character strings in the reference media data if there are at least two consecutive character strings in the reference media data to obtain target media data corresponding to the media data to be corrected; or

[0237] The abnormality output module 18 is configured to output a data correction abnormality message if the data scale difference between the reference media data and the media data to be corrected is greater than or equal to an abnormality difference threshold.

[0238] The data acquisition module 11 includes:

[0239] The request response unit 114 is used to respond to the data translation request and obtain the media data to be modified associated with the data translation request;

[0240] The device also includes:

[0241] The data translation module 19 is used to obtain the translation language type requested by the data translation request, translate the reference media data, and obtain the translation data of the reference media data under the translation language type;

[0242] The translation output module 20 is used to output translation data.

[0243] An embodiment of the present application provides a data correction device, which can obtain media data to be corrected; obtain an initial character string constituting the media data to be corrected and the character association between the initial character strings, and determine the data features to be corrected of the media data to be corrected based on the initial character string and the character association; obtain the feature attention between the input character in the i-th round of prediction and the data features to be corrected, perform data prediction on the data features to be corrected based on the feature attention, and obtain a predicted character that is adjacent to and after the input character in the i-th round of prediction, and when the predicted character is not an end character, determine the predicted character as the input character in the i+1th round of prediction; i is a positive integer; when the predicted character is an end character, each predicted character is composed of reference media data for correcting the media data to be corrected. Through the above process, character string detection can be performed on the media data to be corrected that needs to be corrected, and the initial character strings that constitute the media data to be corrected and the character associations between the initial character strings can be determined, so that the obtained features of the data to be corrected can represent the basic semantic information of the media data to be corrected, as well as the associations between different initial character strings. Character-by-character prediction can be performed based on the features of the data to be corrected. Since the features of the data to be corrected can represent the character associations between the initial character strings, when performing character-by-character prediction, the order of each character can be affected based on the character associations, and the character-by-character prediction can complete and correct missing characters, etc., thereby improving the accuracy and versatility of data correction.

[0244] For further information, see Fig.13 , Fig.13 Schematic diagram of a model training device provided in an embodiment of the present application. The model training device may be a computer program (including program code, etc.) running in a computer device, for example, the model training device may be an application software; the device may be used to execute the corresponding steps in the method provided in an embodiment of the present application. Fig.13 As shown, the model training device 1300 can be used for Fig.10 The computer device in the corresponding embodiment, specifically, the device may include: a sample acquisition module 31, a sample noise addition module 32, a sample feature acquisition module 33, a sample prediction module 34, a sample input determination module 35, a sample generation module 36 and a model adjustment module 37.

[0245] A sample acquisition module 31 is used to acquire reference data samples;

[0246] The sample noise adding module 32 is used to perform noise adding processing on the reference data sample to obtain the data sample to be corrected corresponding to the reference data sample;

[0247] The sample feature acquisition module 33 is used to input the data sample to be corrected into the initial data correction model, obtain the initial string samples constituting the data sample to be corrected and the sample character association between the initial string samples, and determine the correction sample data feature of the data sample to be corrected based on the initial string samples and the sample character association;

[0248] The sample prediction module 34 is used to obtain the sample feature attention between the sample input character in the i-th round of prediction and the corrected sample data feature in the initial data correction model, and perform data prediction on the corrected sample data feature based on the sample feature attention to obtain the sample prediction character that is located after and adjacent to the sample input character in the i-th round of prediction; i is a positive integer;

[0249] A sample input determination module 35, for determining the sample prediction character as the sample input character in the (i+1)th round of prediction when the sample prediction character is not the end character;

[0250] A sample generating module 36, for forming predicted sample correction data for correcting the data sample to be corrected by combining each predicted sample prediction character with the predicted sample prediction character when the sample prediction character is the end character;

[0251] The model adjustment module 37 is used to adjust the parameters of the initial data correction model based on the reference data samples and the predicted sample correction data to obtain a data correction model for media data correction.

[0252] The sample noise adding module 32 includes:

[0253] The character deletion unit 321 is used to delete one or at least two characters in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or

[0254] The character exchange unit 322 is used to exchange the positions of at least two characters in the reference data sample to obtain the data sample to be corrected corresponding to the reference data sample; or

[0255] A placeholder adding unit 323 is used to add a placeholder to the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or

[0256] The character replacement unit 324 is used to replace one or at least two characters in the reference data sample with placeholders to obtain a data sample to be corrected corresponding to the reference data sample.

[0257] Optionally, the data correction model may be adjusted and optimized during use of the data correction model to improve the model quality of the data correction model.

[0258] In an embodiment of the present application, a data correction model can be trained through the above process, so that the correction data in the data correction model can learn a large amount of data anomaly information, and then obtain adjusted correction parameters, so that data correction processing can be performed on a large amount of data anomaly information based on the correction parameters, thereby improving the versatility and accuracy of data correction.

[0259] See also Fig.14 , Fig.14 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.14 As shown, the computer device in the embodiment of the present application may include: one or more processors 1401, a memory 1402, and an input-output interface 1403. The processor 1401, the memory 1402, and the input-output interface 1403 are connected via a bus 1404. The memory 1402 is used to store a computer program, which includes program instructions, and the input-output interface 1403 is used to receive and output data, such as for data interaction between the computer device and the business device; the processor 1401 is used to execute the program instructions stored in the memory 1402.

[0260] The processor 1401 is located in a computer device that performs data correction processing and can perform the following operations:

[0261] Obtaining media data to be corrected;

[0262] Acquire initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determine data features of the media data to be corrected based on the initial character strings and the character associations;

[0263] Obtain feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, perform data prediction on the feature of the data to be corrected based on the feature attention, obtain a predicted character that is adjacent to and after the input character in the i-th round of prediction, and when the predicted character is not the end character, determine the predicted character as the input character in the i+1-th round of prediction; i is a positive integer;

[0264] When the predicted character is an end character, each predicted character is composed into reference media data for correcting the media data to be corrected.

[0265] The processor 1401 is located in a computer device for model training and can perform the following operations:

[0266] Acquire a reference data sample, perform noise processing on the reference data sample, and obtain a data sample to be corrected corresponding to the reference data sample;

[0267] Inputting the data sample to be corrected into the initial data correction model, obtaining the initial character string samples constituting the data sample to be corrected and the sample character association degree between the initial character string samples, and determining the correction sample data feature of the data sample to be corrected based on the initial character string samples and the sample character association degree;

[0268] In the initial data correction model, the sample feature attention between the sample input character in the i-th round prediction and the corrected sample data feature is obtained, and the corrected sample data feature is predicted based on the sample feature attention to obtain the sample prediction character that is located after and adjacent to the sample input character in the i-th round prediction. When the sample prediction character is not the end character, the sample prediction character is determined as the sample input character in the (i+1)th round prediction; i is a positive integer;

[0269] When the sample prediction character is the end character, each predicted sample prediction character is formed into prediction sample correction data for correcting the data sample to be corrected;

[0270] Based on the reference data samples and the predicted sample correction data, the parameters of the initial data correction model are adjusted to obtain a data correction model for media data correction.

[0271] In some feasible implementations, the processor 1401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0272] The memory 1402 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1401 and the input / output interface 1403. A portion of the memory 1402 may also include a non-volatile random access memory. For example, the memory 1402 may also store information about the device type.

[0273] In a specific implementation, the computer device can execute the following operations through its built-in functional modules: Figure 3 or Fig.10 For details on the implementation methods provided in each step, please refer to the Figure 3 or Fig.10 The implementation methods provided in each step will not be repeated here.

[0274] The embodiment of the present application provides a computer device, including: a processor, an input / output interface, and a memory, wherein the processor obtains a computer program in the memory and executes the computer program. Figure 3 The various steps of the method shown in are used to perform data correction operations. The embodiment of the present application realizes obtaining the media data to be corrected; obtaining the initial character string constituting the media data to be corrected and the character association between the initial character strings, and determining the data features to be corrected of the media data to be corrected based on the initial character string and the character association; obtaining the feature attention between the input character in the i-th round of prediction and the data features to be corrected, and performing data prediction on the data features to be corrected based on the feature attention, and obtaining the predicted character that is located after and adjacent to the input character in the i-th round of prediction, and when the predicted character is not the end character, determining the predicted character as the input character in the i+1th round of prediction; i is a positive integer; when the predicted character is the end character, each predicted predicted character is composed of reference media data for correcting the media data to be corrected. Through the above process, character string detection can be performed on the media data to be corrected that needs to be corrected, and the initial character strings that constitute the media data to be corrected and the character associations between the initial character strings can be determined, so that the obtained features of the data to be corrected can represent the basic semantic information of the media data to be corrected, as well as the associations between different initial character strings. Character-by-character prediction can be performed based on the features of the data to be corrected. Since the features of the data to be corrected can represent the character associations between the initial character strings, when performing character-by-character prediction, the order of each character can be affected based on the character associations, and the character-by-character prediction can complete and correct missing characters, etc., thereby improving the accuracy and versatility of data correction.

[0275] The present application also provides a computer-readable storage medium storing a computer program suitable for being loaded and executed by the processor. Figure 3 or Fig.10 For details on the data correction methods and model training provided in each step, please refer to the Figure 3 or Fig.10 The implementation methods provided in each step are not repeated here. In addition, the description of the beneficial effects of adopting the same method is not repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the computer program can be deployed to execute on one computer device, or on multiple computer devices located in one place, or on multiple computer devices distributed in multiple locations and interconnected by a communication network.

[0276] The computer-readable storage medium may be the data correction device provided by any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0277] The present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes Figure 3 or Fig.10 The method provided in the various optional methods can perform character string detection on the media data to be corrected that needs to be corrected, determine the initial character strings that constitute the media data to be corrected, and the character associations between the initial character strings, so that the obtained data features to be corrected can represent the basic semantic information of the media data to be corrected, as well as the associations between different initial character strings, and can perform character-by-character prediction based on the data features to be corrected. Since the data features to be corrected can represent the character associations between the initial character strings, when performing character-by-character prediction, the order of each character can be affected based on the character associations, and the character-by-character prediction can complete and correct missing characters, etc., thereby improving the accuracy and versatility of data correction.

[0278] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other step units inherent to these processes, methods, devices, products, or equipment.

[0279] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in this description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0280] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart 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 correction device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data correction device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data modification device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data modification device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0281] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0282] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0283] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.< / e> < / s> < / s> < / s> < / s> < / e> < / s> < / e> < / s>

Claims

1. A media data correction method, applied to image data correction, characterized in that: The method comprises: Acquiring media data to be corrected, including: acquiring initial detection media data and a media data type corresponding to the initial detection media data, the initial detection media data including image pixels, and different media data types corresponding to different pre-correction formats; acquiring a pre-correction format corresponding to the media data type of the initial detection media data; performing data format detection on the initial detection media data; if a pre-correction format exists in the initial detection media data, performing format pre-correction processing on the initial detection media data based on the pre-correction format to obtain the media data to be corrected, including: if a format with a data size greater than a threshold exists in the initial detection media data, acquiring the pre-correction format; The method comprises: determining a media size of the initially detected media data, dividing the initially detected media data based on the media size to obtain the media data to be corrected, wherein the size of the media data to be corrected is less than or equal to the size threshold; if the initially detected media data has a first color value format, obtaining the media characters to be corrected corresponding to the first color value format from the initially detected media data, converting the first color value format of the media characters to be corrected in the initially detected media data into a second color value format, and obtaining the media data to be corrected; if the initially detected media data has an invalid area, deleting the invalid area in the initially detected media data, and obtaining the media data to be corrected; Acquire an initial character string constituting the media data to be corrected and a character association degree between the initial character strings, wherein the initial character string includes one or more pixel characters, and determine a data feature to be corrected of the media data to be corrected based on the initial character string and the character association degree; Acquire the feature attention between the input character in the i-th round of prediction and the data feature to be corrected, perform data prediction on the data feature to be corrected based on the feature attention, and obtain the predicted character located after and adjacent to the input character in the i-th round of prediction, including: performing semantic information parsing on the input character in the i-th round of prediction based on the self-attention layer and the normalization layer to obtain the input semantic vector of the input character in the i-th round of prediction; performing cross-correlation prediction on the input semantic vector of the input character in the i-th round of prediction and the data feature to be corrected based on the cross-attention layer and the normalization layer, determining the feature attention between the input character in the i-th round of prediction and the data feature to be corrected, and obtaining the cross-correlation feature of the input character in the i-th round of prediction based on the feature attention between the input character in the i-th round of prediction and the data feature to be corrected; perform feature conversion on the cross-correlation feature of the input character in the i-th round of prediction based on the feedforward network and the normalization layer to obtain the correlation prediction feature of the input character in the i-th round of prediction; predict the predicted character in the i-th round of prediction based on the correlation prediction feature of the input character in the i-th round of prediction; When the predicted character is not the end character, the predicted character is determined as the input character in the (i+1)th round of prediction; i is a positive integer; When the predicted character is the end character, each predicted character is used to form reference media data for correcting the media data to be corrected.

2. The method according to claim 1, characterized in that If the pre-correction format exists in the initial detection media data, performing format pre-correction processing on the initial detection media data based on the pre-correction format to obtain the media data to be corrected, including: If a pre-correction format exists in the initially detected media data, obtaining a phrase to be corrected corresponding to the pre-correction format; If the pre-corrected format of the phrase to be corrected is a first writing font, obtaining a first associated phrase of the phrase to be corrected in a second writing font, replacing the phrase to be corrected in the initial detection media data with the first associated phrase, and obtaining the media data to be corrected; If the pre-correction format of the phrase to be corrected is a first character format, obtain a first standard code corresponding to the phrase to be corrected in the first character format, determine a second standard code corresponding to the phrase to be corrected in a second character format based on the first standard code, determine a second associated phrase of the phrase to be corrected based on the second standard code, replace the phrase to be corrected in the initial detection media data with the second associated phrase, and obtain the media data to be corrected.

3. The method according to claim 1, characterized in that The pre-corrected format includes a format in which the number of characters is greater than a threshold; if the pre-corrected format exists in the initial detection media data, the initial detection media data is subjected to format pre-correction processing based on the pre-corrected format to obtain the media data to be corrected, including: If the pre-correction format exists in the initial detection media data, the sentence separator in the initial detection media data is obtained based on the pre-correction format, and the initial detection media data is split based on the sentence separator to obtain the media data to be corrected.

4. The method according to claim 1, characterized in that The number of the initial character strings is M, where M is a positive integer; The obtaining of initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determining the data features to be corrected of the media data to be corrected based on the initial character strings and the character associations, includes: Obtaining M initial character strings constituting the media data to be corrected, and obtaining character associations between the M initial character strings through a self-attention mechanism; Based on the character associations between the M initial character strings, feature enhancement is performed on the initial data features of the M initial character strings to obtain enhanced data features of the M initial character strings; The enhanced data features of the M initial character strings are subjected to feature fusion to obtain the data features to be corrected of the media data to be corrected.

5. The method according to claim 4, characterized in that The step of obtaining the character associations between the M initial character strings through the self-attention mechanism includes: By using a self-attention mechanism, dot product processing is performed on the initial data features of the jth initial string and the initial data features of other initial strings to obtain the character similarity between the jth initial string and the other initial strings; j is a positive integer less than or equal to M; the other initial strings refer to the initial strings other than the jth initial string among the M initial strings; Normalizing the character similarities between the j-th initial character string and the other initial character strings to obtain the character associations between the j-th initial character string and the other initial character strings; The step of enhancing the initial data features of the M initial character strings based on the character associations between the M initial character strings to obtain enhanced data features of the M initial character strings includes: Based on the character association between the j-th initial character string and the other initial character strings, weighted processing is performed on the initial data features of the other initial character strings to obtain the features to be enhanced of the j-th initial character string; The initial data features of the j-th initial character string are enhanced based on the features to be enhanced of the j-th initial character string to obtain enhanced data features of the j-th initial character string.

6. The method according to claim 1, characterized in that The number of the initial character strings is M, where M is a positive integer; The obtaining of initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determining the data features to be corrected of the media data to be corrected based on the initial character strings and the character associations, includes: Obtaining M initial character strings constituting the media data to be modified; Obtaining the initial data features of the jth initial string, obtaining the character association degree between the jth initial string and the (j+1)th initial string, and based on the character association degree between the jth initial string and the (j+1)th initial string and the initial data features of the jth initial string, performing feature enhancement on the initial data features of the (j+1)th initial string to obtain the hidden features of the (j+1)th initial string, until the hidden features of the Mth initial string are obtained; j is a positive integer less than M; The hidden feature of the Mth initial character string is determined as the data feature to be corrected of the media data to be corrected.

7. The method according to claim 1, characterized in that The number of the initial character strings is M, where M is a positive integer; The obtaining of initial character strings constituting the media data to be corrected and character associations between the initial character strings, and determining the data features to be corrected of the media data to be corrected based on the initial character strings and the character associations, includes: Obtaining M initial character strings constituting the media data to be modified, and obtaining initial data features corresponding to the M initial character strings respectively; Extracting semantic information from initial data features corresponding to the M initial character strings respectively, to obtain semantic features corresponding to the M initial character strings respectively; Pooling processing is performed on the semantic features respectively corresponding to the M initial character strings to obtain the data features to be corrected of the media data to be corrected.

8. The method according to claim 1, characterized in that The method further comprises: If the number of the media data to be corrected is at least two, merging the reference media data corresponding to the at least two media data to be corrected to obtain the target media data corresponding to the media data to be corrected; or If there are at least two consecutive character strings in the reference media data, deduplication processing is performed on the at least two consecutive character strings in the reference media data to obtain target media data corresponding to the media data to be corrected; or, If the data scale difference between the reference media data and the media data to be corrected is greater than or equal to the abnormal difference threshold, a data correction abnormality message is output.

9. The method according to claim 1, characterized in that The obtaining of the media data to be corrected further includes: In response to the data translation request, obtaining the media data to be modified associated with the data translation request; The method further comprises: Obtaining a translation language type requested by the data translation request, performing translation processing on the reference media data, and obtaining translation data of the reference media data in the translation language type; The translation data is output.

10. A media data correction method, applied to image data correction, characterized in that: The method comprises: Acquire a reference data sample and a media data type corresponding to the reference data sample, the reference data sample including image pixels, different media data types corresponding to different pre-correction formats, and acquire the pre-correction format corresponding to the media data type of the reference data sample; perform data format detection on the reference data sample; if the reference data sample has a pre-correction format, perform format pre-correction processing on the reference data sample based on the pre-correction format, including: if the reference data sample has a format with a data size greater than a threshold, acquire the media size of the reference data sample, segment the reference data sample based on the media size, and perform pre-correction processing on the reference data sample; The reference data sample is subjected to noise processing to obtain a data sample to be corrected, and the size of the data sample to be corrected is less than or equal to the size threshold; if the reference data sample has a first color value format, a media character to be corrected corresponding to the first color value format is obtained from the reference data sample, the first color value format of the media character to be corrected in the reference data sample is converted into a second color value format, and the reference data sample is subjected to noise processing to obtain a data sample to be corrected; if the reference data sample has an invalid area, the invalid area in the reference data sample is deleted, and the reference data sample is subjected to noise processing to obtain a data sample to be corrected; Input the data sample to be corrected into the initial data correction model, obtain the initial character string samples constituting the data sample to be corrected and the sample character association degree between the initial character string samples, wherein the initial character string includes one or more pixel characters, and determine the correction sample data feature of the data sample to be corrected based on the initial character string samples and the sample character association degree; In the initial data correction model, the sample feature attention between the sample input character in the i-th round prediction and the corrected sample data feature is obtained, and the corrected sample data feature is predicted based on the sample feature attention to obtain the sample predicted character that is located after and adjacent to the sample input character in the i-th round prediction, including: performing semantic information analysis on the input character in the i-th round prediction based on the self-attention layer and the normalization layer to obtain the input semantic vector of the input character in the i-th round prediction; performing cross-correlation prediction on the input semantic vector of the input character in the i-th round prediction and the data feature to be corrected based on the cross-attention layer and the normalization layer to determine the i-th round prediction. Attention is paid to the input characters in the prediction and the features of the data to be corrected. Based on the attention of the input characters in the i-th round of prediction and the features of the data to be corrected, the cross-correlation features of the input characters in the i-th round of prediction are obtained. Based on the feedforward network and the normalization layer, the cross-correlation features of the input characters in the i-th round of prediction are transformed to obtain the correlation prediction features of the input characters in the i-th round of prediction. The predicted characters in the i-th round of prediction are predicted based on the correlation prediction features of the input characters in the i-th round of prediction. When the sample predicted character is not the end character, the sample predicted character is determined as the sample input character in the (i+1)th round of prediction. i is a positive integer. When the sample prediction character is the end character, each predicted sample prediction character is used to form prediction sample correction data for correcting the data sample to be corrected; Based on the reference data sample and the predicted sample correction data, the parameters of the initial data correction model are adjusted to obtain a data correction model for media data correction.

11. The method according to claim 10, characterized in that The step of performing noise processing on the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample includes: Deleting one or at least two characters of the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, Swapping the positions of at least two characters in the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, Add a placeholder to the reference data sample to obtain a data sample to be corrected corresponding to the reference data sample; or, One or at least two characters in the reference data sample are replaced with the placeholder to obtain a data sample to be corrected corresponding to the reference data sample.

12. A media data correction device, applied to image data correction, characterized in that: The device comprises: The data acquisition module is used to acquire initial detection media data and a media data type corresponding to the initial detection media data, wherein the initial detection media data includes image pixels, and different media data types correspond to different pre-correction formats; acquire a pre-correction format corresponding to the media data type of the initial detection media data; perform data format detection on the initial detection media data; if a pre-correction format exists in the initial detection media data, perform format pre-correction processing on the initial detection media data based on the pre-correction format to obtain media data to be corrected, including: if a format with a data size greater than a threshold value exists in the initial detection media data, acquire the initial detection media data; The method comprises the steps of: detecting a media size of the initially detected media data, dividing the initially detected media data based on the media size to obtain the media data to be corrected, wherein the size of the media data to be corrected is less than or equal to the size threshold; if the initially detected media data has a first color value format, obtaining the media characters to be corrected corresponding to the first color value format from the initially detected media data, converting the first color value format of the media characters to be corrected in the initially detected media data into a second color value format, and obtaining the media data to be corrected; if the initially detected media data has an invalid area, deleting the invalid area in the initially detected media data, and obtaining the media data to be corrected; A feature acquisition module, configured to acquire an initial character string constituting the media data to be modified and a character association degree between the initial character strings, wherein the initial character string includes one or more pixel characters, and determine a data feature to be modified of the media data to be modified based on the initial character string and the character association degree; A character prediction module, used for obtaining the feature attention between the input character in the i-th round of prediction and the data feature to be corrected, performing data prediction on the data feature to be corrected based on the feature attention, and obtaining the predicted character located after and adjacent to the input character in the i-th round of prediction, including: performing semantic information parsing on the input character in the i-th round of prediction based on the self-attention layer and the normalization layer to obtain the input semantic vector of the input character in the i-th round of prediction; performing cross-correlation prediction on the input semantic vector of the input character in the i-th round of prediction and the data feature to be corrected based on the cross-attention layer and the normalization layer, determining the feature attention between the input character in the i-th round of prediction and the data feature to be corrected, and obtaining the cross-correlation feature of the input character in the i-th round of prediction based on the feature attention between the input character in the i-th round of prediction and the data feature to be corrected; performing feature conversion on the cross-correlation feature of the input character in the i-th round of prediction based on the feedforward network and the normalization layer to obtain the correlation prediction feature of the input character in the i-th round of prediction; predicting the predicted character in the i-th round of prediction based on the correlation prediction feature of the input character in the i-th round of prediction; An input determination module, configured to determine the predicted character as an input character in the (i+1)th round of prediction when the predicted character is not an end character; i is a positive integer; The data generating module is used for, when the predicted character is the end character, forming each predicted character into reference media data for correcting the media data to be corrected.

13. A media data correction device, applied to image data correction, characterized in that: The device comprises: A sample acquisition module is used to acquire a reference data sample and a media data type corresponding to the reference data sample, wherein the reference data sample includes image pixels, and different media data types correspond to different pre-correction formats, and the pre-correction format corresponding to the media data type of the reference data sample is acquired; data format detection is performed on the reference data sample; if a pre-correction format exists in the reference data sample, format pre-correction processing is performed on the reference data sample based on the pre-correction format, including: if a format having a data size greater than a threshold exists in the reference data sample, the media size of the reference data sample is acquired, and the reference data sample is segmented based on the media size to obtain a data sample to be corrected, wherein the size of the data sample to be corrected is less than or equal to the size threshold; if a first color value format exists in the reference data sample, the media character to be corrected corresponding to the first color value format is acquired from the reference data sample, and the first color value format of the media character to be corrected in the reference data sample is converted into a second color value format to obtain a data sample to be corrected; if an invalid area exists in the reference data sample, the invalid area in the reference data sample is deleted to obtain a data sample to be corrected; A sample noise adding module, used for performing noise adding processing on the reference data sample after performing format pre-correction processing on the reference data sample, so as to obtain a data sample to be corrected corresponding to the reference data sample; A sample feature acquisition module, used for inputting the data sample to be corrected into the initial data correction model, obtaining an initial character string sample constituting the data sample to be corrected and a sample character association degree between the initial character string samples, wherein the initial character string includes one or more pixel characters, and determining a correction sample data feature of the data sample to be corrected based on the initial character string sample and the sample character association degree; The sample prediction module is used to obtain the sample feature attention between the sample input character in the i-th round of prediction and the feature of the corrected sample data in the initial data correction model, perform data prediction on the corrected sample data feature based on the sample feature attention, and obtain the sample prediction character located after and adjacent to the sample input character in the i-th round of prediction, including: performing semantic information parsing on the input character in the i-th round of prediction based on the self-attention layer and the normalization layer to obtain the input semantic vector of the input character in the i-th round of prediction; performing cross-correlation prediction on the input semantic vector of the input character in the i-th round of prediction and the feature of the data to be corrected based on the cross-attention layer and the normalization layer, determining the feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected, and obtaining the cross-correlation feature of the input character in the i-th round of prediction based on the feature attention between the input character in the i-th round of prediction and the feature of the data to be corrected; performing feature conversion on the cross-correlation feature of the input character in the i-th round of prediction based on the feedforward network and the normalization layer to obtain the correlation prediction feature of the input character in the i-th round of prediction; predicting the predicted character in the i-th round of prediction based on the correlation prediction feature of the input character in the i-th round of prediction; i is a positive integer; A sample input determination module, used for determining the sample prediction character as the sample input character in the (i+1)th round of prediction when the sample prediction character is not the end character; A sample generating module, used for, when the sample predicted character is the end character, forming predicted sample correction data for correcting the data sample to be corrected by combining each predicted sample predicted character; The model adjustment module is used to adjust the parameters of the initial data correction model based on the reference data sample and the predicted sample correction data to obtain a data correction model for media data correction.

14. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1 to 9, or executes the method described in any one of claims 10 to 11.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 9, or executes the method according to any one of claims 10 to 11.

16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method described in any one of claims 1 to 9 is implemented, or the method described in any one of claims 10 to 11 is executed.

Citation Information

Patent Citations

  • Method, device and medium for correcting data to be corrected

    CN114117082A