WO2022007823A1 - 一种文本数据处理方法及装置 - Google Patents

一种文本数据处理方法及装置 Download PDF

Info

Publication number
WO2022007823A1
WO2022007823A1 PCT/CN2021/104902 CN2021104902W WO2022007823A1 WO 2022007823 A1 WO2022007823 A1 WO 2022007823A1 CN 2021104902 W CN2021104902 W CN 2021104902W WO 2022007823 A1 WO2022007823 A1 WO 2022007823A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
model
noise
data
processing
Prior art date
Application number
PCT/CN2021/104902
Other languages
English (en)
French (fr)
Inventor
崔桐
肖镜辉
李良友
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21838387.5A priority Critical patent/EP4167231A4/en
Publication of WO2022007823A1 publication Critical patent/WO2022007823A1/zh
Priority to US18/151,186 priority patent/US20230162723A1/en

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/06Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
    • G10L15/063Training
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/094Adversarial learning
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/08Speech classification or search
    • G10L15/16Speech classification or search using artificial neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/20Speech recognition techniques specially adapted for robustness in adverse environments, e.g. in noise, of stress induced speech
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/22Procedures used during a speech recognition process, e.g. man-machine dialogue
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition

Definitions

  • the present application relates to the field of artificial intelligence, and in particular, to a text data processing method and device.
  • Artificial intelligence is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that responds in a similar way to human intelligence.
  • Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
  • ASR automatic speech recognition
  • speech recognition models Due to the interference of various factors such as environmental noise and user accent, speech recognition models often have recognition errors, such as homophones, near-phones, repetitions, and sentence segmentation errors.
  • the text processing module located downstream of speech recognition has weak robustness and is very sensitive to text noise in the input. When the input contains noise, it is often unable to obtain correct results.
  • the noise of speech recognition can be introduced during model training. Some words in the text are replaced with words with different but similar pronunciations, however, the noise-added texts generated based on the above methods often fail to reflect the real speech recognition errors.
  • the present application provides a text data processing method, characterized in that it includes:
  • the training device can obtain the target text; wherein, the target text can be the text expressed in the voice data, wherein the voice data can be obtained by using a public voice recognition data set or by manual collection.
  • the target text may be the correct text expressed by the speech data.
  • the target text is processed to obtain the text with added noise
  • the training data of the noise generation model includes at least a first text and a second text
  • the first text is the correct text corresponding to the voice data
  • the second text is the text obtained by performing voice recognition on the voice data through the first voice recognition model
  • the training device can obtain the voice data and the first text, and process the speech data based on the first speech recognition model to obtain a second text, process the first text according to the initial noise generation model to obtain an output text, and according to the output text and the second text, Obtain the loss, and based on the loss, update the initial noise generation model until the loss meets a preset condition, and obtain the noise generation model; at least use the noise-added text as training data to perform a text processing model Train to get the trained text processing model.
  • the noise generation model in the embodiment of the present application is obtained by training based on the correct text and the recognition result of the first speech recognition model, compared with the noisy text generation method based on word replacement, the noise generation model generated by using the noise generation model adds noise.
  • the text is more reflective of the errors of the real noise generation model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the noise-added text does not reflect the error of the real noise-generating model.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or, the character string included in the target text and the noise-added text The difference in the included strings is within a preset range.
  • the first text and the second text are different texts.
  • the processing of the target text according to the noise generation model includes: processing the target text according to the noise generation model to obtain a plurality of noise-added texts, and each Confidence of the noise-added text; according to the confidence, select one or more noise-added texts from the plurality of noise-added texts; for example, the noise-added text with the highest confidence may be selected, or Several noised texts.
  • the training the text processing model using at least the noise-added text as training data includes: training the text processing model using at least the one or more noise-added texts as training data.
  • the method further includes: acquiring speech to be recognized; processing the speech to be recognized according to a second speech recognition model to obtain recognized text; The recognized text is processed to obtain a processing result.
  • the first speech recognition model and the second speech recognition model may be the same speech recognition model, or may be different speech recognition models.
  • the noise generation model can learn the performance of the first speech recognition model, and when faced with the same input text, it can output output text similar to the first speech recognition model.
  • the trained text processing model can The output of the recognition model has stronger robustness. If the first speech recognition model and the second speech recognition model are the same speech recognition model, at this time, the data processing effect of the text processing model on the output of the second speech model is compared. When the first speech recognition model and the second speech recognition model are not the same speech recognition model, the effect will be better.
  • the noise generation model is at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • the present application provides a model training method, the method includes: acquiring voice data and a first text, where the first text is the correct text corresponding to the voice data; The voice data is processed to obtain a second text; the first text and the second text are used as training data to train an initial noise generation model to obtain a noise generation model.
  • the training of the initial noise generation model using the first text and the second text as training data includes:
  • a loss is obtained, and based on the loss, the initial noise generation model is updated until the loss meets a preset condition, and the noise generation model is obtained.
  • the noise generation model and the initial noise generation model are at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • the present application provides a text data processing method, including:
  • the to-be-recognized speech is processed to obtain a recognized text
  • the recognized text is processed to obtain a processing result; wherein, in the process of training the text processing model, the training data of the text processing model includes at least the text with added noise, and the The text with added noise is obtained by processing the target text according to the noise generation model; in the process of training the noise generation model, the training data of the noise generation model includes at least a first text and a second text, and the first text and the second text are included.
  • One text is the correct text corresponding to the speech data
  • the second text is the text obtained by performing speech recognition on the speech data by the first speech recognition model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the first text and the second text are different texts.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or,
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range.
  • the present application provides a text data processing device, including:
  • a text noise adding module configured to process the target text according to the noise generating model to obtain the text with added noise; wherein, in the process of training the noise generating model, the training data of the noise generating model at least include the first A text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model;
  • the training module is used for training the text processing model with at least the noise-added text as training data to obtain the trained text processing model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the first text and the second text are different texts.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or,
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range.
  • the text noise adding module is configured to process the target text according to a noise generation model to obtain a plurality of noise-added texts and a confidence level of each noise-added text; According to the confidence, select one or more noise-added texts from the plurality of noise-added texts; the training module is configured to at least use the one or more noise-added texts as training data, Process the model for training.
  • the acquisition module is used to acquire the speech to be recognized
  • a speech recognition module configured to process the to-be-recognized speech according to the second speech recognition model to obtain recognized text
  • a text processing module configured to process the recognized text according to the trained text processing model to obtain a processing result.
  • the obtaining module is configured to obtain the voice data and the first text
  • the speech recognition module is configured to process the speech data based on the first speech recognition model to obtain the second text; process the first text according to an initial noise generation model to obtain an output text;
  • the training module is configured to obtain a loss according to the output text and the second text, and based on the loss, update the initial noise generation model until the loss meets a preset condition, and obtain the noise generation model Model.
  • the noise generation model is at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • the present application provides a model training device, the device comprising:
  • an acquisition module for acquiring voice data and a first text, where the first text is the correct text corresponding to the voice data
  • a speech recognition module configured to process the speech data based on the first speech recognition model to obtain a second text
  • a training module configured to use the first text and the second text as training data to train an initial noise generation model to obtain a noise generation model.
  • the training module is configured to process the first text according to the initial noise generation model to obtain an output text
  • a loss is obtained, and based on the loss, the initial noise generation model is updated until the loss meets a preset condition, and the noise generation model is obtained.
  • the noise generation model and the initial noise generation model are at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • the present application provides a text data processing device, comprising:
  • an acquisition module used to acquire the speech to be recognized
  • a speech recognition module configured to process the to-be-recognized speech according to the second speech recognition model to obtain recognized text
  • the text processing module is configured to process the recognized text according to the trained text processing model, and obtain a processing result; wherein, in the process of training the text processing model, the training data of the text processing model at least include plus Noise text, the noise-added text is obtained by processing the target text according to the noise generation model; in the process of training the noise generation model, the training data of the noise generation model includes at least the first text and the first text. Two texts, the first text is the correct text corresponding to the speech data, and the second text is the text obtained by performing speech recognition on the speech data by the first speech recognition model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the first text and the second text are different texts.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or,
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range.
  • the present application provides a text data processing method, including:
  • the to-be-recognized speech is processed to obtain a recognized text
  • the recognized text is processed to obtain the denoised text; wherein, in the process of training the text error correction model, the training data of the text error correction model at least includes the first text and the third text.
  • the first text is the correct text corresponding to the voice data
  • the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model
  • the denoised text is processed to obtain a processing result.
  • the output of the text error correction model when the input of the text error correction model includes the second text, the output of the text error correction model includes output text, and the output text is the same as the first text. Differences between texts are within a preset range.
  • the first text and the second text are different texts.
  • the present application provides a text data processing device, including:
  • an acquisition module used to acquire the speech to be recognized
  • a speech recognition module configured to process the to-be-recognized speech according to the second speech recognition model to obtain recognized text
  • a text error correction module configured to process the recognized text according to the text error correction model to obtain denoised text; wherein, in the process of training the text error correction model, the training data of the text error correction model It includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model;
  • the text processing module is used for processing the denoised text according to the text processing model to obtain a processing result.
  • the output of the text error correction model when the input of the text error correction model includes the second text, the output of the text error correction model includes output text, and the output text is the same as the first text. Differences between texts are within a preset range.
  • the first text and the second text are different texts.
  • the present application provides a text data processing device, which may include a processor, the processor is coupled to a memory, the memory stores program instructions, and the above-mentioned first aspect is implemented when the program instructions stored in the memory are executed by the processor.
  • a text data processing device which may include a processor, the processor is coupled to a memory, the memory stores program instructions, and the above-mentioned first aspect is implemented when the program instructions stored in the memory are executed by the processor.
  • the present application provides a model training device, which may include a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned first aspect is implemented method.
  • a model training device which may include a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned first aspect is implemented method.
  • the present application provides a text data processing device, which may include a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned third aspect is realized. method described. For the steps in each possible implementation manner of the third aspect performed by the processor, reference may be made to the third aspect for details, and details are not repeated here.
  • the present application provides a text data processing device, which may include a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above-mentioned seventh aspect is realized. method described. For the steps in each possible implementation manner of the seventh aspect performed by the processor, reference may be made to the seventh aspect for details, and details are not repeated here.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when it is executed on a computer, the computer executes the method described in the first aspect.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when it is executed on a computer, the computer executes the method described in the second aspect.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, which, when executed on a computer, causes the computer to execute the method described in the third aspect.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, which, when executed on a computer, causes the computer to execute the method described in the seventh aspect.
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the method of the above-mentioned first aspect.
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the method of the second aspect above.
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the method of the third aspect above.
  • the present application provides a circuit system, the circuit system comprising a processing circuit configured to perform the method of the seventh aspect above.
  • the present application provides a computer program that, when run on a computer, causes the computer to execute the method described in the first aspect.
  • the present application provides a computer program that, when run on a computer, causes the computer to execute the method described in the second aspect above.
  • the present application provides a computer program that, when executed on a computer, causes the computer to execute the method described in the third aspect.
  • the present application provides a computer program that, when run on a computer, causes the computer to execute the method described in the seventh aspect.
  • the present application provides a chip system
  • the chip system includes a processor for supporting a server or a threshold value obtaining device to implement the functions involved in the above aspects, for example, sending or processing the above methods. the data and/or information involved.
  • the chip system further includes a memory for storing necessary program instructions and data of the server or the communication device.
  • the chip system may be composed of chips, and may also include chips and other discrete devices.
  • Fig. 1 is a kind of structural schematic diagram of artificial intelligence main frame
  • Figure 2a is a natural language processing system
  • Figure 2b is another natural language processing system
  • FIG. 2c is a schematic diagram of a related device for natural language processing provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the architecture of a system 100 according to an embodiment of the present application.
  • FIG. 4a is a text data processing method provided by an embodiment of the present application.
  • FIG. 4b is a text data processing method provided by an embodiment of the present application.
  • 5a is a schematic flowchart of a text data processing method provided by an embodiment of the present application.
  • FIG. 5b is a schematic architecture diagram of a text data processing method provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a model training method provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a text processing apparatus 700 provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a text processing apparatus 800 provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a model training apparatus 900 provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an execution device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a training device provided by an embodiment of the application.
  • FIG. 12 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • Figure 1 shows a schematic structural diagram of the main frame of artificial intelligence.
  • the above-mentioned artificial intelligence theme framework is explained in two dimensions (vertical axis).
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has gone through the condensed process of "data-information-knowledge-wisdom".
  • the "IT value chain” reflects the value brought by artificial intelligence to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecological process of the system.
  • the infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and supports through the basic platform. Communication with the outside world through sensors; computing power is provided by smart chips (hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA); the basic platform includes distributed computing framework and network-related platform guarantee and support, which can include cloud storage and computing, interconnection networks, etc. For example, sensors communicate with external parties to obtain data, and these data are provided to the intelligent chips in the distributed computing system provided by the basic platform for calculation.
  • smart chips hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA
  • the basic platform includes distributed computing framework and network-related platform guarantee and support, which can include cloud storage and computing, interconnection networks, etc. For example, sensors communicate with external parties to obtain data, and these data are provided to the intelligent chips in the distributed computing system provided by the basic platform for calculation.
  • the data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data from traditional devices, including business data from existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
  • machine learning and deep learning can perform symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc. on data.
  • Reasoning refers to the process of simulating human's intelligent reasoning method in a computer or intelligent system, using formalized information to carry out machine thinking and solving problems according to the reasoning control strategy, and the typical function is search and matching.
  • Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, image identification, etc.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall solution of artificial intelligence, and the productization of intelligent information decision-making to achieve landing applications. Its application areas mainly include: intelligent terminals, intelligent transportation, Smart healthcare, autonomous driving, safe city, etc.
  • Figure 2a shows a natural language processing system
  • the natural language processing system includes user equipment and data processing equipment.
  • the user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers.
  • the user equipment is the initiator of natural language data processing, and as the initiator of requests such as language question and answer or query, the user usually initiates the request through the user equipment.
  • the above-mentioned data processing device may be a device or server with data processing functions, such as a cloud server, a network server, an application server, and a management server.
  • the data processing equipment receives the query sentences/voice/text and other questions from the intelligent terminal through the interactive interface, and then performs machine learning, deep learning, search, reasoning, decision-making and other languages through the memory for storing data and the processor for data processing. data processing.
  • the memory in the data processing device may be a general term, including local storage and a database for storing historical data.
  • the database may be on the data processing device or on other network servers.
  • the user equipment can receive an instruction from the user.
  • the user equipment can receive a piece of text input by the user, and then initiate a request to the data processing device, so that the data processing device can respond to the paragraph obtained by the user equipment.
  • the text executes natural language processing applications (such as text classification, text reasoning, named entity recognition, translation, etc.), so as to obtain the corresponding natural language processing application processing results (such as processing results, inference results, named entity recognition results for this piece of text) , translation results, etc.).
  • natural language processing applications such as text classification, text reasoning, named entity recognition, translation, etc.
  • the user equipment may receive a segment of Chinese input by the user, and then initiate a request to the data processing device, so that the data processing device performs entity classification on the segment of Chinese, thereby obtaining an entity processing result for the segment of Chinese;
  • the device may receive a segment of Chinese input by the user, and then initiate a request to the data processing device, so that the data processing device translates the segment of Chinese into English, thereby obtaining an English translation for the segment of Chinese.
  • the data processing device may execute the text data processing method of the embodiment of the present application.
  • Figure 2b shows another natural language processing system.
  • the user equipment is directly used as a data processing device.
  • the user equipment can directly receive input from the user and process it directly by the hardware of the user equipment itself.
  • the specific process is the same as Similar to FIG. 2a, reference may be made to the above description, which will not be repeated here.
  • the user equipment can receive instructions from the user, for example, the user equipment can receive the voice made by the user, and then generate a piece of text corresponding to the voice, and then the user equipment itself can execute the natural language for the piece of text.
  • Language processing applications such as text classification, text reasoning, named entity recognition, translation, etc.
  • processing results of the corresponding natural language processing applications for the piece of text such as processing results, inference results, named entity recognition results, translation results
  • the user equipment itself can execute the text data processing method of the embodiment of the present application.
  • FIG. 2c is a schematic diagram of a related device for natural language processing provided by an embodiment of the present application.
  • the user equipment in the above-mentioned FIGS. 2a and 2b may specifically be the local device 301 or the local device 302 in FIG. 2c, and the data processing device in FIG. 2a may specifically be the execution device 210 in FIG. 2c, wherein the data storage system 250 may be To store the data to be processed by the execution device 210, the data storage system 250 may be integrated on the execution device 210, or may be set on the cloud or other network servers.
  • the processors in Figures 2a and 2b may perform data training/machine learning/deep learning through a neural network model or other models (eg, support vector machine-based models), and use the data to finally train or learn the model for text sequences
  • Execute natural language processing applications such as text classification, sequence tagging, reading comprehension, text generation, text reasoning, translation, etc. to obtain corresponding processing results.
  • FIG. 3 is a schematic diagram of the architecture of a system 100 provided by an embodiment of the present application.
  • the execution device 110 is configured with an input/output (I/O) interface 112, which is used for data interaction with external devices.
  • I/O input/output
  • the user may input data to the I/O interface 112 through the client device 140, and the input data may include: various tasks to be scheduled, callable resources, and other parameters in this embodiment of the present application.
  • the execution device 110 may call the data storage system 150
  • the data, codes, etc. in the corresponding processing can also be stored in the data storage system 150 .
  • the I/O interface 112 returns the processing results to the client device 140 for provision to the user.
  • the training device 120 can generate corresponding target models/rules based on different training data for different goals or tasks, and the corresponding target models/rules can be used to achieve the above-mentioned goals or complete the above-mentioned tasks. , which provides the user with the desired result.
  • the training data may be stored in the database 130 and come from training samples collected by the data collection device 160 .
  • the user can manually specify input data, which can be operated through the interface provided by the I/O interface 112 .
  • the client device 140 can automatically send the input data to the I/O interface 112 . If the user's authorization is required to request the client device 140 to automatically send the input data, the user can set the corresponding permission in the client device 140 .
  • the user can view the result output by the execution device 110 on the client device 140, and the specific presentation form can be a specific manner such as display, sound, and action.
  • the client device 140 can also be used as a data collection terminal to collect the input data of the input I/O interface 112 and the output result of the output I/O interface 112 as new sample data as shown in the figure, and store them in the database 130 .
  • the I/O interface 112 directly uses the input data input into the I/O interface 112 and the output result of the output I/O interface 112 as shown in the figure as a new sample The data is stored in database 130 .
  • FIG. 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data The storage system 150 is an external memory relative to the execution device 110 , and in other cases, the data storage system 150 may also be placed in the execution device 110 .
  • the neural network can be obtained by training according to the training device 120 .
  • An embodiment of the present application also provides a chip, where the chip includes a neural network processor NPU.
  • the chip can be set in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111 .
  • the chip can also be set in the training device 120 as shown in FIG. 3 to complete the training work of the training device 120 and output the target model/rule.
  • the neural network processor NPU is mounted on the main central processing unit (CPU) (host CPU) as a co-processor, and tasks are allocated by the main CPU.
  • the core part of the NPU is the arithmetic circuit, and the controller controls the arithmetic circuit to extract the data in the memory (weight memory or input memory) and perform operations.
  • the arithmetic circuit includes multiple processing units (process engines, PEs).
  • the arithmetic circuit is a two-dimensional systolic array.
  • the arithmetic circuit may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • the arithmetic circuit is a general-purpose matrix processor.
  • the operation circuit fetches the data corresponding to the matrix B from the weight memory, and buffers it on each PE in the operation circuit.
  • the arithmetic circuit fetches the data of matrix A from the input memory and performs matrix operation on matrix B, and stores the partial result or final result of the matrix in an accumulator.
  • the vector calculation unit can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on.
  • the vector computing unit can be used for network computation of non-convolutional/non-FC layers in neural networks, such as pooling, batch normalization, local response normalization, etc.
  • the vector computation unit can store the processed output vector to a unified buffer.
  • the vector computing unit may apply a nonlinear function to the output of the arithmetic circuit, such as a vector of accumulated values, to generate activation values.
  • the vector computation unit generates normalized values, merged values, or both.
  • the vector of processed outputs can be used as activation input to an operational circuit, such as for use in subsequent layers in a neural network.
  • Unified memory is used to store input data as well as output data.
  • the weight data directly transfers the input data in the external memory to the input memory and/or the unified memory through the direct memory access controller (DMAC), stores the weight data in the external memory into the weight memory, and transfers the unified memory store the data in the external memory.
  • DMAC direct memory access controller
  • the bus interface unit (BIU) is used to realize the interaction between the main CPU, the DMAC and the instruction fetch memory through the bus.
  • the instruction fetch buffer connected to the controller is used to store the instructions used by the controller
  • the controller is used for invoking the instructions cached in the memory to realize and control the working process of the operation accelerator.
  • the unified memory, input memory, weight memory and instruction fetch memory are all on-chip memories
  • the external memory is the memory outside the NPU
  • the external memory can be double data rate synchronous dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM), high bandwidth memory (HBM), or other readable and writable memory.
  • a neural network can be composed of neural units, and a neural unit can refer to an operation unit that takes xs and intercept 1 as inputs, and the output of the operation unit can be:
  • s 1, 2,...n, n is a natural number greater than 1
  • Ws is the weight of xs
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
  • the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting many of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units.
  • the work of each layer in a neural network can be expressed mathematically To describe: From the physical level, the work of each layer in the neural network can be understood as the transformation from the input space to the output space (that is, the row space of the matrix to the column space) through five operations on the input space (set of input vectors). ), these five operations include: 1. Dimension raising/lowering; 2. Enlarging/reducing; 3. Rotation; 4. Translation; 5. "Bending”. Among them, the operations of 1, 2, and 3 are determined by Complete, the operation of 4 is completed by +b, and the operation of 5 is realized by a().
  • W is the weight vector, and each value in the vector represents the weight value of a neuron in the neural network of this layer.
  • This vector W determines the space transformation from the input space to the output space described above, that is, the weight W of each layer controls how the space is transformed.
  • the purpose of training the neural network is to finally obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by the vectors W of many layers). Therefore, the training process of the neural network is essentially learning the way to control the spatial transformation, and more specifically, learning the weight matrix.
  • the neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller.
  • BP error back propagation
  • the input signal is passed forward until the output will generate error loss, and the parameters in the initial neural network model are updated by back-propagating the error loss information, so that the error loss converges.
  • the back-propagation algorithm is a back-propagation movement dominated by error loss, aiming to obtain the parameters of the optimal neural network model, such as the weight matrix.
  • Natural language is human language
  • natural language processing is the processing of human language.
  • Natural language processing is the process of systematically analyzing, understanding, and extracting information from text data in an intelligent and efficient manner.
  • MT machine translation
  • NER named entity recognition
  • RE relation extraction
  • IE information extraction
  • sentiment analysis speech recognition
  • speech rec ognition question answering
  • questions answering themes split and so on.
  • natural language processing tasks can fall into the following categories.
  • Sequence tagging Each word in a sentence requires the model to give a categorical category based on the context. Such as Chinese word segmentation, part-of-speech tagging, named entity recognition, semantic role tagging.
  • Classification tasks output a classification value for the entire sentence, such as text classification.
  • Sentence relationship inference Given two sentences, determine whether the two sentences have a nominal relationship. Such as endilment, QA, semantic rewriting, natural language inference.
  • Generative task output a piece of text, generate another piece of text.
  • Word segmentation (word segmentation or word breaker, WB): Divide continuous natural language data into lexical sequences with semantic rationality and integrity, which can solve the problem of cross ambiguity. For example: to graduates and students who have not yet graduated; participle 1: to graduates and students who have not yet graduated; participle 2: to graduates and students who have not yet graduated.
  • NER Named Entity Recognition
  • Part-speech tagging assign a part of speech (noun, verb, adjective, etc.) to each word in natural language data; dependency parsing: automatically analyze the syntactic components (subject, predicate, object, attributive, adverbial and complement, etc.), can solve the problem of structural ambiguity. Comment: You can enjoy the sunrise in the room; Ambiguity 1: The room is okay; Ambiguity 2: You can enjoy the sunrise; Part of speech: In the room (subject), you can (predicate), enjoy the sunrise (verb-object phrase).
  • Word embedding&semantic similarity vectorized representation of vocabulary, and the calculation of semantic similarity of vocabulary based on this, which can solve the similarity of vocabulary and language. For example: watermelon and (dumb melon/strawberry), which is closer?
  • Vectorized representation watermelon (0.1222, 0.22333,..); similarity calculation: dummy (0.115) strawberry (0.325); vectorized representation: (-0.333, 0.1223..) (0.333, 0.3333,..).
  • Text semantic similarity Relying on the massive data of the whole network and deep neural network technology, the ability to realize the calculation of semantic similarity between texts can solve the problem of text semantic similarity. For example: how to prevent the license plate from the front of the car and (how to install the front license plate/how to apply for the Beijing license plate), which is closer?
  • Vectorized representation how to prevent the front of the car from the license plate (0.1222,0.22333,..); similarity calculation: how to install the front license plate (0.762), how to apply for the Beijing license plate (0.486), vectorized representation: (-0.333,0.1223..)( 0.333, 0.3333, .. ).
  • the language model is the basic model in NPL. It is trained and learned through a large amount of corpus, so that LM can infer the probability of unknown words based on existing information (such as text information such as words that have appeared in the context). It can also be understood that LM is used A probabilistic model to compute the probability of a sentence.
  • a language model is a probability distribution over sequences of natural language data that characterize the likelihood that a certain sequence of text of a certain length exists. In short, the language model is to predict what the next word is based on the context. Since there is no need to manually label the corpus, the language model can learn rich semantic knowledge from the unlimited large-scale corpus.
  • Large-scale pre-training language models also known as large-scale language pre-training models, generally refer to the use of large-scale corpora (such as sentences, paragraphs and other language training materials) to design language model training tasks and train large-scale neural network algorithms
  • the resulting large-scale neural network algorithm structure is a large-scale pre-training language model, and other tasks can be performed on the basis of this model for feature extraction or task fine-tuning to achieve specific tasks.
  • the idea of pre-training is to first train a task to obtain a set of model parameters, then use the set of model parameters to initialize the network model parameters, and then use the initialized network model to train other tasks to obtain models suitable for other tasks. .
  • the neural language representation model can learn powerful language representation capabilities, and can extract rich syntactic and semantic information from texts.
  • a large-scale pre-trained language model can provide tokens containing rich semantic information and sentence-level features for downstream tasks, or directly perform fine-tune on the pre-trained model for downstream tasks to quickly and easily obtain downstream exclusive models. .
  • the neural network training method provided in the embodiment of the present application involves the processing of natural language data, and can be specifically applied to data processing methods such as data training, machine learning, and deep learning. Carry out symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc., and finally obtain a trained text processing model; and, the text data processing method provided by the embodiment of the present application can use the above-mentioned trained text processing model , input the input data (such as the target text and the text with noise added in this application) into the trained text processing model to obtain output data (such as the processing result of the text processing model in this application).
  • text processing model training method and text processing method provided in the embodiments of this application are inventions based on the same idea, and can also be understood as two parts in a system, or two stages of an overall process : such as model training phase and model application phase.
  • FIG. 4a is a text data processing method provided by an embodiment of the present application. As shown in FIG. 4a, the text data processing method provided by this embodiment includes:
  • the training device may acquire target text, wherein the target text may be text expressed in voice data, and the voice data may be acquired by using a public speech recognition data set or by manual collection.
  • the target text may be the correct text expressed by the speech data.
  • the target text according to the noise generation model to obtain the text with added noise; wherein, in the process of training the noise generation model, the training data of the noise generation model includes at least the first text and the second text.
  • Text the first text is the correct text corresponding to the voice data
  • the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model.
  • the training device can process the target text according to the noise generation model to obtain the noise-added text; the following describes how to train the noise generation model:
  • the training device may acquire the voice data and the first text, process the voice data based on the first voice recognition model to obtain the second text, and perform the processing of the first text on the basis of the initial noise generation model. Perform processing to obtain an output text, obtain a loss according to the output text and the second text, and update the initial noise generation model based on the loss until the loss meets a preset condition, and obtain the noise generation model Model.
  • a recognition result can be obtained by processing the speech data based on the first speech recognition model, because the recognition result obtained by the speech recognition model is not necessarily accurate.
  • the recognition result of the sentence "where are you going?" processed by the first speech recognition model can be "What are you going?".
  • the training device can use the result obtained by processing the voice data based on the first voice recognition model ( The second text) and the standard sentence (the first text) form a sentence pair, and the standard-noise sentence pair is used to train the noise generation model.
  • the noise generation model in this embodiment may be a text generation model or a text editing model.
  • the text generation model can be a bidirectional (long short-term memory, LSTM) model, a GPT (generative pre-training) model, and the like.
  • the text editing model can be Google's LaserTagger model, etc.
  • the input of the text generation model is the sequence of each word segment of the target text, and the output is the sequence of each word segment of the noise-added text;
  • the input of the text editing model is the sequence of each word segment of the target text, and the output is the modification of the input text.
  • the input text can be modified into noise-added text.
  • sentences with possible speech recognition errors can be generated. For example: input “The clergy tied the knot.”, the model can generate “The clergy told the knot.”, “The clergy tied the night.”, etc., the pronunciation of these sentences is relatively close to the original sentence, belonging to the speech recognition system may occur mistake.
  • the target text may be processed according to a noise generation model to obtain multiple noise-added texts and a confidence level of each noise-added text; Noised Text Select one or more noised texts. For example, the noise-added text with the highest confidence level, or the noise-added text with the highest confidence level can be selected.
  • the difference between the target text and the noise-added text is within a preset range.
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range; and/or, the character string included in the target text and the noise-added text include The difference of the strings is within a preset range.
  • the obtained noise-added text may be compared with the target text, and confrontation samples may be screened out according to the editing rate of the pronunciation sequence.
  • This step is mainly to filter out samples that contain too much noise, and these samples will have a relatively large negative impact on the downstream text processing model.
  • the pronunciation sequence can be obtained through a linguistic dictionary. For example, Chinese can be represented by pinyin, and English can be represented by phonetic symbols.
  • Edit distance refers to the minimum number of edit operations required to convert two strings from one to the other. Allowed editing operations include replacing one character with another, inserting a character, and deleting a character.
  • the edit rate is the edit distance divided by the length of the target text. The length of the target text can be expressed by the number of words in the target text. In this embodiment, the edit rate can be used to measure the noise level of the noise sentence generated by the noise generation model compared to the original sentence. By setting Threshold to filter out noisy text with an average edit rate greater than the threshold.
  • the original sentence is "The clergy tied the knot.”
  • the pronunciation sequence is: ['DH','AH0','P','R','IY1','S','T','T' ,'AY1','D','DH','AH0','N','AA1','T'].
  • the resulting noised text includes:
  • the pronunciation sequence is: ['DH','AH0','P','R','IY1','S','T','T','UW1', 'Y', 'UW1','Y','UW1'].
  • the edit rate is 0.4.
  • the edit rate is 1.4. Set the threshold to 1.0 to filter the second text with noise added.
  • a public speech recognition data set such as Common voice
  • an existing automatic speech recognition (Automatic Speech Recognition, ASR) system is used to perform the speech data in it.
  • Speech recognition get speech recognition results.
  • Filter out misidentified samples second text).
  • the correct text (the first text) corresponding to the speech data is "The valet left the room.”
  • the ASR recognition result (the second text) is "The valley left the room.”.
  • the first text and the second text can be organized into the following form: ORI[SEP]ASR[EOS], and fine-tune the GPT-2 small model to obtain a noise generation model.
  • the obtained noise generation model uses the obtained noise generation model to generate multiple candidate sentences, calculate the pronunciation editing rate with the original sentence, and retain the candidate sentences less than or equal to 1.0.
  • the obtained sentence and the target language sentence corresponding to the original sentence form a new training sample.
  • enter the target text such as The clergy tied the knot.
  • you can get multiple noise-added texts The prayer tied the knot., The clergyrod down the knot., The clergy to you,you ., The clergy tied the knight., The clergy tied the knot dot.
  • the text that is too far from the target text can be eliminated (for example, The clergy to you,you., The clergy tied the knot dot.)
  • Get multiple filtered noise-added texts Get multiple filtered noise-added texts.
  • the text processing model may be trained by using the noise-added text together with the downstream task training samples (correct text).
  • the speech to be recognized may be obtained, the speech to be recognized may be processed according to the second speech recognition model to obtain the recognized text, and the recognized text may be obtained according to the trained text.
  • a processing model is used to process the recognized text to obtain a processing result.
  • the trained text processing model may be used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • steps 401, 402 and 403 can be a terminal device or a server on the cloud side, and steps 401, 402 and 403 can also be obtained through data processing and interaction between the terminal device and the server.
  • the terminal device can obtain the target text; and send the target text to the server, and the server processes the target text according to the noise generation model to obtain the noise-added text; wherein, in the process of training the noise generation model , the training data of the noise generation model includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the voice data through the first voice recognition model. Text obtained by voice recognition; at least the text with added noise is used as training data to train a text processing model to obtain a trained text processing model.
  • the terminal device can obtain the target text; and process the target text according to the noise generation model to obtain the text with added noise; wherein, in the process of training the noise generation model, the noise generation model
  • the training data includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data through the first voice recognition model;
  • the terminal The device may send the noise-added text to the server, and the server may use at least the noise-added text as training data to train a text processing model to obtain a trained text processing model.
  • the terminal device can obtain the target text; process the target text according to the noise generation model to obtain the text with added noise; wherein, in the process of training the noise generation model, the training of the noise generation model
  • the data includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model; at least The noise-added text is used as training data to train a text processing model to obtain a trained text processing model.
  • the server can obtain the target text; and send the target text to the terminal device, and the terminal device processes the target text according to the noise generation model to obtain the noise-added text; wherein, in the training of the noise generation model During the process, the training data of the noise generation model includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the first voice recognition model.
  • the text obtained by voice recognition of the data; the terminal device can send the noise-added text to the server, and the server can use at least the noise-added text as training data to train the text processing model to obtain the trained text processing model.
  • the server can obtain the target text; and send the target text to the terminal device, and the terminal device noise generation model processes the target text to obtain the text with added noise; wherein, in the process of training the noise generation model , the training data of the noise generation model includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the voice data through the first voice recognition model. Text obtained by voice recognition; at least the text with added noise is used as training data to train a text processing model to obtain a trained text processing model.
  • the server can obtain the target text; according to the noise generation model, the target text is processed to obtain the text with added noise; wherein, in the process of training the noise generation model, the training data of the noise generation model It includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data through the first voice recognition model; the server may The noise-added text is sent to the terminal device, and the terminal device may use at least the noise-added text as training data to train a text processing model to obtain a trained text processing model.
  • the server can obtain the target text; according to the noise generation model, the target text is processed to obtain the text with added noise; wherein, in the process of training the noise generation model, the training data of the noise generation model It includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model; The text with the added noise is used as training data to train the text processing model, and the trained text processing model is obtained.
  • this embodiment is evaluated on two datasets, namely the STW conference dataset and the MSLT v1.1 public dataset.
  • the evaluation index is the BLEU (BilingualEvaluationUnderstudy) value.
  • An embodiment of the present application provides a text data processing method, including: obtaining target text; processing the target text according to a noise generation model to obtain text with added noise; wherein, in the process of training the noise generation model , the training data of the noise generation model includes at least a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the voice data performed by the first voice recognition model.
  • Text obtained by speech recognition; at least the noise-added text is used as training data to train a text processing model to obtain a trained text processing model.
  • the noise generation model in the embodiment of the present application is obtained by training based on the recognition result of the first speech recognition model. Compared with the noise sample generation method based on rules and word replacement, the noise generation model generated by using the noise generation model is more efficient. It can reflect the error of the real noise generation model.
  • Fig. 5a is a schematic flowchart of a text data processing method provided by an embodiment of the present application.
  • the text processing method provided by an embodiment of the present application includes:
  • the to-be-recognized voice may be acquired, where the to-be-recognized voice may be obtained by collecting the user's voice by an audio sensor, or voice data uploaded by the user.
  • a recognition result can be obtained by processing the speech data based on the second speech recognition model, because the recognition result obtained by the second speech recognition model is not necessarily accurate. For example, the sentence “where are you going?" is processed by the speech recognition model and the recognition result can be "What are you going?".
  • the recognized text according to the trained text processing model to obtain a processing result; wherein, in the process of training the text processing model, the training data of the text processing model includes at least the text with added noise, The noise-added text is obtained by processing the target text according to the noise generation model; in the process of training the noise generation model, the training data of the noise generation model includes at least the first text and the second text, so the The first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model.
  • the trained text processing model may be used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • step 503 For the text processing model trained in step 503, reference may be made to the description of step 403 in the embodiment corresponding to Fig. 4a, and details are not repeated here.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the difference between the target text and the noise-added text is within a preset range.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or, the character string included in the target text and the noise-added text The difference in the included strings is within a preset range.
  • the first text and the second text are different texts.
  • an embodiment of the present application further provides a method for processing text data, including: acquiring speech to be recognized, and processing the speech to be recognized according to a second speech recognition model to obtain recognized text.
  • a method for processing text data including: acquiring speech to be recognized, and processing the speech to be recognized according to a second speech recognition model to obtain recognized text.
  • the recognized text may be processed according to a text error correction model to obtain denoised text; wherein, in the process of training the text error correction model, the training data of the text error correction model At least include a first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model; in In an optional implementation, when the input of the text error correction model includes the second text, the output of the text error correction model includes the output text, and the output text is the same as the first text. The difference is within a preset range. The first text and the second text are different texts.
  • the denoised text may be processed according to a text processing model to obtain a processing result.
  • Fig. 5b is a schematic diagram of the architecture of a text data processing method provided by an embodiment of the application.
  • speech data and corresponding correct text can be obtained from the ASR corpus , and process the acquired speech data based on ASR to obtain the second text, form clean-noisy pairs from the first text and the second text, train the noise generation model based on the clean-noisy pairs, and obtain the downstream task training set (that is, the training data set for training the text processing model), perform data enhancement on the training data set based on the noise generation model (that is, perform noise processing) to obtain the noisy samples with added noise, and then select and not add noise from the noisy samples.
  • the difference between the noise-processed samples is smaller than the preset value, and the selected noisy samples are used as adversarial samples and the downstream task training set to train the downstream task model (ie the text processing model) to obtain the trained text processing model.
  • the output of the ASR (the second text) can also be obtained, and the second text is subjected to error correction processing through the error correction model to obtain denoised text, and passed through the downstream task model (ie the text processing model) ) to process the denoised text to get the processing result.
  • FIG. 6 is a schematic flowchart of a model training method provided by an embodiment of the present application.
  • the model training method provided by the embodiment of the present application includes:
  • a recognition result can be obtained by processing the speech data based on the first speech recognition model, because the recognition result obtained by the speech recognition model is not necessarily accurate. For example, the sentence “where are you going?" is processed by the speech recognition model and the recognition result can be "What are you going?".
  • the training device can use the result obtained by processing the voice data based on the first voice recognition model ( The second text) and the standard sentence (the first text) form a sentence pair, and the standard-noise sentence pair is used to train the noise generation model.
  • the noise generation model in this embodiment may be a text generation model or a text editing model.
  • the text generation model can be a bidirectional (long short-term memory, LSTM) model, a GPT (generative pre-training) model, and the like.
  • the text editing model can be Google's LaserTagger model, etc.
  • the input of the text generation model is the sequence of each word segment of the target text, and the output is the sequence of each word segment of the noise-added text;
  • the input of the text editing model is the sequence of each word segment of the target text, and the output is the modification of the input text.
  • the input text can be modified into noise-added text.
  • sentences with possible speech recognition errors can be generated. For example: input “The clergy tied the knot.”, the model can generate “The clergy told the knot.”, “The clergy tied the night.”, etc., the pronunciation of these sentences is relatively close to the original sentence, belonging to the speech recognition system may occur mistake.
  • the target text may be processed according to a noise generation model to obtain multiple noise-added texts and a confidence level of each noise-added text; Noised Text Select one or more noised texts. For example, the noise-added text with the highest confidence level, or the noise-added text with the highest confidence level can be selected.
  • FIG. 7 is a schematic diagram of a text processing apparatus 700 provided by the embodiment of the present application.
  • a text processing apparatus 700 provided by an embodiment of the application includes:
  • Text noise adding module 702 configured to process the target text according to the noise generating model to obtain the text with added noise; wherein, in the process of training the noise generating model, the training data of the noise generating model at least includes A first text and a second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model;
  • the training module 703 is configured to at least use the noise-added text as training data to train a text processing model to obtain a trained text processing model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the first text and the second text are different texts.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or,
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range.
  • the text noise adding module is configured to process the target text according to a noise generation model to obtain a plurality of noise-added texts and a confidence level of each noise-added text; According to the confidence, select one or more noise-added texts from the plurality of noise-added texts; the training module is configured to at least use the one or more noise-added texts as training data, Process the model for training.
  • the acquisition module is used to acquire the speech to be recognized
  • a speech recognition module configured to process the to-be-recognized speech according to the second speech recognition model to obtain recognized text
  • a text processing module configured to process the recognized text according to the trained text processing model to obtain a processing result.
  • the obtaining module is configured to obtain the voice data and the first text
  • the speech recognition module is configured to process the speech data based on the first speech recognition model to obtain the second text; process the first text according to an initial noise generation model to obtain an output text;
  • the training module is configured to obtain a loss according to the output text and the second text, and based on the loss, update the initial noise generation model until the loss meets a preset condition, and obtain the noise generation model Model.
  • the noise generation model is at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • FIG. 8 is a schematic diagram of a text processing apparatus 800 provided by an embodiment of the present application.
  • a text processing apparatus 800 provided by an embodiment of the present application includes:
  • a speech recognition module 802 configured to process the to-be-recognized speech according to the second speech recognition model to obtain recognized text;
  • a text processing module 803, configured to process the recognized text according to the trained text processing model to obtain a processing result; wherein, in the process of training the text processing model, the training data of the text processing model at least includes Text with added noise, the text with added noise is obtained by processing the target text according to the noise generation model; in the process of training the noise generation model, the training data of the noise generation model includes at least the first text and The second text, the first text is the correct text corresponding to the voice data, and the second text is the text obtained by performing voice recognition on the voice data by the first voice recognition model.
  • the output of the noise generation model includes the output text
  • the output text and the second text have a difference between the output text and the second text. The difference is within the preset range.
  • the trained text processing model is used to implement at least one of the following tasks: text translation, text semantic recognition, text classification, automatic question answering, information recommendation, and text emotion recognition.
  • the difference between the target text and the noise-added text is within a preset range.
  • the first text and the second text are different texts.
  • the pronunciation difference between the target text and the noise-added text is within a preset range; and/or,
  • the difference between the character string included in the target text and the character string included in the noise-added text is within a preset range.
  • FIG. 9 is a schematic diagram of a model training apparatus 900 provided by an embodiment of the present application.
  • a model training apparatus 900 provided by an embodiment of the present application includes:
  • an acquisition module 901 configured to acquire voice data and a first text, where the first text is the correct text corresponding to the voice data;
  • a speech recognition module 902 configured to process the speech data based on the first speech recognition model to obtain a second text
  • the training module 903 is configured to use the first text and the second text as training data to train an initial noise generation model to obtain a noise generation model.
  • the training module 903 is configured to process the first text according to the initial noise generation model to obtain an output text
  • a loss is obtained, and based on the loss, the initial noise generation model is updated until the loss meets a preset condition, and the noise generation model is obtained.
  • the noise generation model and the initial noise generation model are at least one of the following: a bidirectional long short-term memory network LSTM, a GPT (generative pre-training) model, and a LaserTagger model.
  • FIG. 10 is a schematic structural diagram of the execution device provided by the embodiment of the present application. Smart wearable devices, servers, etc., are not limited here.
  • the data processing apparatus described in the embodiment corresponding to FIG. 10 may be deployed on the execution device 1000 to implement the data processing function in the embodiment corresponding to FIG. 10 .
  • the execution device 1000 includes: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004 (wherein the number of processors 1003 in the execution device 1000 may be one or more, and one processor is taken as an example in FIG. 10 ) , wherein the processor 1003 may include an application processor 10031 and a communication processor 10032 .
  • the receiver 1001, the transmitter 1002, the processor 1003, and the memory 1004 may be connected by a bus or otherwise.
  • Memory 1004 may include read-only memory and random access memory, and provides instructions and data to processor 1003 .
  • a portion of memory 1004 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 1004 stores processors and operation instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
  • the processor 1003 controls the operation of the execution device.
  • the various components of the execution device are coupled together through a bus system, where the bus system may include a power bus, a control bus, and a status signal bus in addition to a data bus.
  • the various buses are referred to as bus systems in the figures.
  • the methods disclosed in the above embodiments of the present application may be applied to the processor 1003 or implemented by the processor 1003 .
  • the processor 1003 may be an integrated circuit chip, which has signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 1003 or an instruction in the form of software.
  • the above-mentioned processor 1003 may be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and may further include an application specific integrated circuit (ASIC), a field programmable Field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable Field-programmable gate array
  • the processor 1003 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory 1004, and the processor 1003 reads the information in the memory 1004, and completes the steps of the above method in combination with its hardware.
  • the receiver 1001 can be used to receive input numerical or character information, and generate signal input related to the relevant setting and function control of the execution device.
  • the transmitter 1002 can be used to output digital or character information through the first interface; the transmitter 1002 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1002 can also include a display device such as a display screen .
  • the processor 1003 is configured to execute the text data processing method executed by the execution device in the embodiment corresponding to FIG. 5a.
  • FIG. 11 is a schematic structural diagram of the training device provided by the embodiment of the present application.
  • the training device 1100 is implemented by one or more servers.
  • the training device 1100 Large differences may occur due to differences in configuration or performance, and may include one or more central processing units (CPU) 1111 (eg, one or more processors) and memory 1132, one or more storage applications
  • a storage medium 1130 eg, one or more mass storage devices for programs 1142 or data 1144.
  • the memory 1132 and the storage medium 1130 may be short-term storage or persistent storage.
  • the program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instructions to operate on the training device. Furthermore, the central processing unit 1111 may be configured to communicate with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the training device 1100 .
  • the training device 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158; or, one or more operating systems 1141, such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • operating systems 1141 such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • the training device may perform the steps in the embodiments corresponding to FIG. 4a and FIG. 6 .
  • Embodiments of the present application also provide a computer program product that, when running on a computer, causes the computer to perform the steps performed by the aforementioned execution device, or causes the computer to perform the steps performed by the aforementioned training device.
  • Embodiments of the present application further provide a computer-readable storage medium, where a program for performing signal processing is stored in the computer-readable storage medium, and when it runs on a computer, the computer executes the steps performed by the aforementioned execution device. , or, causing the computer to perform the steps as performed by the aforementioned training device.
  • the execution device, training device, or terminal device provided in this embodiment of the present application may specifically be a chip, and the chip includes: a processing unit and a communication unit, the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, pins or circuits, etc.
  • the processing unit can execute the computer executable instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiments, or the chip in the training device executes the data processing method described in the above embodiment.
  • the storage unit is a storage unit in the chip, such as a register, a cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as only Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.
  • ROM Read-only memory
  • RAM random access memory
  • FIG. 12 is a schematic structural diagram of a chip provided by an embodiment of the application.
  • the chip may be represented as a neural network processor NPU 1200, and the NPU 1200 is mounted as a co-processor to the main CPU (Host CPU), tasks are allocated by the Host CPU.
  • the core part of the NPU is the arithmetic circuit 1203, which is controlled by the controller 1204 to extract the matrix data in the memory and perform multiplication operations.
  • the arithmetic circuit 1203 includes multiple processing units (Process Engine, PE). In some implementations, arithmetic circuit 1203 is a two-dimensional systolic array. The arithmetic circuit 1203 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1203 is a general-purpose matrix processor.
  • the operation circuit fetches the data corresponding to the matrix B from the weight memory 1202 and buffers it on each PE in the operation circuit.
  • the arithmetic circuit fetches the data of matrix A and matrix B from the input memory 1201 to perform matrix operation, and stores the partial result or final result of the matrix in the accumulator 1208 .
  • Unified memory 1206 is used to store input data and output data.
  • the weight data is directly passed through the storage unit access controller (Direct Memory Access Controller, DMAC) 1205, and the DMAC is transferred to the weight memory 1202.
  • Input data is also moved to unified memory 1206 via the DMAC.
  • DMAC Direct Memory Access Controller
  • the BIU is the Bus Interface Unit, that is, the bus interface unit 1210, which is used for the interaction between the AXI bus and the DMAC and the instruction fetch buffer (Instruction Fetch Buffer, IFB) 1209.
  • IFB Instruction Fetch Buffer
  • the bus interface unit 1210 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 1209 to obtain instructions from the external memory, and also for the storage unit access controller 1205 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
  • the DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1206 , the weight data to the weight memory 1202 , or the input data to the input memory 1201 .
  • the vector calculation unit 1207 includes a plurality of operation processing units, and further processes the output of the operation circuit 1203, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc., if necessary. It is mainly used for non-convolutional/fully connected layer network computation in neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.
  • the vector computation unit 1207 can store the vector of the processed output to the unified memory 1206 .
  • the vector calculation unit 1207 can apply a linear function; or a nonlinear function to the output of the operation circuit 1203, such as performing linear interpolation on the feature plane extracted by the convolutional layer, such as a vector of accumulated values, to generate activation values.
  • the vector computation unit 1207 generates normalized values, pixel-level summed values, or both.
  • the vector of processed outputs can be used as activation input to arithmetic circuitry 1203, eg, for use in subsequent layers in a neural network.
  • the instruction fetch memory (instruction fetch buffer) 1209 connected to the controller 1204 is used to store the instructions used by the controller 1204;
  • the unified memory 1206, the input memory 1201, the weight memory 1202 and the instruction fetch memory 1209 are all On-Chip memories. External memory is private to the NPU hardware architecture.
  • the processor mentioned in any one of the above may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the above program.
  • the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be A physical unit, which can be located in one place or distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be retrieved from a website, computer, training device, or data Transmission from the center to another website site, computer, training facility or data center via wired (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means.
  • wired eg coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a training device, a data center, or the like that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biomedical Technology (AREA)
  • Machine Translation (AREA)

Abstract

本申请公开了一种文本数据处理方法,应用于人工智能领域,包括:获取目标文本;根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。本申请中的噪声生成模型由于是基于第一语音识别模型的识别结果进行训练得到的,相比于基于规则和词替换的带噪样本生成方法,使用噪声生成模型生成的带噪样本更能反映真实的噪声生成模型的错误。

Description

一种文本数据处理方法及装置
本申请要求于2020年07月10日提交中国专利局、申请号为202010662105.9、发明名称为“一种文本数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,尤其涉及一种文本数据处理方法及装置。
背景技术
人工智能(artificial intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用***。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式作出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。
近年来,语音技术的发展催生了很多基于语音技术的应用,如语音助手、智能家居、语音翻译等。目前,业界基于语音技术的应用一般都是先经过自动语音识别(automatic speech recognition,ASR)模块识别成文本,再由文本处理模块对文本进行处理,比如进行语音翻译,自动应答等等。
由于环境噪音和用户口音等多种因素干扰,语音识别模型经常出现识别错误,如同音词、近音词、重复、断句错误等。而位于语音识别下游的文本处理模块鲁棒性弱,对于输入中的文本噪音非常敏感,当输入中含有噪音时往往无法得到正确的结果。
目前,为了提升神经网络模型对带噪声的输入的鲁棒性,可以在模型训练时引入语音识别的噪声,在现有的实现中,为了得到加噪声的文本,可以基于某些词典将正确的文本中的部分词语替换为不同但是发音相似的词语,然而,基于上述方法生成的加噪声的文本往往无法反映真实的语音识别错误。
发明内容
第一方面,本申请提供了一种文本数据处理方法,其特征在于,包括:
获取目标文本;训练设备可以获取目标文本;其中,目标文本可以是语音数据中所表达的文本,其中,语音数据可以使用公开的语音识别数据集或者通过人工采集的方式获取。该目标文本可以是语音数据所表达的正确的文本。
根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;训练设备可以获取所述语音数据以及第一文本,并基于第一语音识别模型对所述语音数据进行处理,得到第二文本,根据初始噪声生成模型对所述第一文本进行处理,得到输出文本,根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训 练后的文本处理模型。
由于本申请实施例中的噪声生成模型是基于正确的文本以及第一语音识别模型的识别结果进行训练得到的,相比于基于词替换的带噪文本生成方法,使用噪声生成模型生成的加噪声的文本更能反映真实的噪声生成模型的错误。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
当目标文本和加噪声的文本之间的差异过大时,可能是由于噪声生成模型本身的性能导致的,在这种特殊情况下,加噪声的文本并不能反映真实的噪声生成模型的错误。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述根据噪声生成模型,对所述目标文本进行处理,包括:根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本;例如,可以选择置信度最高的加噪声的文本,或者置信度前几的加噪声的文本。所述至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,包括:至少以所述一个或多个加噪声的文本作为训练数据,对文本处理模型进行训练。
在一种可选的实现中,所述方法还包括:获取待识别语音;根据第二语音识别模型对所述待识别语音进行处理,得到识别文本;根据所述训练后的文本处理模型,对所述识别文本进行处理,得到处理结果。
其中,第一语音识别模型和第二语音识别模型可以是同一个语音识别模型,也可以是不同的语音识别模型。噪声生成模型可以学习到第一语音识别模型的性能,在面对同样的输入文本时,可以输出和第一语音识别模型相似的输出文本,相应的,训练后的文本处理模型可以对第一语音识别模型的输出具有更强的鲁棒性,若第一语音识别模型和第二语音识别模型是同一个语音识别模型,此时,文本处理模型对第二语音模型的输出的数据处理效果相比第一语音识别模型和第二语音识别模型不是同一个语音识别模型时,效果会更好。
在一种可选的实现中,所述噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
第二方面,本申请提供了一种模型训练方法,所述方法包括:获取语音数据以及第一文本,所述第一文本为所述语音数据对应的正确文本;基于第一语音识别模型对所述语音数据进行处理,得到第二文本;以所述第一文本以及所述第二文本作为训练数据,对初始 噪声生成模型进行训练,得到噪声生成模型。
在一种可选的实现中,所述以所述第一文本以及所述第二文本作为训练数据,对所述初始噪声生成模型进行训练,包括:
根据所述初始噪声生成模型对所述第一文本进行处理,得到输出文本;
根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
在一种可选的实现中,所述噪声生成模型以及所述初始噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
第三方面,本申请提供了一种文本数据处理方法,包括:
获取待识别语音;
根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
根据训练后的文本处理模型,对所述识别文本进行处理,得到处理结果;其中,在训练所述文本处理模型的过程中,所述文本处理模型的训练数据至少包括加噪声的文本,所述加噪声的文本为根据噪声生成模型,对目标文本进行处理得到的;在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
第四方面,本申请提供了一种文本数据处理装置,包括:
获取模块,用于获取目标文本;
文本加噪模块,用于根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;
训练模块,用于至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范 围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
在一种可选的实现中,所述文本加噪模块,用于根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本;所述训练模块,用于至少以所述一个或多个加噪声的文本作为训练数据,对文本处理模型进行训练。
在一种可选的实现中,所述获取模块,用于获取待识别语音;
语音识别模块,用于根据第二语音识别模型对所述待识别语音进行处理,得到识别文本;
文本处理模块,用于根据所述训练后的文本处理模型,对所述识别文本进行处理,得到处理结果。
在一种可选的实现中,所述获取模块,用于获取所述语音数据以及所述第一文本;
所述语音识别模块,用于基于所述第一语音识别模型对所述语音数据进行处理,得到所述第二文本;根据初始噪声生成模型对所述第一文本进行处理,得到输出文本;
所述训练模块,用于根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
在一种可选的实现中,所述噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
第五方面,本申请提供了一种模型训练装置,所述装置包括:
获取模块,用于获取语音数据以及第一文本,所述第一文本为所述语音数据对应的正确文本;
语音识别模块,用于基于第一语音识别模型对所述语音数据进行处理,得到第二文本;
训练模块,用于以所述第一文本以及所述第二文本作为训练数据,对初始噪声生成模型进行训练,得到噪声生成模型。
在一种可选的实现中,所述训练模块,用于根据所述初始噪声生成模型对所述第一文本进行处理,得到输出文本;
根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
在一种可选的实现中,所述噪声生成模型以及所述初始噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
第六方面,本申请提供了一种文本数据处理装置,包括:
获取模块,用于获取待识别语音;
语音识别模块,用于根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
文本处理模块,用于根据训练后的文本处理模型,对所述识别文本进行处理,得到处理结果;其中,在训练所述文本处理模型的过程中,所述文本处理模型的训练数据至少包括加噪声的文本,所述加噪声的文本为根据噪声生成模型,对目标文本进行处理得到的;在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
第七方面,本申请提供了一种文本数据处理方法,包括:
获取待识别语音;
根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
根据文本纠错模型,对所述识别文本进行处理,得到去噪声的文本;其中,在训练所述文本纠错模型的过程中,所述文本纠错模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;
根据文本处理模型,对所述去噪声的文本进行处理,得到处理结果。
在一种可选的实现中,在所述文本纠错模型的输入包括所述第二文本的情况下,所述文本纠错模型的输出包括输出文本,且所述输出文本与所述第一文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
第八方面,本申请提供了一种文本数据处理装置,包括:
获取模块,用于获取待识别语音;
语音识别模块,用于根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
文本纠错模块,用于根据文本纠错模型,对所述识别文本进行处理,得到去噪声的文本;其中,在训练所述文本纠错模型的过程中,所述文本纠错模型的训练数据至少包括第 一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;
文本处理模块,用于根据文本处理模型,对所述去噪声的文本进行处理,得到处理结果。
在一种可选的实现中,在所述文本纠错模型的输入包括所述第二文本的情况下,所述文本纠错模型的输出包括输出文本,且所述输出文本与所述第一文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
第九方面,本申请提供了一种文本数据处理装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第一方面所述的方法。对于处理器执行第一方面的各个可能实现方式中的步骤,具体均可以参阅第一方面,此处不再赘述。
第十方面,本申请提供了一种模型训练装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第一方面所述的方法。对于处理器执行第二方面的各个可能实现方式中的步骤,具体均可以参阅第二方面,此处不再赘述。
第十一方面,本申请提供了一种文本数据处理装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第三方面所述的方法。对于处理器执行第三方面的各个可能实现方式中的步骤,具体均可以参阅第三方面,此处不再赘述。
第十二方面,本申请提供了一种文本数据处理装置,可以包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时实现上述第七方面所述的方法。对于处理器执行第七方面的各个可能实现方式中的步骤,具体均可以参阅第七方面,此处不再赘述。
第十三方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
第十四方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第二方面所述的方法。
第十五方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第三方面所述的方法。
第十六方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第七方面所述的方法。
第十七方面,本申请提供了一种电路***,所述电路***包括处理电路,所述处理电路配置为执行上述第一方面所述的方法。
第十八方面,本申请提供了一种电路***,所述电路***包括处理电路,所述处理电路配置为执行上述第二方面所述的方法。
第十九方面,本申请提供了一种电路***,所述电路***包括处理电路,所述处理电 路配置为执行上述第三方面所述的方法。
第二十方面,本申请提供了一种电路***,所述电路***包括处理电路,所述处理电路配置为执行上述第七方面所述的方法。
第二十一方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
第二十二方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第二方面所述的方法。
第二十三方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第三方面所述的方法。
第二十四方面,本申请提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第七方面所述的方法。
第二十五方面,本申请提供了一种芯片***,该芯片***包括处理器,用于支持服务器或门限值获取装置实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片***还包括存储器,所述存储器,用于保存服务器或通信设备必要的程序指令和数据。该芯片***,可以由芯片构成,也可以包括芯片和其他分立器件。
附图说明
图1为人工智能主体框架的一种结构示意图;
图2a为一种自然语言处理***;
图2b为另一种自然语言处理***;
图2c为本申请实施例提供的自然语言处理的相关设备的示意图;
图3为本申请实施例提供的一种***100架构的示意图;
图4a为本申请实施例提供的一种文本数据处理方法;
图4b为本申请实施例提供的一种文本数据处理方法;
图5a为本申请实施例提供的一种文本数据处理方法的流程示意;
图5b为本申请实施例提供的一种文本数据处理方法的架构示意;
图6为本申请实施例提供的一种模型训练方法的流程示意;
图7为本申请实施例提供的一种文本处理装置700的示意;
图8为本申请实施例提供的一种文本处理装置800的示意;
图9为本申请实施例提供的一种模型训练装置900的示意;
图10为本申请实施例提供的执行设备的一种结构示意图;
图11为本申请实施例提供的训练设备一种结构示意图;
图12为本申请实施例提供的芯片的一种结构示意图。
具体实施方式
下面结合本发明实施例中的附图对本发明实施例进行描述。本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、***、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
首先对人工智能***总体工作流程进行描述,请参见图1,图1示出的为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到***的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施
基础设施为人工智能***提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算***中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有***的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能***中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用***,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能***在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能交通、智能医疗、自动驾驶、平安城市等。
接下来介绍几种本申请的应用场景。
图2a示出了一种自然语言处理***,该自然语言处理***包括用户设备以及数据处理设备。其中,用户设备包括手机、个人电脑或者信息处理中心等智能终端。用户设备为自然语言数据处理的发起端,作为语言问答或者查询等请求的发起方,通常用户通过用户设备发起请求。
上述数据处理设备可以是云服务器、网络服务器、应用服务器以及管理服务器等具有数据处理功能的设备或服务器。数据处理设备通过交互接口接收来自智能终端的查询语句/语音/文本等问句,再通过存储数据的存储器以及数据处理的处理器环节进行机器学习,深度学习,搜索,推理,决策等方式的语言数据处理。数据处理设备中的存储器可以是一个统称,包括本地存储以及存储历史数据的数据库,数据库可以在数据处理设备上,也可以在其它网络服务器上。
在图2a所示的自然语言处理***中,用户设备可以接收用户的指令,例如用户设备可以接收用户输入的一段文本,然后向数据处理设备发起请求,使得数据处理设备针对用户设备得到的该一段文本执行自然语言处理应用(例如文本分类、文本推理、命名实体识别、翻译等),从而得到针对该一段文本的对应的自然语言处理应用的处理结果(例如处理结果、推理结果、命名实体识别结果、翻译结果等)。示例性的,用户设备可以接收用户输入的一段中文,然后向数据处理设备发起请求,使得数据处理设备对该一段中文进行实体分类,从而得到针对该一段中文的实体处理结果;示例性的,用户设备可以接收用户输入的一段中文,然后向数据处理设备发起请求,使得数据处理设备将该一段中文翻译成英文,从而得到针对该一段中文的英文译文。
在图2a中,数据处理设备可以执行本申请实施例的文本数据处理方法。
图2b示出了另一种自然语言处理***,在图2b中,用户设备直接作为数据处理设备,该用户设备能够直接接收来自用户的输入并直接由用户设备本身的硬件进行处理,具体过程与图2a相似,可参考上面的描述,在此不再赘述。
在图2b所示的自然语言处理***中,用户设备可以接收用户的指令,例如用户设备可以接收用户发出的语音,然后生成语音对应的一段文本,然后再由用户设备自身针对该一段文本执行自然语言处理应用(例如文本分类、文本推理、命名实体识别、翻译等),从而得到针对该一段文本的对应的自然语言处理应用的处理结果(例如处理结果、推理结果、命名实体识别结果、翻译结果等)。
在图2b中,用户设备自身就可以执行本申请实施例的文本数据处理方法。
图2c是本申请实施例提供的自然语言处理的相关设备的示意图。
上述图2a和图2b中的用户设备具体可以是图2c中的本地设备301或者本地设备302,图2a中的数据处理设备具体可以是图2c中的执行设备210,其中,数据存储***250可以存储执行设备210的待处理数据,数据存储***250可以集成在执行设备210上,也可以设置在云 上或其它网络服务器上。
图2a和图2b中的处理器可以通过神经网络模型或者其它模型(例如,基于支持向量机的模型)进行数据训练/机器学习/深度学习,并利用数据最终训练或者学习得到的模型针对文本序列执行自然语言处理应用(例如文本分类、序列标注、阅读理解、文本生成、文本推理、翻译等),从而得到相应的处理结果。
图3是本申请实施例提供的一种***100架构的示意图,在图3中,执行设备110配置输入/输出(input/output,I/O)接口112,用于与外部设备进行数据交互,用户可以通过客户设备140向I/O接口112输入数据,所述输入数据在本申请实施例中可以包括:各个待调度任务、可调用资源以及其他参数。
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理(比如进行本申请中神经网络的功能实现)过程中,执行设备110可以调用数据存储***150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储***150中。
最后,I/O接口112将处理结果返回给客户设备140,从而提供给用户。
值得说明的是,训练设备120可以针对不同的目标或称不同的任务,基于不同的训练数据生成相应的目标模型/规则,该相应的目标模型/规则即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。其中,训练数据可以存储在数据库130中,且来自于数据采集设备160采集的训练样本。
在图3中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112提供的界面进行操作。另一种情况下,客户设备140可以自动地向I/O接口112发送输入数据,如果要求客户设备140自动发送输入数据需要获得用户的授权,则用户可以在客户设备140中设置相应权限。用户可以在客户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备140也可以作为数据采集端,采集如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果作为新的样本数据,并存入数据库130。当然,也可以不经过客户设备140进行采集,而是由I/O接口112直接将如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果,作为新的样本数据存入数据库130。
值得注意的是,图3仅是本申请实施例提供的一种***架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图3中,数据存储***150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储***150置于执行设备110中。如图3所示,可以根据训练设备120训练得到神经网络。
本申请实施例还提供的一种芯片,该芯片包括神经网络处理器NPU。该芯片可以被设置在如图3所示的执行设备110中,用以完成计算模块111的计算工作。该芯片也可以被设置在如图3所示的训练设备120中,用以完成训练设备120的训练工作并输出目标模型/规则。
神经网络处理器NPU,NPU作为协处理器挂载到主中央处理器(central processing unit,CPU)(host CPU)上,由主CPU分配任务。NPU的核心部分为运算电路,控制器控制运算电 路提取存储器(权重存储器或输入存储器)中的数据并进行运算。
在一些实现中,运算电路内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路是二维脉动阵列。运算电路还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)中。
向量计算单元可以对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。例如,向量计算单元可以用于神经网络中非卷积/非FC层的网络计算,如池化(pooling),批归一化(batch normalization),局部响应归一化(local response normalization)等。
在一些实现种,向量计算单元能将经处理的输出的向量存储到统一缓存器。例如,向量计算单元可以将非线性函数应用到运算电路的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元生成归一化的值、合并值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路的激活输入,例如用于在神经网络中的后续层中的使用。
统一存储器用于存放输入数据以及输出数据。
权重数据直接通过存储单元访问控制器(direct memory access controller,DMAC)将外部存储器中的输入数据搬运到输入存储器和/或统一存储器、将外部存储器中的权重数据存入权重存储器,以及将统一存储器中的数据存入外部存储器。
总线接口单元(bus interface unit,BIU),用于通过总线实现主CPU、DMAC和取指存储器之间进行交互。
与控制器连接的取指存储器(instruction fetch buffer),用于存储控制器使用的指令;
控制器,用于调用指存储器中缓存的指令,实现控制该运算加速器的工作过程。
一般地,统一存储器,输入存储器,权重存储器以及取指存储器均为片上(On-Chip)存储器,外部存储器为该NPU外部的存储器,该外部存储器可以为双倍数据率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM)、高带宽存储器(high bandwidth memory,HBM)或其他可读可写的存储器。
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。
(1)神经网络
神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:
Figure PCTCN2021104902-appb-000001
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神 经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
神经网络中的每一层的工作可以用数学表达式
Figure PCTCN2021104902-appb-000002
来描述:从物理层面神经网络中的每一层的工作可以理解为通过五种对输入空间(输入向量的集合)的操作,完成输入空间到输出空间的变换(即矩阵的行空间到列空间),这五种操作包括:1、升维/降维;2、放大/缩小;3、旋转;4、平移;5、“弯曲”。其中1、2、3的操作由
Figure PCTCN2021104902-appb-000003
完成,4的操作由+b完成,5的操作则由a()来实现。这里之所以用“空间”二字来表述是因为被分类的对象并不是单个事物,而是一类事物,空间是指这类事物所有个体的集合。其中,W是权重向量,该向量中的每一个值表示该层神经网络中的一个神经元的权重值。该向量W决定着上文所述的输入空间到输出空间的空间变换,即每一层的权重W控制着如何变换空间。训练神经网络的目的,也就是最终得到训练好的神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。因此,神经网络的训练过程本质上就是学习控制空间变换的方式,更具体的就是学习权重矩阵。
因为希望神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到神经网络能够预测出真正想要的目标值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么神经网络的训练就变成了尽可能缩小这个loss的过程。
(2)反向传播算法
神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的神经网络模型中参数的大小,使得神经网络模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的神经网络模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的神经网络模型的参数,例如权重矩阵。
(3)自然语言处理(natural language processing,NLP)
自然语言(natural language)即人类语言,自然语言处理(NLP)就是对人类语言的处理。自然语言处理是以一种智能与高效的方式,对文本数据进行***化分析、理解与信息提取的过程。通过使用NLP及其组件,我们可以管理非常大块的文本数据,或者执行大量的自动化任务,并且解决各式各样的问题,如自动摘要(automatic summarization),机器翻译(m achine translation,MT),命名实体识别(named entity recognition,NER),关系提取(relatio n extraction,RE),信息抽取(information extraction,IE),情感分析,语音识别(speech rec  ognition),问答***(question answering)以及主题分割等等。
示例性的,自然语言处理任务可以有以下几类。
序列标注:句子中每一个单词要求模型根据上下文给出一个分类类别。如中文分词、词性标注、命名实体识别、语义角色标注。
分类任务:整个句子输出一个分类值,如文本分类。
句子关系推断:给定两个句子,判断这两个句子是否具备某种名义关系。例如entilme nt、QA、语义改写、自然语言推断。
生成式任务:输出一段文本,生成另一段文本。如机器翻译、文本摘要、写诗造句、看图说话。
下面示例性的列举一些自然语言处理案例。
分词(word segmentation或word breaker,WB):将连续的自然语言数据,切分成具有语义合理性和完整性的词汇序列,可以解决交叉歧义问题。例句:致毕业和尚未毕业的同学;分词1:致毕业和尚未毕业的同学;分词2:致毕业和尚未毕业的同学。
命名实体识别(named entity recognition,NER):识别自然语言数据中具有特定意义的实体(人、地、机构、时间、作品等),可以从粒度整合未登录体词。例句:天使爱美丽在线观看;分词:天使爱美丽在线观看;实体:天使爱美丽->电影。
词性标注(part-speech tagging):为自然语言数据中的每个词汇赋予一个词性(名词、动词、形容词等);依存句法分析(dependency parsing):自动分析句子中的句法成分(主语、谓语、宾语、定语、状语和补语等成分),可以解决结构歧义问题。评论:房间里还可以欣赏日出;歧义1:房间还可以;歧义2:可以欣赏日出;词性:房间里(主语),还可以(谓语),欣赏日出(动宾短语)。
词向量与语义相似度(word embedding&semantic similarity):对词汇进行向量化表示,并据此实现词汇的语义相似度计算,可以解决词汇语言相似度。例如:西瓜与(呆瓜/草莓),哪个更接近?向量化表示:西瓜(0.1222,0.22333,..);相似度计算:呆瓜(0.115)草莓(0.325);向量化表示:(-0.333,0.1223..)(0.333,0.3333,..)。
文本语义相似度(text semantic similarity):依托全网海量数据和深度神经网络技术,实现文本间的语义相似度计算的能力,可以解决文本语义相似度问题。例如:车头如何防止车牌与(前牌照怎么装/如何办理北京牌照),哪个更接近?向量化表示:车头如何防止车牌(0.1222,0.22333,..);相似度计算:前牌照怎么装(0.762),如何办理北京牌照(0.486),向量化表示:(-0.333,0.1223..)(0.333,0.3333,..)。
(4)语言模型(language model,LM)
语言模型是NPL中的基础模型,通过大量语料训练学习,使得LM能够根据已有的信息(例如上下文中已经出现过的词等文本信息)来推测未知词的概率,也可以理解为LM是用来计算一个句子的概率的概率模型。换句话说,语言模型是自然语言数据序列的概率分布,表征特定长度特定序列文本存在的可能性。简而言之,语言模型即是根据上下文去预测下一个词是什么,由于不需要人工标注语料,因此语言模型能够从无限制的大规模语料中学习到丰富的语义知识。
(5)大规模预训练语言模型(large scale pretrained language model)
大规模预训练语言模型,也可称为大规模语言预训练模型,一般是指使用大规模的语料(例如句子,段落等语言训练素材),设计语言模型训练任务,训练大规模的神经网络算法结构来学习实现,最终得到的大规模神经网络算法结构就是大规模预训练语言模型,后续有其它任务可以在该模型的基础上进行特征抽取或者任务微调来实现特定任务目的。预训练的思想就是先对一个任务进行训练得到一套模型参数,然后利用该套模型参数对网络模型参数进行初始化,再利用经初始化的网络模型对其他任务进行训练,得到其他任务适配的模型。通过在大规模的语料上进行预训练,神经语言表示模型可以学习到强大语言表示能力,能够从文本中抽取出丰富的句法、语义信息。大规模预训练语言模型可以提供包含丰富语义信息的token以及句子级的特征供下游任务使用,或者直接在预训练模型上进行针对下游任务的微调(fine-tune),方便快捷地得到下游专属模型。
下面从神经网络的训练侧和神经网络的应用侧对本申请提供的方法进行描述。
本申请实施例提供的神经网络的训练方法,涉及自然语言数据的处理,具体可以应用于数据训练、机器学习、深度学习等数据处理方法,对训练数据(如本申请中的加噪声的文本)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的文本处理模型;并且,本申请实施例提供的文本数据处理方法可以运用上述训练好的文本处理模型,将输入数据(如本申请中目标文本以及加噪声的文本)输入到所述训练好的文本处理模型中,得到输出数据(如本申请中文本处理模型的处理结果)。需要说明的是,本申请实施例提供的文本处理模型的训练方法和文本处理方法是基于同一个构思产生的发明,也可以理解为一个***中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。
参见图4a,图4a为本申请实施例提供的一种文本数据处理方法,如图4a中示出的那样,本实施例提供的文本数据处理方法包括:
401、获取目标文本。
本申请实施例中,训练设备可以获取目标文本;其中,目标文本可以是语音数据中所表达的文本,其中,语音数据可以使用公开的语音识别数据集或者通过人工采集的方式获取。该目标文本可以是语音数据所表达的正确的文本。
402、根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本。
本申请实施例中,训练设备在获取到目标文本之后,可以根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;接下来描述如何训练噪声生成模型:
本申请实施例中,训练设备可以获取所述语音数据以及第一文本,并基于第一语音识别模型对所述语音数据进行处理,得到第二文本,根据初始噪声生成模型对所述第一文本进行处理,得到输出文本,根据所述输出文本和所述第二文本,获取损失,并基于所述损 失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
具体的,基于第一语音识别模型对所述语音数据进行处理可以得到识别结果,由于语音识别模型得到识别结果并不一定是准确的。例如,“where are you going?”这句话经过第一语音识别模型处理得到的识别结果可以为“What are you going?”。
当识别结果不准确时,识别结果为和第一文本(正确结果)不同的第二文本,本实施例中,训练设备可以将基于第一语音识别模型对所述语音数据进行处理得到的结果(第二文本)与标准句子(第一文本)组成句子对,利用标准-噪声句子对,训练噪声生成模型。
可选的,本实施例中的噪声生成模型可以是文本生成模型,也可以是文本编辑模型。其中,文本生成模型可以为双向(long short-term memory,LSTM)、GPT(generative pre-training)模型等。文本编辑模型可以为Google的LaserTagger模型等。
其中,文本生成模型的输入为目标文本的各个分词的序列,输出为加噪声的文本的各个分词的序列;文本编辑模型的输入为目标文本的各个分词的序列,输出为对输入文本的修改方式,基于修改方式可以将输入文本修改为加噪声的文本。
对于训练好的模型,输入正确的文本,可以生成带有可能的语音识别错误的句子。比如:输入“The priest tied the knot.”,模型可以生成“The priest told the knot.”、“The priest tied the night.”等,这些句子发音跟原始句子都比较接近,属于语音识别***可能发生的错误。
本申请实施例中,可以根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本。例如,可以选择置信度最高的加噪声的文本,或者置信度前几的加噪声的文本。
本申请实施例中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。具体的,所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内;和/或,所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
可选的,本申请实施例中,可以将得到的加噪声的文本与目标文本对比,按照发音序列的编辑率筛选出对抗样本。这个步骤主要是为了滤除包含过多噪声的样本,这些样本会对下游的文本处理模型产生比较大的负面影响。发音序列可以通过语言学词典获取,比如,中文可以用拼音表示,英文可以用音标表示。以英文为例,“The priest tied the knot.”的发音序列为:['DH','AH0','P','R','IY1','S','T','T','AY1','D','DH','AH0','N','AA1','T']。编辑距离指两个字串之间,由一个转成另一个所需的最少编辑操作次数。允许的编辑操作包括将一个字符替换成另一个字符,***一个字符,删除一个字符。编辑率是编辑距离除以目标文本的长度,目标文本的长度可以用目标文本的单词数表示,本实施例可以用编辑率衡量噪声生成模型生成的噪声句子相比原始句子的噪声程度,通过设置阈值,过滤掉平均编辑率大于阈值的加噪声的文本。
比如:原始句子为“The priest tied the knot.”,发音序列为:['DH','AH0','P','R','IY1','S','T','T','AY1','D','DH','AH0','N','AA1','T']。生成的加噪声的文本包括:
“The priest told the knot.”,发音序列为:['DH','AH0','P','R','IY1','S','T','T','UW1','Y', 'UW1','Y','UW1']。编辑率为0.4。
“The priest to you,you.”,发音序列为:['DH','AH0','P','R','IY1','S','T','T','UW1','Y','UW1','Y','UW1’]。编辑率为1.4。若设置阈值为1.0可过滤第二个加噪声的文本。
示例性的,在一种具体的实现中,参照图4b,可以收集公开的语音识别数据集,如Common voice,用现有的自动语音识别(Automatic Speech Recognition,ASR)***对其中的语音数据进行语音识别,获取语音识别结果。过滤出识别错误的样本(第二文本)。如:语音数据对应的正确文本(第一文本)为“The valet left the room.”,ASR识别结果(第二文本)为“The valley left the room.”。之后可将第一文本-第二文本组织成如下的形式:ORI[SEP]ASR[EOS],并对GPT-2 small模型进行微调fine-tune,得到噪声生成模型。利用得到的噪声生成模型生成多个候选句子,计算与原句子的发音编辑率,保留小于等于1.0的候选句子。并将得到的句子与原句对应的目标语言句子组成新的训练样本。对于训练得到的噪声生成模型,输入目标文本(例如The priest tied the knot.),可以得到多个加噪声的文本(The priest tied the knot.、The priest down the knot.、The priest to you,you.、The priest tied the knight.、The priest tied the knot dot.),可以将和目标文本差距过大的文本剔除(例如剔除The priest to you,you.、The priest tied the knot dot.),进而得到多个过滤后的加噪声的文本。
403、至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
本申请实施例中,可以以所述加噪声的文本与下游任务训练样本(正确的文本)一起训练文本处理模型。可选的,可以选择将干净样本(正确的文本)和加噪声的文本混合后一起从头训练文本处理模型,也可以先用干净样本(正确的文本)训练文本处理模型到收敛,然后在干净样本和对抗样本的合集上微调文本处理模型。
本申请实施例中,在得到训练后的文本处理模型之后,可以获取待识别语音,根据所述第二语音识别模型对所述待识别语音进行处理,得到识别文本,根据所述训练后的文本处理模型,对所述识别文本进行处理,得到处理结果。
本申请实施例中,所述训练后的文本处理模型可以用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
应理解,步骤401、402以及403的执行主体可以为终端设备,也可以为云侧的服务器,步骤401、402以及403也可以通过终端设备和服务器进行数据处理以及之间的交互得到。
可选的,终端设备可以获取目标文本;并将目标文本发送至服务器,服务器根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,终端设备可以获取目标文本;并根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的 训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;终端设备可以将加噪声的文本发送至服务器,服务器可以至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,终端设备可以获取目标文本;根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,服务器可以获取目标文本;并将目标文本发送至终端设备,终端设备根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;终端设备可以将加噪声的文本发送至服务器,服务器可以至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,服务器可以获取目标文本;并将目标文本发送至终端设备,终端设备噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,服务器可以获取目标文本;根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;服务器可以将加噪声的文本发送至终端设备,终端设备可以至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
可选的,服务器可以获取目标文本;根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
以文本处理模型用于进行文本翻译为例,本实施例在两个数据集上进行了评价,分别是STW会议数据集和MSLT v1.1公开数据集。评价指标为BLEU(BilingualEvaluationUnderstudy)值。
分别训练了2个不同规模的文本处理模型,实验结果为如下表所示:
Figure PCTCN2021104902-appb-000004
对比实验结果,可以看到本实施例在多个数据集上均有显著提升。
本申请实施例提供了一种文本数据处理方法,包括:获取目标文本;根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。本申请实施例中的噪声生成模型由于是基于第一语音识别模型的识别结果进行训练得到的,相比于基于规则和词替换的带噪样本生成方法,使用噪声生成模型生成的带噪样本更能反映真实的噪声生成模型的错误。
参照图5a,图5a为本申请实施例提供的一种文本数据处理方法的流程示意,如图5a中示出的那样,本申请实施例提供的文本处理方法包括:
501、获取待识别语音。
本申请实施例中,可以获取待识别语音,其中,待识别语音可以为音频传感器采集用户的语音得到的,或者是用户上传的语音数据。
502、根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本。
具体的,基于第二语音识别模型对所述语音数据进行处理可以得到识别结果,由于第二语音识别模型得到识别结果并不一定是准确的。例如,“where are you going?”这句话经过语音识别模型处理得到的识别结果可以为“What are you going?”。
503、根据训练后的文本处理模型,对所述识别文本进行处理,得到处理结果;其中,在训练所述文本处理模型的过程中,所述文本处理模型的训练数据至少包括加噪声的文本,所述加噪声的文本为根据噪声生成模型,对目标文本进行处理得到的;在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过所述第一语音识别模型对所述语音数据进行语音识别得到的文本。
本申请实施例中,所述训练后的文本处理模型可以用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
步骤503中训练后的文本处理模型可以参照图4a对应的实施例中步骤403的描述,这里 不再赘述。在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种实现中,本申请实施例还提供了一种文本数据处理方法,包括:获取待识别语音,根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本。上述步骤的具体描述可以参照步骤501和步骤502的描述,这里不再赘述。
本申请实施例中,可以根据文本纠错模型,对所述识别文本进行处理,得到去噪声的文本;其中,在训练所述文本纠错模型的过程中,所述文本纠错模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过所述第一语音识别模型对所述语音数据进行语音识别得到的文本;在一种可选的实现中,在所述文本纠错模型的输入包括所述第二文本的情况下,所述文本纠错模型的输出包括输出文本,且所述输出文本与所述第一文本之间的差异在预设范围内。所述第一文本和所述第二文本为不同的文本。
本申请实施例中,可以根据文本处理模型,对所述去噪声的文本进行处理,得到处理结果。
参见图5b,图5b为本申请实施例提供的一种文本数据处理方法的架构示意,如图5b中示出的那样,可以从ASR语料中获取语音数据以及对应的正确文本(第一文本),并基于ASR对获取到的语音数据进行处理,以得到第二文本,并将第一文本和第二文本构成clean-noisy pairs,基于clean-noisy pairs训练噪声生成模型,并获取下游任务训练集(即训练文本处理模型的训练数据集),基于噪声生成模型对训练数据集进行数据增强(即进行加噪声处理),得到加噪声的带噪样本,之后从带噪样本中选择和未进行加噪处理的样本之间的差异小于预设值的样本,将选择的带噪样本作为对抗样本和下游任务训练集一起训练下游任务模型(即文本处理模型),得到训练后的文本处理模型。
如图5b中所示,还可以获取ASR的输出(第二文本),并通过纠错模型对第二文本进行纠错处理,以得到去噪声的文本,并通过下游任务模型(即文本处理模型)对去噪声的文本进行处理,以得到处理结果。
参照图6,图6为本申请实施例提供的一种模型训练方法的流程示意,如图6中示出的那样,本申请实施例提供的模型训练方法包括:
601、获取语音数据以及第一文本,所述第一文本为所述语音数据对应的正确文本;
602、基于第一语音识别模型对所述语音数据进行处理,得到第二文本;
603、以所述第一文本以及所述第二文本作为训练数据,对初始噪声生成模型进行训练,得到噪声生成模型。
具体的,基于第一语音识别模型对所述语音数据进行处理可以得到识别结果,由于语音识别模型得到识别结果并不一定是准确的。例如,“where are you going?”这句话经过语音识别模型处理得到的识别结果可以为“What are you going?”。
当识别结果不准确时,识别结果为和第一文本(正确结果)不同的第二文本,本实施例中,训练设备可以将基于第一语音识别模型对所述语音数据进行处理得到的结果(第二文本)与标准句子(第一文本)组成句子对,利用标准-噪声句子对,训练噪声生成模型。
可选的,本实施例中的噪声生成模型可以是文本生成模型,也可以是文本编辑模型。其中,文本生成模型可以为双向(long short-term memory,LSTM)、GPT(generative pre-training)模型等。文本编辑模型可以为Google的LaserTagger模型等。
其中,文本生成模型的输入为目标文本的各个分词的序列,输出为加噪声的文本的各个分词的序列;文本编辑模型的输入为目标文本的各个分词的序列,输出为对输入文本的修改方式,基于修改方式可以将输入文本修改为加噪声的文本。
对于训练好的模型,输入正确的文本,可以生成带有可能的语音识别错误的句子。比如:输入“The priest tied the knot.”,模型可以生成“The priest told the knot.”、“The priest tied the night.”等,这些句子发音跟原始句子都比较接近,属于语音识别***可能发生的错误。
本申请实施例中,可以根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本。例如,可以选择置信度最高的加噪声的文本,或者置信度前几的加噪声的文本。
接下来从装置的角度对本申请实施例提供的文本处理装置进行描述,参照图7,图7为本申请实施例提供的一种文本处理装置700的示意,如图7中示出的那样,本申请实施例提供的一种文本处理装置700,包括:
获取模块701,用于获取目标文本;
文本加噪模块702,用于根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;
训练模块703,用于至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
在一种可选的实现中,所述文本加噪模块,用于根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本;所述训练模块,用于至少以所述一个或多个加噪声的文本作为训练数据,对文本处理模型进行训练。
在一种可选的实现中,所述获取模块,用于获取待识别语音;
语音识别模块,用于根据第二语音识别模型对所述待识别语音进行处理,得到识别文本;
文本处理模块,用于根据所述训练后的文本处理模型,对所述识别文本进行处理,得到处理结果。
在一种可选的实现中,所述获取模块,用于获取所述语音数据以及所述第一文本;
所述语音识别模块,用于基于所述第一语音识别模型对所述语音数据进行处理,得到所述第二文本;根据初始噪声生成模型对所述第一文本进行处理,得到输出文本;
所述训练模块,用于根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
在一种可选的实现中,所述噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
参照图8,图8为本申请实施例提供的一种文本处理装置800的示意,如图8中示出的那样,本申请实施例提供的一种文本处理装置800,包括:
获取模块801,用于获取待识别语音;
语音识别模块802,用于根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
文本处理模块803,用于根据训练后的文本处理模型,对所述识别文本进行处理,得到处理结果;其中,在训练所述文本处理模型的过程中,所述文本处理模型的训练数据至少包括加噪声的文本,所述加噪声的文本为根据噪声生成模型,对目标文本进行处理得到的;在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过所述第一语音识别模型对所述语音数据进行语音识别得到的文本。
在一种可选的实现中,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
在一种可选的实现中,所述训练后的文本处理模型用于实现如下任务的至少一种:文 本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
在一种可选的实现中,所述第一文本和所述第二文本为不同的文本。
在一种可选的实现中,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
参照图9,图9为本申请实施例提供的一种模型训练装置900的示意,如图9中示出的那样,本申请实施例提供的一种模型训练装置900,包括:
获取模块901,用于获取语音数据以及第一文本,所述第一文本为所述语音数据对应的正确文本;
语音识别模块902,用于基于第一语音识别模型对所述语音数据进行处理,得到第二文本;
训练模块903,用于以所述第一文本以及所述第二文本作为训练数据,对初始噪声生成模型进行训练,得到噪声生成模型。
在一种可选的实现中,所述训练模块903,用于根据所述初始噪声生成模型对所述第一文本进行处理,得到输出文本;
根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
在一种可选的实现中,所述噪声生成模型以及所述初始噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型以及LaserTagger模型。
接下来介绍本申请实施例提供的一种执行设备,请参阅图10,图10为本申请实施例提供的执行设备的一种结构示意图,执行设备1000具体可以表现为手机、平板、笔记本电脑、智能穿戴设备、服务器等,此处不做限定。其中,执行设备1000上可以部署有图10对应实施例中所描述的数据处理装置,用于实现图10对应实施例中数据处理的功能。具体的,执行设备1000包括:接收器1001、发射器1002、处理器1003和存储器1004(其中执行设备1000中的处理器1003的数量可以一个或多个,图10中以一个处理器为例),其中,处理器1003可以包括应用处理器10031和通信处理器10032。在本申请的一些实施例中,接收器1001、发射器1002、处理器1003和存储器1004可通过总线或其它方式连接。
存储器1004可以包括只读存储器和随机存取存储器,并向处理器1003提供指令和数据。存储器1004的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1004存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器1003控制执行设备的操作。具体的应用中,执行设备的各个组件通过总线***耦合在一起,其中总线***除包括数据总线之外,还可以包括电源总线、控制总线和状态 信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线***。
上述本申请实施例揭示的方法可以应用于处理器1003中,或者由处理器1003实现。处理器1003可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1003中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1003可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1003可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1004,处理器1003读取存储器1004中的信息,结合其硬件完成上述方法的步骤。
接收器1001可用于接收输入的数字或字符信息,以及产生与执行设备的相关设置以及功能控制有关的信号输入。发射器1002可用于通过第一接口输出数字或字符信息;发射器1002还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器1002还可以包括显示屏等显示设备。
本申请实施例中,在一种情况下,处理器1003,用于执行图5a对应实施例中的执行设备执行的文本数据处理方法。
本申请实施例还提供了一种训练设备,请参阅图11,图11是本申请实施例提供的训练设备一种结构示意图,具体的,训练设备1100由一个或多个服务器实现,训练设备1100可因配置或性能不同而产生比较大的差异,可以包括一个或一个以***处理器(central processing units,CPU)1111(例如,一个或一个以上处理器)和存储器1132,一个或一个以上存储应用程序1142或数据1144的存储介质1130(例如一个或一个以上海量存储设备)。其中,存储器1132和存储介质1130可以是短暂存储或持久存储。存储在存储介质1130的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备中的一系列指令操作。更进一步地,中央处理器1111可以设置为与存储介质1130通信,在训练设备1100上执行存储介质1130中的一系列指令操作。
训练设备1100还可以包括一个或一个以上电源1126,一个或一个以上有线或无线网络接口1150,一个或一个以上输入输出接口1158;或,一个或一个以上操作***1141,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
具体的,训练设备可以执行图4a以及图6对应的实施例中的步骤。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步 骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。
本申请实施例提供的执行设备、训练设备或终端设备具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使执行设备内的芯片执行上述实施例描述的数据处理方法,或者,以使训练设备内的芯片执行上述实施例描述的数据处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体的,请参阅图12,图12为本申请实施例提供的芯片的一种结构示意图,所述芯片可以表现为神经网络处理器NPU 1200,NPU 1200作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1203,通过控制器1204控制运算电路1203提取存储器中的矩阵数据并进行乘法运算。
在一些实现中,运算电路1203内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路1203是二维脉动阵列。运算电路1203还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1203是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1202中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1201中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1208中。
统一存储器1206用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)1205,DMAC被搬运到权重存储器1202中。输入数据也通过DMAC被搬运到统一存储器1206中。
BIU为Bus Interface Unit即,总线接口单元1210,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)1209的交互。
总线接口单元1210(Bus Interface Unit,简称BIU),用于取指存储器1209从外部存储器获取指令,还用于存储单元访问控制器1205从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1206或将权重数据搬运到权重存储器1202中或将输入数据数据搬运到输入存储器1201中。
向量计算单元1207包括多个运算处理单元,在需要的情况下,对运算电路1203的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对特 征平面进行上采样等。
在一些实现中,向量计算单元1207能将经处理的输出的向量存储到统一存储器1206。例如,向量计算单元1207可以将线性函数;或,非线性函数应用到运算电路1203的输出,例如对卷积层提取的特征平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1207生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1203的激活输入,例如用于在神经网络中的后续层中的使用。
控制器1204连接的取指存储器(instruction fetch buffer)1209,用于存储控制器1204使用的指令;
统一存储器1206,输入存储器1201,权重存储器1202以及取指存储器1209均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向 另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (21)

  1. 一种文本数据处理方法,其特征在于,包括:
    获取目标文本;
    根据噪声生成模型,对所述目标文本进行处理,得到加噪声的文本;其中,在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本;
    至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,得到训练后的文本处理模型。
  2. 根据权利要求1所述的方法,其特征在于,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
  3. 根据权利要求1或2所述的方法,其特征在于,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
  5. 根据权利要求1至4任一所述的方法,其特征在于,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
    所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
  6. 根据权利要求1至5任一所述的方法,其特征在于,所述第一文本和所述第二文本为不同的文本。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述根据噪声生成模型,对所述目标文本进行处理,包括:
    根据噪声生成模型,对所述目标文本进行处理,得到多个加噪声的文本,以及每个加噪声的文本的置信度;根据所述置信度,从所述多个加噪声的文本选择一个或多个加噪声的文本;所述至少以所述加噪声的文本作为训练数据,对文本处理模型进行训练,包括:
    至少以所述一个或多个加噪声的文本作为训练数据,对文本处理模型进行训练。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述方法还包括:
    获取待识别语音;
    根据第二语音识别模型对所述待识别语音进行处理,得到识别文本;
    根据所述训练后的文本处理模型,对所述识别文本进行处理,得到处理结果。
  9. 根据权利要求1至8任一所述的方法,其特征在于,所述方法还包括:
    获取所述语音数据以及所述第一文本;
    基于所述第一语音识别模型对所述语音数据进行处理,得到所述第二文本;
    根据初始噪声生成模型对所述第一文本进行处理,得到输出文本;
    根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
  10. 根据权利要求1至9任一所述的方法,其特征在于,所述噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型或LaserTagger模型。
  11. 一种模型训练方法,其特征在于,所述方法包括:
    获取语音数据以及第一文本,所述第一文本为所述语音数据对应的正确文本;
    基于第一语音识别模型对所述语音数据进行处理,得到第二文本;
    以所述第一文本以及所述第二文本作为训练数据,对初始噪声生成模型进行训练,得到噪声生成模型。
  12. 根据权利要求11所述的方法,其特征在于,所述以所述第一文本以及所述第二文本作为训练数据,对所述初始噪声生成模型进行训练,包括:
    根据所述初始噪声生成模型对所述第一文本进行处理,得到输出文本;
    根据所述输出文本和所述第二文本,获取损失,并基于所述损失,更新所述初始噪声生成模型,直到所述损失满足预设条件,得到所述噪声生成模型。
  13. 根据权利要求11或12所述的方法,其特征在于,所述噪声生成模型以及所述初始噪声生成模型为如下的至少一种:双向长短期记忆网络LSTM、GPT(generative pre-training)模型或LaserTagger模型。
  14. 一种文本数据处理方法,其特征在于,包括:
    获取待识别语音;
    根据第二语音识别模型,对所述待识别语音进行处理,得到识别文本;
    根据训练后的文本处理模型,对所述识别文本进行处理,得到处理结果;其中,在训练所述文本处理模型的过程中,所述文本处理模型的训练数据至少包括加噪声的文本,所述加噪声的文本为根据噪声生成模型,对目标文本进行处理得到的;在训练所述噪声生成模型的过程中,所述噪声生成模型的训练数据至少包括第一文本以及第二文本,所述第一 文本为语音数据对应的正确文本,所述第二文本为通过第一语音识别模型对所述语音数据进行语音识别得到的文本。
  15. 根据权利要求14所述的方法,其特征在于,在所述噪声生成模型的输入包括所述第一文本的情况下,所述噪声生成模型的输出包括输出文本,且所述输出文本与所述第二文本之间的差异在预设范围内。
  16. 根据权利要求14或15所述的方法,其特征在于,所述训练后的文本处理模型用于实现如下任务的至少一种:文本翻译、文本语义识别、文本分类、自动问答、信息推荐以及文本情感识别。
  17. 根据权利要求14至16任一所述的方法,其特征在于,所述目标文本和所述加噪声的文本之间的差异在预设范围内。
  18. 根据权利要求14至17任一所述的方法,其特征在于,所述目标文本和所述加噪声的文本之间的发音差异在预设范围内;和/或,
    所述目标文本包括的字符串和所述加噪声的文本包括的字符串的差异在预设范围内。
  19. 根据权利要求14至18任一所述的方法,其特征在于,所述第一文本和所述第二文本为不同的文本。
  20. 一种文本数据处理装置,其特征在于,所述装置包括存储器和处理器;所述存储器存储有代码,所述处理器被配置为执行所述代码,当所述代码被执行时,所述文本数据处理装置执行如权利要求1至19任一所述的方法。
  21. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一个或多个指令,所述指令在由一个或多个计算机执行时使得所述一个或多个计算机实施权利要求1至19任一所述的方法。
PCT/CN2021/104902 2020-07-10 2021-07-07 一种文本数据处理方法及装置 WO2022007823A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21838387.5A EP4167231A4 (en) 2020-07-10 2021-07-07 TEXT DATA PROCESSING METHOD AND APPARATUS
US18/151,186 US20230162723A1 (en) 2020-07-10 2023-01-06 Text data processing method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010662105.9 2020-07-10
CN202010662105.9A CN111951805A (zh) 2020-07-10 2020-07-10 一种文本数据处理方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/151,186 Continuation US20230162723A1 (en) 2020-07-10 2023-01-06 Text data processing method and apparatus

Publications (1)

Publication Number Publication Date
WO2022007823A1 true WO2022007823A1 (zh) 2022-01-13

Family

ID=73341256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/104902 WO2022007823A1 (zh) 2020-07-10 2021-07-07 一种文本数据处理方法及装置

Country Status (4)

Country Link
US (1) US20230162723A1 (zh)
EP (1) EP4167231A4 (zh)
CN (1) CN111951805A (zh)
WO (1) WO2022007823A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114861635A (zh) * 2022-05-10 2022-08-05 广东外语外贸大学 一种中文拼写纠错方法、装置、设备及存储介质
CN115617943A (zh) * 2022-10-09 2023-01-17 名之梦(上海)科技有限公司 文本清洗方法、装置、设备与计算机可读存储介质
CN115640611A (zh) * 2022-11-25 2023-01-24 荣耀终端有限公司 一种自然语言处理模型的更新方法及相关设备
CN116432665A (zh) * 2023-06-15 2023-07-14 北京中关村科金技术有限公司 对话模型构建方法、文本生成方法、装置、***及设备

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951805A (zh) * 2020-07-10 2020-11-17 华为技术有限公司 一种文本数据处理方法及装置
CN112580495A (zh) * 2020-12-16 2021-03-30 上海眼控科技股份有限公司 文本识别方法、装置、计算机设备和存储介质
CN112967718B (zh) * 2021-04-02 2024-04-12 深圳吉祥星科技股份有限公司 基于声音的投影仪控制方法、装置、设备及存储介质
KR102557810B1 (ko) * 2021-05-11 2023-07-24 고려대학교 산학협력단 학습 데이터 생성 방법 및 이를 이용한 음성 인식 후처리 방법
CN113571041A (zh) * 2021-07-21 2021-10-29 北京淇瑀信息科技有限公司 语音识别文本处理方法、装置和电子设备
CN113590761B (zh) * 2021-08-13 2022-03-25 网易有道信息技术(北京)有限公司 文本处理模型的训练方法、文本处理方法及相关设备
US20230178079A1 (en) * 2021-12-07 2023-06-08 International Business Machines Corporation Adversarial speech-text protection against automated analysis
CN114610158A (zh) * 2022-03-25 2022-06-10 Oppo广东移动通信有限公司 数据处理方法及装置、电子设备、存储介质
CN114841137A (zh) * 2022-04-18 2022-08-02 北京百度网讯科技有限公司 模型获取方法、装置、电子设备及存储介质
CN118095368A (zh) * 2022-11-26 2024-05-28 华为技术有限公司 一种生成模型训练方法、数据转换方法以及装置
CN116384411B (zh) * 2023-06-05 2023-07-25 北京水滴科技集团有限公司 基于外呼机器人的用户意图识别模型的训练方法和装置
CN117313656B (zh) * 2023-09-21 2024-05-07 成都明途科技有限公司 文本生成方法、训练方法、模型、装置、设备及存储介质
CN117370537B (zh) * 2023-12-08 2024-04-19 浙江口碑网络技术有限公司 基于aigc的问答应用开发方法和平台
CN117454893B (zh) * 2023-12-22 2024-03-22 深圳大数信科技术有限公司 基于Python的智能切词方法、***、设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1178465A2 (en) * 2000-07-31 2002-02-06 Matsushita Electric Industrial Co., Ltd. Method for noise adaptation in automatic speech recognition using transformed matrices
JP2018004997A (ja) * 2016-07-04 2018-01-11 日本放送協会 音声合成装置及びプログラム
CN108417205A (zh) * 2018-01-19 2018-08-17 苏州思必驰信息科技有限公司 语义理解训练方法和***
CN109635305A (zh) * 2018-12-17 2019-04-16 北京百度网讯科技有限公司 语音翻译方法及装置、设备及存储介质
CN110931018A (zh) * 2019-12-03 2020-03-27 珠海格力电器股份有限公司 智能语音交互的方法、装置及计算机可读存储介质
CN111160568A (zh) * 2019-12-27 2020-05-15 北京百度网讯科技有限公司 机器阅读理解模型训练方法、装置、电子设备和存储介质
CN111951805A (zh) * 2020-07-10 2020-11-17 华为技术有限公司 一种文本数据处理方法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008515078A (ja) * 2004-09-30 2008-05-08 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ 自動テキスト訂正
WO2013003749A1 (en) * 2011-06-30 2013-01-03 Rosetta Stone, Ltd Statistical machine translation framework for modeling phonological errors in computer assisted pronunciation training system
US9336769B2 (en) * 2011-07-01 2016-05-10 Nec Corporation Relative semantic confidence measure for error detection in ASR
KR20180055189A (ko) * 2016-11-16 2018-05-25 삼성전자주식회사 자연어 처리 방법 및 장치와 자연어 처리 모델을 학습하는 방법 및 장치
CN108694443B (zh) * 2017-04-05 2021-09-17 富士通株式会社 基于神经网络的语言模型训练方法和装置
CN110895691B (zh) * 2018-09-12 2023-06-23 阿里巴巴集团控股有限公司 图像处理方法、装置及电子设备
CN109918627B (zh) * 2019-01-08 2024-03-19 平安科技(深圳)有限公司 文本生成方法、装置、电子设备及存储介质
CN110830489B (zh) * 2019-11-14 2022-09-13 国网江苏省电力有限公司苏州供电分公司 基于内容抽象表示的对抗式欺诈网站检测方法及***

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1178465A2 (en) * 2000-07-31 2002-02-06 Matsushita Electric Industrial Co., Ltd. Method for noise adaptation in automatic speech recognition using transformed matrices
JP2018004997A (ja) * 2016-07-04 2018-01-11 日本放送協会 音声合成装置及びプログラム
CN108417205A (zh) * 2018-01-19 2018-08-17 苏州思必驰信息科技有限公司 语义理解训练方法和***
CN109635305A (zh) * 2018-12-17 2019-04-16 北京百度网讯科技有限公司 语音翻译方法及装置、设备及存储介质
CN110931018A (zh) * 2019-12-03 2020-03-27 珠海格力电器股份有限公司 智能语音交互的方法、装置及计算机可读存储介质
CN111160568A (zh) * 2019-12-27 2020-05-15 北京百度网讯科技有限公司 机器阅读理解模型训练方法、装置、电子设备和存储介质
CN111951805A (zh) * 2020-07-10 2020-11-17 华为技术有限公司 一种文本数据处理方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4167231A4

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114861635A (zh) * 2022-05-10 2022-08-05 广东外语外贸大学 一种中文拼写纠错方法、装置、设备及存储介质
CN115617943A (zh) * 2022-10-09 2023-01-17 名之梦(上海)科技有限公司 文本清洗方法、装置、设备与计算机可读存储介质
CN115617943B (zh) * 2022-10-09 2023-06-30 名之梦(上海)科技有限公司 文本清洗方法、装置、设备与计算机可读存储介质
CN115640611A (zh) * 2022-11-25 2023-01-24 荣耀终端有限公司 一种自然语言处理模型的更新方法及相关设备
CN116432665A (zh) * 2023-06-15 2023-07-14 北京中关村科金技术有限公司 对话模型构建方法、文本生成方法、装置、***及设备
CN116432665B (zh) * 2023-06-15 2023-10-10 北京中关村科金技术有限公司 对话模型构建方法、文本生成方法、装置、***及设备

Also Published As

Publication number Publication date
CN111951805A (zh) 2020-11-17
US20230162723A1 (en) 2023-05-25
EP4167231A4 (en) 2023-11-29
EP4167231A1 (en) 2023-04-19

Similar Documents

Publication Publication Date Title
WO2022007823A1 (zh) 一种文本数据处理方法及装置
WO2021047286A1 (zh) 文本处理模型的训练方法、文本处理方法及装置
WO2020228376A1 (zh) 文本处理方法、模型训练方法和装置
US20230016365A1 (en) Method and apparatus for training text classification model
WO2022057776A1 (zh) 一种模型压缩方法及装置
WO2022068627A1 (zh) 一种数据处理方法及相关设备
CN111368993B (zh) 一种数据处理方法及相关设备
WO2022068314A1 (zh) 神经网络训练的方法、神经网络的压缩方法以及相关设备
WO2022001724A1 (zh) 一种数据处理方法及装置
WO2023160472A1 (zh) 一种模型训练方法及相关设备
WO2022253074A1 (zh) 一种数据处理方法及相关设备
CN113704460B (zh) 一种文本分类方法、装置、电子设备和存储介质
WO2021057884A1 (zh) 语句复述方法、训练语句复述模型的方法及其装置
CN115221846A (zh) 一种数据处理方法及相关设备
US20240152770A1 (en) Neural network search method and related device
CN111145914B (zh) 一种确定肺癌临床病种库文本实体的方法及装置
CN113326383B (zh) 一种短文本实体链接方法、装置、计算设备与存储介质
WO2021129411A1 (zh) 文本处理方法及装置
WO2023116572A1 (zh) 一种词句生成方法及相关设备
CN115795025A (zh) 一种摘要生成方法及其相关设备
CN116109449A (zh) 一种数据处理方法及相关设备
WO2021129410A1 (zh) 文本处理方法及装置
WO2021083312A1 (zh) 训练语句复述模型的方法、语句复述方法及其装置
WO2023143262A1 (zh) 一种数据处理方法及相关设备
CN116842168B (zh) 跨领域问题处理方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21838387

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021838387

Country of ref document: EP

Effective date: 20230116

NENP Non-entry into the national phase

Ref country code: DE