CN107291690B - Punctuation adding method and device and punctuation adding device - Google Patents

Punctuation adding method and device and punctuation adding device Download PDF

Info

Publication number
CN107291690B
CN107291690B CN201710396130.5A CN201710396130A CN107291690B CN 107291690 B CN107291690 B CN 107291690B CN 201710396130 A CN201710396130 A CN 201710396130A CN 107291690 B CN107291690 B CN 107291690B
Authority
CN
China
Prior art keywords
punctuation
text
target
semantic
target text
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710396130.5A
Other languages
Chinese (zh)
Other versions
CN107291690A (en
Inventor
姜里羊
王宇光
陈伟
郑宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development Co Ltd
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 Beijing Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN201710396130.5A priority Critical patent/CN107291690B/en
Publication of CN107291690A publication Critical patent/CN107291690A/en
Application granted granted Critical
Publication of CN107291690B publication Critical patent/CN107291690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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/086Learning methods using evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems

Abstract

The embodiment of the invention provides a punctuation adding method and device and a device for punctuation adding, wherein the method specifically comprises the following steps: acquiring a text to be processed; adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed; and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text. The embodiment of the invention can improve the accuracy of punctuation addition.

Description

Punctuation adding method and device and punctuation adding device
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for adding punctuation, and an apparatus for adding punctuation.
Background
In the information processing technology fields such as the communication field and the internet field, in some application scenarios, punctuations need to be added to some files lacking punctuations, for example, to facilitate reading, to add punctuations to texts corresponding to speech recognition results, and the like.
In the existing scheme, punctuations can be added to texts corresponding to voice recognition results according to the mute intervals of voice signals. Specifically, a threshold of the mute length may be set first, and if the length of the mute interval of the speaking user in the speech signal exceeds the threshold, a punctuation is added to the corresponding position; otherwise, if the length of the mute interval of the speaking user in the speech signal does not exceed the threshold, the punctuation is not added.
However, in the process of implementing the embodiment of the present invention, the inventor finds that different speaking users often have different speech rates, so that adding punctuation to the text corresponding to the speech recognition result according to the silence interval of the speech signal in the existing scheme will affect the accuracy of punctuation addition. For example, if the speech rate of the speaking user is too fast, there will be no interval between sentences, or the interval is so short that it is less than the threshold, then no punctuation will be added to the text.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a punctuation addition method, a punctuation addition device, and a device for punctuation addition that overcome or at least partially solve the above problems, and can improve the accuracy of punctuation addition.
In order to solve the above problems, the invention discloses a punctuation adding method, comprising: acquiring a text to be processed; adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed; and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
Optionally, the adding punctuation to the target text through the neural network model includes: performing word segmentation on the target text to obtain a corresponding second word sequence; obtaining a plurality of candidate punctuation addition results corresponding to the second word sequence; determining a language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model; and selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
Optionally, the adding punctuation to the target text through the neural network model includes: adding punctuations to the target text through a neural network conversion model to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
Optionally, the adding punctuation to the target text through the neural network conversion model includes: encoding the target text to obtain a source end hidden layer state corresponding to the target text; decoding a source end hidden layer state corresponding to the target text according to model parameters of a neural network conversion model to obtain the probability that each word in the target text belongs to a candidate punctuation; and obtaining a second punctuation addition result corresponding to the target text according to the probability that each word in the target text belongs to the candidate punctuation.
Optionally, the adding punctuation to the text to be processed includes: and adding punctuation for the text to be processed through the N-element grammar language model.
Optionally, adding punctuation to the text to be processed through the N-gram language model includes: performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed; adding punctuation between adjacent words in the first word sequence to obtain a global punctuation adding path corresponding to the first word sequence; according to the sequence from front to back, a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path are obtained from the global punctuation adding path in a moving mode; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation; determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model; and obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
Optionally, the determining, in a recursive manner, the target punctuations corresponding to the optimal first semantic segment according to the sequence from front to back includes: determining a language model score corresponding to the current first semantic fragment by using an N-element grammar language model; selecting an optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment; punctuation included in the optimal current first semantic segment is used as a target punctuation corresponding to the optimal current first semantic segment; and obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
On the other hand, the invention discloses a punctuation adding device, comprising:
the text acquisition module is used for acquiring a text to be processed;
the first punctuation adding module is used for adding punctuation for the text to be processed so as to obtain a first punctuation adding result corresponding to the text to be processed; and
and the second punctuation adding module is used for adding punctuation to the target text through a neural network model when the first punctuation adding result comprises the target text of which the word number exceeds the word number threshold and does not contain preset punctuation so as to obtain a second punctuation adding result corresponding to the target text.
Optionally, the second punctuation adding module comprises:
the second word segmentation sub-module is used for segmenting the target text to obtain a corresponding second word sequence;
a candidate result obtaining submodule, configured to obtain multiple candidate punctuation addition results corresponding to the second word sequence;
the second model score determining unit is used for determining the language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model;
and the second selection unit is used for selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
Optionally, the second punctuation adding module comprises:
the model processing submodule is used for adding punctuations to the target text through a neural network conversion model so as to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
Optionally, the model processing sub-module includes:
the encoding unit is used for encoding the target text to obtain a source end hidden layer state corresponding to the target text;
the decoding unit is used for decoding a source end hidden layer state corresponding to the target text according to a model parameter of a neural network conversion model so as to obtain the probability that each vocabulary in the target text belongs to a candidate punctuation;
and the result determining unit is used for obtaining a second punctuation addition result corresponding to the target text according to the probability that each vocabulary in the target text belongs to the candidate punctuation.
Optionally, the first punctuation adding module adds punctuation to the text to be processed through an N-gram language model, and the first punctuation adding module includes:
the first word segmentation sub-module is used for segmenting the text to be processed to obtain a first word sequence corresponding to the text to be processed;
the first adding submodule is used for adding punctuations between adjacent words in the first word sequence so as to obtain a global punctuation adding path corresponding to the first word sequence;
the local information acquisition submodule is used for acquiring a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path from the global punctuation adding path in a moving mode according to the sequence from front to back; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation;
the recursion submodule is used for determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and the result acquisition submodule is used for acquiring a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
Optionally, the recursion submodule comprises:
the first model score determining unit is used for determining a language model score corresponding to the current first semantic fragment by using the N-element grammar language model;
the first selection unit is used for selecting the optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
a target punctuation determination unit, configured to use a punctuation included in the optimal current first semantic segment as a target punctuation corresponding to the optimal current first semantic segment;
and the semantic segment updating module is used for obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
Optionally, the result obtaining sub-module includes:
and the target punctuation adding unit is used for adding punctuation to the first word sequence according to the target punctuation corresponding to each optimal first semantic segment in a sequence from back to front or a sequence from front to back so as to obtain a first punctuation adding result corresponding to the text to be processed.
In yet another aspect, an apparatus for punctuation addition comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured for execution by the one or more processors, the one or more programs comprising instructions for: acquiring a text to be processed; adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed; and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
In yet another aspect, the present disclosure discloses a machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform the foregoing punctuation addition method.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, under the condition that the first punctuation addition result comprises a target text of which the word number exceeds the word number threshold and does not contain preset punctuations, punctuation is added to the target text through a neural network model so as to obtain a second punctuation addition result corresponding to the target text. Because the neural network model can represent a vocabulary through the word vectors and represent the semantic distance between the vocabularies through the distance between the word vectors, the embodiment of the invention can participate a plurality of contexts corresponding to the vocabulary into the training of the neural network model, so that the neural network model has accurate punctuation adding capability; therefore, the method adds the punctuation to the text to be processed through the neural network model, can solve the problem that the punctuation is not added to a long section of text in the first punctuation adding result to a certain extent, and further can improve the accuracy of punctuation addition.
Drawings
FIG. 1 is a schematic diagram of an exemplary architecture of a speech recognition system of the present invention;
FIG. 2 is a flow chart of the steps of an embodiment of a punctuation addition method of the present invention;
FIG. 3 is a diagram illustrating a punctuation addition process for a sequence of words according to an embodiment of the present invention;
FIG. 4 is a block diagram of an embodiment of a punctuation adding device according to the present invention;
FIG. 5 is a block diagram illustrating an apparatus for punctuation addition as a terminal according to an example embodiment; and
fig. 6 is a block diagram illustrating an apparatus for punctuation addition as a server according to an example embodiment.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The embodiment of the invention provides a punctuation adding scheme, which can be used for firstly adding punctuation for a text to be processed so as to obtain a first punctuation adding result corresponding to the text to be processed; and then, under the condition that the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
Aiming at the problem that no punctuation is added to a long text in a first punctuation addition result, the embodiment of the invention can add punctuation to the target text through a neural network model under the condition that the first punctuation addition result comprises the target text of which the word number exceeds a word number threshold and does not contain preset punctuation so as to obtain a second punctuation addition result corresponding to the target text. Because the neural network model can represent a vocabulary through the word vectors and represent the semantic distance between the vocabularies through the distance between the word vectors, the embodiment of the invention can participate a plurality of contexts corresponding to the vocabulary into the training of the neural network model, so that the neural network model has accurate punctuation adding capability; therefore, the method adds the punctuation to the text to be processed through the neural network model, can solve the problem that the punctuation is not added to a long section of text in the first punctuation adding result to a certain extent, and further can improve the accuracy of punctuation addition.
The embodiment of the invention can be applied to any application scenes needing to add punctuations in voice recognition, voice translation and the like, and it can be understood that the embodiment of the invention does not limit the specific application scenes.
The punctuation adding method provided by the embodiment of the invention can be applied to the application environment of devices such as a terminal or a server. Optionally, the terminal may include, but is not limited to: smart phones, tablets, laptop portable computers, in-vehicle computers, desktop computers, smart televisions, wearable devices, and the like. The server can be a cloud server or a common server and is used for providing punctuation addition service for the client.
The punctuation adding method provided by the embodiment of the invention can be suitable for processing Chinese, Japanese, Korean and other languages, and is used for improving the accuracy of punctuation addition. It can be understood that any language in which punctuation needs to be added is within the application scope of the punctuation addition method of the embodiment of the present invention.
Referring to fig. 1, an exemplary structural diagram of a speech recognition system of the present invention is shown, which may specifically include: speech recognition means 101 and punctuation addition means 102. The voice recognition device 101 and the punctuation adding device 102 may be separate devices (including a server or a terminal), and may be commonly disposed in the same device; it is understood that the specific arrangement of the speech recognition device 101 and the punctuation adding device 102 is not limited by the embodiment of the present invention.
The speech recognition apparatus 101 may be configured to convert a speech signal of a speaking user into text information, and specifically, the speech recognition apparatus 101 may output a speech recognition result. In practical applications, a speaking user may speak in a speech translation scene and send a speech signal, and then the speech signal of the speaking user may be received by a microphone or other speech acquisition devices, and the received speech signal is sent to the speech recognition device 101; alternatively, the voice recognition apparatus 101 may have a function of receiving a voice signal of a speaking user.
Alternatively, the speech recognition apparatus 101 may employ speech recognition technology to convert the speech signal of the speaking user into text information. If the speech signal of the user who speaks is marked as S, the S is processed in series to obtain a corresponding speech feature sequence O, and the sequence O is marked as { O ═ O1,O2,…,Oi,…,OTIn which O isiIs the ith speech feature, T is speechTotal number of sound features. A sentence corresponding to a speech signal S can be regarded as a word string composed of many words, and is denoted by W ═ W1,w2,…,wn}. The process of speech recognition is to find the most probable word string W according to the known speech feature sequence O, where T, i, and n are positive integers.
Specifically, the speech recognition is a model matching process, in which a speech model is first established according to the speech characteristics of a person, and a template required for the speech recognition is established by extracting required features through analysis of an input speech signal; the process of recognizing the voice input by the user is a process of comparing the characteristics of the voice input by the user with the template, and finally determining the best template matched with the voice input by the user so as to obtain a voice recognition result. The specific speech recognition algorithm may adopt a training and recognition algorithm based on a statistical hidden markov model, or may adopt other algorithms such as a training and recognition algorithm based on a neural network, a recognition algorithm based on dynamic time warping matching, and the like.
The punctuation adding device 102 may be connected to the speech recognition device 101, and may receive a speech recognition result sent by the speech recognition device 101, and add punctuation to the received speech recognition result, specifically, may add punctuation to a text to be processed first by using the received speech recognition result as the text to be processed, so as to obtain a first punctuation addition result corresponding to the text to be processed; and then, under the condition that the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
Optionally, the first punctuation addition result corresponding to the text to be processed may be edited according to the second punctuation addition result corresponding to the target text, for example, the editing may replace the target text in the first punctuation addition result corresponding to the text to be processed with the second punctuation addition result corresponding to the target text, so as to obtain a final punctuation addition result corresponding to the text to be processed. Naturally, the above editing processing on the first punctuation addition result is only used as an optional embodiment, and actually, the editing processing on the second punctuation addition result may also be performed according to the first punctuation addition result corresponding to the text to be processed, so as to obtain a final punctuation addition result corresponding to the text to be processed; or, in the case that the first punctuation addition result only contains the target text, the second punctuation addition result can also be directly used as the final punctuation addition result corresponding to the text to be processed.
In practical application, the final punctuation addition result corresponding to the text to be processed can be output. Optionally, in an application scenario of voice recognition, the punctuation adding device 102 may output the final punctuation adding result to the user or a client corresponding to the user; in the application scenario of speech translation, the punctuation adding device 102 may output the final punctuation addition result to the machine translation device. It can be understood that, according to an actual application scenario, a person skilled in the art may determine an output mode corresponding to a final punctuation addition result corresponding to the text to be processed, and the embodiment of the present invention does not limit a specific output mode corresponding to the final punctuation addition result corresponding to the text to be processed.
Method embodiment
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a punctuation addition method of the present invention is shown, which may specifically include the following steps:
step 201, acquiring a text to be processed;
step 202, adding punctuations to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed;
step 203, if the first punctuation addition result includes a target text of which the number of words exceeds a word number threshold and does not include preset punctuations, adding punctuation to the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
In the embodiment of the invention, the text to be processed can be used for representing the text needing to be added with punctuation, and the text to be processed can be sourced from the text or voice input by a user through a device, and can also be sourced from other devices. It should be noted that, the text to be processed may include: one language or more than one language, for example, the text to be processed may include chinese, or may include a mixture of chinese and other languages such as english, and the embodiment of the present invention does not limit the specific text to be processed.
In practical applications, the embodiment of the present invention may execute the punctuation addition method flow of the embodiment of the present invention through a client APP (Application), and the client Application may run on the terminal, for example, the client Application may be any APP running on the terminal, and then the client Application may obtain the text to be processed from other applications of the terminal. Or, in the embodiment of the present invention, the function device of the client application may execute the punctuation addition method flow in the embodiment of the present invention, and then the function device may obtain the text to be processed from other function devices. Alternatively, the embodiment of the present invention may execute the punctuation adding method of the embodiment of the present invention through a server.
In an optional embodiment of the present invention, step 201 may obtain the text to be processed according to the voice signal of the speaking user, in this case, step 201 may convert the voice signal of the speaking user into text information, and obtain the text to be processed from the text information. Alternatively, step 201 may directly receive text information corresponding to the voice signal of the user from the voice recognition apparatus, and obtain the text to be processed from the text information.
In practical applications, step 201 may obtain a text to be processed from a text corresponding to the voice signal or a text input by the user according to practical application requirements. Optionally, the text to be processed may be obtained from the text corresponding to the voice signal S according to the interval time of the voice signal S; for example, when the interval time of the voice signal S is greater than the time threshold, a corresponding demarcation point may be determined according to the time point, a text corresponding to the voice signal S before the demarcation point is used as a text to be processed, and the text corresponding to the voice signal S after the demarcation point is processed to continuously obtain the text to be processed. It can be understood that the embodiment of the present invention does not impose any limitation on the specific process of obtaining the text to be processed from the text corresponding to the voice signal or the text input by the user.
In practical applications, step 202 may add punctuation to the text to be processed in any punctuation adding manner. For example, punctuation may be added to the text to be processed corresponding to the speech signal based on the mute interval of the speech signal in the existing scheme.
In an optional embodiment of the present invention, punctuation may be added to the text to be processed by a language model. In the field of natural language processing, a language model is a probabilistic model built for a language or languages with the purpose of building a distribution that describes the probability of occurrence of a given sequence of words in a language. In particular to embodiments of the present invention, the distribution of the probability of occurrence of a given sequence of words in a language described by a language model may be referred to as a language model score. Optionally, the language model may be obtained by obtaining a corpus sentence from the corpus, segmenting the corpus sentence, and training the corpus sentence according to a word sequence obtained by segmenting the word. Alternatively, a given word sequence described by the language model may be punctuated to enable punctuation addition processing for speech recognition results.
In the embodiment of the present invention, the language model may include: an N-gram (N-gram) language model, and/or a neural network language model, wherein the neural network language model may further include: RNNLM (Recurrent Neural Network Language Model), CNNLM (Convolutional Neural Network Language Model), DNNLM (deep Neural Network Language Model), and the like.
Where the N-gram language model is based on the assumption that the occurrence of the nth word is only related to the first N-1 words and not to any other words, the probability of a complete sentence is the product of the probabilities of occurrence of the words. In the embodiment of the invention, the punctuation is added to the text to be processed through the N-element grammar language model, and the N-element grammar language model can give a more reasonable first punctuation adding result according to the score of the language model, so that the accuracy of punctuation adding can be improved.
In an optional embodiment of the present invention, the adding punctuation to the text to be processed through the N-gram language model specifically may include: performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed; and adding punctuation for the first word sequence through the N-element grammar language model to obtain a corresponding first punctuation addition result.
In the embodiment of the present invention, multiple candidate punctuations may be added between adjacent words in the first word sequence, that is, punctuation addition processing may be performed on the target word sequence according to a situation that multiple candidate punctuations are added between adjacent words in the first word sequence, so that the first word sequence corresponds to multiple punctuation addition schemes and corresponding first punctuation addition results. Optionally, the language model scores of the multiple first punctuation addition results can be determined through the N-gram language model, so that the first punctuation addition result with the optimal language model score can be finally obtained.
It should be noted that, a person skilled in the art may determine a candidate punctuation point to be added according to an actual application requirement, and optionally, the candidate punctuation point may include: the invention relates to a method for segmenting words, which comprises the following steps of generating a word segmentation point.
Referring to fig. 3, a schematic diagram of a punctuation addition processing procedure of a word sequence according to an embodiment of the present invention is shown, where the word sequence is "hello/my is/mingmen/happy/know you", and then candidate punctuations may be added between adjacent words of "hello/my is/mingmen/happy/know you"; in fig. 3, words such as "hello", "my is", "xiaoming", "happy", "know you" are respectively represented by rectangles, and punctuations such as comma, space, exclamation mark, question mark, period are respectively represented by circles, so that there may be multiple paths between punctuations after the first word "hello" and the last word "know you" of the word sequence.
In another optional embodiment of the present invention, a dynamic programming algorithm may be used to select an optimal global punctuation addition path and an optimal first punctuation addition result corresponding to the optimal global punctuation addition path from multiple global punctuation addition paths of the text to be processed, where the optimal first punctuation addition result may achieve global optimization of the language model score, and the global state may be used to represent the whole corresponding to the first punctuation addition result corresponding to the text to be processed, so the optimal first punctuation addition result of the embodiment of the present invention may improve accuracy of punctuation addition. Accordingly, the step 202 of adding punctuation to the text to be processed through the N-gram language model may include:
a1, performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed;
step A2, adding punctuation between adjacent words in the first word sequence to obtain a global punctuation adding path corresponding to the first word sequence;
a3, acquiring a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path from the global punctuation adding path in a moving mode according to the sequence from front to back; the number of character units included in different first semantic fragments is the same, and there are repeated character units in adjacent first semantic fragments, where the character units may include: words and/or punctuation;
step A4, determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and A5, obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
According to the sequence from front to back in the steps A1 to A5, repeated first semantic segments with the same length (containing the same number of character units) are obtained from the global punctuation adding path in a moving mode, and according to the sequence from front to back, the target punctuation corresponding to the optimal first semantic segment is determined in a recursion mode. The process of acquiring the global punctuation addition path may refer to fig. 3, and the embodiment of the present invention does not limit the specific process of acquiring the global punctuation addition path. The local punctuation addition paths may be used to represent portions of global punctuation addition paths, each of which may correspond to a first semantic segment.
In practical application, the language model score corresponding to the first semantic segment can be determined by the N-gram language model. Assuming that N is 5, the length of the first semantic segment may be 5, and assuming that the number of the first character unit of the word sequence is 1, the following order of numbering may be followed: 1-5, 2-6, 3-7, 4-8 and the like, obtaining a corresponding first semantic segment with the length of 5 from the first punctuation addition result, and determining a language model score corresponding to each first semantic segment by using an N-gram language model, for example, if each first semantic segment is input into the N-gram language model, the N-gram language model can output a corresponding language model score. It is understood that the moving distance between the adjacent first semantic segments is 1, which is only an example, and in fact, a person skilled in the art may determine the moving distance between the adjacent first semantic segments according to the actual application requirement, for example, the moving distance may also be 2, 3, etc.
In an optional embodiment of the present invention, the step a4, according to the sequence from front to back, determines the target punctuation corresponding to the optimal first semantic segment in a recursive manner, which may specifically include:
a41, determining a language model score corresponding to the current first semantic fragment by using an N-gram language model;
a42, selecting the optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
step A43, using punctuation included in the optimal current first semantic segment as a target punctuation corresponding to the optimal current first semantic segment;
and A44, obtaining the next first semantic segment according to the target punctuation corresponding to the optimal current first semantic segment.
The current first semantic segment can be used for representing a first semantic field corresponding to a local punctuation adding path in the recursion process, if the number of the current first semantic segment is k, and k is a positive integer, the language model score corresponding to the kth first semantic segment can be determined by using an N-gram language model, the optimal kth first semantic segment with the optimal language model score is selected from multiple kth first semantic segments, and the punctuations contained in the optimal kth first semantic segment are used as corresponding target punctuations; and obtaining a (k +1) th first semantic segment according to the target punctuation corresponding to the optimal kth first semantic segment, wherein the (k +1) th first semantic segment can multiplex the target punctuation corresponding to the optimal kth first semantic segment. Taking fig. 3 as an example, assuming that the length of the first semantic segment is 5, and the optimal 1 st first semantic segment is "hello/,/my is/space/xiaoming", the 2 nd first semantic segment "punctuation/my is/punctuation/xiaoming/punctuation" may multiplex the target punctuation corresponding to the optimal 1 st first semantic segment, so that the 2 nd first semantic segment may add punctuation on the basis of ",/my is/space/xiaoming/punctuation", so that the optimal punctuation may be selected from various punctuations after "xiaoming".
In practical application, the obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment may specifically include: adding punctuations to the first word sequence according to the target punctuations corresponding to the optimal first semantic segments in the order from back to front or the order from front to back so as to obtain a first punctuation addition result corresponding to the text to be processed. That is, target punctuations corresponding to the punctuations (between adjacent words) of the global punctuation addition path may be determined in a certain order, and a first punctuation addition result corresponding to the text to be processed may be obtained according to the target punctuations.
In summary, in the punctuation addition process from step a1 to step a5, since the adjacent first semantic fragments have repeated character units, the next first semantic fragment can multiplex the target punctuation corresponding to the optimal current first semantic fragment, so that the computation required for obtaining the optimal punctuation addition result can be reduced in a recursive manner; in addition, because the adjacent first semantic fragments have a moving distance, the embodiment of the invention can realize the optimization of the optimal language model score corresponding to all the first semantic fragments through the optimization of the optimal language model score of the first semantic fragments.
Although the N-gram language model has the advantage of high processing speed, since the N-gram language model can only see the preceding N-1 words (above) in the process of adding punctuation, and cannot know the punctuation addition condition in the whole text to be processed, there is a possibility that a very long text in the first punctuation addition result is not added with punctuation. In the case of an application scenario applied to translation, in order to improve translation quality, translation is usually performed depending on punctuation, that is, a machine translation device usually translates a text with punctuation, whereas translation performed on a text without punctuation is prone to cause a problem of low translation quality. Therefore, the first punctuation addition result obtained by the N-gram language model may not meet the requirement of machine translation.
In practical applications, the first punctuation addition result obtained in step 202 may be determined, and specifically, it may be determined whether the first punctuation addition result includes a target text whose word count exceeds a word count threshold and which does not include a preset punctuation. The preset punctuation can be determined by those skilled in the art according to the actual application requirements. For example, the preset punctuation can be determined according to translation requirements. Examples of the preset punctuation may include: comma, question mark, period, exclamation mark, etc., and the specific preset punctuations are not limited in the embodiments of the present invention.
The word number threshold may be the number of the single words included in the first punctuation addition result, and the single words may be equivalent to words for characters composed of alphabetical characters such as english, german, and the like; for characters composed of non-alphabetic characters, such as chinese, japanese, korean, etc., the above-mentioned single character may be a single character.
The word count threshold may be determined by one skilled in the art according to practical application requirements, for example, the word count threshold may be a preset empirical value in the initial case. And in the later period, the preset experience value can be adjusted according to user feedback and/or translation quality corresponding to the word number threshold. For example, if the translation quality corresponding to the current word count threshold TH is lower than the preset condition, the translation quality may be adjusted lower based on the current word count threshold TH, for example, to (TH-1). Optionally, the range of TH may include: 15-20, it is to be understood that the specific word count threshold is not limited by the embodiments of the present invention.
Step 203 may add punctuation to the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text, in a case that the first punctuation addition result includes a target text in which the number of words exceeds a word number threshold and does not include preset punctuation. Because the neural network model can represent a vocabulary through the word vectors and represent the semantic distance between the vocabularies through the distance between the word vectors, the embodiment of the invention can participate a plurality of contexts corresponding to the vocabulary into the training of the neural network model, so that the neural network model has accurate punctuation adding capability; therefore, the method adds the punctuation to the text to be processed through the neural network model, can solve the problem that the punctuation is not added to a long section of text in the first punctuation adding result to a certain extent, and further can improve the accuracy of punctuation addition.
The embodiment of the invention can provide the following technical scheme for adding punctuations to the target text through the neural network model:
technical solution 1
In technical solution 1, the neural network model may be a neural network language model, and the process of adding punctuation to the target text through the neural network model may include: performing word segmentation on the target text to obtain a corresponding second word sequence; obtaining a plurality of candidate punctuation addition results corresponding to the second word sequence; determining a language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model; and selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
One advantage of neural network language models over N-gram language models, such as RNNLM, is that: all the above can be utilized to predict the next word, so RNNLM can have the description capability of the language model score of the semantic fragment with variable length, that is, RNNLM is suitable for the semantic fragments with wider length range, for example, the length range of the semantic fragment corresponding to RNNLM can be: 1 to a second length threshold, wherein the second length threshold may be greater than the first length threshold.
In the technical scheme 1, because RNNLM is suitable for semantic fragments with a wide length range, all semantic fragments of each candidate punctuation addition result can be taken as a whole, and the RNNLM determines language model scores corresponding to all semantic fragments of the candidate punctuation addition result. For example, if all character units included in the candidate punctuation addition result are input into RNNLM, RNNLM may output a corresponding language model score.
Technical solution 2
In technical scheme 2, the neural network model may be a neural network conversion model, and technical scheme 2 may convert a problem of punctuation addition into a problem of vocabulary punctuation conversion, where the vocabulary punctuation conversion specifically converts each vocabulary in the source corpus into a punctuation corresponding to the target, and the problem of vocabulary punctuation conversion is processed through the neural network conversion model obtained based on parallel corpus training.
Accordingly, the process of adding punctuation to the target text through the neural network model may include: adding punctuations to the target text through a neural network conversion model to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model may be obtained by training according to a parallel corpus, where the parallel corpus may include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
In practical applications, the parallel corpus may include: the source end linguistic data and the target end linguistic data can be punctuations corresponding to all vocabularies in the source end linguistic data. In general, the punctuation corresponding to each vocabulary may be punctuation added later in the vocabulary.
In practical applications, the source corpus may include: the target end linguistic data can be punctuations corresponding to all vocabularies in the source end sentences. For example, for the source end sentence "how today weather we go out and play a bar", the target end mark corresponding to each vocabulary may be "__? ___! ", wherein" _ "indicates that no punctuation is added after the corresponding vocabulary.
In an alternative embodiment of the present invention, the process of obtaining the neural network transformation model according to the parallel corpus training may include: establishing a neural network conversion model from the vocabulary of the source end to the punctuations of the target end according to the neural network structure; and training the parallel linguistic data by utilizing a neural network learning algorithm to obtain model parameters of the neural network conversion model.
In an alternative embodiment of the present invention, the neural network structure may include: RNN (Recurrent Neural Networks), LSTM (Long Short-Term Memory), or GRU (Gated Recurrent Unit), etc. It is understood that one skilled in the art can adopt the required neural network structure according to the requirement of practical application, and it is understood that the embodiment of the present invention does not impose limitation on the specific neural network structure.
Optionally, the neural network conversion model may include: mapping function of vocabulary of source end to punctuation of target end, which can be expressed in the form of conditional probability, such as P (y | x) or P (y | x)j| y < j, x), wherein x represents source information (such as information of a target text), and y represents target information (such as punctuations corresponding to words in the target text); generally, the higher the accuracy of adding the punctuation, the higher the accuracy of the punctuationThe greater the conditional probability.
In practical applications, the neural network structure may include a plurality of neuron layers, and specifically, the neuron layers may include: the device comprises an input layer, a hidden layer and an output layer, wherein the input layer is responsible for receiving source end information and distributing the source end information to the hidden layer, the hidden layer is responsible for required calculation and outputting a calculation result to the output layer, and the output layer is responsible for outputting target end information, namely the calculation result. In an alternative embodiment of the present invention, the model parameters of the neural network transformation model may include: at least one of a first connection weight W between the input layer and the hidden layer, a second connection weight U between the output layer and the hidden layer, and bias parameters of the output layer and the hidden layer, it can be understood that the embodiment of the present invention does not limit the specific network conversion model and the corresponding model parameters thereof.
And (4) training the parallel corpora, wherein the maximum goal of the neural network conversion model is to give the probability that the source end information x outputs correct punctuation information y. In practical application, a neural network learning algorithm can be used for training the parallel corpus, and an optimization method such as a random gradient descent method is used for optimizing the model parameters. Optionally, the neural network learning algorithm may include: BP (error back propagation) algorithm, inheritance, and the like, it can be understood that the embodiment of the present invention does not impose any limitation on the specific neural network learning algorithm and the specific process of training parallel corpora by using the neural network learning algorithm.
In practical application, the target text may be input into a neural network conversion model obtained by training, the target text is processed by the neural network conversion model, and a second punctuation addition result corresponding to the target text is output. In an optional embodiment of the present invention, the processing of the target text by the neural network conversion model to which the punctuation is added by the neural network conversion model may include:
step S1, encoding the target text to obtain a source end hidden layer state corresponding to the target text;
step S2, decoding a source end hidden layer state corresponding to the target text according to model parameters of a neural network conversion model to obtain the probability that each vocabulary in the target text belongs to a candidate punctuation;
and step S3, obtaining a second punctuation addition result corresponding to the target text according to the probability that each vocabulary in the target text belongs to the candidate punctuation.
In practical applications, step S1 may first convert each vocabulary in the target text into a corresponding vocabulary vector, where the dimension of the vocabulary vector may be the same as the size of the vocabulary, but the dimension of the vocabulary vector is larger due to the size of the vocabulary, so that to avoid dimension disaster and better express the semantic relationship between the vocabulary and the vocabulary, the vocabulary vector may be mapped to a low-dimensional semantic space, each vocabulary will be represented by a fixed-dimension dense vector, which is called a word vector, and the distance between the word vectors may measure the similarity between the vocabularies to some extent. Further, the word sequence corresponding to the target text can be compressed by using a neural network structure to obtain a compressed representation of the whole target text, that is, a source hidden state corresponding to the target text. Optionally, a word sequence corresponding to the target text may be compressed by using an activation function (such as a sigmoid function, a tanh (hyperbolic tangent function), and the like) of a hidden layer of a neural network structure, so as to obtain a source hidden layer state corresponding to the target text.
In an optional embodiment of the present invention, the source hidden layer state may include: the source-side hidden state in the forward direction, so that the hidden state of each word in the target text only compresses the preceding words. Alternatively, the source hidden layer state may include: the forward source end hidden layer state and the backward source end hidden layer state, so that the hidden layer state of each vocabulary in the target text not only compresses the vocabulary in front of the hidden layer state, but also compresses the vocabulary behind the compressor, and a plurality of contexts corresponding to one vocabulary can participate in the training of the network conversion model, so that the network conversion model has accurate punctuation adding capability.
In an embodiment of the present invention, in step S2, a context vector corresponding to a source end is obtained according to a source end hidden layer state corresponding to a target text, a target end hidden layer state is determined according to the context vector, and a probability that each vocabulary in the target text belongs to a candidate punctuation is determined according to the hidden layer state and a model parameter of a neural network conversion model.
It should be noted that, a person skilled in the art may determine candidate punctuations to be added between adjacent vocabularies according to actual application requirements, and optionally, the candidate punctuations may include: a comma, a question mark, a period, an exclamation point, a space, etc., where a space "_" may or may not play a role in word segmentation, for example, for english, a space may be used to segment different words, and for chinese, a space may be a punctuation that does not play any role, it is understood that embodiments of the present invention are not limited to specific candidate punctuation.
In an optional embodiment of the present invention, the context vector corresponding to the source end may be a fixed vector, and specifically, the context vector corresponding to the source end may be a combination of all source-end hidden layer states. In the case that the context vector corresponding to the source end can be a fixed vector, the contribution of each vocabulary of the source end to each target end position is the same, but there is a certain irrationality, for example, the contribution of a source end position consistent with a target end position to a target end position is significantly larger. The rationality described above is not a problem when the source sentence is relatively short, but if the source sentence is relatively long, the disadvantage will be relatively obvious, and therefore the accuracy of punctuation addition will be reduced and the amount of computation will be easily increased.
In view of the problem that the accuracy of the context vector corresponding to the source end may be decreased due to a fixed vector, in an optional embodiment of the present invention, a variable context vector may be adopted, and correspondingly, the adding a punctuation mark to the target text through the neural network conversion model may further include: step S3, determining the alignment probability between the source end position corresponding to the target text and the target end position corresponding to the punctuation addition result;
the step S2, decoding the source hidden state corresponding to the target text according to the model parameters of the neural network transformation model, may include: obtaining a context vector corresponding to a source end according to the alignment probability and the source end hidden layer state corresponding to the target text; determining a hidden layer state of a target end according to the context vector; and determining the probability that each word in the target text belongs to the candidate punctuations according to the hidden layer state and the model parameters of the neural network conversion model.
The alignment probability can be used for representing the matching degree between the ith source end position and the jth target end position, and the context vector corresponding to the source end is obtained according to the alignment probability and the source end hidden layer state corresponding to the target text, so that the context vector corresponding to the source end can pay more attention to partial vocabulary of the source end, the operation amount can be reduced to a certain extent, and the accuracy of punctuation addition can be improved.
The embodiment of the present invention may provide the following determination manner of the alignment probability between the source end position corresponding to the target text and the target end position corresponding to the punctuation addition result:
determining a mode 1, and obtaining the alignment probability between a source end position corresponding to the target text and a target end position corresponding to the punctuation addition result according to the model parameters of the neural network conversion model and the hidden layer state of the target end; or
Determining a mode 2, and comparing the source end hidden layer state with the target end hidden layer state to obtain the alignment probability between a source end position corresponding to the target text and a target end position corresponding to the punctuation addition result; or
And determining a mode 3, determining alignment source end positions corresponding to the target end positions, and determining alignment probabilities between each target end position and the corresponding alignment source end position.
Specifically, the softmax function may be input to a product of the first connection weight and the target-side hidden layer state, and the softmax function outputs the alignment probability. Therein, the softmax function is a normalization function that can map a stack of real values to the [0,1] interval and make their sum 1.
The determination mode 2 may compare the source hidden layer state and the target hidden layer state by an alignment function. An example of the alignment function may be a ratio between an index of a scoring function and a result of summing the index based on the hidden layer state to the scoring function, where the scoring function may be a function related to the source hidden layer state and the target hidden layer state, and it is understood that the specific alignment function is not limited in the embodiment of the present invention.
The determination mode 3 may generate a corresponding aligned source end position p for the jth target end positionjAnd a window is fetched at the source end [ p ]j-D,pj+D]And D is a positive integer, the context vector can be obtained by calculating the weighted average of the hidden layer state of the source end in the window, and if the window exceeds the boundary of the source end sentence, the boundary of the sentence is taken as the standard. Wherein p isjThe alignment source end position p can be a preset value or a value obtained through online estimationjThe specific determination process of (a) is not added to the value.
The above detailed description of the determining process of the alignment probability is given by the determining means 1 to the determining means 3, and it can be understood that a person skilled in the art may adopt any one of the determining means 1 to the determining means 3 according to the actual application requirement, or may also adopt other determining means, and the embodiment of the present invention does not limit the specific determining process of the alignment probability.
Step S3 may obtain a second punctuation addition result corresponding to the target text according to the probability that each word in the target text obtained in step S2 belongs to the candidate punctuation, and specifically, may use the candidate punctuation with the highest probability for one word as its corresponding target punctuation. Further, a second punctuation addition result corresponding to the target text can be obtained according to the target punctuation corresponding to each vocabulary in the target text, and the punctuation addition result can be the target text subjected to punctuation addition processing. For example, the punctuation addition result corresponding to the target text "hello i am happy to know you with mingmy" may be "hello, i am xiaming to know you with happy". Of course, the punctuation addition result may be a target punctuation corresponding to each vocabulary in the target text, and it can be understood that the embodiment of the present invention does not impose any limitation on the specific representation manner of the punctuation addition result.
The process of adding punctuation to the target text through the neural network model is described in detail in the foregoing technical solutions 1 to 2, and it can be understood that a person skilled in the art may adopt any one of the technical solutions 1 and 2 according to the actual application requirements, or may also adopt other processes of adding punctuation to the target text through the neural network model, for example, a source end of the adopted neural network model may be a text to be processed, a target end may be a text subjected to punctuation addition processing, and the like.
In an optional embodiment of the present invention, the first punctuation addition result corresponding to the to-be-processed text obtained in step 202 may be edited according to the second punctuation addition result corresponding to the target text obtained in step 203, for example, the editing may replace the target text in the first punctuation addition result corresponding to the to-be-processed text with the second punctuation addition result corresponding to the target text, so as to obtain a final punctuation addition result corresponding to the to-be-processed text.
In practical application, the final punctuation addition result corresponding to the text to be processed can be output. Optionally, in an application scenario of voice recognition, the final punctuation addition result may be output to the user or a client corresponding to the user; in the application scenario of speech translation, the final punctuation addition result may be output to a machine translation device. It can be understood that, according to an actual application scenario, a person skilled in the art may determine an output mode corresponding to a final punctuation addition result corresponding to the text to be processed, and the embodiment of the present invention does not limit a specific output mode corresponding to the final punctuation addition result corresponding to the text to be processed.
In summary, in the punctuation adding method according to the embodiment of the present invention, under the condition that the first punctuation addition result includes a target text whose word count exceeds a word count threshold and which does not include a preset punctuation, punctuation is added to the target text through a neural network model, so as to obtain a second punctuation addition result corresponding to the target text. Because the neural network model can represent a vocabulary through the word vectors and represent the semantic distance between the vocabularies through the distance between the word vectors, the embodiment of the invention can participate a plurality of contexts corresponding to the vocabulary into the training of the neural network model, so that the neural network model has accurate punctuation adding capability; therefore, the method adds the punctuation to the text to be processed through the neural network model, can solve the problem that the punctuation is not added to a long section of text in the first punctuation adding result to a certain extent, and further can improve the accuracy of punctuation addition.
It should be noted that, for simplicity of description, the method embodiments are described as a series of motion combinations, but those skilled in the art should understand that the present invention is not limited by the described motion sequences, because some steps may be performed in other sequences or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no moving act is required as an embodiment of the invention.
Device embodiment
Referring to fig. 4, a block diagram of a structure of an embodiment of a punctuation adding apparatus of the present invention is shown, which may specifically include:
a text obtaining module 401, configured to obtain a text to be processed;
a first punctuation adding module 402, configured to add punctuation to the text to be processed to obtain a first punctuation adding result corresponding to the text to be processed; and
a second punctuation adding module 403, configured to add punctuation to the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text when the first punctuation addition result may include a target text whose word count exceeds a word count threshold and does not include a preset punctuation.
Optionally, the first punctuation adding module 402 adds punctuation to the text to be processed through an N-gram language model, and the first punctuation adding module 402 may include:
the first word segmentation sub-module is used for segmenting the text to be processed to obtain a first word sequence corresponding to the text to be processed;
the first adding submodule is used for adding punctuations between adjacent words in the first word sequence so as to obtain a global punctuation adding path corresponding to the first word sequence;
the local information acquisition submodule is used for acquiring a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path from the global punctuation adding path in a moving mode according to the sequence from front to back; the number of character units included in different first semantic fragments is the same, and there are repeated character units in adjacent first semantic fragments, where the character units may include: words and/or punctuation;
the recursion submodule is used for determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and the result acquisition submodule is used for acquiring a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
Optionally, the recursion submodule may include:
the first model score determining unit is used for determining a language model score corresponding to the current first semantic fragment by using the N-element grammar language model;
the first selection unit is used for selecting the optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
a target punctuation determination unit, configured to use a punctuation included in the optimal current first semantic segment as a target punctuation corresponding to the optimal current first semantic segment;
and the semantic segment updating module is used for obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
Optionally, the result obtaining sub-module may include:
and the target punctuation adding unit is used for adding punctuation to the first word sequence according to the target punctuation corresponding to each optimal first semantic segment in a sequence from back to front or a sequence from front to back so as to obtain a first punctuation adding result corresponding to the text to be processed.
Optionally, the second punctuation adding module 403 may include:
the second word segmentation sub-module is used for segmenting the target text to obtain a corresponding second word sequence;
a candidate result obtaining submodule, configured to obtain multiple candidate punctuation addition results corresponding to the second word sequence;
the second model score determining unit is used for determining the language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model;
and the second selection unit is used for selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
Optionally, the second punctuation adding module 403 may include:
the model processing submodule is used for adding punctuations to the target text through a neural network conversion model so as to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, and the parallel corpora may include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
Optionally, the model processing sub-module may include:
the encoding unit is used for encoding the target text to obtain a source end hidden layer state corresponding to the target text;
the decoding unit is used for decoding a source end hidden layer state corresponding to the target text according to a model parameter of a neural network conversion model so as to obtain the probability that each vocabulary in the target text belongs to a candidate punctuation;
and the result determining unit is used for obtaining a second punctuation addition result corresponding to the target text according to the probability that each vocabulary in the target text belongs to the candidate punctuation.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention further provides a punctuation adding device, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and configured to be executed by one or more processors, the one or more programs including instructions for: acquiring a text to be processed; adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed; and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
Fig. 5 is a block diagram illustrating an apparatus for punctuation addition as a terminal according to an exemplary embodiment. For example, terminal 900 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
Referring to fig. 5, terminal 900 can include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
Processing component 902 generally controls overall operation of terminal 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 902 may include one or more processors 920 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
Memory 904 is configured to store various types of data to support operation at terminal 900. Examples of such data include instructions for any application or method operating on terminal 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power components 906 provide power to the various components of the terminal 900. The power components 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the terminal 900.
The multimedia components 908 include a screen providing an output interface between the terminal 900 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide motion action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the terminal 900 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when terminal 900 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing various aspects of state assessment for the terminal 900. For example, sensor assembly 914 can detect an open/closed state of terminal 900, a relative positioning of components, such as a display and keypad of terminal 900, a change in position of terminal 900 or a component of terminal 900, the presence or absence of user contact with terminal 900, an orientation or acceleration/deceleration of terminal 900, and a change in temperature of terminal 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communication component 916 is configured to facilitate communications between terminal 900 and other devices in a wired or wireless manner. Terminal 900 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as memory 904 comprising instructions, executable by processor 920 of terminal 900 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 6 is a block diagram illustrating an apparatus for punctuation addition as a server according to an example embodiment. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided that includes instructions, such as memory 1932 that includes instructions executable by a processor of server 1900 to perform the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an apparatus (terminal or server), enable the apparatus to perform a punctuation addition method, the method comprising: acquiring a text to be processed; adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed; and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
Optionally, the adding punctuation to the target text through the neural network model includes: performing word segmentation on the target text to obtain a corresponding second word sequence; obtaining a plurality of candidate punctuation addition results corresponding to the second word sequence; determining a language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model; and selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
Optionally, the adding punctuation to the target text through the neural network model includes: adding punctuations to the target text through a neural network conversion model to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
Optionally, the adding punctuation to the target text through the neural network conversion model includes: encoding the target text to obtain a source end hidden layer state corresponding to the target text; decoding a source end hidden layer state corresponding to the target text according to model parameters of a neural network conversion model to obtain the probability that each word in the target text belongs to a candidate punctuation; and obtaining a second punctuation addition result corresponding to the target text according to the probability that each word in the target text belongs to the candidate punctuation.
Optionally, the adding punctuation to the text to be processed includes: and adding punctuation for the text to be processed through the N-element grammar language model.
Optionally, adding punctuation to the text to be processed through the N-gram language model includes: performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed; adding punctuation between adjacent words in the first word sequence to obtain a global punctuation adding path corresponding to the first word sequence; according to the sequence from front to back, a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path are obtained from the global punctuation adding path in a moving mode; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation; determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model; and obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
Optionally, the determining, in a recursive manner, the target punctuations corresponding to the optimal first semantic segment according to the sequence from front to back includes: determining a language model score corresponding to the current first semantic fragment by using an N-element grammar language model; selecting an optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment; punctuation included in the optimal current first semantic segment is used as a target punctuation corresponding to the optimal current first semantic segment; and obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
The method for adding punctuations, the device for adding punctuations and the device for adding punctuations provided by the invention are described in detail above, and specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (22)

1. A punctuation adding method is characterized by comprising the following steps:
acquiring a text to be processed;
adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed;
and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
2. The method of claim 1, wherein adding punctuation to the target text by the neural network model comprises:
performing word segmentation on the target text to obtain a corresponding second word sequence;
obtaining a plurality of candidate punctuation addition results corresponding to the second word sequence;
determining a language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model;
and selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
3. The method of claim 1, wherein adding punctuation to the target text by the neural network model comprises:
adding punctuations to the target text through a neural network conversion model to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
4. The method of claim 3, wherein adding punctuation to the target text by a neural network transformation model comprises:
encoding the target text to obtain a source end hidden layer state corresponding to the target text;
decoding a source end hidden layer state corresponding to the target text according to model parameters of a neural network conversion model to obtain the probability that each word in the target text belongs to a candidate punctuation;
and obtaining a second punctuation addition result corresponding to the target text according to the probability that each word in the target text belongs to the candidate punctuation.
5. The method according to any one of claims 1 to 4, wherein the adding punctuation to the text to be processed comprises: and adding punctuation for the text to be processed through the N-element grammar language model.
6. The method of claim 5, wherein adding punctuation to the text to be processed by the N-gram language model comprises:
performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed;
adding punctuation between adjacent words in the first word sequence to obtain a global punctuation adding path corresponding to the first word sequence;
according to the sequence from front to back, a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path are obtained from the global punctuation adding path in a moving mode; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation;
determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
7. The method according to claim 6, wherein the determining the target punctuation corresponding to the optimal first semantic segment by a recursive method in the order from front to back comprises:
determining a language model score corresponding to the current first semantic fragment by using an N-element grammar language model;
selecting an optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
punctuation included in the optimal current first semantic segment is used as a target punctuation corresponding to the optimal current first semantic segment;
and obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
8. A punctuation adding device, comprising:
the text acquisition module is used for acquiring a text to be processed;
the first punctuation adding module is used for adding punctuation for the text to be processed so as to obtain a first punctuation adding result corresponding to the text to be processed; and
and the second punctuation adding module is used for adding punctuation to the target text through a neural network model when the first punctuation adding result comprises the target text of which the word number exceeds the word number threshold and does not contain preset punctuation so as to obtain a second punctuation adding result corresponding to the target text.
9. The apparatus of claim 8, wherein the second punctuation addition module comprises:
the second word segmentation sub-module is used for segmenting the target text to obtain a corresponding second word sequence;
a candidate result obtaining submodule, configured to obtain multiple candidate punctuation addition results corresponding to the second word sequence;
the second model score determining unit is used for determining the language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model;
and the second selection unit is used for selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
10. The apparatus of claim 8, wherein the second punctuation addition module comprises:
the model processing submodule is used for adding punctuations to the target text through a neural network conversion model so as to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
11. The apparatus of claim 10, wherein the model processing sub-module comprises:
the encoding unit is used for encoding the target text to obtain a source end hidden layer state corresponding to the target text;
the decoding unit is used for decoding a source end hidden layer state corresponding to the target text according to a model parameter of a neural network conversion model so as to obtain the probability that each vocabulary in the target text belongs to a candidate punctuation;
and the result determining unit is used for obtaining a second punctuation addition result corresponding to the target text according to the probability that each vocabulary in the target text belongs to the candidate punctuation.
12. The apparatus of claim 8, wherein the first punctuation adding module adds punctuation to the text to be processed through an N-gram language model, the first punctuation adding module comprising:
the first word segmentation sub-module is used for segmenting the text to be processed to obtain a first word sequence corresponding to the text to be processed;
the first adding submodule is used for adding punctuations between adjacent words in the first word sequence so as to obtain a global punctuation adding path corresponding to the first word sequence;
the local information acquisition submodule is used for acquiring a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path from the global punctuation adding path in a moving mode according to the sequence from front to back; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation;
the recursion submodule is used for determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and the result acquisition submodule is used for acquiring a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
13. The apparatus of claim 12, wherein the recursion submodule comprises:
the first model score determining unit is used for determining a language model score corresponding to the current first semantic fragment by using the N-element grammar language model;
the first selection unit is used for selecting the optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
a target punctuation determination unit, configured to use a punctuation included in the optimal current first semantic segment as a target punctuation corresponding to the optimal current first semantic segment;
and the semantic segment updating module is used for obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
14. The apparatus of claim 12, wherein the result obtaining sub-module comprises:
and the target punctuation adding unit is used for adding punctuation to the first word sequence according to the target punctuation corresponding to each optimal first semantic segment in a sequence from back to front or a sequence from front to back so as to obtain a first punctuation adding result corresponding to the text to be processed.
15. An apparatus for punctuation addition comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for:
acquiring a text to be processed;
adding punctuation to the text to be processed to obtain a first punctuation addition result corresponding to the text to be processed;
and if the first punctuation addition result comprises a target text of which the word number exceeds a word number threshold and does not contain preset punctuations, adding punctuation for the target text through a neural network model to obtain a second punctuation addition result corresponding to the target text.
16. The apparatus of claim 15, wherein adding punctuation to the target text by the neural network model comprises:
performing word segmentation on the target text to obtain a corresponding second word sequence;
obtaining a plurality of candidate punctuation addition results corresponding to the second word sequence;
determining a language model score corresponding to the candidate punctuation addition result by utilizing a neural network language model;
and selecting a candidate punctuation addition result with the optimal language model score from the multiple candidate punctuation addition results corresponding to the second word sequence as a second punctuation addition result corresponding to the target text.
17. The apparatus of claim 15, wherein adding punctuation to the target text by the neural network model comprises:
adding punctuations to the target text through a neural network conversion model to obtain a second punctuation addition result corresponding to the target text; the neural network conversion model is obtained by training according to parallel corpora, wherein the parallel corpora include: the source end linguistic data and the target end linguistic data are punctuations corresponding to all vocabularies in the source end linguistic data.
18. The apparatus of claim 17, wherein adding punctuation to the target text by a neural network transformation model comprises:
encoding the target text to obtain a source end hidden layer state corresponding to the target text;
decoding a source end hidden layer state corresponding to the target text according to model parameters of a neural network conversion model to obtain the probability that each word in the target text belongs to a candidate punctuation;
and obtaining a second punctuation addition result corresponding to the target text according to the probability that each word in the target text belongs to the candidate punctuation.
19. The apparatus according to any one of claims 15 to 18, wherein the adding punctuation to the text to be processed comprises: and adding punctuation for the text to be processed through the N-element grammar language model.
20. The apparatus of claim 19, wherein adding punctuation to the text to be processed by an N-gram language model comprises:
performing word segmentation on the text to be processed to obtain a first word sequence corresponding to the text to be processed;
adding punctuation between adjacent words in the first word sequence to obtain a global punctuation adding path corresponding to the first word sequence;
according to the sequence from front to back, a local punctuation adding path and a first semantic segment corresponding to the local punctuation adding path are obtained from the global punctuation adding path in a moving mode; the number of character units contained in different first semantic fragments is the same, and the adjacent first semantic fragments have repeated character units, wherein the character units comprise: words and/or punctuation;
determining a target punctuation corresponding to the optimal first semantic segment in a recursion mode according to the sequence from front to back; the language model score corresponding to the optimal first semantic fragment is optimal, and the language model score corresponding to the first semantic fragment is determined through an N-gram language model;
and obtaining a first punctuation addition result corresponding to the text to be processed according to the target punctuation corresponding to each optimal first semantic segment.
21. The apparatus according to claim 20, wherein the determining the target punctuation corresponding to the optimal first semantic segment by a recursive method in a front-to-back order comprises:
determining a language model score corresponding to the current first semantic fragment by using an N-element grammar language model;
selecting an optimal current first semantic fragment from the multiple current first semantic fragments according to the language model score corresponding to the current first semantic fragment;
punctuation included in the optimal current first semantic segment is used as a target punctuation corresponding to the optimal current first semantic segment;
and obtaining the next first semantic segment according to the target punctuations corresponding to the optimal current first semantic segment.
22. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform a punctuation addition method as recited in one or more of claims 1 to 7.
CN201710396130.5A 2017-05-26 2017-05-26 Punctuation adding method and device and punctuation adding device Active CN107291690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710396130.5A CN107291690B (en) 2017-05-26 2017-05-26 Punctuation adding method and device and punctuation adding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710396130.5A CN107291690B (en) 2017-05-26 2017-05-26 Punctuation adding method and device and punctuation adding device

Publications (2)

Publication Number Publication Date
CN107291690A CN107291690A (en) 2017-10-24
CN107291690B true CN107291690B (en) 2020-10-27

Family

ID=60094233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710396130.5A Active CN107291690B (en) 2017-05-26 2017-05-26 Punctuation adding method and device and punctuation adding device

Country Status (1)

Country Link
CN (1) CN107291690B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766325B (en) * 2017-09-27 2021-05-28 百度在线网络技术(北京)有限公司 Text splicing method and device
CN109979435B (en) * 2017-12-28 2021-10-22 北京搜狗科技发展有限公司 Data processing method and device for data processing
CN108597517B (en) * 2018-03-08 2020-06-05 深圳市声扬科技有限公司 Punctuation mark adding method and device, computer equipment and storage medium
CN108564953B (en) * 2018-04-20 2020-11-17 科大讯飞股份有限公司 Punctuation processing method and device for voice recognition text
CN109410949B (en) * 2018-10-11 2021-11-16 厦门大学 Text content punctuation adding method based on weighted finite state converter
CN109255115B (en) * 2018-10-19 2023-04-07 科大讯飞股份有限公司 Text punctuation adjustment method and device
CN109614627B (en) * 2019-01-04 2023-01-20 平安科技(深圳)有限公司 Text punctuation prediction method and device, computer equipment and storage medium
CN109817210B (en) * 2019-02-12 2021-08-17 百度在线网络技术(北京)有限公司 Voice writing method, device, terminal and storage medium
CN109918666B (en) * 2019-03-06 2024-03-15 北京工商大学 Chinese punctuation mark adding method based on neural network
CN111785259A (en) * 2019-04-04 2020-10-16 北京猎户星空科技有限公司 Information processing method and device and electronic equipment
CN111797632B (en) * 2019-04-04 2023-10-27 北京猎户星空科技有限公司 Information processing method and device and electronic equipment
CN112036174B (en) * 2019-05-15 2023-11-07 南京大学 Punctuation marking method and device
CN110445922B (en) * 2019-07-30 2021-05-07 惠州Tcl移动通信有限公司 Mobile terminal contact sharing method and device and storage medium
CN111261162B (en) * 2020-03-09 2023-04-18 北京达佳互联信息技术有限公司 Speech recognition method, speech recognition apparatus, and storage medium
CN111581911B (en) * 2020-04-23 2022-02-15 北京中科智加科技有限公司 Method for automatically adding punctuation to real-time text, model construction method and device
CN113378541B (en) * 2021-05-21 2023-07-07 标贝(北京)科技有限公司 Text punctuation prediction method, device, system and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201818A (en) * 2006-12-13 2008-06-18 李萍 Method for calculating language structure, executing participle, machine translation and speech recognition using HMM
CN101593518A (en) * 2008-05-28 2009-12-02 中国科学院自动化研究所 The balance method of actual scene language material and finite state network language material
CN103544406A (en) * 2013-11-08 2014-01-29 电子科技大学 Method for detecting DNA sequence similarity by using one-dimensional cell neural network
CN104022978A (en) * 2014-06-18 2014-09-03 中国联合网络通信集团有限公司 Half-blindness channel estimating method and system
CN104391963A (en) * 2014-12-01 2015-03-04 北京中科创益科技有限公司 Method for constructing correlation networks of keywords of natural language texts
WO2014140541A3 (en) * 2013-03-15 2015-03-19 Google Inc. Signal processing systems
CN104765769A (en) * 2015-03-06 2015-07-08 大连理工大学 Short text query expansion and indexing method based on word vector
CN105512692A (en) * 2015-11-30 2016-04-20 华南理工大学 BLSTM-based online handwritten mathematical expression symbol recognition method
CN106257441A (en) * 2016-06-30 2016-12-28 电子科技大学 A kind of training method of skip language model based on word frequency

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170032280A1 (en) * 2015-07-27 2017-02-02 Salesforce.Com, Inc. Engagement estimator

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201818A (en) * 2006-12-13 2008-06-18 李萍 Method for calculating language structure, executing participle, machine translation and speech recognition using HMM
CN101593518A (en) * 2008-05-28 2009-12-02 中国科学院自动化研究所 The balance method of actual scene language material and finite state network language material
WO2014140541A3 (en) * 2013-03-15 2015-03-19 Google Inc. Signal processing systems
CN103544406A (en) * 2013-11-08 2014-01-29 电子科技大学 Method for detecting DNA sequence similarity by using one-dimensional cell neural network
CN104022978A (en) * 2014-06-18 2014-09-03 中国联合网络通信集团有限公司 Half-blindness channel estimating method and system
CN104391963A (en) * 2014-12-01 2015-03-04 北京中科创益科技有限公司 Method for constructing correlation networks of keywords of natural language texts
CN104765769A (en) * 2015-03-06 2015-07-08 大连理工大学 Short text query expansion and indexing method based on word vector
CN105512692A (en) * 2015-11-30 2016-04-20 华南理工大学 BLSTM-based online handwritten mathematical expression symbol recognition method
CN106257441A (en) * 2016-06-30 2016-12-28 电子科技大学 A kind of training method of skip language model based on word frequency

Also Published As

Publication number Publication date
CN107291690A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN107291690B (en) Punctuation adding method and device and punctuation adding device
CN107221330B (en) Punctuation adding method and device and punctuation adding device
CN107632980B (en) Voice translation method and device for voice translation
CN109243430B (en) Voice recognition method and device
CN107291704B (en) Processing method and device for processing
CN108628813B (en) Processing method and device for processing
CN108399914B (en) Voice recognition method and device
CN107274903B (en) Text processing method and device for text processing
CN111145756B (en) Voice recognition method and device for voice recognition
US20210158126A1 (en) Method and device for compressing a neural network model for machine translation and storage medium
CN108628819B (en) Processing method and device for processing
CN108073572B (en) Information processing method and device, simultaneous interpretation system
CN110069624B (en) Text processing method and device
CN107564526B (en) Processing method, apparatus and machine-readable medium
CN113362812A (en) Voice recognition method and device and electronic equipment
CN111831806B (en) Semantic integrity determination method, device, electronic equipment and storage medium
CN111369978A (en) Data processing method and device and data processing device
CN107424612B (en) Processing method, apparatus and machine-readable medium
CN112735396A (en) Speech recognition error correction method, device and storage medium
CN114154459A (en) Speech recognition text processing method and device, electronic equipment and storage medium
CN107422872B (en) Input method, input device and input device
CN111640452A (en) Data processing method and device and data processing device
CN113362813A (en) Voice recognition method and device and electronic equipment
CN108733657B (en) Attention parameter correction method and device in neural machine translation and electronic equipment
CN109979435B (en) Data processing method and device for data processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant