WO2020073533A1 - 自动问答方法及装置 - Google Patents

自动问答方法及装置 Download PDF

Info

Publication number
WO2020073533A1
WO2020073533A1 PCT/CN2018/125252 CN2018125252W WO2020073533A1 WO 2020073533 A1 WO2020073533 A1 WO 2020073533A1 CN 2018125252 W CN2018125252 W CN 2018125252W WO 2020073533 A1 WO2020073533 A1 WO 2020073533A1
Authority
WO
WIPO (PCT)
Prior art keywords
semantic
question
input question
input
vector
Prior art date
Application number
PCT/CN2018/125252
Other languages
English (en)
French (fr)
Inventor
许开河
楼星雨
王少军
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020073533A1 publication Critical patent/WO2020073533A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/01Customer relationship services

Definitions

  • the present disclosure relates to the field of artificial intelligence technology, and in particular, to an automatic question answering method and device.
  • the customer service robot can only answer the semantically complete questions raised by the user, and for some problems omitted according to the above content, the customer service robot cannot handle it.
  • the following dialogue :
  • the customer service robot cannot obtain the corresponding answer based on the question "How much is the annual fee" based on the omission above.
  • this method is very clumsy based on templates and rules. It can cover fewer scenes and is difficult to expand.
  • the present disclosure provides an automatic question answering method and device.
  • An automatic question answering method includes:
  • the omitted phrase in the input question is predicted from the above corpus corresponding to the input question through a semantic supplement model
  • the reply information of the input question is obtained from a question and answer database based on the input question with incomplete semantics and the obtained omitted phrase.
  • An automatic question answering device including:
  • the semantic vector construction module is configured to: construct the semantic vector of the input problem
  • the semantic integrity judgment module is configured to: perform semantic integrity judgment on the input question according to the semantic vector;
  • the omitted phrase prediction module is configured to: if the semantics of the input question are incomplete, predict the omitted phrases in the input question from the above corpus corresponding to the input question through a semantic supplement model;
  • the reply information acquisition module is configured to acquire reply information of the input question from a question and answer database based on the semantically incomplete input question and the obtained omitted phrase.
  • An automatic question answering device including:
  • Memory for storing processor executable instructions
  • the processor is configured as the automatic question answering method described above.
  • the technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: adopting a deep learning method to perform omission phrase prediction for an input problem with incomplete semantics, and obtaining reply information of the input question based on the predicted omission phrase combined with the input question, Therefore, the flexibility of automatic question answering can be improved, and the user experience is improved, especially the customer service robot in the field of artificial intelligence technology.
  • FIG. 1 is a schematic diagram of an implementation environment involved in this disclosure
  • Fig. 2 is a block diagram of a question and answer server according to an exemplary embodiment
  • Fig. 3 is a flowchart of an automatic question answering method according to an exemplary embodiment
  • step S110 in the embodiment shown in FIG. 3;
  • FIG. 5 is a flowchart of step S130 in the embodiment shown in FIG. 3;
  • step S150 in the embodiment shown in FIG. 3;
  • Fig. 7 is a flowchart illustrating an automatic question and answer method according to another exemplary embodiment
  • step S170 is a flowchart of step S170 in the embodiment corresponding to FIG. 3;
  • Fig. 9 is a block diagram of an automatic question answering device according to an exemplary embodiment
  • Fig. 10 is a block diagram of an automatic question answering device according to another exemplary embodiment.
  • FIG. 1 is a schematic diagram of an implementation environment involved in this disclosure.
  • the implementation environment includes: a question and answer server 200 and at least one terminal 100.
  • the terminal 100 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, and other electronic devices that can establish a network connection with a question and answer server and can run a client, which is not specifically limited herein.
  • a wireless or wired network connection is established in advance between the terminal 100 and the question answering server 200, so that the client 100 running on the terminal 100 realizes the interaction between the terminal 100 and the question answering server 200.
  • the question answering server 200 can obtain the question entered by the user on the terminal 100, and then perform semantic vector construction, semantic integrity judgment, omission phrase prediction, and matching reply information for the question. .
  • the terminal 100 can receive the reply information matched by the question and answer server, and present the reply information to the user, so as to automatically answer the questions input by the user.
  • Fig. 2 is a block diagram of a question and answer server according to an exemplary embodiment.
  • the server with this hardware structure can be used for automatic question answering and is deployed in the implementation environment shown in FIG. 1.
  • question and answer server is only an example adapted to the present disclosure, and it cannot be considered as providing any limitation on the scope of use of the present disclosure.
  • the question and answer server cannot also be interpreted as needing to rely on or must have one or more components in the exemplary question and answer server 200 shown in FIG. 2.
  • the question answering server 200 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) , Central Processing Units) 270.
  • CPU central processing unit
  • CPU Central Processing Unit
  • the power supply 210 is used to provide an operating voltage for each hardware device on the question and answer server 200.
  • the interface 230 includes at least one wired or wireless network interface 231, at least one serial-parallel conversion interface 233, at least one input-output interface 235, at least one USB interface 237, etc., for communicating with external devices.
  • the memory 250 may be a read-only memory, a random access memory, a magnetic disk, or an optical disk.
  • the resources stored on the memory 250 include an operating system 251, application programs 253, and data 255. .
  • the operating system 251 is used to manage and control the hardware devices and application programs 253 on the question and answer server 200 to realize the calculation and processing of the massive data 255 by the central processor 270. LinuxTM, FreeBSDTM, etc.
  • the application program 253 is a computer program that completes at least one specific job based on the operating system 251, and may include at least one module (not shown in FIG. 2), and each module may separately include a series of questions and answers to the question and answer server 200. Computer readable instructions.
  • the data 255 may be a question-and-answer database stored on a disk.
  • the central processor 270 may include one or more processors, and is configured to communicate with the memory 250 through a bus for computing and processing the massive data 255 in the memory 250.
  • the question answering server 200 to which the present disclosure is applied will complete the automatic question answering method by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.
  • the question and answer server 200 may be used by one or more application specific integrated circuits (Application Specific Integrated Circuit (ASIC for short), digital signal processor, digital signal processing equipment, programmable logic device, field programmable gate array, controller, microcontroller, microprocessor, or other electronic components to implement the following method. Therefore, the implementation of the present disclosure is not limited to any specific hardware circuit, software, or a combination of both.
  • ASIC Application Specific Integrated Circuit
  • Fig. 3 is a flow chart showing an automatic question answering method according to an exemplary embodiment.
  • the automatic question answering method can be applied to the question answering server 200 in the implementation environment shown in FIG. 1 and executed by the question answering server 200, and may include the following steps:
  • Step S110 construct a semantic vector of the input question.
  • the user inputs a question on the terminal 100, and then the question and answer server 200 acquires the user's input question from the terminal 100, and constructs a semantic vector of the input question for the acquired input question.
  • the input question is a question entered by the user on the terminal 100.
  • the input question may be a problem in different fields.
  • the input question may be about bank card, storage, loan, interest Related issues;
  • the input problem can be related to insurance handling, claims and other related issues, of course, it can also be a comprehensive problem in multiple fields, such as for users who are students, the input problem can be about comprehensive Encyclopedia of knowledge. There is no specific limitation here.
  • the automatic question answering method of the present disclosure is particularly suitable for the scene of multiple rounds of question answering.
  • the semantic vector refers to a vector constructed by the encoding corresponding to each word in the input question and the weight corresponding to each word, which is used to represent the semantics of the input question.
  • each word in the sentence contributes differently to the semantics of the sentence. For example, in the question of "what materials are needed for handling a safe car owner card”, “processing”, “owner card” and “materials” contribute more to the semantics of the entire question, so the weights corresponding to these three words are greater, and " The words “Ping'an”, “Need” and “Which” contribute slightly to the semantics of the whole question, so the weights corresponding to these words are smaller.
  • a text database will be constructed.
  • a question and answer database will be constructed, which includes several questions that the user may ask and reply information (answers) to the questions.
  • the question-and-answer database is constructed for scenarios where automatic question-answering is applied, for example, for insurance application scenarios, and the questions and response information of the questions and answers included in the question-and-answer database are for insurance-related information. Therefore, for different application scenarios, the questions included in the question and answer data are different.
  • the question and answer database includes a dictionary, which is used to encode the words in these questions and reply information, and configure the corresponding weight for each word in the question or reply information. Therefore, after receiving the user's input question, the semantic vector of the input question can be constructed according to the dictionary of the question and answer database, the encoding of the words in the input question, and the weight of each word in the input question.
  • the encoding corresponding to each word is a real number, that is, a number is used to represent a word in a sentence, and the weight corresponding to the word is also a real number. Therefore, the final semantic vector constructed for the input problem is a real vector.
  • step S110 includes:
  • Step S111 Segment the input question.
  • the word segmentation refers to dividing the input question into a number of words arranged in order, for example, "what materials are required for handling a safe car owner card” can be divided into "processing ⁇ safe ⁇ car owner card ⁇ what ⁇ materials ⁇ required”.
  • Word segmentation can be performed using a word segmentation algorithm. For example, a word segmentation method based on string matching, a word segmentation method based on understanding, or a word segmentation method based on statistics can be used.
  • Step S112 Part-of-speech tag the words in the input question according to the word segmentation result to determine the weight corresponding to each word in the input question.
  • Part-of-speech tagging refers to tagging according to the grammatical position and attribute of each word in the input question, such as the word at the subject position, the word at the predicate position, and the word at the object position; for example, nouns Part of speech, such as human nouns, time nouns, place nouns, etc.), verbs, negative words, etc.
  • nouns Part of speech such as human nouns, time nouns, place nouns, etc.
  • verbs negative words
  • the configuration of the word weight in each question or answer in the dictionary is configured according to the grammatical position in the answer in the question or answer and the part of speech of the word. Therefore, according to the result of part-of-speech tagging, the weight corresponding to each word in the input question can be determined.
  • Step S113 Construct a semantic vector of the input question according to the encoding corresponding to the word in the input question and the corresponding weight.
  • the semantic vector of the input question can be constructed from the code corresponding to the word in the dictionary of the question and answer database and the weight corresponding to the word according to the word segmentation result.
  • Step S130 Perform semantic integrity judgment on the input problem according to the semantic vector.
  • Semantic integrity judgment refers to judging whether the semantics of the input question is complete through the semantic vector.
  • the input problems with incomplete semantics include the input problems that are omitted for the above, such as subject ellipsis, object ellipsis, attribute attribution, and other sentence component ellipsis.
  • the semantic integrity judgment of the input problem can be performed by deep learning, that is, the semantic judgment model is constructed using a neural network, and the semantic judgment model is trained using several sample problems. After the training is completed, it can be judged whether the semantics of the input question is complete for an input question.
  • the semantic judgment model for semantic integrity judgment may include the following steps:
  • Step S131 Use the semantic judgment model to predict the semantic integrity label of the input question according to the semantic vector prediction.
  • Step S132 Determine whether the semantics of the input question are complete based on the semantic complete label.
  • the semantic integrity label includes the label "complete” for semantic integrity and the label "incomplete” for semantic incompleteness.
  • the semantic integrity label may be embodied by encoding, for example, the number 0 represents a semantically incomplete label "complete”, and the number 1 represents a semantically complete label "incomplete”. Therefore, the semantic integrity label output by the semantic judgment model can be used to judge whether the semantics of the input question are complete.
  • the semantic judgment model needs to be trained, which specifically includes:
  • sample questions include semantically complete sample questions and semantically incomplete sample questions, such as the complete semantic sample question without omission, based on the incomplete semantic sample question omitted above.
  • semantic integrity annotation on the sample problem includes the annotation on the semantic incomplete sample problem and the annotation on the semantic complete sample problem.
  • the semantic judgment model according to the acquired sample problem and the corresponding annotation. That is, input the sample problem and the corresponding annotation into the semantic judgment model.
  • the semantic judgment model will output a semantic integrity label for each sample input problem. If the semantic integrity corresponding to the sample problem indicated by the output semantic integrity label If the semantic integrity indicated by the label is different, the parameters of the semantic judgment model are adjusted until the semantic integrity indicated by the two is the same.
  • the semantic judgment model after the training is completed can be used to judge the semantic integrity of input questions in the present disclosure.
  • whether the semantic judgment model has been trained can be determined by testing, that is, testing with a number of sample problems that are different from the training. If the semantic judgment model is trained, the semantics corresponding to the sample problems used in the test are complete If the accuracy of sexual judgment reaches the required precision, the training of the semantic judgment model can be stopped, that is, the training of the semantic judgment model is completed. If the accuracy rate does not reach the required accuracy, then continue to train the semantic judgment model.
  • the more sample problems for training the higher the accuracy of the prediction of the semantic judgment model.
  • the semantic integrity judgment of the input question is carried out through the constructed semantic judgment model, which improves the efficiency of automatic question answering. Moreover, after the semantic judgment model is trained, the semantic integrity judgment can be made for different types of questions, which improves the processing efficiency.
  • the reply information of the input question is matched from the question and answer database according to the semantic vector of the input question.
  • step S150 if the semantics of the input question are incomplete, the omitted phrases in the input question are predicted from the above corpus corresponding to the input question through the semantic supplement model.
  • the semantic supplement model is a model constructed by a neural network, that is, the deep learning method is used to predict the omitted phrases in the input problem, so that the automatic question answering method of topic transfer according to the template can be avoided, and the flexibility of automatic question answering can be improved.
  • step S150 before step S150 is performed, the method further includes:
  • the above corpus corresponding to the input question is constructed according to the question corpus and the reply corpus before the input question.
  • the automatic question answering method of the present disclosure is applicable to scenarios where multiple rounds of question and answer are performed.
  • a multiple round question and answer scenario if there is an omission in the input question, it is generally omitted for the above, so there is a correspondence for an input question Of the above corpus.
  • the above corpus is composed of the questions posed by the user before entering the question, and the reply information made by the question and answer server according to the questions posed by the user.
  • the reply information is the reply corpus before entering the question.
  • the previous two questions of the input question and the responses corresponding to the previous two questions are generally used to construct Enter the above corpus corresponding to the question. Therefore, after the response information of the input question is matched from the question and answer database, the above corpus is updated, and the input question and the corresponding response information about the reply are added to the above corpus, and the distance input question in the above corpus is first raised The question and the corresponding reply information are removed from the above corpus, and the updated above corpus is used as the next input question's above corpus.
  • step S150 includes:
  • Step S151 Construct a vector representation of the above corpus.
  • the above corpus consists of question corpus and reply corpus before inputting the question.
  • question corpus consists of question corpus and reply corpus before inputting the question.
  • reply corpus before inputting the question.
  • the above corpus of the problem can be composed of a set of question corpus and reply corpus of "what materials are required for the owner card” and “materials required by the owner card”.
  • the above corpus of input questions can be composed of multiple sets of question and answer corpus (question corpus and reply corpus) before the input question.
  • constructing the vector representation of the above corpus means constructing a complete semantic vector for the question corpus and the reply corpus in the above corpus.
  • step S152 a vector corresponding to the omitted phrase in the input question is predicted from the vector representation of the corpus according to the semantic vector using the semantic supplement model.
  • the semantic supplement model uses the reading comprehension idea based on the semantic vector of the input question, combining the semantic vector of the input question with the vector representation of the above corpus, and matching from the above corpus to the part associated with the words in the input question, Thus, the vector corresponding to the omitted phrase in the input problem is predicted.
  • the semantic supplement model may adopt the R-net model.
  • R-net is a neural network model proposed by Microsoft for machine reading comprehension.
  • the R-net model is creatively used for the prediction of omitted phrases in the process of automatic question answering, thereby improving the flexibility and efficiency of automatic question answering, so that the customer service robot can reply to the input question based on the omission above.
  • the R-net model includes four layers, of which layer I is used to construct the input problem and the semantic vector of the corpus above, that is, the semantic vector of the input problem mentioned above and the vector representation of the corpus above; layer II is used to The semantic vector of the input question is compared with the vector representation of the above corpus, so as to find out the phrases in the above corpus that are related or similar to the input question; layer III compares the related or similar phrases compared with layer II The phrases are placed in the above corpus for comparison through the attention mechanism, so as to locate several phrases that may be omitted phrases; layer IV performs classification prediction according to the corresponding vectors of the located several phrases, that is, the classification prediction obtains this The vector corresponding to each phrase in several phrases is the probability of the vector corresponding to the omitted phrase, and then the probability of the vector corresponding to each phrase in the several phrases is compared, and the vector corresponding to the phrase with the highest probability is corresponding to the omitted phrase vector.
  • Step S153 Determine the omitted phrase according to the vector corresponding to the omitted phrase.
  • step S150 it also includes:
  • Step S011 Acquire a number of semantically incomplete sample questions and a sample sample corpus of the sample question, and an omitted phrase supplemented by the sample sample sample corpus for the corresponding sample question.
  • step S012 a semantic supplement model is trained through a number of semantically incomplete sample problems and corresponding samples above the corpus and supplementary omitted phrases.
  • the training process in step S012 includes:
  • the model parameters of the semantic supplement model are adjusted until the predicted omitted phrases are the same as the added omitted phrases.
  • Step S013 when the semantic supplement model predicts the omission of phrases in the problem of incomplete semantics to the specified accuracy, the training of the semantic supplement model is completed.
  • step S170 the reply information of the input question is obtained from the question and answer database according to the semantically incomplete input question and the obtained omitted phrase.
  • the question and answer database stores a number of question corpora and answer corpora. Based on the input question and the obtained omitted phrases, the complete semantics of the question entered by the user can be correspondingly determined, and then the answer corpus can be matched according to the completeness and from the question and answer database as input questions reply message.
  • the question and answer database can be created by collecting several questions and corresponding answers, or based on the collected questions, transforming the questions to obtain multiple expansion questions, because different users ask questions for the same question The way is also different.
  • the collected questions and corresponding answers are also different.
  • the question corpus and answer corpus in the question and answer database are for insurance-related services. For example, the type of insurance, type of insurance, insurance claims, insurance costs, etc.
  • step S170 includes:
  • step S171 the complete semantic vector of the input question is constructed according to the input question with incomplete semantics and the obtained omitted phrases.
  • step S172 the reply information of the input question is obtained from the question and answer database by matching through the complete semantic vector.
  • the deep learning method is used to classify and predict the omitted phrases in the input question, so that in the automatic question and answer process, the complete semantics of the input question can be understood according to the predicted omitted phrases and the reply can be improved.
  • the flexibility and efficiency of automatic question answering can improve the user experience.
  • the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the automatic question answering method performed by the question answering server 200 of the present disclosure.
  • the automatic question answering method embodiments of the present disclosure please refer to the automatic question answering method embodiments of the present disclosure.
  • An automatic question answering device as shown in Figure 9, includes:
  • the semantic vector construction module 110 is configured to: construct a semantic vector of the input question.
  • the semantic integrity judgment module 130 which is connected to the semantic vector construction module 110, is configured to perform semantic integrity judgment on the input problem according to the semantic vector.
  • the omitted phrase prediction module 150 which is connected to the semantic integrity judgment module 130, is configured to: if the semantics of the input question are incomplete, predict the omitted phrases in the input question from the corpus corresponding to the input question through the semantic supplement model.
  • the reply information acquiring module 170 is connected to the omitted phrase prediction module 150, and is configured to acquire reply information of the input question from the question and answer database based on the semantically incomplete input question and the obtained omitted phrase.
  • the automatic question answering device of the present disclosure can be applied to customer service robots in different application scenarios to automatically respond to user questions, thereby improving the flexibility of the customer service robot and improving user experience.
  • the semantic vector construction module 110 includes:
  • the word segmentation unit is configured to segment the input question.
  • the part-of-speech tagging unit is configured to perform part-of-speech tagging on the words in the input question according to the result of word segmentation to determine the weight corresponding to each word in the input question.
  • the semantic vector construction unit is configured to construct a semantic vector of the input question according to the encoding corresponding to the word in the input question and the corresponding weight.
  • the semantic integrity judgment module 130 includes:
  • the semantic integrity label prediction unit is configured to use a semantic judgment model to predict the semantic integrity label of the input problem according to the semantic vector prediction.
  • the semantic integrity judgment unit is configured to judge whether the semantics of the input question is complete according to the semantic integrity label.
  • the automatic question answering device further includes:
  • the above corpus construction module is configured to: construct the above corpus corresponding to the input question according to the question corpus before the input question and the reply corpus.
  • the omitted phrase prediction module 150 includes:
  • the vector construction unit is configured to construct a vector representation of the above corpus.
  • the vector prediction unit of the omitted phrase is configured to predict the vector corresponding to the omitted phrase in the input problem from the vector representation of the corpus according to the semantic vector using the semantic supplement model.
  • the omitted phrase determination unit is configured to determine the omitted phrase according to the vector corresponding to the omitted phrase.
  • the automatic question answering device further includes:
  • the sample obtaining module is configured to obtain a number of semantically incomplete sample questions and a sample sample corpus of sample questions, and an omitted phrase supplemented by the sample sample corpus of the sample question to the corresponding sample question.
  • the model training module is configured to train the semantic supplement model through a number of semantically incomplete sample problems and corresponding samples above the corpus and supplemented omitted phrases.
  • the training completion module is configured to complete the training of the semantic supplement model when the prediction of the omission of the semantic supplement model to the problem of incomplete semantics reaches the specified accuracy.
  • the reply information acquisition module 170 includes:
  • the complete semantic vector construction unit is configured to construct a complete semantic vector of the input question based on the input question with incomplete semantics and the obtained omitted phrases.
  • the reply information matching unit is configured to match the response information of the input question from the question and answer database through the complete semantic vector.
  • the present disclosure also provides an automatic question answering device.
  • the automatic question answering device can be used in the question answering server 200 of the implementation environment shown in FIG. 1 to perform all or part of the steps of any of the above automatic question answering method embodiments.
  • the automatic question answering device 1000 includes:
  • the processor 1001 is configured as the method in the above automatic question answering method embodiment.
  • the executable instructions may be computer-readable instructions.
  • the computer-readable instructions are read from the memory 1002 through the bus / data line 1003 to perform all or part of the steps in any of the above automatic question answering method embodiments.
  • a computer-readable storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, the automatic question answering method in any of the above embodiments is implemented.
  • the computer-readable storage medium includes, for example, a memory 250 of instructions that can be executed by the central processor 270 of the question and answer server 200 to complete the automatic question and answer method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Machine Translation (AREA)

Abstract

本公开涉及人工智能技术领域,具体揭示了一种自动问答方法及装置,包括:构建输入问题的语义向量;根据所述语义向量对所述输入问题进行语义完整性判断;如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。采用深度学习的方法,针对语义不完整的输入问题进行省略词组预测,根据预测得到的省略词组结合输入的问题获取输入问题的回复信息,从而可以提高自动问答的灵活性,提高用户体验。

Description

自动问答方法及装置 技术领域
本申请要求2018年10月12日递交、发明名称为“自动问答方法及装置”的中国专利申请CN201811192199.7的优先权,在此通过引用将其全部内容合并于此。
本公开涉及人工智能技术领域,特别涉及一种自动问答方法及装置。
背景技术
目前,客服机器人只能针对用户提出的语义完整的问题进行解答,而对于一些根据上文内容进行省略的问题,客服机器人则无法处理。例如如下的对话:
Client(用户): 车主卡需要什么材料
Seat(客服机器人): 车主卡需要xxx材料
Client(用户): 年费多少?
客服机器人无法根据 “年费多少”这一基于上文进行省略的问题获取到对应的答复。
现有技术中针对这类问题的一种解决方式是:通过模板提取出当前对话的主题,然后默认把这一主题传递到下一段对话。例如如下的对话:
Client(用户): 车主卡需要什么材料 ?(模板会提取“车主卡”作为主题,并传递下去。)
Seat(客服机器人): 车主卡需要xxx材料。
Client(用户): 那旅游卡呢?   (继承上文的主题 “车主卡”,客户问题变成 “车主卡那旅游卡呢?”  变成了一个句法不通的问题)
所以该种方法基于模板和规则,还是比较十分笨拙,能覆盖的场景比较少,难以扩展。
因此,如何让客服机器人回答基于上文内容进行省略的问题还有待解决。
技术问题
为了解决相关技术中存在的问题,本公开提供了一种自动问答方法及装置。
技术解决方案
一种自动问答方法,所述方法包括:
构建输入问题的语义向量;
根据所述语义向量对所述输入问题进行语义完整性判断;
如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
一种自动问答装置,包括:
语义向量构建模块,配置为:构建输入问题的语义向量;
语义完整性判断模块,配置为:根据所述语义向量对所述输入问题进行语义完整性判断;
省略词组预测模块,配置为:如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
回复信息获取模块,配置为:根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
一种自动问答装置,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器配置为以上所述的自动问答方法。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上所述的自动问答方法。
有益效果
本公开的实施例提供的技术方案可以包括以下有益效果:采用深度学习的方法,针对语义不完整的输入问题进行省略词组预测,根据预测得到的省略词组结合输入的问题获取输入问题的回复信息,从而可以提高自动问答的灵活性,提高了用户体验,特别是人工智能技术领域中的客服机器人。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并于说明书一起用于解释本申请的原理。
图1是根据本公开所涉及的实施环境的示意图;
图2是根据一示例性实施例示出的一种问答服务器的框图;
图3是根据一示例性实施例示出的一种自动问答方法的流程图;
图4是图3所示实施例中步骤S110的流程图;
图5是图3所示实施例中步骤S130的流程图;
图6是图3所示实施例中步骤S150的流程图;
图7是根据另一示例性实施例示出的一种自动问答方法的流程图;
图8是图3对应实施例中步骤S170的流程图;
图9是根据一示例性实施例示出的一种自动问答装置的框图;
图10是根据另一示例性实施例示出的一种自动问答装置的框图。
本发明的实施方式
这里将详细地对示例性实施例执行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
图1是根据本公开所涉及的实施环境的示意图。该实施环境包括:问答服务器200和至少一个终端100。
其中终端100可以是智能手机、平板电脑、笔记本电脑、台式电脑等可以与问答服务器建立网络连接且可以运行客户端的电子设备,在此不进行具体限定。终端100与问答服务器200之间预先建立了无线或者有线的网络连接,从而,通过在终端100上运行的客户端实现终端100与问答服务器200进行交互。
基于问答服务器200与终端100之间的交互,问答服务器200便可以获取到用户在终端100上输入的问题,然后针对该问题进行语义向量构建、语义完整性判断、省略词组预测以及匹配回复信息等。终端100可以接收问答服务器所匹配的回复信息,并将回复信息呈现给用户,从而实现自动对用户输入的问题进行回答。
图2是根据一示例性实施例示出的一种问答服务器的框图。具有此硬件结构的服务器可用于进行自动问答而部署在图1所示的实施环境中。
需要说明的是,该问答服务器只是一个适配于本公开的示例,不能认为是提供了对本公开使用范围的任何限制。该问答服务器也不能解释为需要依赖于或者必须具有图2中示出的示例性的问答服务器200中的一个或者多个组件。
该问答服务器的硬件结构可因配置或者性能的不同而产生较大的差异,如图2所示,问答服务器200包括:电源210、接口230、至少一存储器250、以及至少一中央处理器(CPU, Central Processing Units)270。
其中,电源210用于为问答服务器200上的各硬件设备提供工作电压。
接口230包括至少一有线或无线网络接口231、至少一串并转换接口233、至少一输入输出接口235以及至少一USB接口237等,用于与外部设备通信。
存储器250作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源包括操作系统251、应用程序253及数据255等,存储方式可以是短暂存储或者永久存储。其中,操作系统251用于管理与控制问答服务器200上的各硬件设备以及应用程序253,以实现中央处理器270对海量数据255的计算与处理,其可以是Windows ServerTM、Mac OS XTM、UnixTM、LinuxTM、FreeBSDTM等。应用程序253是基于操作系统251之上完成至少一项特定工作的计算机程序,其可以包括至少一模块(图2中未示出),每个模块都可以分别包含有对问答服务器200的一系列计算机可读指令。数据255可以是存储于磁盘中的问答数据库等。
中央处理器270可以包括一个或多个以上的处理器,并设置为通过总线与存储器250通信,用于运算与处理存储器250中的海量数据255。
如上面所详细描述的,适用本公开的问答服务器200将通过中央处理器270读取存储器250中存储的一系列计算机可读指令的形式来完成自动问答方法。
在示例性实施例中,问答服务器200可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit ,简称ASIC)、数字信号处理器、数字信号处理设备、可编程逻辑器件、现场可编程门阵列、控制器、微控制器、微处理器或其他电子元件实现,用于执行下述方法。因此,实现本公开并不限于任何特定硬件电路、软件以及两者的组合。
图3是根据一示例性实施例示出的一种自动问答方法的流程图。该自动问答方法可以适用于图1所示实施环境的问答服务器200中,由问答服务器200执行,可以包括以下步骤:
步骤S110,构建输入问题的语义向量。
用户在终端100上输入问题,然后问答服务器200从终端100上获取用户的输入问题,并针对所获取的输入问题构建输入问题的语义向量。
其中输入问题是用户在终端100上所输入的问题,针对不同的应用场景,输入问题可以是针对不同领域的问题,例如在银行的应用场景,输入问题可以是关于银行卡、存储、贷款、利息等相关的问题;在保险的应用场景中,输入问题可以是关于保险办理、理赔等相关的问题,当然也可以是多个领域综合的问题,比如针对用户为学生的,输入问题可以是关于综合百科知识的问题。在此不进行具体限定。
其中,值得说明的是,本公开的自动问答方法特别适用于多轮问答的场景。
语义向量是指通过输入问题中各个词对应的编码以及每个词对应的权重所构建的向量,该向量用于表示输入问题的语义。在一个句子当中,句子中每个词对句子的语义的贡献程度不同。例如在“办理平安车主卡需要哪些材料”这一问题中,“办理”“车主卡”“材料”对整个问题的语义贡献程度更大,所以该三个词所对应的权重更大,而“平安”、“需要”“哪些”这些词对整个问题的语义贡献程度稍小,所以该些词对应的权重小一些。
针对一个文本处理系统,会构建一个文本数据库。例如在本公开的方法中会构建一个问答数据库,其中包括了若干用户可能问的问题以及问题的回复信息(答案)。当然,该问答数据库是针对自动问答所应用的场景所构建的,例如针对保险的应用场景,该问答数据库所收录的问题以及问题的回复信息是针对保险相关信息。所以,针对不同的应用场景,问答数据中收录的问题存在差异。
针对这些问题和回复信息,问答数据库中包括一个词典,该词典用于对这些问题和回复信息中的词进行编码,以及问题或者回复信息中每个词配置对应的权重。从而在接收了用户的输入问题之后,可以根据问答数据库的词典,输入问题中词的编码以及输入问题中每个词的权重构建输入问题的语义向量。
在具体实施例中,每个词对应的编码为实数,即用数字来表示句子中的词语,词所对应的权重也为实数,因而,最终针对输入问题所构建的语义向量为一实数向量。
在一示例性实施例中,如图4所示,步骤S110包括:
步骤S111,对输入问题进行分词。
其中,分词是指将输入问题分割成若干个按顺序排列的词语,例如“办理平安车主卡需要哪些材料”可以分词为“办理^平安^车主卡^需要^哪些^材料”。
分词可以采用分词算法进行,例如可以采用基于字符串匹配的分词方法、基于理解的分词方法或基于统计的分词方法等算法,在此不进行限定。
步骤S112,根据分词结果对输入问题中的词进行词性标注,以确定输入问题中的每个词所对应的权重。
词性标注是指根据每个词在输入问题中的语法位置以及属性进行的标注,例如处在主语位置的词、处在谓语位置的词、处在宾语位置的词;例如名词(指物名词、指人名词、时间名词、地点名词等)、动词、否定词等词性,当然以上仅仅是示例性列举,不能认为是对本公开使用范围的限制。
在上文提到的问答数据库中的词典,该词典中对每个问题或者答案中的词权重的配置是根据此在问题或者中的答案中的语法位置以及该词的词性来进行配置的。从而根据词性标注的结果,可以确定输入问题中每个词所对应的权重。
步骤S113,根据输入问题中的词所对应的编码以及所对应的权重构建得到输入问题的语义向量。
在得到分词结果,从而可以根据分词结果从问答数据库的词典中中词对应的编码以及词对应的权重构建输入问题的语义向量。
步骤S130,根据语义向量对输入问题进行语义完整性判断。
语义完整性判断即通过语义向量判断该输入问题的语义是否完整。其中语义不完整的输入问题包括针对上文进行省略的输入问题,例如主语省略、宾语省略、定语省略以及其他句子成分省略等,例如如果该输入问题之前问了“车主卡需要什么材料”,在回答了“车主卡需要×××材料”之后,用户还可能问“那旅游卡呢?”当然,就单纯这一个问题“那旅游卡呢”,该问题的语义是不完整的,如果没有上文的语料信息,问答服务器是无法根据该问题进行回复的。
在一示例性实施例中,可以通过深度学习的方法进行输入问题的语义完整性判断,即利用神经网络构建语义判断模型,并利用若干样本问题进行语义判断模型的训练,从而,语义判断模型在训练完成后可以针对一输入问题判断该输入问题的语义是否完整。具体的,如图5所示,语义判断模型进行语义完整性判断可以包括如下步骤:
步骤S131,利用语义判断模型根据语义向量预测得到输入问题的语义完整性标签。
步骤S132,根据语义完整标签判断输入问题的语义是否完整。
其中语义完整性标签包括针对语义完整的标签“完整”和针对语义不完整的标签“不完整”。在具体实施方式中,语义完整性标签可以是通过编码来体现,例如用数字0表示语义不完整的标签“完整”,用数字1表示语义完整的标签“不完整”。从而可以根据语义判断模型所输出的语义完整性标签进行判断输入问题的语义是否完整。
在一具体实施例中,在利用语义判断模型进行语义完整性判断之前,需要对语义判断模型进行训练,具体包括:
获取若干样本问题以及对样本问题的语义完整性标注。其中样本问题包括语义完整的样本问题和语义不完整的样本问题,例如没有省略的完整语义样本问题,基于上文省略的的不完整语义样本问题。相对应的,对样本问题的语义完整性标注包括针对语义不完整样本问题的标注和针对语义完整样本问题的标注。
根据所获取的样本问题和所对应标注进行语义判断模型的训练。即将样本问题和对应的标注输入到语义判断模型中,语义判断模型会针对每一样本输入问题输出一个语义完整性标签,如果所输出的语义完整性标签所指示的样本问题所对应语义完整性与标注所指示的语义完整性不同,则调整语义判断模型的参数,直至两者所指示的语义完整性相同。
训练完成后的语义判断模型可以用于本公开中输入问题的语义完整性判断。在具体实施例中,语义判断模型是否训练完成,可以通过测试来判定,即用若干不同于训练所用的样本问题来进行测试,如果语义判断模型在训练后针对测试所用的样本问题所对应语义完整性判断的准确率达到要求的精度,则可以停止语义判断模型的训练,即语义判断模型训练完成。如果准确率没有达到要求的精度,那么继续进行语义判断模型的训练。当然,排除语义判断模型的模型结构的影响外,训练用的样本问题越多,则语义判断模型预测的准确率越高。
通过所构建的语义判断模型来进行输入问题的语义完整性判断,提高了自动问答的效率,而且,在语义判断模型训练之后,可以针对不同类型的问题进行语义完整性判断,提高了处理效率。
在一示例性实施例中,如果根据语义判断模型判断出输入问题的语义完整,则根据输入问题的语义向量从问答数据库中匹配输入问题的回复信息。
步骤S150,如果输入问题的语义不完整,通过语义补充模型从输入问题对应的上文语料库中预测得到输入问题中的省略词组。
其中语义补充模型是通过神经网络所构建的模型,即采用深度学习的方式进行输入问题中省略词组的预测,从而可以避免根据模板进行主题传递的自动问答方式,可以提高自动问答的灵活性。
在一示例性实施例中,在执行步骤S150之前,还包括:
根据输入问题之前的问题语料和回复语料构建输入问题对应的上文语料库。
正如上文中所指出,本公开的自动问答方法适用于进行多轮问答的场景,在多轮问答场景中,输入问题中如果有省略,一般是针对上文进行省略,所以针对一输入问题有对应的上文语料。该上文语料是由输入问题之前用户提出的问题,以及问答服务器根据用户所提出问题作出的回复信息构成,输入问题之前用户提出的问题即输入问题之前的问题语料,问答服务器根据用户所提出问题作出的回复信息即输入问题之前的回复语料。
在一具体实施例中,在保证对输入问题中的省略词组的预测精度的条件下,为了降低语义补充模型的运算量,一般利用输入问题的上两个问题以及上两个问题对应的回复构建输入问题对应的上文语料。从而,在从问答数据库中匹配到输入问题的回复信息之后,更新上文语料库,即将回复完成的输入问题以及对应的回复信息补充到上文语料库中,并将上文语料库中距离输入问题最早提出的问题以及对应的回复信息从上文语料库中移除,将更新后的上文语料库作为下一输入问题的上文语料库。
在一实施例中,采用深度学习模型进行省略词组的预测可以如图6所示,步骤S150包括:
步骤S151,构建上文语料库的向量表示。
如上所述,上文语料库由输入问题之前的问题语料和回复语料构成。例如在如下的对话中:
Client(用户):车主卡需要什么材料
Seat(客服机器人):车主卡需要×××材料
Client(用户):年费多少
那么针对用户的“年费多少”这一问题,该问题的上文语料库可由“车主卡需要什么材料”以及“车主卡需要×××材料”这一组问题语料和回复语料构成。当然在更多轮的问答中,输入问题的上文语料库可以由输入问题之前的多组问答语料(问题语料和回复语料)构成。
采用与构建输入问题的语义向量相同的方式,构建上文语料库的向量表示即对上文语料库中的问题语料和回复语料构建完整语义向量。
步骤S152,利用语义补充模型根据语义向量从上文语料库的向量表示中预测得到输入问题中的省略词组所对应的向量。
语义补充模型根据输入问题的语义向量,采用阅读理解的思路,将输入问题的语义向量与上文语料库的向量表示结合起来,从上文语料库中匹配到与输入问题中的词相关联的部分,从而预测得到输入问题中省略词组所对应的向量。
在一示例性实施例中,语义补充模型可以采用R-net模型。其中R-net是由微软提出的用于机器阅读理解的神经网络模型。在本公开中,创造性地将R-net模型用于自动问答过程中的省略词组的预测,从而提高自动问答的灵活性和效率,从而客服机器人可以对基于上文省略的输入问题进行回复。
R-net模型包括四层,其中第I层用于构建输入问题和上文语料库的语义向量,即上文提到的输入问题的语义向量和上文语料库的向量表示;第II层用于将输入问题的语义向量与上文语料库的向量表示进行比对,从而找出上文语料库中与输入问题相关联或者相似的词组;第III层将第II层所比对到的相关联或者相似的词组通过注意力机制放在上文语料库中进行比对,从而定位到可能是省略词组的若干个词组;第IV层根据所定位到的若干个词组所对应向量进行分类预测,即分类预测得到该若干个词组中每个词组所对应向量为省略词组所对应向量的概率,然后将该若干个词组中每个词组所对应向量的概率进行比较,将概率最大的词组所对应向量作为省略词组所对应向量。
步骤S153,根据省略词组所对应向量确定省略词组。
当然,语义补充模型用于省略词组的预测之前还需要对语义补充模型进行训练,所以,在一示例性实施例中,如图7所示,在步骤S150之前,还包括:
步骤S011,获取若干语义不完整的样本问题及样本问题的样本上文语料库,以及根据样本问题的样本上文语料库对所对应样本问题补充的省略词组。
步骤S012,通过若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行语义补充模型的训练。
其中步骤S012中的训练过程包括:
将每一样本问题及所对应的样本上文语料库输入到语义补充模型中,预测得到样本问题中的省略词组。
根据对样本问题所补充的省略词组,调整语义补充模型的模型参数,直到预测得到的省略词组与所补充的省略词组相同。
步骤S013,当语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成语义补充模型的训练。
步骤S170,根据语义不完整的输入问题和所获得的省略词组从问答数据库中获取输入问题的回复信息。
问答数据库中存储了若干问题语料和答复语料,在根据输入问题和所获得的省略词组可以对应确定用户所输入的问题的完整语义,进而根据完整以及从问答数据库中匹配答复语料作为对输入问题的回复信息。在具体实施例中,问答数据库的创建可以搜集的若干问题以及对应的答复来创建,或者在所搜集问题的基础上,对问题进行变换得到多个拓展问题,因为用户不同,针对同一问题提问的方式也有所不同。当然,针对本公开自动问答系统应用的领域不同,所搜集的问题以及对应的答复也不相同,例如,在保险的应用场景中,问答数据库中的问题语料和答复语料是针对保险相关业务的,例如保险的类别、险别、保险的理赔、保险的费用等。
在一示例性实施例中,如图8所示,步骤S170包括:
步骤S171,根据语义不完整的输入问题和所获得的省略词组构建输入问题的完整语义向量。
步骤S172,通过完整语义向量从问答数据库中匹配得到输入问题的回复信息。
通过本公开的技术方案,采用深度学习的方式,对输入问题中的省略词组进行分类预测,从而可以在自动问答过程中,根据预测得到的省略词组理解输入问题的完整语义,进行回复,提高了自动问答的灵活性和效率,从而可以提高用户体验。
下述为本公开装置实施例,可以用于执行本公开上述问答服务器200执行的自动问答方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开自动问答方法实施例。
一种自动问答装置,如图9所示,包括:
语义向量构建模块110,配置为:构建输入问题的语义向量。
语义完整性判断模块130,该模块与语义向量构建模块110连接,配置为:根据语义向量对输入问题进行语义完整性判断。
省略词组预测模块150,该模块与语义完整性判断模块130连接,配置为:如果输入问题的语义不完整,通过语义补充模型从输入问题对应的上文语料库中预测得到输入问题中的省略词组。
回复信息获取模块170,该模块与省略词组预测模块150连接,配置为:根据语义不完整的输入问题和所获得的省略词组从问答数据库中获取输入问题的回复信息。
本公开的自动问答装置可以应用于不同应用场景的客服机器人,自动对用户的问题进行回复,从而可以提高客服机器人的灵活性,提高用户体验。
在一实施例中,语义向量构建模块110包括:
分词单元,配置为:对输入问题进行分词。
词性标注单元,配置为:根据分词结果对输入问题中的词进行词性标注,以确定输入问题中的每个词所对应的权重。
语义向量构建单元,配置为:根据输入问题中的词所对应的编码以及所对应的权重构建得到输入问题的语义向量。
在一实施例中,语义完整性判断模块130包括:
语义完整性标签预测单元,配置为:利用语义判断模型根据语义向量预测得到输入问题的语义完整性标签。
语义完整性判断单元,配置为:根据语义完整标签判断输入问题的语义是否完整。
在一实施例中,自动问答装置还包括:
上文语料库构建模块,配置为:根据输入问题之前的问题语料和回复语料构建输入问题对应的上文语料库。
在一实施例中,省略词组预测模块150包括:
向量构建单元,配置为:构建上文语料库的向量表示。
省略词组的向量预测单元,配置为:利用语义补充模型根据语义向量从上文语料库的向量表示中预测得到输入问题中的省略词组所对应向量。
省略词组确定单元,配置为:根据省略词组所对应向量确定省略词组。
在一实施例中,自动问答装置还包括:
样本获取模块,配置为:获取若干语义不完整的样本问题及样本问题的样本上文语料库,以及根据样本问题的样本上文语料库对所对应样本问题补充的省略词组。
模型训练模块,配置为:通过若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行语义补充模型的训练。
训练完成模块,配置为:当语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成语义补充模型的训练。
在一实施例中,回复信息获取模块170包括:
完整语义向量构建单元,配置为:根据语义不完整的输入问题和所获得的省略词组构建输入问题的完整语义向量。
回复信息匹配单元,配置为:通过完整语义向量从问答数据库中匹配得到输入问题的回复信息。
上述装置中各个模块/单元的功能和作用的实现过程具体详见上述自动问答方法中对应步骤的实现过程,在此不再赘述。
可选的,本公开还提供一种自动问答装置,该自动问答装置可以用于图1所示实施环境的问答服务器200中,用于执行以上任一自动问答方法实施例的全部或者部分步骤。如图10所示,该自动问答装置1000包括:
处理器1001,以及
用于存储处理器1001可执行指令的存储器1002。
其中,处理器1001配置为以上自动问答方法实施例中的方法。可执行指令可以是计算机可读指令,处理器1001在工作时,通过总线/数据线1003从存储器1002中读取计算机可读指令执行以上任一自动问答方法实施例中的全部或者部分步骤。
上述装置中各个模块/单元的功能和作用的实现过程具体详见上述自动问答方法中对应步骤的实现过程,在此不再赘述。
在示例性实施例中,还提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以上任一实施例中的自动问答方法。该计算机可读存储介质例如包括指令的存储器250,上述指令可由问答服务器200的中央处理器270执行以完成上述自动问答方法。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (28)

  1. 一种自动问答方法,所述方法包括:
    构建输入问题的语义向量;
    根据所述语义向量对所述输入问题进行语义完整性判断;
    如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
    根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
  2. 根据权利要求1所述的方法,其中,所述构建输入问题的语义向量,包括:
    对所述输入问题进行分词;
    根据分词结果对所述输入问题中的词进行词性标注,以确定所述输入问题中的每个词所对应的权重;
    根据所述输入问题中的词所对应的编码以及所对应的所述权重构建得到所述输入问题的语义向量。
  3. 根据权利要求1或2所述的方法,其中,所述根据所述语义向量对所述输入问题进行语义完整性判断,包括:
    利用语义判断模型根据所述语义向量预测得到所述输入问题的语义完整性标签;
    根据所述语义完整标签判断所述输入问题的语义是否完整。
  4. 根据权利要求1至3中任一项所述的方法,其中,所述通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组之前,所述方法还包括:
    根据所述输入问题之前的问题语料和回复语料构建所述输入问题对应的上文语料库。
  5. 根据权利要求1至4中任一项所述的方法,其中,所述通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组,包括:
    构建所述上文语料库的向量表示;
    利用所述语义补充模型根据所述语义向量从所述上文语料库的向量表示中预测得到所述输入问题中的省略词组所对应向量;
    根据所述省略词组所对应向量确定所述省略词组。
  6. 根据权利要求1至5中任一项所述的方法,其中,所述通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组之前,还包括:
    获取若干语义不完整的样本问题及所述样本问题的样本上文语料库,以及根据所述样本问题的样本上文语料库对所对应样本问题补充的省略词组;
    通过所述若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行所述语义补充模型的训练;
    当所述语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成所述语义补充模型的训练。
  7. 根据权利要求1至6中任一项所述的方法,其中,所述根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息,包括:
    根据语义不完整的所述输入问题和所获得的所述省略词组构建所述输入问题的完整语义向量;
    通过所述完整语义向量从问答数据库中匹配得到所述输入问题的回复信息。
  8. 一种自动问答装置,包括:
    语义向量构建模块,配置为:构建输入问题的语义向量;
    语义完整性判断模块,配置为:根据所述语义向量对所述输入问题进行语义完整性判断;
    省略词组预测模块,配置为:如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
    回复信息获取模块,配置为:根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
  9. 根据权利要求8所述的装置,其中,所述语义向量构建模块包括:
    分词单元,配置为:对所述输入问题进行分词;
    词性标注单元,配置为:根据分词结果对所述输入问题中的词进行词性标注,以确定所述输入问题中的每个词所对应的权重;
    语义向量构建单元,配置为:根据所述输入问题中的词所对应的编码以及所对应的所述权重构建得到所述输入问题的语义向量。
  10. 根据权利要求8或9所述的装置,其中,所述语义完整性判断模块包括:
    语义完整性标签预测单元,配置为:利用语义判断模型根据所述语义向量预测得到所述输入问题的语义完整性标签;
    语义完整性判断单元,配置为:根据所述语义完整标签判断所述输入问题的语义是否完整。
  11. 根据权利要求8至10中任一项所述的装置,所述装置还包括:
    上文语料库构建模块,配置为:根据所述输入问题之前的问题语料和回复语料构建所述输入问题对应的上文语料库。
  12. 根据权利要求8至11中任一项所述的装置,其中,所述省略词组预测模块包括:
    向量构建单元,配置为:构建所述上文语料库的向量表示;
    省略词组的向量预测单元,配置为:利用所述语义补充模型根据所述语义向量从所述上文语料库的向量表示中预测得到所述输入问题中的省略词组所对应向量;
    省略词组确定单元,配置为:根据所述省略词组所对应向量确定所述省略词组。
  13. 根据权利要求8至12中任一项所述的装置,其中,所述装置还包括:
    样本获取模块,配置为:获取若干语义不完整的样本问题及所述样本问题的样本上文语料库,以及根据所述样本问题的样本上文语料库对所对应样本问题补充的省略词组;
    模型训练模块,配置为:通过所述若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行所述语义补充模型的训练;
    训练完成模块,配置为:当所述语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成所述语义补充模型的训练。
  14. 根据权利要求8至13中任一项所述的装置,其中,所述回复信息获取模块包括:
    完整语义向量构建单元,配置为:根据语义不完整的所述输入问题和所获得的所述省略词组构建所述输入问题的完整语义向量;
    回复信息匹配单元,配置为:通过所述完整语义向量从问答数据库中匹配得到所述输入问题的回复信息。
  15. 一种自动问答装置,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器配置为以下步骤:
    构建输入问题的语义向量;
    根据所述语义向量对所述输入问题进行语义完整性判断;
    如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
    根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
  16. 根据权利要求15所述的装置,其中,在构建输入问题的语义向量步骤中,所述处理器执行以下步骤:
    对所述输入问题进行分词;
    根据分词结果对所述输入问题中的词进行词性标注,以确定所述输入问题中的每个词所对应的权重;
    根据所述输入问题中的词所对应的编码以及所对应的所述权重构建得到所述输入问题的语义向量。
  17. 根据权利要求15或16所述的装置,其中,在根据所述语义向量对所述输入问题进行语义完整性判断步骤中,所述处理器执行以下步骤:
    利用语义判断模型根据所述语义向量预测得到所述输入问题的语义完整性标签;
    根据所述语义完整标签判断所述输入问题的语义是否完整。
  18. 根据权利要求15至17中任一项所述的装置,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤之前,所述处理器还执行以下步骤:
    根据所述输入问题之前的问题语料和回复语料构建所述输入问题对应的上文语料库。
  19. 根据权利要求15至18中任一项所述的装置,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤中,所述处理器执行以下步骤:
    构建所述上文语料库的向量表示;
    利用所述语义补充模型根据所述语义向量从所述上文语料库的向量表示中预测得到所述输入问题中的省略词组所对应向量;
    根据所述省略词组所对应向量确定所述省略词组。
  20. 根据权利要求15至19中任一项所述的装置,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤之前,所述处理器还执行以下步骤:
    获取若干语义不完整的样本问题及所述样本问题的样本上文语料库,以及根据所述样本问题的样本上文语料库对所对应样本问题补充的省略词组;
    通过所述若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行所述语义补充模型的训练;
    当所述语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成所述语义补充模型的训练。
  21. 根据权利要求15至20中任一项所述的装置,其中,在根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息步骤中,所述处理器执行以下步骤:
    根据语义不完整的所述输入问题和所获得的所述省略词组构建所述输入问题的完整语义向量;
    通过所述完整语义向量从问答数据库中匹配得到所述输入问题的回复信息。
  22. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序由处理器执行以下步骤:
    构建输入问题的语义向量;
    根据所述语义向量对所述输入问题进行语义完整性判断;
    如果所述输入问题的语义不完整,通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组;
    根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息。
  23. 根据权利要求22所述的计算机可读存储介质,其中,在构建输入问题的语义向量步骤中,所述处理器执行以下步骤:
    对所述输入问题进行分词;
    根据分词结果对所述输入问题中的词进行词性标注,以确定所述输入问题中的每个词所对应的权重;
    根据所述输入问题中的词所对应的编码以及所对应的所述权重构建得到所述输入问题的语义向量。
  24. 根据权利要求22或23所述的计算机可读存储介质,其中,在根据所述语义向量对所述输入问题进行语义完整性判断步骤中,所述处理器执行以下步骤:
    利用语义判断模型根据所述语义向量预测得到所述输入问题的语义完整性标签;
    根据所述语义完整标签判断所述输入问题的语义是否完整。
  25. 根据权利要求22至24中任一项所述的计算机可读存储介质,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤之前,所述处理器还执行以下步骤:
    根据所述输入问题之前的问题语料和回复语料构建所述输入问题对应的上文语料库。
  26. 根据权利要求22至25中任一项所述的计算机可读存储介质,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤中,所述处理器执行以下步骤:
    构建所述上文语料库的向量表示;
    利用所述语义补充模型根据所述语义向量从所述上文语料库的向量表示中预测得到所述输入问题中的省略词组所对应向量;
    根据所述省略词组所对应向量确定所述省略词组。
  27. 根据权利要求22至26中任一项所述的计算机可读存储介质,其中,在通过语义补充模型从所述输入问题对应的上文语料库中预测得到所述输入问题中的省略词组步骤之前,所述处理器还执行以下步骤:
    获取若干语义不完整的样本问题及所述样本问题的样本上文语料库,以及根据所述样本问题的样本上文语料库对所对应样本问题补充的省略词组;
    通过所述若干语义不完整样本问题以及所对应的样本上文语料库、所补充的省略词组进行所述语义补充模型的训练;
    当所述语义补充模型对语义不完整的问题中省略词组的预测达到指定精度,完成所述语义补充模型的训练。
  28. 根据权利要求22至27中任一项所述的计算机可读存储介质,其中,在根据语义不完整的所述输入问题和所获得的所述省略词组从问答数据库中获取所述输入问题的回复信息步骤中,所述处理器执行以下步骤:
    根据语义不完整的所述输入问题和所获得的所述省略词组构建所述输入问题的完整语义向量;
    通过所述完整语义向量从问答数据库中匹配得到所述输入问题的回复信息。
PCT/CN2018/125252 2018-10-12 2018-12-29 自动问答方法及装置 WO2020073533A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811192199.7A CN109522395A (zh) 2018-10-12 2018-10-12 自动问答方法及装置
CN201811192199.7 2018-10-12

Publications (1)

Publication Number Publication Date
WO2020073533A1 true WO2020073533A1 (zh) 2020-04-16

Family

ID=65772381

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/125252 WO2020073533A1 (zh) 2018-10-12 2018-12-29 自动问答方法及装置

Country Status (2)

Country Link
CN (1) CN109522395A (zh)
WO (1) WO2020073533A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020242383A1 (en) * 2019-05-28 2020-12-03 Active Intelligence Pte Ltd Conversational diaglogue system and method
CN110457450B (zh) * 2019-07-05 2023-12-22 平安科技(深圳)有限公司 基于神经网络模型的答案生成方法及相关设备
CN110717023B (zh) * 2019-09-18 2023-11-07 平安科技(深圳)有限公司 面试回答文本的分类方法及装置、电子设备、存储介质
CN110956962A (zh) * 2019-10-17 2020-04-03 中国第一汽车股份有限公司 车载机器人的答复信息确定方法、装置及设备
CN111078853B (zh) * 2019-12-13 2023-05-02 上海智臻智能网络科技股份有限公司 问答模型的优化方法、装置、计算机设备和存储介质
CN111104503A (zh) * 2019-12-24 2020-05-05 华中科技大学 一种建筑工程质量验收规范问答系统及其构建方法
CN112183114B (zh) * 2020-08-10 2024-05-14 招联消费金融股份有限公司 模型训练、语义完整性识别方法和装置
CN112035636B (zh) * 2020-08-28 2023-06-02 康键信息技术(深圳)有限公司 医疗问诊系统的问答管理方法、装置、设备及存储介质
CN113282733B (zh) * 2021-06-11 2024-04-09 上海寻梦信息技术有限公司 客服问题匹配方法、系统、设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632979A (zh) * 2017-10-13 2018-01-26 华中科技大学 一种用于交互式问答的问题解析方法及系统
CN108334487A (zh) * 2017-07-14 2018-07-27 腾讯科技(深圳)有限公司 缺失语意信息补全方法、装置、计算机设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589844B (zh) * 2015-12-18 2017-08-08 北京中科汇联科技股份有限公司 一种用于多轮问答系统中缺失语义补充的方法
CN107798140B (zh) * 2017-11-23 2020-07-03 中科鼎富(北京)科技发展有限公司 一种对话系统构建方法、语义受控应答方法及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334487A (zh) * 2017-07-14 2018-07-27 腾讯科技(深圳)有限公司 缺失语意信息补全方法、装置、计算机设备和存储介质
CN107632979A (zh) * 2017-10-13 2018-01-26 华中科技大学 一种用于交互式问答的问题解析方法及系统

Also Published As

Publication number Publication date
CN109522395A (zh) 2019-03-26

Similar Documents

Publication Publication Date Title
WO2020073533A1 (zh) 自动问答方法及装置
CN112131366B (zh) 训练文本分类模型及文本分类的方法、装置及存储介质
Dharwadkar et al. A medical chatbot
WO2020228376A1 (zh) 文本处理方法、模型训练方法和装置
WO2022007823A1 (zh) 一种文本数据处理方法及装置
CN111897941B (zh) 对话生成方法、网络训练方法、装置、存储介质及设备
CN112288075B (zh) 一种数据处理方法及相关设备
CN113157863B (zh) 问答数据处理方法、装置、计算机设备及存储介质
CN113761153B (zh) 基于图片的问答处理方法、装置、可读介质及电子设备
CN111666416A (zh) 用于生成语义匹配模型的方法和装置
CN113704460B (zh) 一种文本分类方法、装置、电子设备和存储介质
WO2022001724A1 (zh) 一种数据处理方法及装置
CN110377733A (zh) 一种基于文本的情绪识别方法、终端设备及介质
CN113705191A (zh) 样本语句的生成方法、装置、设备及存储介质
CN116821373A (zh) 基于图谱的prompt推荐方法、装置、设备及介质
CN111931503B (zh) 信息抽取方法及装置、设备、计算机可读存储介质
CN112131884B (zh) 用于实体分类的方法和装置、用于实体呈现的方法和装置
US20220139245A1 (en) Using personalized knowledge patterns to generate personalized learning-based guidance
Lola et al. Chatbot for fitness management using IBM Watson
WO2023040545A1 (zh) 一种数据处理方法、装置、设备、存储介质和程序产品
CN112861474B (zh) 一种信息标注方法、装置、设备及计算机可读存储介质
Kulkarni et al. College chat-bot
CN112052320B (zh) 一种信息处理方法、装置及计算机可读存储介质
CN112149426B (zh) 阅读任务处理方法及相关设备
CN111414609B (zh) 一种对象验证方法和装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18936843

Country of ref document: EP

Kind code of ref document: A1