Data processing method, device, electronic device and computer storage medium
By extracting contextual information from the text output by the speech recognition system and using dot and label prediction models to supplement punctuation marks, the problem that the text output by the automatic speech recognition system does not contain punctuation marks is solved and the readability and semantic accuracy of the text are improved. .
Patent Information
- Application Number
- CN202110390911.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-12
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-04-12
AI Technical Summary
The text output by existing automatic speech recognition systems does not contain punctuation marks, resulting in poor reading experience and semantic expression.
By obtaining the text to be processed without punctuation marks, extract the contextual information and input it into the dot prediction model and label prediction model respectively to generate text containing punctuation marks to improve the readability and semantic accuracy of the text.
By predicting and supplementing punctuation marks and labels, a text containing punctuation marks is formed, which improves the readability and semantic accuracy of the text and solves the problems of poor text readability and poor semantic expression in the prior art.
Smart Images

Figure CN113095062B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a data processing method, device, electronic device and computer storage medium. Background Art
[0002] The existing automatic speech recognition system (ASR) is used to recognize speech into text so that users can quickly obtain the content of speech data when it is inconvenient to listen to the speech data. For example, in an instant messaging application, user A sends speech data to user B, and user B can convert the speech data into text for viewing when it is inconvenient to play the speech. The text output by the existing speech recognition system does not contain punctuation marks, which makes the reading experience and semantic expression poor. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a data processing solution to at least partially solve the above problems.
[0004] According to a first aspect of an embodiment of the present invention, there is provided a data processing method, comprising: obtaining a text to be processed that does not carry punctuation marks; extracting context information from the text to be processed; inputting the context information into a point mark prediction model and at least one label prediction model, respectively, and obtaining a point mark label sequence output by the point mark prediction model and a label label sequence output by the at least one label prediction model; and generating a text containing punctuation marks based on the text to be processed, the point mark label sequence and at least one label label sequence.
[0005] According to a second aspect of an embodiment of the present invention, a data processing method is provided, comprising: obtaining a text to be processed without punctuation marks corresponding to speech data; processing the text to be processed using a point prediction model and at least one label prediction model respectively to obtain a predicted text, wherein the predicted text contains the text to be processed and labels and / or points corresponding to the text to be processed; determining a corrected text based on a correction operation on the labels and / or points in the predicted text; and using the corrected text to adjust the at least one label prediction model and / or point prediction model.
[0006] According to a third aspect of an embodiment of the present invention, a data processing device is provided, comprising: a first acquisition module, used to acquire a text to be processed that does not carry punctuation marks; an extraction module, used to extract context information from the text to be processed; a first prediction module, used to input the context information into a point mark prediction model and at least one label prediction model, respectively, and obtain a point mark label sequence output by the point mark prediction model and a label label sequence output by the at least one label prediction model; a generation module, used to generate a text containing punctuation marks based on the text to be processed, the point mark label sequence and at least one label label sequence.
[0007] According to a fourth aspect of an embodiment of the present invention, a data processing device is provided, comprising: a second acquisition module, used to acquire a text to be processed without punctuation marks corresponding to speech data; a second prediction module, used to process the text to be processed using a point prediction model and at least one label prediction model respectively to obtain a predicted text, wherein the predicted text contains the text to be processed and labels and / or points corresponding to the text to be processed; a correction module, used to determine a corrected text based on a correction operation on the labels and / or points in the predicted text; and an adjustment module, used to use the corrected text to adjust the at least one label prediction model and / or point prediction model.
[0008] According to a fifth aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the data processing method described in the first aspect or the second aspect.
[0009] According to a sixth aspect of an embodiment of the present invention, there is provided a computer storage medium on which a computer program is stored. When the program is executed by a processor, the data processing method as described in the first aspect or the second aspect is implemented.
[0010] According to the data processing solution provided by the embodiment of the present invention, context information for representing semantics is obtained from the text to be processed, and point prediction and label prediction are performed using the point prediction model and the label prediction model respectively according to the context information. Based on the predicted point label sequence and label label sequence, the corresponding points and labels are added to the text to be processed to form a text containing punctuation marks, thereby improving the readability and semantic accuracy of the text. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present invention 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 recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0012] Figure 1 is a flowchart of a data processing method according to Embodiment 1 of the present invention;
[0013] Figure 2A is a flowchart of a data processing method according to Embodiment 2 of the present invention;
[0014] Figure 2B is a schematic diagram of a prediction system corresponding to the data processing method according to the second embodiment of the present invention;
[0015] Figure 2C A schematic diagram of a flow chart of a usage scenario according to the second embodiment of the present invention;
[0016] Figure 3 is a flowchart of the steps of a data processing method according to Embodiment 3 of the present invention;
[0017] Figure 4 is a structural block diagram of a data processing device according to a fourth embodiment of the present invention;
[0018] Figure 5 is a structural block diagram of a data processing device according to a fifth embodiment of the present invention;
[0019] Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device according to Embodiment 6 of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0021] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.
[0022] Embodiment 1
[0023] Reference Figure 1 , showing a step flow chart of a data processing method according to a first embodiment of the present invention.
[0024] In this embodiment, the method includes the following steps:
[0025] Step S102: Obtain the text to be processed without punctuation marks.
[0026] The text to be processed may be text obtained by performing speech recognition on speech data, but is not limited thereto. The text to be processed may also be any other text that needs to be filled with punctuation marks.
[0027] Step S104: extracting context information from the text to be processed.
[0028] The context information is used to characterize the semantics of the text to be processed. In one feasible manner, the text to be processed can be encoded by a deep learning model to obtain the context information. The deep learning model can be a transformer model, or an RNN model, or an LSTM model, etc., which is not limited in this embodiment.
[0029] Step S106: input the context information into the point sign prediction model and at least one label prediction model respectively, and obtain the point sign label sequence output by the point sign prediction model and the label label sequence output by the at least one label prediction model.
[0030] In order to be able to predict punctuation marks in the text to be processed, punctuation marks are added to the text to be processed to form a text with punctuation marks, so as to increase readability and make the meaning more accurate.
[0031] In this embodiment, not only the context information is input into the dot mark prediction model to obtain the dot mark label sequence output by the dot mark prediction model to supplement the dot marks in the text to be processed, but also the context information is input into the label prediction model to obtain the label label sequence output by the label prediction model to supplement the labels in the text to be processed, thereby making it possible to supplement not only the dot marks but also the labels, so that the semantics of the supplemented text are clearer and the readability is better.
[0032] Among them, punctuation marks are used to indicate pauses of different lengths in spoken language, such as periods, question marks, exclamation marks, commas, and semicolons.
[0033] Marks are used to indicate the nature or function of words in written language, such as quotation marks, book title marks, etc.
[0034] The dot mark prediction model can be an MLP classifier. The context information is input into the dot mark prediction model. The dot mark prediction model predicts whether there is a dot mark after each character in the text to be processed based on the context information, and if there is a dot mark, it predicts what kind of dot mark it is.
[0035] Taking the text to be processed "AA Times published an article saying that ** will rise sharply" as an example, the corresponding context information is input into the punctuation prediction model. The punctuation prediction model predicts the punctuation tags corresponding to each character, namely: "A", "A", "Times", "published", "article", "saying", "*", "*", "will", "rise", "sharply". For example, since there is no punctuation after the first "A", the corresponding punctuation tag is determined to be the punctuation empty tag, denoted as "-". The punctuation tags corresponding to the second "A", as well as "Times", "published", "article", are all punctuation empty tags. The punctuation tag corresponding to the character "saying" is the colon tag, denoted as ":".
[0036] In addition, the context information is input into at least one label prediction model to predict whether the text to be processed contains the corresponding label and to predict the position of the label. In this embodiment, a corresponding label prediction model can be trained for each type of label. Or, in other embodiments, a single label prediction model can be trained to predict at least two or more types of labels.
[0037] Taking the example of training a corresponding label prediction model for each label, this approach can more accurately predict the label. For example, the context information is input into the label prediction model for predicting guillemets. The label prediction model predicts the label tags corresponding to each character in the text to be processed, thereby outputting a sequence of label tags. For example, if the text to be processed is "AA Times published an article saying that ** will rise sharply", and its context information is input into the label prediction model for predicting guillemets, the label tags corresponding to each character are determined, and then the sequence of label tags is determined according to the positions of the characters in the text to be processed, such as "B_G I_G I_G I_G-----------". Here, "B_G" represents the beginning guillemet tag, which is the abbreviation of Begining-Guillemet. "I_G" represents the inside guillemet tag, which is the abbreviation of Inside-Guillemet. "-" represents the empty tag, that is, the corresponding character has no corresponding punctuation mark.
[0038] It should be noted that the label tags and punctuation tags can be appropriately configured as needed and are not limited to this.
[0039] Step S108: Generate the text containing punctuation marks according to the text to be processed, the punctuation tag sequence, and at least one of the label tag sequences.
[0040] Based on the obtained punctuation tag sequence and label tag sequence, the corresponding punctuation marks and labels are supplemented in the text to be processed, thereby generating the text containing punctuation marks.
[0041] For example, the text to be processed is "AA Times published an article saying that ** will rise sharply." The corresponding dot label sequence is "-------:------." and the label label sequence is ""B_G I_G I_G I_G---------", then according to the dot label sequence and the label label sequence, the corresponding dots and labels are added to the text to be processed, and the generated text containing punctuation marks is: "AA Times published an article saying: ** will rise sharply. "
[0042] Through this embodiment, context information for representing semantics is obtained from the text to be processed, and point prediction and label prediction are performed using the point prediction model and label prediction model respectively according to the context information. Based on the predicted point label sequence and label label sequence, the corresponding points and labels are added to the text to be processed to form a text containing punctuation marks, thereby improving the readability and semantic accuracy of the text.
[0043] The data processing method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0044] Embodiment 2
[0045] Reference Figure 2A , showing a step flow chart of the data processing method of embodiment 2 of the present application.
[0046] In this embodiment, the method is used to process a text to be processed that does not contain punctuation marks output by an automatic speech recognition system as an example for description, and the method includes the following steps:
[0047] Step S202: Obtain the text to be processed without punctuation marks.
[0048] The text to be processed may be text output by an automatic speech recognition system, but is not limited thereto, and may be any text that does not contain punctuation marks.
[0049] In one feasible manner, step S202 includes the following sub-steps:
[0050] Sub-step S2021: receiving voice data.
[0051] The voice data may be voice data received through an instant messaging application, or voice data extracted from video data, and the like.
[0052] Sub-step S2022: performing speech recognition on the speech data to obtain text corresponding to the speech data as the text to be processed.
[0053] For example, voice data is input into a speech recognition model, and the output text is obtained as the text to be processed.
[0054] Of course, in other feasible ways, text without punctuation marks may also be received from an instant messaging application as the text to be processed, and there is no limitation to this.
[0055] Step S204: extracting context information from the text to be processed.
[0056] The context information carries the semantics of the text to be processed. For example, step S204 can be implemented as: inputting the text to be processed into a feature extraction model for extracting semantic features, and obtaining a context representation vector output by the feature extraction model and carrying the context semantics as the context information.
[0057] The feature extraction model may be a transformer model, or a convolutional neural network, a recurrent neural network, etc. The feature extraction model is used to encode the text to be processed to obtain encoded context information containing context semantics, and the context information may be represented in the form of a context representation vector.
[0058] Step S206: input the context information into the point sign prediction model and at least one label prediction model respectively, and obtain the point sign label sequence output by the point sign prediction model and the label label sequence output by the at least one label prediction model.
[0059] In one feasible manner, step S206 includes the following sub-steps:
[0060] Sub-step S2061: inputting the context information into the dot mark prediction model, and predicting the dot mark label corresponding to each character in the text to be processed by the dot mark prediction model.
[0061] The dot prediction model can be an MLP classifier, and the MLP classifier can be multi-task learned through dot training samples, so as to train the MLP classifier to predict dot. In this embodiment, the trained MLP classifier adopts a sequence labeling framework, which can predict which specific dot or no dot is after each character, and use the corresponding dot label to represent it.
[0062] By inputting the context information into the dot number prediction model, the dot number prediction model predicts the dot number label corresponding to each character according to the semantics in the context information.
[0063] The dot tag sequence includes dot entity tags and empty tags for indicating dots. Among them, dot entity tags can be used to indicate real dots. For example, the dot entity tag ": " is used to indicate the colon itself, and the dot entity tag ". " is used to indicate the full stop itself, etc. Of course, in other embodiments, the dot entity tags can also be in other forms as long as the corresponding dots can be determined.
[0064] The empty tag is used to indicate no dot, which can be represented by the tag "-". Of course, it can also be represented in other forms, such as "+", etc.
[0065] Sub-step S2062: Generate the dot tag sequence according to the predicted dot tags and the positions of the characters corresponding to the dot tags in the text to be processed.
[0066] After obtaining the dot tags corresponding to each character, generate the dot tag sequence according to the order between the characters (i.e., the positions of the characters in the text to be processed).
[0067] For example, the text to be processed is "AA Times published an article with the title BB won in the election". Its corresponding dot tag sequence can be expressed as "---------:--------.". This indicates that after the character "wei", the corresponding dot is ":", after the character "sheng", the corresponding dot is ".", and there is no dot after the remaining characters.
[0068] Sub-step S2063: Input the context information into at least one of the label prediction models, and predict the label tags corresponding to each character in the text to be processed through the label prediction models.
[0069] The label prediction model can be an MLP classifier or other models capable of natural language processing. In this embodiment, to ensure the accuracy of prediction, a corresponding label model is used for prediction for each type of label. For example, for book titles, a trained label prediction model capable of predicting book titles is used; for quotation marks, a trained label prediction model capable of predicting quotation marks is used; for dashes, a trained label prediction model capable of predicting dashes is used, etc., which will not be elaborated here.
[0070] Different label prediction models can be trained using corresponding training samples to ensure the accuracy of their predictions.
[0071] In this way, through the MLP classifier, multi-task learning is carried out using the sequence annotation framework to achieve label prediction. For example, through the label prediction model corresponding to book titles, obtain the label tags of book titles corresponding to each character in the text to be processed; through the label prediction model corresponding to quotation marks, obtain the label tags of quotation marks corresponding to each character in the text to be processed, etc.
[0072] Sub-step S2064: Generate at least one label tag sequence according to the predicted label tags and the positions of the characters corresponding to the label tags in the text to be processed.
[0073] According to the position of each character in the text to be processed, and the position of each character in the text to be processed, a label tag sequence is determined.
[0074] For example, the text to be processed is "AA Times article titled BB wins the election". Its corresponding book title label sequence is "B_G I_G I_G I_G-------------", and its corresponding quotation mark label sequence is "----------B_Q I_Q I_Q I_Q I_Q I_Q I_Q". The label sequence can be IOBtagging, or it can be replaced by a tagging schema such as IOBES, which is not limited in this embodiment.
[0075] It should be noted that the aforementioned prediction through the point number prediction model and the label prediction model does not limit the execution order. The point number prediction and the label prediction can be executed serially or in parallel. When executed serially, the point number prediction can be performed first and then the label prediction, or the label prediction can be performed first and then the point number prediction.
[0076] Step S208: Generate text containing punctuation marks according to the text to be processed, the punctuation mark sequence and at least one of the label mark sequences.
[0077] In one feasible embodiment, step S208 can be implemented as follows: based on the positions of the dots indicated by the dot tag sequence and the characters corresponding to the dots in the text to be processed, and the positions of the symbols indicated by the symbol tag sequence and the characters corresponding to the symbols in the text to be processed, the dots and the symbols are added to the text to be processed to obtain text containing punctuation marks.
[0078] For example, the text to be processed is "AA Times article titled BB wins the election". According to the obtained period label sequence, it is determined that the period labels corresponding to the first 8 characters are empty labels, so there is no need to add periods. The period label corresponding to the 9th character indicates to add a colon, and a period is added after the last character.
[0079] Similarly, according to the label tag sequence, labels are added to the positions corresponding to the corresponding characters of the text to be processed, thereby obtaining the text containing punctuation marks. The text containing punctuation marks after adding labels and periods is: The title of the article published in "AA Times" is: "BB wins the election".
[0080] It should be noted that when adding points and labels, the execution order is not restricted.
[0081] The implementation process of this method is described below in conjunction with a specific usage scenario:
[0082] In this usage scenario, the method can be used to respond to the voice-to-text command sent by the instant messaging application. For example, user A sends voice data to user B, and user B triggers the text-to-text option through the interface of the instant messaging application. Based on the triggering operation of user B, the instant messaging application sends a voice-to-text command to the server that configures the method. The server that configures the method uses an automatic speech recognition system to recognize the voice data according to the voice-to-text command and obtains the text to be processed without punctuation marks.
[0083] like Figure 2B As shown, the server is configured with a feature extraction model, a dot prediction model and at least one label prediction model for implementing the method. The feature extraction model may be a transformer model, the dot prediction model and at least one label prediction model may be an MLP classifier, and a corresponding label prediction model for prediction is configured for each label. For example, a label prediction model for predicting book titles, a label prediction model for predicting quotation marks, and a label prediction model for predicting dashes, etc. are included.
[0084] The processing process of this method is as follows Figure 2C As shown, based on the obtained text to be processed, such as "AA Times article titled BB won the election", the text to be processed is converted into a vector form by performing word segmentation and word vector (such as Word Embedding) conversion or other methods, and the text to be processed in vector form is input into the feature extraction model, and the feature extraction model is used to encode it to obtain a context representation vector carrying context semantics as context information.
[0085] The context information is input into the dot prediction model and each label prediction model respectively to obtain the dot label sequence output by the dot prediction model, such as "---------:--------.", and the label label sequence output by each label prediction model, such as the label label sequence corresponding to the book title marks: "B_G I_G I_G I_G-------------", and the label label sequence corresponding to the quotation marks: "----------B_Q I_Q I_Q I_Q I_Q I_Q". Since the label sequences other than the book title marks and quotation marks only include empty labels, they are not shown in the figure.
[0086] The text to be processed is processed according to the dot label sequence and each label label sequence to obtain the text containing punctuation marks. In order to reduce the amount of data processing, when processing the text to be processed, the label sequence containing only empty labels can be omitted, and only the label sequence containing non-empty label sequences can be used to process the text to be processed. The processed text is: The title of the article published in "AA Times" is: "BB won the election".
[0087] This method can simultaneously model and predict marks and punctuation marks, and then merge the predicted punctuation marks, marks and the text to be processed into a text containing punctuation marks. Compared with the traditional text processing method, this method can not only fill the punctuation marks into the text to be processed, but also fill the marks, making the text more readable and more semantically clear, which is helpful for the subsequent natural language understanding of the text and improves the accuracy of natural language understanding.
[0088] This method can also complement the ASR system by completing the punctuation of the text to be processed that does not contain punctuation, solving the problem of poor readability of the text output by the existing ASR system and low accuracy in subsequent natural language understanding tasks. By adding the label prediction model and the dot prediction model, labels and dot marks can be predicted at the same time, thereby improving the readability of the text and the accuracy of downstream natural language understanding tasks.
[0089] The data processing method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as tablet computers, mobile phones, etc.) and PCs, etc.
[0090] Embodiment 3
[0091] Reference Figure 3 , showing a step flow chart of the data processing method of embodiment 3 of the present application.
[0092] In this embodiment, the method is used to adjust the label prediction model and / or the point number prediction model to improve the accuracy of the label prediction model and / or the point number prediction model. The method includes the following steps:
[0093] Step S302: Obtain the text to be processed without punctuation marks corresponding to the voice data.
[0094] The voice data may be voice data sent during interaction through an instant messaging application, or may be voice data captured from a video or audio, etc. This embodiment does not impose any limitation on this.
[0095] By performing speech recognition on the speech data, a text to be processed without punctuation marks corresponding to the speech data can be obtained. For example, the text to be processed is "AA magazine published an article saying that ** will be hit by a snowstorm."
[0096] Step S304: using a point prediction model and at least one label prediction model to process the text to be processed to obtain a predicted text.
[0097] The point number prediction model is used to predict the point numbers in the text to be processed, and it can be a trained neural network model that can perform point number prediction, such as using a trained MLP classifier to perform point number prediction.
[0098] The label prediction model is used to predict the labels in the text to be processed. It can be a trained neural network model that can perform label prediction. For each label, a corresponding MLP classifier can be trained to predict the corresponding label.
[0099] In this embodiment, in order to facilitate the processing of the point number prediction model and the label prediction model, the context information of the text to be processed can be extracted, and the extracted context information can be input into the point number prediction model and each label prediction model respectively, so as to obtain the predicted point number and label.
[0100] The predicted point number can be represented by a point number label sequence, and the predicted label can be represented by a label label sequence.
[0101] Based on the obtained dot mark label sequence, label label sequence and the text to be processed, a predicted text can be synthesized, where the predicted text includes the text to be processed and the labels and / or dot marks corresponding to the text to be processed.
[0102] For example, the predicted text corresponding to the aforementioned text to be processed may be "AA Magazine published an article stating that ** will be hit by a snowstorm."
[0103] In order to improve the accuracy of the prediction of the point number prediction model and / or the label prediction model, the prediction text can be displayed, and the point number and / or label in the prediction text can be corrected. For example, the prediction text is displayed on the display screen, and if the viewer sees that the prediction is inaccurate, the viewer can make a correction operation on it. When the correction operation is received, the point number prediction model and the label prediction model can be adjusted through the following steps to improve the prediction accuracy.
[0104] Step S306: Determine the corrected text according to the correction operation on the marks and / or dots in the predicted text.
[0105] Correction operations include, for example, deleting redundant points or symbols, adding points or symbols at appropriate locations, replacing inaccurate points or symbols with correct points or symbols, and so on.
[0106] Based on the correction operation, a more accurate and corrected text can be obtained. For example, the corrected text is "AA Magazine published an article saying that ** will be hit by a snowstorm.", by adding ":" after the word "says".
[0107] Step S308: Use the modified text to adjust the at least one label prediction model and / or point prediction model.
[0108] In one example, the adjustment operation may be implemented as:
[0109] A new label sequence and / or point mark label sequence is obtained from the corrected text, and the text to be processed corresponding to the speech data is used as a training sample, and the corresponding new label sequence and / or point mark label sequence is used as a supervision label to train the label prediction model and / or point mark prediction model. In this way, the adjusted point mark prediction model and / or label prediction model has a higher prediction accuracy.
[0110] Through this embodiment, the point mark and label prediction model is used to predict the points and labels of the text to be processed corresponding to the speech data, so as to obtain the predicted text containing the points and / or labels, and based on the correction operation of the points and / or labels in the predicted text, the corrected text with higher accuracy of the points and / or labels is obtained, and then the point mark prediction model and / or label prediction model are adjusted according to the corrected text, so as to obtain the point mark prediction model and / or label prediction model with higher prediction accuracy, thereby improving the prediction accuracy.
[0111] Embodiment 4
[0112] Reference Figure 4 , shows a structural block diagram of a data processing device according to a fourth embodiment of the present application.
[0113] The device of this embodiment includes:
[0114] A first acquisition module 402 is used to acquire a text to be processed without punctuation marks;
[0115] An extraction module 404 is used to extract context information from the text to be processed;
[0116] A first prediction module 406, configured to input the context information into a point sign prediction model and at least one label prediction model, respectively, and obtain a point sign label sequence output by the point sign prediction model and a label label sequence output by the at least one label prediction model;
[0117] The generating module 408 is used to generate text containing punctuation marks according to the text to be processed, the dot mark tag sequence and at least one of the label tag sequences.
[0118] Optionally, the first prediction module 406 is used to input the context information into the dot mark prediction model respectively to obtain the dot mark label sequence output by the dot mark prediction model, input the context information into the dot mark prediction model, and predict the dot mark labels corresponding to each character in the text to be processed through the dot mark prediction model; generate the dot mark label sequence according to the predicted dot mark labels and the positions of the characters corresponding to the dot mark labels in the text to be processed.
[0119] Optionally, the point number tag includes a point number entity tag for indicating a point number and an empty tag.
[0120] Optionally, the first prediction module 406 is used to input the context information into at least one label prediction model and obtain a label label sequence output by the at least one label prediction model, and predict the label labels corresponding to each character in the text to be processed by each label prediction model; generate at least one label label sequence according to the predicted label labels and the positions of the characters corresponding to the label labels in the text to be processed.
[0121] Optionally, the first acquisition module 402 is used to receive voice data; perform voice recognition on the voice data to obtain text corresponding to the voice data as the text to be processed.
[0122] Optionally, the extraction module 404 is used to input the text to be processed into a feature extraction model for extracting semantic features, and obtain a context representation vector carrying context semantics output by the feature extraction model as the context information.
[0123] Optionally, a generation module 408 is used to add the dots and the labels to the text to be processed based on the positions of the dots indicated by the dot label sequence and the characters corresponding to the dots in the text to be processed, and the positions of the labels indicated by the label label sequence and the characters corresponding to the labels in the text to be processed, so as to obtain text containing punctuation marks.
[0124] The data processing device of this embodiment is used to implement the corresponding data processing methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0125] Embodiment 5
[0126] Reference Figure 5 , shows a structural block diagram of a data processing device according to a fifth embodiment of the present application.
[0127] In this embodiment, a data processing device includes:
[0128] The second acquisition module 502 is used to acquire the text to be processed without punctuation marks corresponding to the voice data;
[0129] A second prediction module 504 is used to process the text to be processed using a point prediction model and at least one label prediction model to obtain a predicted text, wherein the predicted text includes the text to be processed and the labels and / or points corresponding to the text to be processed;
[0130] A correction module 506, configured to determine a corrected text according to a correction operation on the mark and / or point in the predicted text;
[0131] The adjustment module 508 is used to use the modified text to adjust the at least one label prediction model and / or dot prediction model.
[0132] The data processing device of this embodiment is used to implement the corresponding data processing methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.
[0133] Embodiment 6
[0134] Reference Figure 6 , shows a schematic diagram of the structure of an electronic device according to Embodiment 6 of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0135] like Figure 6 As shown, the electronic device may include: a processor (processor) 602, a communication interface (Communic6tions Interf6ce) 604, a memory (memory) 606, and a communication bus 608.
[0136] in:
[0137] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .
[0138] The communication interface 604 is used to communicate with other electronic devices or servers.
[0139] The processor 602 is used to execute the program 610, and specifically can execute the relevant steps in the above data processing method embodiment.
[0140] Specifically, the program 610 may include program codes, which include computer operation instructions.
[0141] The processor 602 may be a central processing unit (CPU), or a specific integrated circuit (6SIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more 6SICs.
[0142] The memory 606 is used to store the program 610. The memory 606 may include a high-speed R6M memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0143] The program 610 can be specifically used to enable the processor 602 to perform operations corresponding to any of the above-mentioned data processing methods.
[0144] The specific implementation of each step in program 610 can refer to the corresponding description of the corresponding steps and units in the above data processing method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0145] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0146] The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD ROM, R6M, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and will be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as 6SIC or FPG6). It is understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (e.g., R6M, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor, or hardware, the data processing method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the data processing method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the data processing method shown herein.
[0147] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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 the embodiments of the present invention.
[0148] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.
Claims
1. A data processing method, comprising: Get the text to be processed without punctuation marks; Extracting contextual information from the text to be processed; Inputting the context information into a point sign prediction model and at least one label prediction model respectively, and obtaining a point sign label sequence output by the point sign prediction model and a label label sequence output by the at least one label prediction model; Generate text containing punctuation marks according to the text to be processed, the punctuation mark sequence and at least one of the label mark sequences; Among them, punctuation marks are used to indicate pauses of different lengths in spoken language; marks are used to indicate the nature or function of words in written language; The step of generating text containing punctuation marks according to the text to be processed, the dot mark label sequence and at least one label label sequence comprises: Based on the positions of the dots indicated by the dot tag sequence and the characters corresponding to the dots in the text to be processed, and the positions of the symbols indicated by the symbol tag sequence and the characters corresponding to the symbols in the text to be processed, the dots and the symbols are added to the text to be processed to obtain text containing punctuation marks.
2. The method according to claim 1, wherein: The step of inputting the context information into the point sign prediction model respectively to obtain the point sign label sequence output by the point sign prediction model comprises: Inputting the context information into a dot number prediction model, and predicting the dot number label corresponding to each character in the text to be processed by the dot number prediction model; The dot mark label sequence is generated according to the predicted dot mark labels and the positions of the characters corresponding to the dot mark labels in the text to be processed.
3. The method according to claim 2, wherein: The point number tag includes a point number entity tag for indicating a point number and an empty tag.
4. The method according to claim 1 or 2, wherein: The step of inputting the context information into at least one label prediction model and obtaining a label tag sequence output by the at least one label prediction model comprises: Inputting the context information into at least one of the label prediction models, and predicting the label corresponding to each character in the text to be processed by each of the label prediction models; At least one label tag sequence is generated according to the predicted label tags and the positions of the characters corresponding to the label tags in the text to be processed.
5. The method according to claim 1, wherein: The step of obtaining the text to be processed without punctuation marks includes: receiving voice data; Perform speech recognition on the speech data to obtain text corresponding to the speech data as the text to be processed.
6. The method according to claim 1, wherein: Extract contextual information from the text to be processed, including: The text to be processed is input into a feature extraction model for extracting semantic features, and a context representation vector carrying context semantics output by the feature extraction model is obtained as the context information.
7. A data processing method, comprising: Obtain the text to be processed without punctuation marks corresponding to the voice data; Using a point prediction model and at least one label prediction model to process the text to be processed respectively to obtain a predicted text, wherein the predicted text includes the text to be processed and labels and / or points corresponding to the text to be processed; Determining a corrected text according to a correction operation on the marks and / or dots in the predicted text; Using the modified text to adjust the at least one label prediction model and / or point prediction model; Among them, punctuation marks are used to indicate pauses of different lengths in spoken language; marks are used to indicate the nature or function of words in written language; The method of using a point prediction model and at least one label prediction model to process the text to be processed to obtain a predicted text, wherein the predicted text contains the text to be processed and labels and / or point numbers corresponding to the text to be processed, including: Inputting the to-be-processed text into the point number prediction model and the at least one label prediction model respectively, and obtaining a point number label sequence output by the point number prediction model and a label label sequence output by the at least one label prediction model; Based on the positions of the dots indicated by the dot tag sequence and the characters corresponding to the dots in the text to be processed, and the positions of the symbols indicated by the symbol tag sequence and the characters corresponding to the symbols in the text to be processed; the dots and the symbols are added to the text to be processed to obtain text containing punctuation marks.
8. A data processing device, comprising: A first acquisition module is used to acquire a text to be processed without punctuation marks; An extraction module, used to extract context information from the text to be processed; A first prediction module, used to input the context information into a point number prediction model and at least one label prediction model respectively, and obtain a point number label sequence output by the point number prediction model and a label label sequence output by the at least one label prediction model; A generating module, configured to generate text containing punctuation marks according to the text to be processed, the dot mark label sequence and at least one of the label label sequences; Among them, punctuation marks are used to indicate pauses of different lengths in spoken language; marks are used to indicate the nature or function of words in written language; In which, the generation module is used to add the dots and the labels to the text to be processed based on the positions of the dots indicated by the dot label sequence and the characters corresponding to the dots in the text to be processed, and the positions of the labels indicated by the label label sequence and the characters corresponding to the labels in the text to be processed, so as to obtain text containing punctuation marks.
9. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the data processing method according to any one of claims 1 to 6 or claim 7 is implemented.
