WO2017186050A1 - 人机智能问答系统的断句识别方法和装置 - Google Patents
人机智能问答系统的断句识别方法和装置 Download PDFInfo
- Publication number
- WO2017186050A1 WO2017186050A1 PCT/CN2017/081201 CN2017081201W WO2017186050A1 WO 2017186050 A1 WO2017186050 A1 WO 2017186050A1 CN 2017081201 W CN2017081201 W CN 2017081201W WO 2017186050 A1 WO2017186050 A1 WO 2017186050A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- sentence
- probability
- statement
- corpus
- current
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3322—Query formulation using system suggestions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/9032—Query formulation
- G06F16/90332—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/049—Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/53—Processing of non-Latin text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Definitions
- the present application relates to the field of computer technology, and in particular to the field of Internet technologies, and in particular, to a method and apparatus for identifying a sentence in a human-machine intelligent question answering system.
- the existing human-machine intelligent question answering system usually adopts a question-and-answer form, that is, the default user input is a complete statement, and then the answer to the question is fed back to the complete sentence.
- the user may split a complete statement into multiple sentences to express, for example, the user may "how long it takes to send something to Beijing", split into "I want to Ask "and how long it takes for things to be sent to Beijing” to enter the two sentences.
- the human-machine intelligent question answering system is required to accurately determine the integrity of the user input statement.
- the existing human-computer intelligent question answering system usually uses the Chinese language language model (N-gram model) to judge the probability that the input sentence is a complete sentence by predicting the probability of occurrence of the next word.
- N-gram model has its own limitations, the value of N can only be 2 or 3, that is, the occurrence of the current word is only related to the previous one or two words, which leads to the model cannot be accurately judged due to the lack of information. Whether the input statement is a complete statement.
- the purpose of the present application is to propose an improved sentence recognition method and apparatus for a human-machine intelligent question answering system to solve the technical problems mentioned in the above background art.
- the present application provides a sentence recognition method for a human-machine intelligent question answering system, the method comprising: receiving a current sentence input by a user; and inputting the current statement into a pre-trained sentence recognition model to obtain the current statement as a first probability of a complete sentence, wherein the sentence recognition model is configured to determine the first probability according to a probability corresponding to a Chinese language model of the current sentence and a probability corresponding to a cyclic neural network language model; if the first probability If the first threshold is greater than the preset, the current statement is determined to be a complete statement.
- the method further comprises: determining, based on a cyclic neural network language model, a second probability that the first word of the current statement appears in a previous sentence adjacent to the current sentence; If the second probability is greater than the preset second threshold, determining that the current statement and the previous sentence adjacent to the current statement are both sentences; combining the current statement with the previous sentence as a complete statement.
- the method further includes the steps of: establishing a sentence recognition model, comprising: acquiring a problem corpus, wherein the problem corpus includes a plurality of question corpora, the problem corpus being a complete statement;
- the corpus segmentation generates a plurality of segmentation sentences; determining a score of each of the segmentation sentences according to the number of words included in the sentence segment and the number of words included in the complete sentence corresponding to the sentence segment, wherein the score is used to represent a corresponding sentence
- the probability that the sentence is a complete sentence; determining the probability corresponding to the Chinese language model of each sentence and the probability corresponding to the cyclic neural network language model; and using the probability of each sentence and the score of the sentence to be a training sample,
- the sentence recognition model is obtained by training.
- the generating the plurality of sentence segments for each of the problem corpuswords includes: generating the sentence segment, comprising: performing word segmentation on the first problem corpus to obtain a first problem consisting of n words a corpus, wherein the first problem corpus is any problem corpus in the problem corpus, n is a natural number; taking the first to i words in the first problem corpus to generate an ith sentence, wherein 1 ⁇ i ⁇ n; generating n pieces of sentences corresponding to the first problem corpus; and generating a sentence corresponding to each of the first question corpora in the question corpus based on the step of generating the sentence.
- the method further includes: if the first probability is less than or equal to a preset first threshold, determining that the current statement is a sentence; prompting the user to continue to input the prompt information.
- the present application provides a sentence recognition device for a human-machine intelligent question answering system.
- the device includes: a current statement receiving module configured to receive a current statement input by a user; and a first probability obtaining module configured to input the current statement into a pre-trained sentence recognition model to obtain the current statement as a complete statement a first probability, wherein the sentence recognition model is configured to determine the first probability according to a probability corresponding to a Chinese language model of the current sentence and a probability corresponding to a cyclic neural network language model; a complete sentence determination module configured to be used The first probability is greater than a preset first threshold, and the current statement is determined to be a complete statement.
- the apparatus further includes: a second probability determination module configured to determine, based on a cyclic neural network language model, that the first word of the current statement appears in a previous sentence adjacent to the current sentence a second probability; if the second probability is greater than a preset second threshold, determining that the current statement and the previous sentence adjacent to the current sentence are both a sentence; the current statement and the upper A sentence is combined as a complete statement.
- a second probability determination module configured to determine, based on a cyclic neural network language model, that the first word of the current statement appears in a previous sentence adjacent to the current sentence a second probability; if the second probability is greater than a preset second threshold, determining that the current statement and the previous sentence adjacent to the current sentence are both a sentence; the current statement and the upper A sentence is combined as a complete statement.
- the apparatus further includes: a sentence recognition model establishing module configured to establish a sentence recognition model, the sentence recognition model establishing module comprising: a problem corpus acquisition unit configured to acquire a problem corpus, wherein The problem corpus includes a plurality of question corpora, the problem corpus is a complete statement; the sentence generating unit is configured to generate a plurality of sentence segments for each of the problem corpus segmentation; the score determining unit is configured to be included according to the sentence segment The number of words and the complete sentence corresponding to the sentence segment include the number of words, and the scores of the respective sentences are determined, wherein the scores are used to represent the probability that the corresponding sentence is a complete sentence; the probability determining unit is configured Determining a probability corresponding to the Chinese language model of each sentence and a probability corresponding to a cyclic neural network language model; a sentence recognition model training unit configured to use the probability of each sentence and the score of the sentence Train the sample and train to obtain the sentence recognition model.
- a sentence recognition model establishing module comprising:
- the sentence generating unit configuration is specifically configured to: generate the sentence, and generate the sentence includes: performing word segmentation on the first question corpus to obtain a first question corpus composed of n words
- the first problem corpus is any problem corpus in the problem corpus, n is a natural number; the first ith word is taken in the first problem corpus, and an ith sentence is generated, wherein, 1 ⁇ i ⁇ n; generating n pieces of sentences corresponding to the first problem corpus; and generating a sentence corresponding to each of the first question corpora in the question corpus based on the step of generating the sentence.
- the apparatus further includes: a sentence determination module configured to determine that the current statement is a sentence if the first probability is less than or equal to a preset first threshold; generating a prompting user to continue inputting Prompt message.
- the method and device for identifying a sentence in a human-machine intelligent question answering system first receives a current sentence input by a user, and then inputs the received current sentence into a pre-trained sentence recognition model to obtain the first sentence of the current statement as a complete sentence. Probability, and then determining whether the first probability is greater than a preset first threshold, and if so, determining that the current statement is a complete statement, the method fusing the Chinese language model and the cyclic neural network language model to determine that the current statement is complete.
- the sentence recognition model of the probability of the statement, the sentence recognition model can improve the accuracy of the human-machine intelligent question answering system to judge that the current statement is a complete statement.
- FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
- FIG. 2 is a flow chart of an embodiment of a sentence recognition method of a human-machine intelligent question answering system according to the present application
- FIG. 3 is a schematic flowchart of an implementation manner of obtaining a pre-trained sentence recognition model in a sentence recognition method of a human-machine intelligent question answering system according to the present application;
- FIG. 4 is a flow chart of still another embodiment of a sentence recognition method of the human-machine intelligent question answering system according to the present application.
- FIG. 5 is a schematic structural diagram of an embodiment of a sentence recognition device of a human-machine intelligent question answering system according to the present application.
- FIG. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server of an embodiment of the present application.
- FIG. 1 shows an exemplary system architecture 100 of an embodiment of a sentence recognition method or a sentence recognition device of a human-machine intelligent question answering system to which the human-machine intelligent question answering system of the present application can be applied.
- system architecture 100 can include terminal devices 101, 102, 103, network 104, and server 105.
- the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
- Network 104 may include various types of connections, such as wired, wireless communication links, fiber optic cables, and the like.
- the user can interact with the server 105 over the network 104 using the terminal devices 101, 102, 103 to receive or transmit messages and the like.
- Various communication client applications such as instant messaging software, shopping applications, search applications, web browser applications, social platform software, etc., may be installed on the terminal devices 101, 102, and 103.
- the terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting human-machine intelligent question and answer, including but not limited to smart phones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III) The motion picture expert compresses the standard audio layer 3), the MP4 (Moving Picture Experts Group Audio Layer IV) player, the laptop portable computer, the desktop computer, and the like.
- MP3 players Motion Picture Experts Group Audio Layer III
- the motion picture expert compresses the standard audio layer 3
- the MP4 Moving Picture Experts Group Audio Layer IV
- Server 105 may be a server that provides various services, such as a backend server that provides support for current statements sent by terminal devices 101, 102, 103.
- the background server can perform statistics, analysis, and the like on the received current statement and the like, and feed back the processing result to the terminal device.
- the sentence recognition method of the human-machine intelligent question answering system is generally executed by the server 105. Accordingly, the sentence recognition device of the human-machine intelligent question answering system is generally disposed in the server 105.
- terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices, networks, and servers.
- a flow 200 of one embodiment of a sentence recognition method of a human-machine intelligent question answering system in accordance with the present application is shown.
- the method for identifying a sentence segment of the human-machine intelligent question answering system includes the following steps:
- Step 201 Receive a current statement input by a user.
- the electronic device for example, the server shown in FIG. 1 on which the human-machine intelligent question answering method runs can receive user input from a terminal that the user uses to perform a human-machine intelligent question and answer through a wired connection or a wireless connection.
- the current statement may include but is not limited to 3G/4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods that are now known or developed in the future. .
- the human-machine intelligent question answering system when the user completes the input once, the user is considered to have input the current statement regardless of whether the statement is a complete statement. For example, when the user wants to ask how long it takes to send to Beijing, whether the user input is a sentence similar to "I want to ask”, or a sentence like "I want to ask how long it takes to send things to Beijing", You can think of the user entering the current statement.
- Step 202 Input the current statement into the pre-trained sentence recognition model to obtain a first probability that the current statement is a complete statement.
- the method for identifying the sentence recognition method of the human-machine intelligent question answering system and the electronic device thereon can pre-train a sentence recognition model, and the sentence recognition model can be used for the probability and the corresponding Chinese language model of the current sentence input by the user.
- the probability corresponding to the cyclic neural network language model determines the first probability that the current statement is a complete statement.
- the electronic device may input the current statement into the sentence recognition model to obtain the first probability that the current statement is a complete statement.
- Step 203 If the first probability is greater than the preset first threshold, determine that the current statement is a complete statement.
- the operation of the sentence recognition method of the human-machine intelligent question answering system and the electronic device thereon may be preset with a first threshold, and then the current statement obtained based on step 202 is the first probability of the complete statement, and the electronic device may The relationship between the first probability and the first threshold is determined. If the first probability is greater than a preset first threshold, the current statement may be considered as a complete statement.
- the current statement may be considered as a sentence.
- the above electronic device may generate prompt information for prompting the user to continue input, and the prompt information may be similar to "Well, you say” or the like.
- the sentence recognition method of the human-machine intelligent question answering system provided by the above embodiment of the present application first receives the current sentence input by the user, and then inputs the received current statement into the pre-trained sentence recognition model to obtain the current statement as a complete statement. a first probability, and then determining whether the first probability is greater than a preset first threshold, and if so, determining that the current statement is a complete statement, the method fusing the Chinese language model and the cyclic neural network language model to determine the current statement For the sentence recognition model of the probability of the complete sentence, the sentence recognition model can improve the accuracy of the human-machine intelligent question answering system to judge that the current statement is a complete statement.
- the pre-trained sentence recognition model used in step 202 can be established by the process 300 as shown in FIG.
- step 301 a problem corpus is obtained.
- the electronic device on which the sentence recognition method of the human-machine intelligent question answering system runs can select a complete problem corpus to form a problem corpus from the historical human-machine quiz data.
- the problem corpus here can include multiple question corpora, and each question corpus is a complete statement.
- the offline consultation data in the Q&A system constitutes the above-mentioned problem corpus.
- the foregoing electronic device further needs to further process the problem corpus obtained above.
- the problem corpus containing multiple complete sentences can be processed as a clause.
- the comma, the comma, etc. in the corpus of the question can be deleted, and the question slogan, the period, the sigh, and the like are used as separators to process the corpus of the problem.
- step 302 a plurality of sentence segments are generated for each problem corpus segmentation.
- the electronic device may perform word segmentation processing on each problem corpus in the problem corpus by various means. After that, according to the word segmentation, each problem corpus correspondence is generated. The sentence is broken. For example, the question slogan "Is this mobile phone a metal body?", you can first do word segmentation processing, and obtain the result of the word segmentation as "This mobile phone is a metal body?", and then obtain the sentence corresponding to the corpus of the question.
- the foregoing electronic device may obtain a sentence corresponding to each problem corpus by the following steps: First, the electronic device may perform word segmentation processing on the first problem corpus, and acquire a first problem corpus composed of n words, where the first A problem corpus may be any problem corpus in the above problem corpus, n is a natural number; afterwards, the electronic device may take the first to i words in the first question corpus to generate an i th sentence; finally, according to the above method Generating n sentences corresponding to the first problem corpus, 1 ⁇ i ⁇ n. The above electronic device can generate a sentence corresponding to each problem corpus in the problem corpus by using the above method.
- the first question corpus is "Is this mobile phone a metal body?"
- the first problem corpus can be segmented and processed, and the result of the word segmentation is "Is this mobile phone a metal body?"
- the first problem corpus includes 6 words, and then the 6 sentence sentences corresponding to the first problem corpus are obtained, and the 6 sentence sentences expected by the first question are: "this", “this mobile phone”, “this mobile phone is”, “This mobile phone is metal”, "This mobile phone is a metal body”, "Is this mobile phone a metal body?" and the "This mobile phone is a metal body" can be considered as a kind of sentence.
- Step 303 Determine the score of each sentence according to the number of words included in the sentence and the number of words included in the complete sentence corresponding to the sentence.
- the electronic device may determine the number of words included in each sentence and the complete sentence corresponding to the sentence, and then in each sentence The number of words included is divided by the number of words contained in the complete statement corresponding to the sentence, and the score obtained is the probability that the sentence is a complete statement.
- the first question corpus contains 6 words.
- the corresponding number of words contained in the above sentence is 3 and 6, and it can be seen that the scores for characterizing the above two sentences as complete sentences are 0.5 and 1.
- Step 304 Determine a probability corresponding to the Chinese language model of each sentence and a probability corresponding to the cyclic neural network language model.
- the above electronic device utilizes a Chinese language model and a cyclic neural network.
- the language model determines the probability of each sentence being a complete statement. Compared with the prior art method for determining the complete sentence probability only by the Chinese language model, the method can effectively avoid the problem that the model accuracy is low due to data sparsity.
- Step 305 training the sample with the probability of each sentence and the score of the sentence, and training to obtain a sentence recognition model.
- the electronic device may use a linear regression algorithm or the like according to the score of each sentence determined in step 303 and the probability corresponding to the Chinese language model of each sentence determined in step 304 and the probability corresponding to the cyclic neural network language model.
- y is the probability that the statement is a complete statement.
- the training method of the sentence recognition model processes the lexical participle of each problem in the problem corpus to obtain the sentence corresponding to each question corpus, and then obtains the score of each sentence and the corresponding Chinese language model. Probability and the corresponding probability of the cyclic neural network language model are used as training data. Finally, the training data is trained by linear regression algorithm to obtain the sentence recognition model.
- the sentence recognition model combines the advantages of the Chinese language model and the cyclic neural network language model, which can be effective.
- the human-machine intelligent question answering system determines the accuracy of the current statement as a complete statement.
- a flow 400 of yet another embodiment of a sentence recognition method for a human intelligent question answering system includes the following steps:
- Step 401 Receive a current statement input by a user.
- the electronic device for example, the server shown in FIG. 1 on which the human-machine intelligent question answering method runs can receive user input from a terminal that the user uses to perform a human-machine intelligent question and answer through a wired connection or a wireless connection.
- the current statement for example, the server shown in FIG. 1.
- Step 402 Input the current statement into the pre-trained sentence recognition model to obtain a first probability that the current statement is a complete statement.
- the sentence recognition method of the human-machine intelligent question answering system and the electronic device on the same can input the current sentence input by the user into the sentence recognition model of the training to obtain the first probability that the current statement is a complete statement.
- the sentence recognition model here It can be used to determine the first probability that the current statement is a complete statement according to the probability corresponding to the Chinese language model of the current sentence input by the user and the probability corresponding to the cyclic neural network language model.
- Step 403 If the first probability is greater than the preset first threshold, determine that the current statement is a complete statement.
- the method for identifying the sentence recognition method of the human-machine intelligent question answering system can be set with a first threshold in advance, and then the electronic device can be based on the first probability that the current statement obtained in step 402 is a complete statement.
- the relationship between the first probability and the first threshold is determined. If the first probability is greater than a preset first threshold, the current statement may be considered as a complete statement.
- Step 404 based on the cyclic neural network language model, determining a second probability that the first word of the current sentence appears in the previous sentence adjacent to the current sentence.
- the current statement determined based on step 403 is a complete statement
- the electronic device may first acquire the previous sentence adjacent to the current statement and the first word in the current sentence, and then use the cyclic neural network model to predict the current state.
- the first word of the statement appears in the second probability in the previous sentence adjacent to the current statement.
- Step 405 If the second probability is greater than the preset second threshold, determine that the current statement and the previous sentence adjacent to the current sentence are both broken sentences.
- the electronic device may preset a second threshold, and then compare the second probability with the second threshold. If the comparison result is that the second probability is greater than the second threshold, it can be considered that the current statement and the previous sentence adjacent to the current sentence are both broken sentences. If the comparison result is that the second probability is less than or equal to the second threshold, it can be considered that the previous sentence is adjacent to the current sentence as a complete sentence.
- step 406 the current statement is combined with the previous sentence as a complete statement.
- the current statement determined based on step 405 and the previous sentence adjacent to the current sentence are both broken sentences, and the electronic device may combine the current statement with the previous sentence adjacent to the current statement as a complete statement.
- the above steps 404, 405 and 406 can be considered as further judgments on whether the current statement is a complete statement, and can further improve the accuracy of determining that the current statement is a complete statement.
- the embodiment realizes a multi-question and answer form of the human-machine intelligent question answering system, that is, when the user input is greater than one sentence, the human-machine intelligent question answering system can perform only one feedback answer.
- the flow 400 of the sentence recognition method of the human-machine intelligent question answering system in the present embodiment highlights the step of further determining whether the current statement is a complete sentence, as compared with the embodiment corresponding to FIG. Therefore, the solution described in this embodiment can re-determine whether the current statement is a complete statement by using a cyclic neural network language model, and further improve the accuracy of determining that the current statement is a complete statement.
- the present application provides an embodiment of a sentence recognition device for a human-machine intelligent question answering system, and the device embodiment is the same as the method embodiment shown in FIG. Correspondingly, the device can be specifically applied to various electronic devices.
- the human-machine intelligent question answering apparatus 500 of the embodiment includes a current sentence receiving module 501, a first probability acquiring module 502, and a complete sentence determining module 503.
- the current statement receiving module 501 is configured to receive a current statement input by the user;
- the first probability obtaining module 502 is configured to input the current statement into the pre-trained sentence recognition model to obtain a first probability that the current statement is a complete statement, where
- the sentence recognition model is configured to determine a first probability according to a probability corresponding to the Chinese language model of the current statement and a probability corresponding to the cyclic neural network language model;
- the complete sentence determination module 503 is configured to: if the first probability is greater than the preset first The threshold determines that the current statement is a complete statement.
- the apparatus 500 further includes a second probability determination module (not shown) configured to determine, based on the cyclic neural network language model, that the first word of the current statement appears a second probability in a previous sentence adjacent to the current statement; if the second probability is greater than a preset second threshold, determining that the current statement and the previous sentence adjacent to the current sentence are both broken sentences; Combined with the previous sentence above as a complete statement.
- a second probability determination module (not shown) configured to determine, based on the cyclic neural network language model, that the first word of the current statement appears a second probability in a previous sentence adjacent to the current statement; if the second probability is greater than a preset second threshold, determining that the current statement and the previous sentence adjacent to the current sentence are both broken sentences; Combined with the previous sentence above as a complete statement.
- the apparatus 500 further includes a sentence recognition model establishing module (not shown) configured to establish a sentence recognition model, where the sentence recognition model establishing module includes: a problem corpus acquisition unit ( Not shown), configured to obtain a problem corpus, wherein the problem corpus includes a plurality of question corpora, each question corpus is a complete statement; a sentence generating unit (not shown) configured to generate a plurality of sentence sentences for each problem corpus segmentation a score determining unit (not shown) configured to determine a score of each sentence according to the number of words included in the sentence and the number of words including the complete sentence corresponding to the sentence Wherein, the score is used to represent a probability that the corresponding sentence is a complete sentence; a probability determining unit (not shown) is configured to determine a probability corresponding to the Chinese language model of each of the above-mentioned sentences and a corresponding language of the cyclic neural network language model Probability; a sentence recognition model training unit (not shown) is configured to train the
- the sentence generating unit (not shown) is configured to: generate a sentence of each question corpus, and the step of generating a sentence includes: performing word segmentation on the first question corpus, and obtaining a first problem corpus consisting of n words, wherein the first problem corpus is any problem corpus in the above problem corpus, n is a natural number; taking the first to i words in the first problem corpus to generate the i-th a sentence, wherein 1 ⁇ i ⁇ n; generating n pieces of sentence corresponding to the first problem corpus; and generating a sentence corresponding to each first corpus in the problem corpus based on the step of generating the sentence.
- the apparatus 500 further includes a sentence determination module (not shown) configured to determine that the current statement is if the first probability is less than or equal to a preset first threshold. Break the sentence; generate a prompt message prompting the user to continue to input.
- a sentence determination module (not shown) configured to determine that the current statement is if the first probability is less than or equal to a preset first threshold. Break the sentence; generate a prompt message prompting the user to continue to input.
- the sentence recognition device 500 of the above-mentioned human-machine intelligent question answering system further includes some other well-known structures, such as a processor, a memory, etc., in order to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are shown in FIG. 5. Not shown in the middle.
- FIG. 6 a block diagram of a computer system 600 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown.
- computer system 600 includes a central processing unit (CPU) 601 that can be loaded into a program in random access memory (RAM) 603 according to a program stored in read only memory (ROM) 602 or from storage portion 608. And perform various appropriate actions and processes.
- RAM random access memory
- ROM read only memory
- RAM random access memory
- various programs and data required for the operation of the system 600 are also stored.
- the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
- An input/output (I/O) interface 605 is also coupled to bus 604.
- the following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 608 including a hard disk or the like. And include such as LAN cards, A communication portion 609 of a network interface card such as a modem. The communication section 609 performs communication processing via a network such as the Internet.
- Driver 610 is also coupled to I/O interface 605 as needed.
- a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like, is mounted on the drive 610 as needed so that a computer program read therefrom is installed into the storage portion 608 as needed.
- an embodiment of the present disclosure includes a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
- the computer program can be downloaded and installed from the network via communication portion 609, and/or installed from removable media 611.
- each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more logic for implementing the specified.
- Functional executable instructions can also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
- the modules involved in the embodiments of the present application may be implemented by software or by hardware.
- the described modules may also be disposed in the processor, for example, as a processor including a current statement receiving module, a first probability acquisition module, and a complete statement determination module.
- the names of these modules do not constitute a limitation on the module itself under certain circumstances.
- the current statement receiving module may also be described as "a module that receives a current statement input by a user.”
- the present application further provides a non-volatile computer storage medium, which may be included in the apparatus described in the foregoing embodiments.
- the non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to: receive a current statement input by a user; input the current statement into a pre-training
- the sentence recognition model obtains a first probability that the current statement is a complete sentence, wherein the sentence recognition model is configured to determine, according to a probability corresponding to a Chinese language model of the current sentence and a probability corresponding to a cyclic neural network language model a first probability; if the first probability is greater than a preset first threshold, determining that the current statement is a complete statement.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Evolutionary Computation (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
本申请公开了一种人机智能问答系统的断句识别方法和装置。所述方法的一具体实施方式包括:接收用户输入的当前语句;将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。该实施方式将汉语言模型和循环神经网络语言模型相融合获得用于确定当前语句为完整语句的概率的断句识别模型,该断句识别模型可以提高人机智能问答系统判断所述当前语句为完整语句的准确率。
Description
相关申请的交叉引用
本申请要求于2016年4月25日提交的中国专利申请号为“201610262499.2”的优先权,其全部内容作为整体并入本申请中。
本申请涉及计算机技术领域,具体涉及互联网技术领域,尤其涉及人机智能问答系统的断句识别方法和装置。
随着人机智能技术的发展,越来越多的问答系统采用人机智能技术。现有的人机智能问答系统通常采用一问一答的形式,即默认用户输入为一个完整语句,而后针对该完整语句反馈问题的答案。而实际上人机对话的过程中,用户可能会将一个完整的语句拆成多个断句进行表达,比如用户可能会将“我想问一下东西送到北京需要多久”,拆分成“我想问一下”和“东西送到北京需要多久”两个断句进行输入。针对这种情况,就需要人机智能问答系统能够准确判断出用户输入语句的完整性。
现有的人机智能问答系统通常是采用汉语言语言模型(N-gram模型)通过预测下一个词出现的概率来判断输入语句为完整语句的概率。但是,由于N-gram模型自身具有局限性,N的取值通常只能为2或3,即当前词的出现只与前面1个或2个词相关,导致该模型因信息缺失而不能准确判断输入语句是否为完整语句。
发明内容
本申请的目的在于提出一种改进的人机智能问答系统的断句识别方法和装置,来解决以上背景技术部分提到的技术问题。
第一方面,本申请提供了一种人机智能问答系统的断句识别方法,所述方法包括:接收用户输入的当前语句;将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。
在一些实施例中,所述方法还包括:基于循环神经网络语言模型,确定所述当前语句的第一个词出现在与所述当前语句相邻的上一句中的第二概率;若所述第二概率大于预设的第二阈值,则确定所述当前语句和与所述当前语句相邻的上一句均为断句;将所述当前语句与所述上一句相结合作为完整语句。
在一些实施例中,所述方法还包括:建立断句识别模型的步骤,包括:获取问题语料库,其中,所述问题语料库包括多个问题语料,所述问题语料为完整语句;对各所述问题语料分词生成多个断句;根据所述断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各所述断句的分值,其中,所述分值用于表征与之对应的断句为完整语句的概率;确定各所述断句的所述汉语言模型对应的概率和循环神经网络语言模型对应的概率;以各所述断句的所述概率以及该断句的分值为训练样本,训练得到所述断句识别模型。
在一些实施例中,所述对各所述问题语料分词生成多个断句,包括:生成所述断句的步骤,包括:对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,其中,所述第一问题语料为所述问题语料库中的任一问题语料,n为自然数;在所述第一问题语料中取第1~i个词,生成第i个语句,其中,1≤i≤n;生成所述第一问题语料对应的n个断句;基于所述生成所述断句的步骤,生成所述问题语料库中各所述第一问题语料对应的断句。
在一些实施例中,所述方法还包括:若所述第一概率小于或等于预设的第一阈值,则确定所述当前语句为断句;提示用户继续输入的提示信息。
第二方面,本申请提供了一种人机智能问答系统的断句识别装置,
所述装置包括:当前语句接收模块,配置用于接收用户输入的当前语句;第一概率获取模块,配置用于将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;完整语句确定模块,配置用于若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。
在一些实施例中,所述装置还包括:第二概率确定模块,配置用于基于循环神经网络语言模型,确定所述当前语句的第一个词出现在与所述当前语句相邻的上一句中的第二概率;若所述第二概率大于预设的第二阈值,则确定所述当前语句和与所述当前语句相邻的上一句均为断句;将所述当前语句与所述上一句相结合作为完整语句。
在一些实施例中,所述装置还包括:断句识别模型建立模块,配置用于建立断句识别模型,所述断句识别模型建立模块包括:问题语料库获取单元,配置用于获取问题语料库,其中,所述问题语料库包括多个问题语料,所述问题语料为完整语句;断句生成单元,配置用于对各所述问题语料分词生成多个断句;分值确定单元,配置用于根据所述断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各所述断句的分值,其中,所述分值用于表征与之对应的断句为完整语句的概率;概率确定单元,配置用于确定各所述断句的所述汉语言模型对应的概率和循环神经网络语言模型对应的概率;断句识别模型训练单元,配置用于以各所述断句的所述概率以及该断句的分值为训练样本,训练得到所述断句识别模型。
在一些实施例中,所述断句生成单元配置具体用于:生成所述断句,且生成所述断句的步骤包括:对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,其中,所述第一问题语料为所述问题语料库中的任一问题语料,n为自然数;在所述第一问题语料中取第1~i个词,生成第i个语句,其中,1≤i≤n;生成所述第一问题语料对应的n个断句;基于所述生成所述断句的步骤,生成所述问题语料库中各所述第一问题语料对应的断句。
在一些实施例中,所述装置还包括:断句确定模块,配置用于若所述第一概率小于或等于预设的第一阈值,则确定所述当前语句为断句;生成提示用户继续输入的提示信息。
本申请提供的人机智能问答系统的断句识别方法和装置,首先接收用户输入的当前语句,之后将接收到的当前语句输入预先训练的断句识别模型,以获取该当前语句为完整语句的第一概率,而后判断该第一概率是否大于预设的第一阈值,若是,则确定该当前语句为完整语句,该方法将汉语言模型和循环神经网络语言模型相融合获得用于确定当前语句为完整语句的概率的断句识别模型,该断句识别模型可以提高人机智能问答系统判断所述当前语句为完整语句的准确率。
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是本申请可以应用于其中的示例性系统架构图;
图2是根据本申请的人机智能问答系统的断句识别方法的一个实施例的流程图;
图3是根据本申请的人机智能问答系统的断句识别方法中,获得预先训练的断句识别模型的一种实现方式的示意性流程图;
图4是根据本申请的人机智能问答系统的断句识别方法的又一个实施例的流程图;
图5是根据本申请的人机智能问答系统的断句识别装置的一个实施例的结构示意图;
图6是适于用来实现本申请实施例的终端设备或服务器的计算机系统的结构示意图。
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与
有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了可以应用本申请的人机智能问答系统的断句识别方法或人机智能问答系统的断句识别装置的实施例的示例性系统架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如即时通信软件、购物类应用、搜索类应用、网页浏览器应用、社交平台软件等。
终端设备101、102、103可以是具有显示屏并且支持人机智能问答的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103发送的当前语句提供支持的后台服务器。后台服务器可以对接收到的当前语句等数据进行统计、分析等处理,并将处理结果反馈给终端设备。
需要说明的是,本申请实施例所提供的人机智能问答系统的断句识别方法一般由服务器105执行,相应地,人机智能问答系统的断句识别装置一般设置于服务器105中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,其示出了根据本申请的人机智能问答系统的断句识别方法的一个实施例的流程200。所述的人机智能问答系统的断句识别方法,包括以下步骤:
步骤201,接收用户输入的当前语句。
在本实施例中,人机智能问答方法运行于其上的电子设备(例如图1所示的服务器)可以通过有线连接方式或者无线连接方式从用户利用其进行人机智能问答的终端接收用户输入的当前语句。需要指出的是,上述无线连接方式可以包括但不限于3G/4G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
通常,在人机智能问答系统中,当用户一次输入完成后即认为用户已经输入了当前语句,而不考虑该语句是否为完整语句。例如,当用户想要询问东西送到北京要多久时,不论用户输入为类似于“我想问一下”的断句,还是类似于“我想问一下东西送到北京要多久”的整句,都可以认为用户输入的是当前语句。
步骤202,将当前语句输入预先训练的断句识别模型得到当前语句为完整语句的第一概率。
在本实施例中,人机智能问答系统的断句识别方法运行与其上的电子设备可以预先训练一个断句识别模型,该断句识别模型可以用于根据用户输入的当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定当前语句为完整语句的第一概率。基于步骤201接收到的用户输入的当前语句,上述电子设备可以将该当前语句输入上述断句识别模型,获取上述当前语句为完整语句的第一概率。
步骤203,若第一概率大于预设的第一阈值,则确定当前语句为完整语句。
在本实施例中,人机智能问答系统的断句识别方法运行与其上的电子设备可以预先设置一个第一阈值,而后基于步骤202获得的上述当前语句为完整语句的第一概率,上述电子设备可以判断该第一概率与上述第一阈值的大小关系,如果上述第一概率大于预设的第一阈值,则可以认为上述当前语句为完整语句。
在本实施例的一些可选的实现方式中,如果上述第一概率小于或等于预设的第一阈值,则可以认为上述当前语句为断句。上述电子设备可以生成用于提示用户继续输入的提示信息,该提示信息可以类似于“嗯,您说”等。
本申请的上述实施例提供的人机智能问答系统的断句识别方法,首先接收用户输入的当前语句,之后将接收到的当前语句输入预先训练的断句识别模型,以获取该当前语句为完整语句的第一概率,而后判断该第一概率是否大于预设的第一阈值,若是,则确定该当前语句为完整语句,该方法将汉语言模型和循环神经网络语言模型相融合获得用于确定当前语句为完整语句的概率的断句识别模型,该断句识别模型可以提高人机智能问答系统判断上述当前语句为完整语句的准确率。
在一些可选的方案中,步骤202中用到的预先训练的断句识别模型可以通过如图3所示的流程300来建立。
步骤301,获取问题语料库。
在本实现方式中,人机智能问答系统的断句识别方法运行于其上的电子设备可以从历史的人机问答数据中选取完整的问题语料组成问题语料库。这里的问题语料库可以包括多个问题语料,并且各问题语料均为完整语句。以电商领域的人机智能问答系统的咨询数据为例,其包括在线咨询数据和离线咨询数据,而离线咨询数据因不是实时交互数据,通常都是较为完整的语句,因此可以选取人机智能问答系统中离线咨询数据组成上述问题语料库。
需要说明的是,上述电子设备还需要对上述获取的问题语料库进一步处理。首先,可以将包含多个完整句子的问题语料做分句处理,这里可以将问题语料中的逗号、顿号等删除后,将问号、句号、叹号等作为分隔符对问题语料进行分句处理。其次,还可以在每个完整语句的后面添加一个例如<END>等的结束标记。
步骤302,对各问题语料分词生成多个断句。
在本实施例中,上述电子设备可以通过各种手段将上述问题语料库中的各问题语料做分词处理。之后,根据分词生成各问题语料对应
的断句。以问题语料“这手机是金属机身吗”为例,可以首先做分词处理,获取分词结果为“这手机是金属机身吗”,而后获取该问题语料对应的断句。
需要说明的是,上述电子设备可以通过如下步骤获取各问题语料对应的断句:首先,上述电子设备可以对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,这里的第一问题语料可以为上述问题语料库中的任一问题语料,n为自然数;之后,上述电子设备可以在第一问题语料中取第1~i个词,生成第i个断句;最后,根据上述方法生成上述第一问题语料对应的n个断句,1≤i≤n。上述电子设备可以利用上述方法生成问题语料库中各问题语料对应的断句。例如,若上述第一问题语料为“这手机是金属机身吗”,首先可以将该第一问题语料进行分词处理,得到分词结果为“这手机是金属机身吗”,由此可见,该第一问题语料包括6个词,而后可以获取上述第一问题语料对应的6个断句,该第一问题预料的6个断句分别为:“这”、“这手机”、“这手机是”、“这手机是金属”、“这手机是金属机身”、“这手机是金属机身吗”,并且其中的“这手机是金属机身吗”可以认为是断句的一种。
步骤303,根据断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各断句的分值。
在本实现方式中,基于步骤302获取的第一问题语料以及第一问题语料对应的断句,上述电子设备可以确定各断句以及该断句对应的完整语句所包含词的数目,进而将各断句中所包含的词数除以该断句对应的完整语句所包含的词数,得到的分值即为该断句为完整语句的概率。以第一问题语料“这手机是金属机身吗”和其对应的断句“这手机是”和“这手机是金属机身吗”为例,上述第一问题语料包含的词数为6,其对应的上述断句包含的词数为3和6,由此可见,用于表征上述两个断句为完整语句概率的分值为0.5和1。
步骤304,确定各断句的汉语言模型对应的概率和循环神经网络语言模型对应的概率。
在本实现方式中,上述电子设备利用汉语言模型和循环神经网络
语言模型,分别确定各断句的为完整语句的概率。此方式与现有技术中的仅通过汉语言模型确定完整语句概率的方式相比,可以有效地避免因数据稀疏导致的模型准确率低的问题。
步骤305,以各断句的概率以及该断句的分值为训练样本,训练得到断句识别模型。
在本实现方式中,基于步骤303确定的各断句的分值和步骤304确定的各断句的汉语言模型对应的概率和循环神经网络语言模型对应的概率,上述电子设备可以采用线性回归算法等训练生成上述断句识别模型。这里的断句识别模型可以是形如y=f(x1,x2)的公式,其中,x1、x2分别指任一语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率,y为该语句为完整语句的概率。
本申请的上述实施例的实现方式提供的断句识别模型的训练方法,对问题语料库中的各问题语料分词处理以获取各问题语料对应的断句,而后获取各断句的分值、汉语言模型对应的概率以及循环神经网络语言模型对应的概率作为训练数据,最后采用线性回归算法等训练上述训练数据训练获得断句识别模型,该断句识别模型融合了汉语言模型和循环神经网络语言模型的优点,可以有效地提高人机智能问答系统判断当前语句为完整语句的准确率。
进一步参考图4,其示出了人机智能问答系统的断句识别方法的又一个实施例的流程400。该人机智能问答系统的断句识别方法的流程400,包括以下步骤:
步骤401,接收用户输入的当前语句。
在本实施例中,人机智能问答方法运行于其上的电子设备(例如图1所示的服务器)可以通过有线连接方式或者无线连接方式从用户利用其进行人机智能问答的终端接收用户输入的当前语句。
步骤402,将当前语句输入预先训练的断句识别模型得到当前语句为完整语句的第一概率。
在本实施例中,人机智能问答系统的断句识别方法运行与其上的电子设备可以将用户输入的当前语句输入上述训练的断句识别模型,以获取上述当前语句为完整语句的第一概率。这里的该断句识别模型
可以用于根据用户输入的当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定当前语句为完整语句的第一概率。
步骤403,若第一概率大于预设的第一阈值,则确定当前语句为完整语句。
在本实施例中,人机智能问答系统的断句识别方法运行与其上的电子设备可以预先设置一个第一阈值,而后基于步骤402获得的上述当前语句为完整语句的第一概率,上述电子设备可以判断该第一概率与上述第一阈值的大小关系,如果上述第一概率大于预设的第一阈值,则可以认为上述当前语句为完整语句。
步骤404,基于循环神经网络语言模型,确定当前语句的第一个词出现在与当前语句相邻的上一句中的第二概率。
在本实施例中,基于步骤403确定的当前语句为完整语句,上述电子设备可以首先获取与上述当前语句相邻的上一句以及当前语句中的第一个词,而后采用循环神经网络模型预测当前语句的第一个词出现在与当前语句相邻的上一句中的第二概率。
步骤405,若第二概率大于预设的第二阈值,则确定当前语句和与当前语句相邻的上一句均为断句。
在本实施例中,上述电子设备可以预先设置一个第二阈值,之后将上述第二概率与第二阈值相比较。如果比较结果为第二概率大于上述第二阈值,则可以认为上述当前语句和与当前语句相邻的上一句均为断句。如果比较结果为第二概率小于或等于上述第二阈值,则可以认为与当前语句相邻得上一句为完整语句。
步骤406,将当前语句与上一句相结合作为完整语句。
在本实施例中,基于步骤405确定的当前语句和与当前语句相邻的上一句均为断句,上述电子设备可以将当前语句和与当前语句相邻的上一句相结合作为完整语句。由此可见,上述步骤404、405和406可以认为是对当前语句是否为完整语句的进一步判断,可以进一步提高判断当前语句为完整语句的准确率。并且该实施例实现了人机智能问答系统的多问一答的形式,即当用户输入大于一个断句的情况下,人机智能问答系统可以只进行一次反馈回答。
从图4中可以看出,与图2对应的实施例相比,本实施例中的人机智能问答系统的断句识别方法的流程400突出了对当前语句是否为完整语句的进一步判断的步骤。由此,本实施例描述的方案可以通过循环神经网络语言模型对当前语句是否为完整语句进行再次的判断,进一步地提高了判断当前语句为完整语句的准确率。
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种人机智能问答系统的断句识别装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例所述的人机智能问答装置500包括:当前语句接收模块501、第一概率获取模块502和完整语句确定模块503。其中,当前语句接收模块501配置用于接收用户输入的当前语句;第一概率获取模块502配置用于将上述当前语句输入预先训练的断句识别模型得到该当前语句为完整语句的第一概率,其中,断句识别模型用于根据上述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定第一概率;完整语句确定模块503配置用于若上述第一概率大于预设的第一阈值,则确定上述当前语句为完整语句。
在本实施例的一些可选的实现方式中,上述装置500还包括第二概率确定模块(未示出),配置用于基于循环神经网络语言模型,确定上述当前语句的第一个词出现在与该当前语句相邻的上一句中的第二概率;若该第二概率大于预设的第二阈值,则确定当前语句和与该当前语句相邻的上一句均为断句;将上述当前语句与上述上一句相结合作为完整语句。
在本实施例的一些可选的实现方式中,上述装置500还包括断句识别模型建立模块(未示出),配置用于建立断句识别模型,该断句识别模型建立模块包括:问题语料库获取单元(未示出),配置用于获取问题语料库,其中,问题语料库包括多个问题语料,各问题语料为完整语句;断句生成单元(未示出),配置用于对各问题语料分词生成多个断句;分值确定单元(未示出),配置用于根据上述断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各断句的分值,
其中,该分值用于表征与之对应的断句为完整语句的概率;概率确定单元(未示出),配置用于确定各上述断句的汉语言模型对应的概率和循环神经网络语言模型对应的概率;断句识别模型训练单元(未示出),配置用于以各上述断句的概率以及该断句的分值为训练样本,训练得到断句识别模型。
在本实施例的一些可选的实现方式中,上述断句生成单元(未示出)配置具体用于:生成各问题语料的断句,生成断句的步骤包括:对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,其中,第一问题语料为上述问题语料库中的任一问题语料,n为自然数;在上述第一问题语料中取第1~i个词,生成第i个语句,其中,1≤i≤n;生成上述第一问题语料对应的n个断句;基于上述生成断句的步骤,生成上述问题语料库中各第一问题语料对应的断句。
在本实施例的一些可选的实现方式中,上述装置500还包括断句确定模块(未示出)配置用于若上述第一概率小于或等于预设的第一阈值,则确定上述当前语句为断句;生成提示用户继续输入的提示信息。
本领域技术人员可以理解,上述人机智能问答系统的断句识别装置500还包括一些其他公知结构,例如处理器、存储器等,为了不必要地模糊本公开的实施例,这些公知的结构在图5中未示出。
下面参考图6,其示出了适于用来实现本申请实施例的终端设备或服务器的计算机系统600的结构示意图。
如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、
调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括当前语句接收模块、第一概率获取模块和完整语句确定模块。其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,当前语句接收模块还可以被描述为“接收用户输入的当前语句的模块”。
作为另一方面,本申请还提供了一种非易失性计算机存储介质,该非易失性计算机存储介质可以是上述实施例中所述装置中所包含的
非易失性计算机存储介质;也可以是单独存在,未装配入终端中的非易失性计算机存储介质。上述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:接收用户输入的当前语句;将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
Claims (12)
- 一种人机智能问答系统的断句识别方法,其特征在于,所述方法包括:接收用户输入的当前语句;将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:基于循环神经网络语言模型,确定所述当前语句的第一个词出现在与所述当前语句相邻的上一句中的第二概率;若所述第二概率大于预设的第二阈值,则确定所述当前语句和与所述当前语句相邻的上一句均为断句;将所述当前语句与所述上一句相结合作为完整语句。
- 根据权利要求2所述的方法,其特征在于,所述方法还包括:建立断句识别模型的步骤,包括:获取问题语料库,其中,所述问题语料库包括多个问题语料,所述问题语料为完整语句;对各所述问题语料分词生成多个断句;根据所述断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各所述断句的分值,其中,所述分值用于表征与之对应的断句为完整语句的概率;确定各所述断句的所述汉语言模型对应的概率和循环神经网络语言模型对应的概率;以各所述断句的所述概率以及该断句的分值为训练样本,训练得 到所述断句识别模型。
- 根据权利要求3所述的方法,其特征在于,所述对各所述问题语料分词生成多个断句,包括:生成所述断句的步骤,包括:对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,其中,所述第一问题语料为所述问题语料库中的任一问题语料,n为自然数;在所述第一问题语料中取第1~i个词,生成第i个语句,其中,1≤i≤n;生成所述第一问题语料对应的n个断句;基于所述生成所述断句的步骤,生成所述问题语料库中各所述第一问题语料对应的断句。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:若所述第一概率小于或等于预设的第一阈值,则确定所述当前语句为断句;生成提示用户继续输入的提示信息。
- 一种人机智能问答系统的断句识别装置,其特征在于,所述装置包括:当前语句接收模块,配置用于接收用户输入的当前语句;第一概率获取模块,配置用于将所述当前语句输入预先训练的断句识别模型得到所述当前语句为完整语句的第一概率,其中,所述断句识别模型用于根据所述当前语句的汉语言模型对应的概率和循环神经网络语言模型对应的概率确定所述第一概率;完整语句确定模块,配置用于若所述第一概率大于预设的第一阈值,则确定所述当前语句为完整语句。
- 根据权利要求6所述的装置,其特征在于,所述装置还包括:第二概率确定模块,配置用于基于循环神经网络语言模型,确定所述当前语句的第一个词出现在与所述当前语句相邻的上一句中的第 二概率;若所述第二概率大于预设的第二阈值,则确定所述当前语句和与所述当前语句相邻的上一句均为断句;将所述当前语句与所述上一句相结合作为完整语句。
- 根据权利要求7所述的装置,其特征在于,所述装置还包括:断句识别模型建立模块,配置用于建立断句识别模型,所述断句识别模型建立模块包括:问题语料库获取单元,配置用于获取问题语料库,其中,所述问题语料库包括多个问题语料,所述问题语料为完整语句;断句生成单元,配置用于对各所述问题语料分词生成多个断句;分值确定单元,配置用于根据所述断句中包含词的数目以及该断句对应的完整语句包含词的数目,确定各所述断句的分值,其中,所述分值用于表征与之对应的断句为完整语句的概率;概率确定单元,配置用于确定各所述断句的所述汉语言模型对应的概率和循环神经网络语言模型对应的概率;断句识别模型训练单元,配置用于以各所述断句的所述概率以及该断句的分值为训练样本,训练得到所述断句识别模型。
- 根据权利要求8所述的装置,其特征在于,所述断句生成单元配置具体用于:生成所述断句,且生成所述断句的步骤包括:对第一问题语料进行分词处理,获取由n个词组成的第一问题语料,其中,所述第一问题语料为所述问题语料库中的任一问题语料,n为自然数;在所述第一问题语料中取第1~i个词,生成第i个语句,其中,1≤i≤n;生成所述第一问题语料对应的n个断句;基于所述生成所述断句的步骤,生成所述问题语料库中各所述第一问题语料对应的断句。
- 根据权利要求6所述的装置,其特征在于,所述装置还包括:断句确定模块,配置用于若所述第一概率小于或等于预设的第一阈值,则确定所述当前语句为断句;生成提示用户继续输入的提示信息。
- 一种设备,包括:处理器;和存储器,所述存储器中存储有能够被所述处理器执行的计算机可读指令,在所述计算机可读指令被执行时,所述处理器执行如权利要求1-5中任一项所述的方法。
- 一种非易失性计算机存储介质,所述计算机存储介质存储有能够被处理器执行的计算机可读指令,当所述计算机可读指令被处理器执行时,所述处理器执行如权利要求1-5中任一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/096,678 US10853421B2 (en) | 2016-04-25 | 2017-04-20 | Segmented sentence recognition method and device for human-machine intelligent question answer system |
RU2018137669A RU2708941C1 (ru) | 2016-04-25 | 2017-04-20 | Способ и устройство распознавания сегментированных предложений для человеко-машинной интеллектуальной вопросно-ответной системы |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610262499.2A CN107305575B (zh) | 2016-04-25 | 2016-04-25 | 人机智能问答系统的断句识别方法和装置 |
CN201610262499.2 | 2016-04-25 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017186050A1 true WO2017186050A1 (zh) | 2017-11-02 |
Family
ID=60150423
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/081201 WO2017186050A1 (zh) | 2016-04-25 | 2017-04-20 | 人机智能问答系统的断句识别方法和装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US10853421B2 (zh) |
CN (1) | CN107305575B (zh) |
RU (1) | RU2708941C1 (zh) |
WO (1) | WO2017186050A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2726739C1 (ru) * | 2019-07-29 | 2020-07-15 | Бейджин Сяоми Интеллиджент Текнолоджи Ко., Лтд. | Способ, аппарат и устройство для обработки естественного языка |
US11704497B2 (en) | 2020-09-09 | 2023-07-18 | International Business Machines Corporation | Generating and using a sentence model for answer generation |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10929754B2 (en) * | 2017-06-06 | 2021-02-23 | Google Llc | Unified endpointer using multitask and multidomain learning |
CN110245331A (zh) * | 2018-03-09 | 2019-09-17 | 中兴通讯股份有限公司 | 一种语句转换方法、装置、服务器及计算机存储介质 |
CN109002434A (zh) * | 2018-05-31 | 2018-12-14 | 青岛理工大学 | 客服问答匹配方法、服务器及存储介质 |
CN111160004B (zh) * | 2018-11-07 | 2023-06-27 | 北京猎户星空科技有限公司 | 一种断句模型的建立方法及装置 |
CN111428010B (zh) * | 2019-01-10 | 2024-01-12 | 北京汇钧科技有限公司 | 人机智能问答的方法和装置 |
CN112509570B (zh) * | 2019-08-29 | 2024-02-13 | 北京猎户星空科技有限公司 | 语音信号处理方法、装置、电子设备及存储介质 |
CN110633476B (zh) * | 2019-09-27 | 2024-04-05 | 北京百度网讯科技有限公司 | 用于获取知识标注信息的方法及装置 |
CN112435656B (zh) * | 2020-12-11 | 2024-03-01 | 平安科技(深圳)有限公司 | 模型训练方法、语音识别方法、装置、设备及存储介质 |
US12008043B2 (en) * | 2021-03-29 | 2024-06-11 | Microsoft Technology Licensing, Llc | Natural language query processing and debugging |
CN115579009B (zh) * | 2022-12-06 | 2023-04-07 | 广州小鹏汽车科技有限公司 | 语音交互方法、服务器及计算机可读存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102880611A (zh) * | 2011-07-14 | 2013-01-16 | 腾讯科技(深圳)有限公司 | 一种语言建模方法及语言建模装置 |
CN103050115A (zh) * | 2011-10-12 | 2013-04-17 | 富士通株式会社 | 识别装置、识别方法、生成装置和生成方法 |
US20150206644A1 (en) * | 2011-02-28 | 2015-07-23 | Hubbell Incorporated | Enclosure system and method for facilitating installation of electrical equipment |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7251599B2 (en) * | 2002-12-10 | 2007-07-31 | International Business Machines Corporation | Automatic construction of unique signatures and confusable sets for database access |
UA67700C2 (en) | 2003-12-30 | 2007-04-25 | Internat Scient And Training C | Method and device for oral translation of sentences |
JP4652737B2 (ja) * | 2004-07-14 | 2011-03-16 | インターナショナル・ビジネス・マシーンズ・コーポレーション | 単語境界確率推定装置及び方法、確率的言語モデル構築装置及び方法、仮名漢字変換装置及び方法、並びに、未知語モデルの構築方法、 |
US9471566B1 (en) * | 2005-04-14 | 2016-10-18 | Oracle America, Inc. | Method and apparatus for converting phonetic language input to written language output |
US8060360B2 (en) * | 2007-10-30 | 2011-11-15 | Microsoft Corporation | Word-dependent transition models in HMM based word alignment for statistical machine translation |
US9978365B2 (en) * | 2008-10-31 | 2018-05-22 | Nokia Technologies Oy | Method and system for providing a voice interface |
US9176941B2 (en) | 2011-07-14 | 2015-11-03 | Tencent Technology (Shenzhen) Company Limited | Text inputting method, apparatus and system based on a cache-based language model and a universal language model |
JP5755603B2 (ja) * | 2012-06-13 | 2015-07-29 | 日本電信電話株式会社 | 言語モデル作成装置、言語モデル作成方法、プログラム |
US9135912B1 (en) * | 2012-08-15 | 2015-09-15 | Google Inc. | Updating phonetic dictionaries |
CN102890723B (zh) * | 2012-10-25 | 2016-08-31 | 深圳市宜搜科技发展有限公司 | 一种例句检索的方法及系统 |
CN103035243B (zh) * | 2012-12-18 | 2014-12-24 | 中国科学院自动化研究所 | 长语音连续识别及识别结果实时反馈方法和系统 |
US9311932B2 (en) | 2014-01-23 | 2016-04-12 | International Business Machines Corporation | Adaptive pause detection in speech recognition |
-
2016
- 2016-04-25 CN CN201610262499.2A patent/CN107305575B/zh active Active
-
2017
- 2017-04-20 US US16/096,678 patent/US10853421B2/en active Active
- 2017-04-20 RU RU2018137669A patent/RU2708941C1/ru active
- 2017-04-20 WO PCT/CN2017/081201 patent/WO2017186050A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150206644A1 (en) * | 2011-02-28 | 2015-07-23 | Hubbell Incorporated | Enclosure system and method for facilitating installation of electrical equipment |
CN102880611A (zh) * | 2011-07-14 | 2013-01-16 | 腾讯科技(深圳)有限公司 | 一种语言建模方法及语言建模装置 |
CN103050115A (zh) * | 2011-10-12 | 2013-04-17 | 富士通株式会社 | 识别装置、识别方法、生成装置和生成方法 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2726739C1 (ru) * | 2019-07-29 | 2020-07-15 | Бейджин Сяоми Интеллиджент Текнолоджи Ко., Лтд. | Способ, аппарат и устройство для обработки естественного языка |
US11501078B2 (en) | 2019-07-29 | 2022-11-15 | Beijing Xiaomi Intelligent Technology Co., Ltd. | Method and device for performing reinforcement learning on natural language processing model and storage medium |
US11704497B2 (en) | 2020-09-09 | 2023-07-18 | International Business Machines Corporation | Generating and using a sentence model for answer generation |
Also Published As
Publication number | Publication date |
---|---|
CN107305575B (zh) | 2021-01-26 |
US20200327168A1 (en) | 2020-10-15 |
CN107305575A (zh) | 2017-10-31 |
US10853421B2 (en) | 2020-12-01 |
RU2708941C1 (ru) | 2019-12-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017186050A1 (zh) | 人机智能问答系统的断句识别方法和装置 | |
JP6718828B2 (ja) | 情報入力方法および装置 | |
JP6751122B2 (ja) | ページ制御方法および装置 | |
CN106685916B (zh) | 电子会议智能装置及方法 | |
CN106686339B (zh) | 电子会议智能 | |
CN106997370B (zh) | 基于作者的文本分类和转换 | |
CN111428010B (zh) | 人机智能问答的方法和装置 | |
WO2021022992A1 (zh) | 对话生成模型的训练方法、对话生成方法、装置及介质 | |
US20190188566A1 (en) | Reward augmented model training | |
CN116127020A (zh) | 生成式大语言模型训练方法以及基于模型的搜索方法 | |
CN108268450B (zh) | 用于生成信息的方法和装置 | |
US20220358292A1 (en) | Method and apparatus for recognizing entity, electronic device and storage medium | |
CN107948437B (zh) | 熄屏显示方法和装置 | |
JP7488871B2 (ja) | 対話推薦方法、装置、電子機器、記憶媒体ならびにコンピュータプログラム | |
CN115309877A (zh) | 对话生成方法、对话模型训练方法及装置 | |
CN116521841B (zh) | 用于生成回复信息的方法、装置、设备及介质 | |
CN113157874B (zh) | 确定用户的意图的方法、装置、设备、介质和程序产品 | |
KR20190074508A (ko) | 챗봇을 위한 대화 모델의 데이터 크라우드소싱 방법 | |
CN113111658B (zh) | 校验信息的方法、装置、设备和存储介质 | |
CN114064943A (zh) | 会议管理方法、装置、存储介质及电子设备 | |
CN117520497A (zh) | 大模型交互处理方法、系统、终端、设备及介质 | |
CN116881730A (zh) | 基于语境的聊天场景匹配系统、方法、设备及存储介质 | |
CN115905490A (zh) | 人机交互对话方法、装置以及设备 | |
CN115620726A (zh) | 语音文本生成方法、语音文本生成模型的训练方法、装置 | |
CN110633476B (zh) | 用于获取知识标注信息的方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17788702 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.02.2019) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17788702 Country of ref document: EP Kind code of ref document: A1 |