CN110046344A - Add the method and terminal device of separator - Google Patents

Add the method and terminal device of separator Download PDF

Info

Publication number
CN110046344A
CN110046344A CN201910184608.7A CN201910184608A CN110046344A CN 110046344 A CN110046344 A CN 110046344A CN 201910184608 A CN201910184608 A CN 201910184608A CN 110046344 A CN110046344 A CN 110046344A
Authority
CN
China
Prior art keywords
matrix
target word
separator
preset
object statement
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.)
Granted
Application number
CN201910184608.7A
Other languages
Chinese (zh)
Other versions
CN110046344B (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910184608.7A priority Critical patent/CN110046344B/en
Publication of CN110046344A publication Critical patent/CN110046344A/en
Application granted granted Critical
Publication of CN110046344B publication Critical patent/CN110046344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Abstract

The present invention is suitable for field of artificial intelligence, provide a kind of addition separator method and terminal device, multiple target words are obtained by carrying out word segmentation processing to object statement, the corresponding location matrix of target word is generated according to position of the target word in preset set of words, and the location matrix of target word is converted to by term vector by Word2Vec model;The term vector for multiple target words that object statement includes is converted into the corresponding hybrid matrix of object statement by preset neural network model;Hybrid matrix is inputted into preset sorter model, export the probability that each target word corresponds to each separator, and by the highest separator addition of the corresponding probability of target word after the target word, to add separator for object statement, so that object statement is separated by different types of decollator, facilitate user's reading and understanding object statement.

Description

Add the method and terminal device of separator
Technical field
The invention belongs to artificial intelligence field more particularly to a kind of methods and terminal device for adding separator.
Background technique
In recent years, more and more speech recognition softwares can convert speech into text, but when voice is converted to text After word, often due to speech recognition can not add the decollators such as punctuation mark for the text generated, user is caused to be difficult to These texts of much smoother reading.It, can be to use especially when the dead time, extremely short big section voice disposable transformation was text Cause bigger reading difficulty in family.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and terminal device for adding separator, it is existing to solve Technology is existing as being difficult for the problem of text adds user's reading difficulty caused by separator automatically.
The first aspect of the embodiment of the present invention provides a kind of method for adding separator, comprising:
The object statement of separator to be added is obtained, and word segmentation processing is carried out to the object statement, generates multiple targets Word;According to preset set of words, it is corresponding for characterizing the target word in the set of words to generate the target word Position location matrix, and the location matrix of the target word is converted to by the target word by preset Word2Vec model Term vector;Sequence according to each target word in the object statement from front to back and from back to front suitable respectively The term vector of each target word is input to preset neural network model by sequence, generate the object statement it is corresponding before Splice to matrix and backward matrix, and by the forward direction matrix and the backward matrix, generates the object statement Corresponding hybrid matrix;The hybrid matrix is inputted into preset sorter model, each target word of output corresponds to each The probability of separator, and by the highest separator addition of the corresponding probability of the target word after the target word, to be described Object statement adds separator.
The second aspect of the embodiment of the present invention provides a kind of device for adding separator, comprising: module is obtained, for obtaining The object statement of separator to be added is taken, and word segmentation processing is carried out to the object statement, generates multiple target words;Modulus of conversion Block, for it is corresponding for characterizing the target word in the word collection to generate the target word according to preset set of words The location matrix of position in conjunction, and the location matrix of the target word is converted to by the mesh by preset Word2Vec model Mark the term vector of word;Computing module, for respectively according to each target word in the object statement from front to back suitable The term vector of each target word is input to preset neural network model, generates institute by sequence and sequence from back to front The corresponding forward direction matrix of object statement and backward matrix are stated, and the forward direction matrix and the backward matrix are spelled It connects, generates the corresponding hybrid matrix of the object statement;Adding module, for the hybrid matrix to be inputted preset classifier Model exports the probability that each target word corresponds to each separator, and by highest point of the corresponding probability of the target word Every symbol addition after the target word, to add separator for the object statement.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory and processor, described to deposit The computer program that can be run on the processor is stored in reservoir, it is real when the computer program is executed by processor The step of method that the first aspect of the existing embodiment of the present invention provides.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, realizes that the first aspect of the embodiment of the present invention mentions when the computer program is executed by processor The step of method of confession.
In embodiments of the present invention, multiple target words are obtained by carrying out word segmentation processing to object statement, according to target word Position in preset set of words generates the corresponding location matrix of target word, and passes through Word2Vec model for target word Location matrix is converted to term vector;Pass through the term vector for multiple target words that object statement is included by preset neural network model Be converted to the corresponding hybrid matrix of object statement;Hybrid matrix is inputted into preset sorter model, exports each target word pair The probability of each separator is answered, and by the highest separator addition of the corresponding probability of target word after the target word, to be Object statement adds separator and facilitates user's reading and understanding target so that object statement is separated by different types of decollator Sentence.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the implementation flow chart of the method for addition separator provided in an embodiment of the present invention;
Fig. 2 is the specific implementation flow chart of the method S104 of addition separator provided in an embodiment of the present invention;
Fig. 3 is the structural block diagram of the device of addition separator provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Fig. 1 shows the implementation process of the method for addition separator provided in an embodiment of the present invention, and this method process includes Step S101 to S106.The specific implementation principle of each step is as follows.
S101: the object statement of separator to be added is obtained, and word segmentation processing is carried out to the object statement, is generated multiple Target word.
In embodiments of the present invention, object statement is the sentence for lacking decollator.For example, when a long section voice passes through voice After identification module is converted to a long section sentence, which is often the absence of punctuation mark, in order to make user be easier to read the language Sentence, the embodiment of the present invention can add punctuation mark for the sentence, at this point, the sentence is segmentation to be added in the embodiment of the present invention The object statement of symbol, all kinds of punctuation marks are decollator to be added.It is to be appreciated that the separator in the embodiment of the present invention is not It is limited only to punctuation mark, it is any for can be used as meeting of being split sentence the segmentation of the embodiment of the present invention Symbol, in different application scenarios, the type of separator can be different.
In embodiments of the present invention, it needs through the participle kit including existing such as jieba Chinese word segmentation tool Object statement is segmented, the multiple target words for constituting object statement are obtained.
It is corresponding for characterizing the target word described to generate the target word according to preset set of words by S102 The location matrix of position in set of words, and converted the location matrix of the target word by preset Word2Vec model For the term vector of the target word.
It is to be appreciated that the target word of textual form can not be brought into subsequent data calculating, it is therefore desirable to will be each Target word is converted to term vector.In embodiments of the present invention, due to needing in the next steps using neural network model, in order to Make neural network model being consistent property in the training process and in calculating process of the reality to object statement, so herein The vocabulary by the training sentence for needing to use in target word and training process is needed to be determined by an identical set of words Position is converted to term vector according to the case where positioning after positioning.
Optionally, in embodiments of the present invention, the dictionary that can contain magnanimity vocabulary using pre-production one is as preset Set of words, it is clear that each word is arranged successively in this set of words, has corresponding position in set of words It sets.The embodiment of the present invention collects a large amount of article in advance, and counts to the word for including in these articles, calculates each The corresponding frequency of occurrence of word finally deposits the word for including in these articles according to descending the putting in order of frequency of occurrence Enter in the dictionary, generates the set of words in the embodiment of the present invention.Illustratively, it is assumed that in set of words comprising 5 words (when So, the word in set of words really used runs far deeper than 5, herein only to facilitate explanation), then it is arranged in set of words Use in primary word: [1,0,0,0,0] indicates, comes deputy word and uses: [0,1,0,0,0] indicates, and so on.
It is used to characterize the target word it is to be appreciated that can be converted to target word one by one by above-mentioned method The location matrix of position in the set of words, this is conducive to make to need in target word and training process in object statement The word for the training sentence used is converted to matrix form by unified mode, improves the reliability of subsequent calculating.
In embodiments of the present invention, need by existing Word2Vec model by each location matrix be converted to word to Amount further calculated in subsequent neural network model so that target word can be brought into, due to passing through Word2Vec The process that model generates term vector is the prior art, therefore is not repeated herein.
S103, the respectively sequence according to each target word in the object statement from front to back and from back to front Sequence, the term vector of each target word is input to preset neural network model, it is corresponding to generate the object statement Forward direction matrix and backward matrix, and the forward direction matrix and the backward matrix are spliced, generate the target The corresponding hybrid matrix of sentence.
In embodiments of the present invention, it is contemplated that the corresponding decollator of identical word different location in object statement can Can be different, therefore simply the term vector to target word one by one cannot individually analyze, and must be by a target word It is combined and is analyzed with its context.Optionally, the embodiment of the present invention is using the shot and long term memory comprising attention mechanism Network.Wherein, which includes: input layer, hidden layer, attention mechanism layer and out gate processing.
It is to be appreciated that when the sequence according to each target word in the object statement from front to back, by each target After the term vector of word is input to preset neural network model, since the input time of different term vectors is different, in the present invention H is used in embodimenttIndicate that moment t enters the term vector of input layer.
Optionally, in hidden layer, pass through formula: yt=relu ((tanh (ht-1·Wp+Bp)+tanh(ht·Wq+Bq)· Wy+By)) calculate moment t input the corresponding hidden layer of term vector output result;Wherein, ytFor moment t input word to The output of corresponding hidden layer is measured as a result, Wp、WqAnd WyRespectively 3 preset weight matrix, Bp、BqAnd ByRespectively 3 A preset bias matrix.Relu is preset line rectification function, and tanh is hyperbolic tangent function, htIndicate moment t input Into the term vector of input layer, t is the integer greater than 2.
Optionally, in the processing of attention mechanism layer, attention mechanism is introduced.Specifically, pass through formulaCalculate the corresponding attention R-matrix of moment t, wherein αtFor the corresponding attention ginseng of moment t Examine matrix, ytFor the output result of the corresponding hidden layer of term vector of moment t input.Then, then pass through formula: Rt=tanh (htt)·Wa+BaCalculate the corresponding attention matrix of moment t, wherein RtFor the corresponding attention matrix of moment t, WaIt is one Preset weight matrix, BaFor a preset bias matrix, htIndicate that moment t inputs the term vector into input layer.* volume is indicated Product operation.
Optionally, in output layer, by htIndicate that moment t inputs the term vector attention corresponding with moment t into input layer Torque battle array carries out dot product, generates moment t and inputs the corresponding output layer of term vector into input layer as a result, and inputting each moment The corresponding output layer result of term vector to input layer is spliced, and the corresponding forward direction matrix of the object statement is generated.
It is to be appreciated that be in the introduction above by according to each target word in the object statement from front to back Sequentially, the term vector of each target word is input to preset neural network model, therefore has ultimately generated forward direction matrix, equally The term vector of each target word is input to by ground when the sequence according to each target word in the object statement from back to front Preset neural network model eventually generates a backward matrix.
In embodiments of the present invention, in order to more accurately comprehensively describe the feature of object statement, by it is preceding to matrix and Backward matrix is spliced, and the corresponding hybrid matrix of object statement is generated.It is to be appreciated that being used in subsequent calculating process The hybrid matrix characterizes object statement.
It is to be appreciated that needing before the object statement for obtaining separator to be added through the training to training data Process, each weight matrix and bias matrix being mentioned above, to generate the preset nerve being mentioned above The training process of network model, the neural network includes:
Step 1: multiple trained sentence matrixes and the corresponding trained hybrid matrix of the trained sentence matrix are obtained.
Preferably, the number of training sentence matrix should be greater than 5000, to improve the recognition accuracy of neural network.
Notably, the format of each trained sentence matrix be it is identical, can guarantee in this way to neural network into When row training, the corresponding neuron of element in each weight matrix and bias matrix be it is fixed, to guarantee neural network Accuracy.
Step 2 executes following steps repeatedly until shot and long term memory network adjusted meets the preset condition of convergence: Using the trained sentence matrix as the input of shot and long term memory network, remember using the trained hybrid matrix as the shot and long term The output for recalling network carries out the more corresponding weight of each neural unit in the shot and long term memory network by back propagation Newly.
Step 3: the shot and long term memory network after output adjustment is as the preset neural network model.
The hybrid matrix is inputted preset sorter model by S104, is exported each target word and is corresponded to each point Every the probability of symbol, and by the highest separator addition of the corresponding probability of the target word after the target word, for the mesh Poster sentence adds separator.
Optionally, the preset sorter model passes through formula:Calculate the mixed moment The corresponding probability matrix of battle array;The σ (j) is the corresponding probability value of j-th of element in the probability matrix;zjFor preset parameter The corresponding parameter of j-th of element in matrix;The M is the number of element in the parameter matrix, the xiFor the mixed moment I-th of element in battle array, the e are natural constant.
Further, the position according to the target word in the object statement is read each from the probability matrix A target word corresponds to the probability of each separator.
In embodiments of the present invention, each row element in probability matrix corresponds to the same target word, each column element pair Answer the same separator, therefore in probability matrix a element representation: some target word corresponds to the probability of some separator.
Further, by the highest separator addition of the corresponding probability of the target word after the target word, for institute State object statement addition separator.
Illustratively, it is assumed that object statement are as follows: " you, which get well me, may I ask where you go to work in the work of safety bank ", it is assumed that root It is learnt according to each element in probability matrix, " you are good " corresponding highest separator of probability is " no punctuation mark ", and " I " be right The highest separator of the probability answered " no punctuation mark ", the highest separator of " " corresponding probability " no punctuation mark ", " safety The corresponding highest separator of probability " no punctuation mark " of bank ", the highest separator of " work " corresponding probability are ", ", " are asked Ask " the corresponding highest separator of probability is ", ", the highest separator of " you " corresponding probability is " no punctuation mark ", " " The corresponding highest separator of probability is " no punctuation mark ", " where " the corresponding highest separator of probability is " no punctuate symbol Number ", the highest decollator of " working " corresponding probability be "? ".So final, the object statement after output addition decollator Are as follows: " you are good, I safety bank work, excuse me, where you go to work? ".
In embodiments of the present invention, multiple target words are obtained by carrying out word segmentation processing to object statement, according to target word Position in preset set of words generates the corresponding location matrix of target word, and passes through Word2Vec model for target word Location matrix is converted to term vector;Pass through the term vector for multiple target words that object statement is included by preset neural network model Be converted to the corresponding hybrid matrix of object statement;Hybrid matrix is inputted into preset sorter model, exports each target word pair The probability of each separator is answered, and by the highest separator addition of the corresponding probability of target word after the target word, to be Object statement adds separator and facilitates user's reading and understanding target so that object statement is separated by different types of decollator Sentence.
In foregoing embodiments, to calculate that each target word corresponds to the probability of each separator in S104 wherein one Kind method is introduced, and be additionally, there may be other and is calculated the method that each target word corresponds to the probability of each separator, is made For another embodiment of the invention, as shown in Fig. 2, above-mentioned S104 further include:
The hybrid matrix is inputted preset conditional random field models by S1041, and it is corresponding each to export each target word The fractional value of a separator.
Optionally, pass through formulaIt is corresponding to calculate each target word The fractional value of each separator, wherein the score (i, j) is the fractional value that target word i corresponds to decollator j, and m is described point Every the total amount of symbol, n is the total amount of the target word, and the τ is preset coefficient, the fi(i, j) is that target word i is corresponding Characteristic function, this feature function is for characterizing the distribution situation for corresponding to each separator based on training data target word, xiIt is mixed Close i-th of element in matrix.
S1042 calculates the corresponding index value of each fractional value according to preset exponential function, and carries out to the index value Normalized corresponds to the probability of each separator as each target word.
Optionally, pass through formulaIt calculates each target word and corresponds to the general of each separator Rate, wherein p (i, j) is the probability that target word i corresponds to separator j, and score (i, j) is the score that target word i corresponds to decollator j Value.
It is to be appreciated that the embodiment of the present invention needs before the object statement for obtaining separator to be added to condition random Field model is trained, and training process includes: to obtain multiple random field training sentences, and the random field training sentence includes multiple Training word, and each trained word corresponds to the fractional value of more than one separator;By existing maximum likelihood estimate, according to The multiple random field training sentence obviously can fit the corresponding characteristic function of target word i, to generate described preset Conditional random field models.
Corresponding to the method for adding separator described in foregoing embodiments, Fig. 3 shows provided in an embodiment of the present invention add Add the structural block diagram of the device of separator, for ease of description, only parts related to embodiments of the present invention are shown.
Referring to Fig. 3, which includes:
Module 301 is obtained, is carried out at participle for obtaining the object statement of separator to be added, and to the object statement Reason, generates multiple target words;
Conversion module 302, for it is corresponding for characterizing the mesh to generate the target word according to preset set of words Mark the location matrix of position of the word in the set of words, and by preset Word2Vec model by the position of the target word Set the term vector that matrix conversion is the target word;
Computing module 303, for the sequence respectively according to each target word in the object statement from front to back And sequence from back to front, the term vector of each target word is input to preset neural network model, described in generation The corresponding forward direction matrix of object statement and backward matrix, and the forward direction matrix and the backward matrix are spliced, Generate the corresponding hybrid matrix of the object statement;
Adding module 304 exports each target word for the hybrid matrix to be inputted preset sorter model The probability of corresponding each separator, and by the highest separator addition of the corresponding probability of the target word the target word it Afterwards, to add separator for the object statement.
Optionally, the neural network model is the shot and long term memory network comprising attention mechanism;
Described device further include:
Training obtains module, mixed for obtaining multiple trained sentence matrixes and the corresponding training of the trained sentence matrix Close matrix;
Loop module, for executing following steps repeatedly until shot and long term memory network adjusted meets preset convergence Condition: using the trained sentence matrix as the input of shot and long term memory network, using the trained hybrid matrix as the length The output of short-term memory network, by back propagation to the corresponding weight of each neural unit in the shot and long term memory network It is updated;
Output module, for the shot and long term memory network after output adjustment as the preset neural network model.
Optionally, the computing module, is specifically used for:
Pass through formula:Calculate the corresponding probability matrix of the hybrid matrix;The σ (j) is The corresponding probability value of j-th of element in the probability matrix;zjFor the corresponding parameter of j-th of element in preset parameter matrix; The M is the number of element in the parameter matrix, the xiFor i-th of element in the hybrid matrix, the e is that nature is normal Number;
According to position of the target word in the object statement, each target word pair is read from the probability matrix Answer the probability of each separator.
Optionally, described that the hybrid matrix is inputted into preset sorter model, it is corresponding to export each target word The probability of each separator, comprising:
The hybrid matrix is inputted into preset conditional random field models, each target word is exported and corresponds to each separation The fractional value of symbol;The corresponding index value of each fractional value is calculated according to preset exponential function, and the index value is returned One change processing, the probability of each separator is corresponded to as each target word.Optionally, in the mesh for obtaining separator to be added Before poster sentence, further includes: multiple random field training sentences are obtained, the random field training sentence includes multiple trained words, and Each trained word corresponds to the fractional value of more than one separator;By maximum likelihood estimate, according to the multiple random field Training sentence fits the preset conditional random field models.
In embodiments of the present invention, multiple target words are obtained by carrying out word segmentation processing to object statement, according to target word Position in preset set of words generates the corresponding location matrix of target word, and passes through Word2Vec model for target word Location matrix is converted to term vector;Pass through the term vector for multiple target words that object statement is included by preset neural network model Be converted to the corresponding hybrid matrix of object statement;Hybrid matrix is inputted into preset sorter model, exports each target word pair The probability of each separator is answered, and by the highest separator addition of the corresponding probability of target word after the target word, to be Object statement adds separator and facilitates user's reading and understanding target so that object statement is separated by different types of decollator Sentence.
Fig. 4 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 4, the terminal of the embodiment is set Standby 4 include: processor 40, memory 41 and are stored in the meter that can be run in the memory 41 and on the processor 40 Calculation machine program 42, such as the program of addition separator.The processor 40 is realized above-mentioned each when executing the computer program 42 Step in the embodiment of the method for a addition separator, such as step 101 shown in FIG. 1 is to 104.Alternatively, the processor 40 The function of each module/unit in above-mentioned each Installation practice, such as unit shown in Fig. 3 are realized when executing the computer program 42 301 to 304 function.
Illustratively, the computer program 42 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 41, and are executed by the processor 40, to complete the present invention.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 42 in the terminal device 4 is described.
The terminal device 4 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 40, memory 41.It will be understood by those skilled in the art that Fig. 4 The only example of terminal device 4 does not constitute the restriction to terminal device 4, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net Network access device, bus etc..
Alleged processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 41 can be the internal storage unit of the terminal device 4, such as the hard disk or interior of terminal device 4 It deposits.The memory 41 is also possible to the External memory equipment of the terminal device 4, such as be equipped on the terminal device 4 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 41 can also both include the storage inside list of the terminal device 4 Member also includes External memory equipment.The memory 41 is for storing needed for the computer program and the terminal device Other programs and data.The memory 41 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of method for adding separator characterized by comprising
The object statement of separator to be added is obtained, and word segmentation processing is carried out to the object statement, generates multiple target words;
According to preset set of words, it is corresponding for characterizing the target word in the set of words to generate the target word Position location matrix, and the location matrix of the target word is converted to by the target word by preset Word2Vec model Term vector;
It, will respectively according to each sequence of the target word in the object statement from front to back and sequence from back to front The term vector of each target word is input to preset neural network model, generates the corresponding forward direction matrix of the object statement And backward matrix, and the forward direction matrix and the backward matrix are spliced, it is corresponding to generate the object statement Hybrid matrix;
The hybrid matrix is inputted into preset sorter model, each target word is exported and corresponds to the general of each separator Rate, and by the highest separator addition of the corresponding probability of the target word after the target word, to add for the object statement Add separator.
2. the method for addition separator as described in claim 1, which is characterized in that the neural network model is comprising paying attention to The shot and long term memory network of power mechanism;
Before the object statement for obtaining separator to be added, the method also includes:
Obtain multiple trained sentence matrixes and the corresponding trained hybrid matrix of the trained sentence matrix;
Following steps are executed repeatedly until shot and long term memory network adjusted meets the preset condition of convergence:
Using the trained sentence matrix as the input of shot and long term memory network, using the trained hybrid matrix as the length The output of phase memory network, by back propagation to the corresponding weight of each neural unit in the shot and long term memory network into Row updates;
Shot and long term memory network after output adjustment is as the preset neural network model.
3. the method for addition separator as described in claim 1, which is characterized in that described input the hybrid matrix is preset Sorter model, export the probability that each target word corresponds to each separator, comprising:
Pass through formula:Calculate the corresponding probability matrix of the hybrid matrix;The σ (j) is described general The corresponding probability value of j-th of element in rate matrix;zjFor the corresponding parameter of j-th of element in preset parameter matrix;The M is The number of element in the parameter matrix, the xiFor i-th of element in the hybrid matrix, the e is natural constant;
According to position of the target word in the object statement, it is corresponding each that each target word is read from the probability matrix The probability of a separator.
4. the method for addition separator as described in claim 1, which is characterized in that described input the hybrid matrix is preset Sorter model, export the probability that each target word corresponds to each separator, comprising:
The hybrid matrix is inputted into preset conditional random field models, each target word is exported and corresponds to each separator Fractional value;
The corresponding index value of each fractional value is calculated according to preset exponential function, and place is normalized to the index value Reason, the probability of each separator is corresponded to as each target word.
5. the method for addition separator as claimed in claim 4, which is characterized in that in the mesh for obtaining separator to be added Before poster sentence, further includes:
Multiple random field training sentences are obtained, the random field training sentence includes multiple trained words, and each trained word is right Answer the fractional value of more than one separator;
By maximum likelihood estimate, the preset condition random field mould is fitted according to the multiple random field training sentence Type.
6. a kind of device for adding separator, which is characterized in that described device includes:
Module is obtained, word segmentation processing is carried out for obtaining the object statement of separator to be added, and to the object statement, generates Multiple target words;
Conversion module, for generating according to preset set of words, the target word is corresponding to exist for characterizing the target word The location matrix of position in the set of words, and by preset Word2Vec model by the location matrix of the target word Be converted to the term vector of the target word;
Computing module, for the sequence respectively according to each target word in the object statement from front to back and by rear The term vector of each target word is input to preset neural network model, generates the object statement by the sequence before arriving Corresponding forward direction matrix and backward matrix, and the forward direction matrix and the backward matrix are spliced, described in generation The corresponding hybrid matrix of object statement;
It is corresponding each to export each target word for the hybrid matrix to be inputted preset sorter model for adding module The probability of a separator, and by the highest separator addition of the corresponding probability of the target word after the target word, with for The object statement adds separator.
7. the device of addition separator as claimed in claim 6, which is characterized in that the neural network model is comprising paying attention to The shot and long term memory network of power mechanism;
Described device further include:
Training obtains module, for obtaining multiple trained sentence matrixes and the corresponding trained mixed moment of the trained sentence matrix Battle array;
Loop module, for executing following steps repeatedly until shot and long term memory network adjusted meets preset convergence item Part: using the trained sentence matrix as the input of shot and long term memory network, using the trained hybrid matrix as the length The output of phase memory network, by back propagation to the corresponding weight of each neural unit in the shot and long term memory network into Row updates;
Output module, for the shot and long term memory network after output adjustment as the preset neural network model.
8. the device of addition separator as claimed in claim 7, which is characterized in that the computing module is specifically used for:
Pass through formula:Calculate the corresponding probability matrix of the hybrid matrix;The σ (j) is described general The corresponding probability value of j-th of element in rate matrix;zjFor the corresponding parameter of j-th of element in preset parameter matrix;The M is The number of element in the parameter matrix, the xiFor i-th of element in the hybrid matrix, the e is natural constant;
According to position of the target word in the object statement, it is corresponding each that each target word is read from the probability matrix The probability of a separator.
9. a kind of terminal device, including memory and processor, it is stored with and can transports on the processor in the memory Capable computer program, which is characterized in that when the processor executes the computer program, realize following steps:
The object statement of separator to be added is obtained, and word segmentation processing is carried out to the object statement, generates multiple target words;
According to preset set of words, it is corresponding for characterizing the target word in the set of words to generate the target word Position location matrix, and the location matrix of the target word is converted to by the target word by preset Word2Vec model Term vector;
It, will respectively according to each sequence of the target word in the object statement from front to back and sequence from back to front The term vector of each target word is input to preset neural network model, generates the corresponding forward direction matrix of the object statement And backward matrix, and the forward direction matrix and the backward matrix are spliced, it is corresponding to generate the object statement Hybrid matrix;
The hybrid matrix is inputted into preset sorter model, each target word is exported and corresponds to the general of each separator Rate, and by the highest separator addition of the corresponding probability of the target word after the target word, for the object statement Add separator.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201910184608.7A 2019-03-12 2019-03-12 Method for adding separator and terminal equipment Active CN110046344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910184608.7A CN110046344B (en) 2019-03-12 2019-03-12 Method for adding separator and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910184608.7A CN110046344B (en) 2019-03-12 2019-03-12 Method for adding separator and terminal equipment

Publications (2)

Publication Number Publication Date
CN110046344A true CN110046344A (en) 2019-07-23
CN110046344B CN110046344B (en) 2022-05-06

Family

ID=67274738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910184608.7A Active CN110046344B (en) 2019-03-12 2019-03-12 Method for adding separator and terminal equipment

Country Status (1)

Country Link
CN (1) CN110046344B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111261162A (en) * 2020-03-09 2020-06-09 北京达佳互联信息技术有限公司 Speech recognition method, speech recognition apparatus, and storage medium
CN112988921A (en) * 2019-12-13 2021-06-18 北京四维图新科技股份有限公司 Method and device for identifying map information change
CN113779964A (en) * 2021-09-02 2021-12-10 中联国智科技管理(北京)有限公司 Statement segmentation method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528530A (en) * 2016-10-24 2017-03-22 北京光年无限科技有限公司 Method and device for determining sentence type
CN108932226A (en) * 2018-05-29 2018-12-04 华东师范大学 A kind of pair of method without punctuate text addition punctuation mark
CN109410949A (en) * 2018-10-11 2019-03-01 厦门大学 Content of text based on weighted finite state converter adds punctuate method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528530A (en) * 2016-10-24 2017-03-22 北京光年无限科技有限公司 Method and device for determining sentence type
CN108932226A (en) * 2018-05-29 2018-12-04 华东师范大学 A kind of pair of method without punctuate text addition punctuation mark
CN109410949A (en) * 2018-10-11 2019-03-01 厦门大学 Content of text based on weighted finite state converter adds punctuate method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHIN CHAR JUIN ET AL.: "Punctuation Prediction using a Bidirectional Recurrent Neural Network with Part-of-Speech Tagging", 《TENCON 2017 - 2017 IEEE REGION 10 CONFERENCE》 *
李雅昆 等: "基于改进的多层BLSTM的中文分词和标点预测", 《计算机应用》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988921A (en) * 2019-12-13 2021-06-18 北京四维图新科技股份有限公司 Method and device for identifying map information change
CN111261162A (en) * 2020-03-09 2020-06-09 北京达佳互联信息技术有限公司 Speech recognition method, speech recognition apparatus, and storage medium
CN111261162B (en) * 2020-03-09 2023-04-18 北京达佳互联信息技术有限公司 Speech recognition method, speech recognition apparatus, and storage medium
CN113779964A (en) * 2021-09-02 2021-12-10 中联国智科技管理(北京)有限公司 Statement segmentation method and device

Also Published As

Publication number Publication date
CN110046344B (en) 2022-05-06

Similar Documents

Publication Publication Date Title
Gallant et al. Representing objects, relations, and sequences
CN112507040B (en) Training method and device for multivariate relation generation model, electronic equipment and medium
CN110287961A (en) Chinese word cutting method, electronic device and readable storage medium storing program for executing
CN105022754B (en) Object classification method and device based on social network
CN109446430A (en) Method, apparatus, computer equipment and the readable storage medium storing program for executing of Products Show
CN110096711A (en) The natural language semantic matching method of the concern of the sequence overall situation and local dynamic station concern
CN111414749B (en) Social text dependency syntactic analysis system based on deep neural network
CN110046344A (en) Add the method and terminal device of separator
CN109739960A (en) Sentiment analysis method, sentiment analysis device and the terminal of text
CN109710760A (en) Clustering method, device, medium and the electronic equipment of short text
CN109344399A (en) A kind of Text similarity computing method based on the two-way lstm neural network of stacking
CN111859964A (en) Method and device for identifying named entities in sentences
CN113298152B (en) Model training method, device, terminal equipment and computer readable storage medium
CN107357785A (en) Theme feature word abstracting method and system, feeling polarities determination methods and system
CN112463989A (en) Knowledge graph-based information acquisition method and system
CN108875024A (en) File classification method, system, readable storage medium storing program for executing and electronic equipment
CN112905750A (en) Generation method and device of optimization model
CN112287667A (en) Text generation method and equipment
CN110245292B (en) Natural language relation extraction method based on neural network noise filtering characteristics
CN108694176A (en) Method, apparatus, electronic equipment and the readable storage medium storing program for executing of document sentiment analysis
CN111767720A (en) Title generation method, computer and readable storage medium
CN116775836A (en) Textbook text question-answering method and system based on multi-level attention
CN109271633B (en) Word vector training method and device for single semantic supervision
US11948387B2 (en) Optimized policy-based active learning for content detection
CN115600595A (en) Entity relationship extraction method, system, equipment and readable storage medium

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