WO2021017300A1 - 问题生成方法、装置、计算机设备及存储介质 - Google Patents

问题生成方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021017300A1
WO2021017300A1 PCT/CN2019/117965 CN2019117965W WO2021017300A1 WO 2021017300 A1 WO2021017300 A1 WO 2021017300A1 CN 2019117965 W CN2019117965 W CN 2019117965W WO 2021017300 A1 WO2021017300 A1 WO 2021017300A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
question sentence
sentence
template
candidate
Prior art date
Application number
PCT/CN2019/117965
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 WO2021017300A1 publication Critical patent/WO2021017300A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Definitions

  • This application relates to the field of human-computer interaction technology, and in particular to a question generation method, question generation device, computer equipment and storage medium.
  • Question answering device is an advanced form of information retrieval device. It can use accurate and concise natural language to answer users' questions in natural language. The main reason for the rise of research is people's demand for fast and accurate information acquisition. Question answering device is currently a research direction in the field of artificial intelligence and natural language processing that has attracted much attention and has broad development prospects. Therefore, question answering devices have been widely used in medical, financial and other industries and have become part of people's daily lives.
  • this application proposes a question generation method, question generation device, computer equipment, and storage medium, which can identify the topic in the question sentence, and combine the topic and similarity to generate the target question sentence, so that the generated target Questions are more in line with the actual needs and ideas of users.
  • this application proposes a question generation method, which includes the steps of: obtaining a question input by a user; obtaining a topic group in the question according to the question; and combining the question with Match the template question sentences in the pre-created knowledge base, obtain each candidate question sentence, and calculate the matching result between each candidate question sentence and the question sentence; and according to the topic group and the matching result, A target question related to the question sentence is selected from the candidate question sentence.
  • this application also provides a question generation device, which includes:
  • the sentence classification system sequentially identifies the topics in the question sentence; it is also used to splice the topics to form a topic group in the question sentence; the semantic recognition module is used to combine the question sentence with each topic
  • One of the template questions in the template question is input into the first channel neural network to obtain the first feature representation of the question and one of the template questions; used to combine the question and each of the template questions
  • One of the template question sentences in is input into the second channel neural network to obtain the question sentence and a second feature representation of the template question sentence; it is used to connect the first feature representation and the
  • the second feature representation is used to obtain the final feature representation of the question sentence and a template question sentence; and also used to calculate the similarity value of the final feature representation of the question sentence and a template question sentence according to a loss function;
  • the question selection module is used to select a target question related to the question sentence according to the topic group and the similarity value.
  • this application also provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the computer-readable instructions When implementing the steps of the above method.
  • the present application also provides a non-volatile computer-readable storage medium on which computer-readable instructions are stored, and the computer-readable instructions implement the steps of the foregoing method when executed by a processor.
  • the question generation method proposed in this application not only considers the semantic matching degree of the question sentence with the template question sentence, but also considers the topic of the question sentence, so that the relevant question sentence can be obtained quickly, conveniently, accurately and efficiently. Questions are very suitable for human-computer interaction devices, and these related questions are more in line with the actual needs and ideas of users.
  • FIG. 1 is a schematic flowchart of a question generation method according to the first embodiment of the present application
  • Fig. 2 is a schematic flowchart of a question generation method according to a second embodiment of the present application
  • FIG. 3 is a schematic flow chart of the question generation method of the third embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a question generation method according to a fourth embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a question generation method according to a fifth embodiment of the present application.
  • Fig. 6 is a schematic flow chart of the question generation method of the sixth embodiment of the present application.
  • Fig. 7 is a schematic block diagram of a question generating apparatus according to a seventh embodiment of the present application.
  • the first embodiment provides a problem generation method.
  • the method includes the following steps:
  • Step S110 Obtain the question input by the user.
  • the input question sentence may be text information or voice information, which is not limited here.
  • the information can be obtained through communication software, such as chat software such as WeChat, SMS, or voice, or through input method software.
  • chat software such as WeChat, SMS, or voice
  • input method software information such as text input by the user through the input method software is not limited here.
  • Step S120 According to the question sentence, a topic group in the question sentence is obtained.
  • the question sentence input by the user is preprocessed first, and the preprocessing includes word segmentation to obtain each entry.
  • the question is "What should I eat for children with hepatitis B”
  • the entries are "Xiaoer”, “Hepatitis B”, “should”, “eat”, and “what”.
  • word2vec use word2vec to process each entry into word vectors through word nesting, and then use these word vectors as the input of the classifier for training.
  • each topic in the question can be identified.
  • the classification model includes two or three classifiers. Each classifier can identify a category of topics. Finally, the topics identified by each classifier are set to form a topic group.
  • the topics in the topic group usually consist of one to three topics, usually two topics, but for some special question sentences, it can also be three topics.
  • the subject of the question is obtained as “Children with hepatitis B” and "eat”, then the “Children with hepatitis B” and "eat”
  • Two topics form a topic group.
  • the subject of the question is “elderly”, “hypertension” and “treatment”, then the “elderly” and " The three themes of "hypertension” and "treatment” constitute a theme group.
  • Step S130 matching the question sentence with the template question sentence in the previously created knowledge base, obtaining each candidate question sentence, and calculating the matching result between each candidate question sentence and the question sentence.
  • each template question and answer in the knowledge base is also preprocessed, and text characteristic information such as each entry of each template question and answer can be obtained. Then, according to the text feature information, each question and answer is mapped to the inverted record table, and all questions and answers with the same term are mapped to the term, thereby constructing an inverted index record for the knowledge base table.
  • the candidate question related to the question is queried from the knowledge base through the inverted index record table. For example, the question is "what should I take for children with hepatitis B", the candidate question is "what medicine should I take for hepatitis B", “what should I do with hepatitis B”, and “what are the precautions for children with hepatitis B".
  • the similarity calculates the similarity between the question and the candidate question respectively.
  • the similarity can be obtained by linearly weighting text similarity, semantic similarity, topic similarity and syntax similarity.
  • the knowledge base is composed of more than 3 million pairs of questions in the medical field, and the training data is composed of 1.4 million pairs of artificially labeled. Therefore, an accuracy of 88% can be achieved in calculating the matching result.
  • Step S140 according to the topic group and the matching result, select a target question related to the question sentence from the candidate question sentence.
  • the first question sentence that is in a different dimension from the subject in the subject group is further selected from the candidate questions, and then according to the matching result (such as similarity value), Then filter out the target questions that best match the questions and are in different dimensions from these first questions.
  • the question generation method in this embodiment not only considers the semantic matching degree of the question sentence with the template question sentence, but also considers the topic of the question sentence, so that the question sentence can be obtained quickly, conveniently, accurately and efficiently.
  • Related questions are very suitable for human-computer interaction devices, and these related questions are more in line with the actual needs and ideas of users.
  • Step S120 in the first embodiment includes:
  • Step S210 According to the pre-created question sentence classification system, each topic in the question sentence is sequentially identified.
  • the classification system of the pre-created question sentence is usually two levels, and the special question sentence is a level.
  • each topic in the question sentence can be identified.
  • the classification system consists of classifiers.
  • Each classifier is an independent nearest linear combination classifier (Nearest Linear Combination, NLC), which is responsible for the classification of the current layer. For example, when the user enters "What should I eat for gestational diabetes?", the question classification system is divided into two levels, namely gestational diabetes-diet. That is, there are two classifiers to identify and classify gestational diabetes and diet.
  • NLC Nearest Linear Combination
  • the word vector of each term in the question sentence is obtained, and then each word vector is used as the input of the classifier.
  • one classifier recognizes the topic of "gestational diabetes" in the question, and at the level of diet, another classifier recognizes the topic of "eating" in the question.
  • the classification system of the question is three levels, namely hypertension comprehensive-special population-treatment. That is, there are three classifiers to identify and classify hypertension, special population and treatment respectively.
  • a classifier recognizes the subject of "hypertension” in the question, and at the level of special populations, a classifier recognizes the subject of "elderly people”. At this level, another classifier recognizes the topic of "treatment”.
  • the classification system is created based on the characteristics of each disease. For example, the first level of diabetes is classified into diabetes complex, gestational diabetes, type 1 diabetes and type 2 diabetes. The second level of diabetes is classified into diet, treatment, exercise, monitoring, common sense, and prevention.
  • Each disease has its own classification system, so that when the user asks a question, for the disease mentioned in the question, the classification system corresponding to the disease is used to identify the subject of the question, making it more targeted Find out related issues for users’ issues.
  • each classifier in the classification system has been trained in advance to ensure the accuracy of single-layer recognition and classification.
  • Step S220 splicing each of the topics to form a topic group in the question sentence.
  • the above-identified topics are spliced together, and then a topic group formed by at most three topics of different levels in the question sentence.
  • a topic group formed by at most three topics of different levels in the question sentence.
  • the topic group contains topics between different levels in the question, which is beneficial to match users with target questions of different dimensions from the topic.
  • Step S130 in the first embodiment includes:
  • Step S310 Based on the inverted index record table, query candidate question sentences related to the question sentence from the knowledge base.
  • each template question and answer in the knowledge base is also preprocessed, and text characteristic information such as each entry of each template question and answer can be obtained. Then, according to the text feature information, each question and answer is mapped to the inverted record table, and all questions and answers with the same term are mapped to the term, thereby constructing an inverted index record for the knowledge base table.
  • each entry is obtained by segmenting the question sentence, and then according to each entry, a candidate question related to the question sentence can be queried from the knowledge base.
  • Step S320 based on the dual-channel neural network model, calculate the similarity value between the question sentence and each candidate question sentence based on the question sentence and each candidate question sentence.
  • the question and the candidate question are expressed in vector form and used as the input of the two-channel neural network model.
  • the two-channel neural network model After the two-channel neural network model is embedded, pooled, connected, discarded and processed at the network layer, it is calculated
  • the question is a similar value to the candidate question.
  • the dual-channel neural network model regards the two input questions as one dual-channel question.
  • the dual-channel neural network model consists of three parts. The first part is the input layer. The second part is composed of n convolutional layers and pooling layers. The third part is composed of a fully connected multilayer perceptron classifier.
  • Step S330 Obtain a matching result between the question sentence and each candidate question sentence according to the similarity value.
  • the match between the candidate question sentence and the question sentence is known. For example, a higher similarity value indicates that the candidate question has a higher matching degree with the question sentence and is more relevant to the question sentence. A lower similarity value indicates that the candidate question has a lower degree of matching with the question sentence and is less relevant to the question sentence.
  • S320 in the steps of the third embodiment includes:
  • Step S410 Input the question sentence and one of the template question sentences into the first channel neural network, and obtain the first feature representation of the question sentence and one of the template question sentences.
  • the question asked by the user and a template question are taken as the input of the first channel neural network, and after processing by the first channel neural network, the first feature representation of the question and the template question is extracted .
  • Step S420 input the question sentence and a template question sentence of each of the template question sentences into the second channel neural network, and obtain the second feature representation of the question sentence and one template question sentence.
  • the question asked by the user and a template question are used as the input of the second-channel neural network, and after the second-channel neural network is processed, the second feature representation of the question and the template question is extracted .
  • the first feature representation is different from the second feature representation, so that the feature vector of the question sentence and the template question sentence can be extracted from multiple dimensions.
  • Step S430 Connect the first feature representation and the second feature representation according to a preset connection rule, and obtain the final feature representation of the question sentence and a template question sentence.
  • the first feature representation and the second feature representation are connected to obtain the final feature representation of the question sentence and the template question sentence.
  • Step S440 Calculate the similarity value represented by the final feature of the question sentence and a template question sentence according to the loss function.
  • the final feature represents the similarity between the template question and the question asked by the user after the loss function is calculated.
  • the method further includes:
  • Step S510 based on the penalty coefficient matrix, obtain a first question sentence in a dimension different from the topic group from the candidate question sentence.
  • the structural similarity value is added to the corresponding penalty coefficient matrix.
  • the structural content of the candidate question and the question sentence itself is not too similar, so as to obtain the second dimension of the topic in the topic group.
  • One question For example, the user input question is "What should I eat for diabetic nephropathy", the candidate questions are "Can I eat bananas for diabetic nephropathy” and "What exercise can I do with diabetic nephropathy", add the penalty coefficient matrix to the two-channel neural network model Later, the candidate question will choose the latter as the first question, that is, the exercise dimension, not the diet dimension, so as to ensure that in the case of the same topic (in this case, diabetic nephropathy), choose topics in other dimensions as much as possible Question as the first question.
  • Step S520 According to the matching result, filter out the target question sentence from the first question sentence.
  • the matching result is the similarity value between the candidate question sentence and the question sentence.
  • the first question sentence is a question sentence that is in a different dimension from the topic of the user's question sentence selected from the candidate question sentence.
  • the first question is further selected to filter out the target question. For example, the first question with a high similarity value can be selected as the target question, so that a question more in line with the actual needs of the user can be pushed.
  • step S140 the method further includes:
  • Step S610 Sort the target question sentences according to the similarity value, and obtain the target question sentences arranged before the preset ranking.
  • the similarity value is expressed as a percentage, and the target question corresponding to the percentage is sorted according to the size of the percentage. That is, the larger the percentage, the higher the ranking of the target question.
  • similarity includes text similarity, semantic similarity, topic similarity and syntactic similarity.
  • the method for calculating the text similarity between the target question and the question may include the following steps: Counting multiple specified features between the target question and the question, and linearly weighting the multiple specified features to obtain the text Similarity.
  • the multiple specified features include: the number and length of common terms between the target question and the question, and the length of the target question and the question.
  • the semantic similarity calculation method can use the word2vec algorithm to express the target question and the respective terms after the question segmentation as a word vector, and take the average of the word vectors in the question to obtain the sentence vector, and calculate the two sentence vectors The cosine similarity between the two is used to obtain the semantic similarity between the target question and the question.
  • the calculation methods of topic similarity and syntactic similarity are all existing technologies, so they will not be described here.
  • Step S620 randomly selecting from the target question before the preset ranking, and pushing it to the user.
  • a question generation device 700 includes a question acquisition module 710, a topic recognition module 720, a semantic recognition module 730, and a question selection module 740.
  • the question acquisition module 710 is used to acquire the question input by the user.
  • the input question sentence may be text information or voice information, which is not limited here.
  • the information can be obtained through communication software, such as chat software such as WeChat, SMS, or voice, or through input method software.
  • chat software such as WeChat, SMS, or voice
  • input method software such as text input by the user through the input method software is not limited here.
  • the topic recognition module 720 is configured to sequentially recognize each topic in the question sentence according to the classification system of the question sentence created in advance.
  • the classification system of the pre-created question sentence is usually two levels, and for the special question sentence, there are three levels.
  • each topic in the question sentence can be identified.
  • the classification system consists of classifiers.
  • Each classifier is an independent nearest linear combination classifier (Nearest Linear Combination, NLC), which is responsible for the classification of the current layer. For example, when the user enters "What should I eat for gestational diabetes?", the question classification system is divided into two levels, namely gestational diabetes-diet. That is, there are two classifiers to identify and classify gestational diabetes and diet.
  • NLC Nearest Linear Combination
  • the word vector of each term in the question sentence is obtained, and then each word vector is used as the input of the classifier.
  • one classifier recognizes the topic of "gestational diabetes" in the question, and at the level of diet, another classifier recognizes the topic of "eating" in the question.
  • the classification system of the question is three levels, namely hypertension comprehensive-special population-treatment. That is, there are three classifiers to identify and classify hypertension, special population and treatment respectively.
  • a classifier recognizes the subject of "hypertension” in the question, and at the level of special populations, a classifier recognizes the subject of "elderly people”. At this level, another classifier recognizes the topic of "treatment”.
  • the classification system is created based on the characteristics of each disease. For example, the first level of diabetes is classified into diabetes complex, gestational diabetes, type 1 diabetes and type 2 diabetes. The second level of diabetes is classified into diet, treatment, exercise, monitoring, common sense, and prevention.
  • Each disease has its own classification system, so that when the user asks a question, for the disease mentioned in the question, the classification system corresponding to the disease is used to identify the subject of the question, making it more targeted Find out related issues for users’ issues.
  • each classifier in the classification system has been trained in advance to ensure the accuracy of single-layer recognition and classification.
  • the topic recognition module 720 is also used to splice the topics to form a topic group in the question sentence. Specifically, the above-identified topics are spliced together, and then a topic group formed by at most three topics of different levels in the question sentence. For example, when the user inputs "What should I eat for gestational diabetes?", the two themes of "gestational diabetes" and “eating” are spliced to form the subject group of the question. When the user enters "How should the elderly get hypertension treated?", the three themes of "hypertension”, “elderly” and “treatment” are spliced to form the subject group of the question. Among them, the topic group contains topics between different levels in the question, which is beneficial to match users with target questions of different dimensions from the topic.
  • the topic recognition module 720 is composed of a three-layer classifier, and each classifier is an independent Nearest Linear Combination (NLC), and its underlying structure is a Convolutional Neural Network (Convolutional Neural Network).
  • CNN Convolutional Neural Network
  • the convolutional neural network is a feed-forward neural network, its artificial neurons can respond to a part of the surrounding units in the coverage area, and has excellent performance for large-scale image processing. It includes an input layer, a hidden layer, and an output layer.
  • the hidden layer includes a convolutional layer (alternating convolutional layer) and a pooling layer.
  • the convolutional layer is used to extract features, and the pooling layer is down-sampling.
  • corresponding manual rules and dictionaries are added according to the characteristics of different arms to ensure that each layer of classifier can achieve better results.
  • the semantic recognition module 730 is configured to input the question sentence and one of the template question sentences into the first channel neural network, and obtain the first feature representation of the question sentence and a template question sentence .
  • the semantic recognition module 730 is configured to input the question sentence and one of the template question sentences into the second channel neural network, and obtain the second feature representation of the question sentence and a template question sentence .
  • the semantic recognition module 730 is configured to connect the first feature representation and the second feature representation according to a preset connection rule to obtain the final feature representation of the question sentence and a template question sentence.
  • the semantic recognition module 730 is also used to calculate the similarity value of the final feature representation of the question sentence and a template question sentence according to the loss function.
  • the semantic recognition module 730 is composed of a dual-channel convolutional neural network.
  • the dual-channel neural network regards the two input questions as one dual-channel question.
  • the two-channel neural network consists of three parts. The first part is the input layer. The second part is composed of n convolutional layers and pooling layers. The third part is composed of a fully connected multilayer perceptron classifier.
  • the question selection module 740 is configured to select a target question related to the question sentence according to the topic group and the similarity value.
  • the target question sentence with a different dimension from the topic in the topic group is selected from the candidate questions. For example, if the user enters "Is essential hypertension surgery possible?", based on the subject group “essential hypertension” and “surgery”, based on the penalty coefficient matrix model, some factors related to the surgical dimension or primary Candidate questions with the same dimensions of hypertension can be obtained to obtain some target questions with different dimensions, such as "What can essential hypertension eat?", "What should patients with essential hypertension pay attention to when exercising?"
  • This application also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, or more A server cluster composed of two servers), etc.
  • the computer equipment in this embodiment at least includes but is not limited to: a memory, a processor, etc., which can be communicatively connected to each other through a device bus.
  • This embodiment also provides a non-volatile computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory ( SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application mall, etc., on which storage There are computer-readable instructions, and the corresponding functions are realized when the program is executed by the processor.
  • the non-volatile computer-readable storage medium of this embodiment is used to store an electronic device, and when executed by a processor, realizes the subject-based problem generation method of the present application.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to enable a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method described in each embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种问题生成方法、问题生成装置、计算机设备及存储介质,涉及人机交互领域。所述方法包括:获取用户输入的问句(S110);根据所述问句获取所述问句中的主题组(S120);将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果(S130);及根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句。所述问题生成方法不仅考虑了问句与模板问句的匹配程度,还考虑了该问句的主题,从而可以既快速方便又准确高效的获取到该问句的相关问句,非常适合人机交互装置,这些相关问句也更符合用户的实际需求与想法。

Description

问题生成方法、装置、计算机设备及存储介质
本申请要求于2019年7月31日提交中国专利局,专利名称为“问题生成方法、装置、计算机设备及存储介质”,申请号为201910699299.7的发明专利的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人机交互技术领域,尤其涉及一种问题生成方法、问题生成装置、计算机设备及存储介质。
背景技术
问答装置是信息检索装置的一种高级形式。它能用准确、简洁的自然语言回答用户用自然语言提出的问题。其研究兴起的主要原因是人们对快速、准确地获取信息的需求。问答装置是目前人工智能和自然语言处理领域中一个备受关注并具有广泛发展前景的研究方向。因此,问答装置已经广泛的应用于医疗、金融等行业中,成为人们日常生活的一部分。
目前,发明人发现常见的智能医疗问答装置相关问题的生成主要依赖于语义相似度匹配,没有考虑主题的因素。因此生成的相关问题有时并不是提问者所想要的。例如,妊娠糖尿病应该吃什么?生成的相关问题可能是糖尿病应该吃什么?而患者更关注的是妊娠糖尿病的其他维度,例如妊娠糖尿病应该如何锻炼,妊娠糖尿病应该如何治疗等等。
发明内容
有鉴于此,本申请提出一种问题生成方法、问题生成装置、计算机设备及存储介质,能够识别出问句中的主题,并结合该主题和相似度,生成目标问句,使得所生成的目标问句更符合用户的实际需求和想法。
首先,为实现上述目的,本申请提出一种问题生成方法,该方法包括步骤:获取用户输入的问句;根据所述问句,获取所述问句中的主题组;将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果;及根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问 句。
此外,为实现上述目的,本申请还提供一种问题生成装置,其包括:
所述问题生成装置包括问句获取模块、主题识别模块、语义识别模块、选取问题模块;所述问句获取模块用于获取用户输入的问句;所述主题识别模块用于根据预先创建的问句的分类体系,依次识别出所述问句中的各主题;还用于拼接各所述主题,形成所述问句中的主题组;所述语义识别模块用于将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示;用于将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示;用于根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示;及还用于根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值;所述问题选取模块用于根据所述主题组和所述相似值,选取与所述问句相关的目标问句。
为实现上述目的,本申请还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述方法的步骤。
为实现上述目的,本申请还提供非易失性计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述方法的步骤。
本申请所提出的问题生成方法,不仅考虑了问句在语义上与模板问句的匹配程度,还考虑了该问句的主题,从而可以既快速方便又准确高效的获取到该问句的相关问句,非常适合人机交互装置,这些相关问句也更符合用户的实际需求与想法。
附图说明
图1是本申请第一实施例之问题生成方法的流程示意图;
图2是本申请第二实施例之问题生成方法的流程示意图;
图3是本申请第三实施例之问题生成方法的流程示意图;
图4是本申请第四实施例之问题生成方法的流程示意图;
图5是本申请第五实施例之问题生成方法的流程示意图;
图6是本申请第六实施例之问题生成方法的流程示意图;及
图7是本申请第七实施例之问题生成装置的方框示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
请参考图1,第一个实施例提供了一种问题生成方法。该方法包括以下步骤:
步骤S110,获取用户输入的问句。
具体地,该输入的问句可以是文字信息,也可以是语音信息,在此不作限定。该信息的获取方式可以通过通讯软件获取,如微信、短信或语音等聊天软件,还可以通过输入法软件获取,如用户通过输入法软件输入的文字等信息,在此不做限定。
步骤S120,根据所述问句,获取所述问句中的主题组。
具体地,先对用户所输入的问句进行预处理,该预处理包括分词得到各词条。例如,问句为“小儿乙肝应该吃什么”,分词后,得到各词条为“小儿”、“乙肝”、“应该”、“吃”、“什么”。再利用word2vec将各词条通过词嵌套处理成词向量,再将这些词向量作为分类器的输入,而进行训练,训练好后就可对问句中的各主题进行识别。其中,分类模型包括两个或三个分类器。每一个分类器可识别一类主题。最后各分类器所识别的主题集合而形成主题组。其中,主题组中的主题通常由一至三个主题构成,一般情况下是两个主题,但是对于某些特殊疑问句也可以是三个主题。例如,当用户输入“小儿乙肝应该吃什么”,则通过分类器分类后,获取到该问句中的主题分别为“小儿乙肝”和“吃”,那么该“小儿乙肝”和“吃”这两个主题就构成了一个主题组。又例如,当用户输入“老年人得了高血压应该怎么治疗”,则获取到该问句中的主题分别为“老年人”、“高血压”和“治疗”,那么该“老年人”、“高血压”和“治疗”这三个主题就构成了一个主题组。
步骤S130,将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句, 并计算各所述候选问句与所述问句之间的匹配结果。
其中,知识库中的每个模板问句和答案也进行预处理,可以得到每个模板问句和答案的各词条等文本特征信息。再根据文本特征信息,将每个问句和答案都映射到倒排记录表中,将具有同一词条的所有问题和答案都映射到该词条上,从而为知识库构建出倒排索引记录表。根据问句,通过倒排索引记录表从知识库中查询到与该问句相关的候选问句。如:问句为“小儿乙肝应该吃什么”,候选问句为“乙肝应该吃什么药”,“得了乙肝应该怎么办”,“小儿乙肝的注意事项是什么”。再分别计算该问句与候选问句之间的相似度。根据该相似度,从而得到各候选问句与问句之间的匹配结果。即相似度越高,候选问句与该问句越匹配。其中该相似度可以由文本相似度、语义相似度、主题相似度和句法相似度经线性加权得到。另外,该知识库是由一个300多万对医疗领域问句构成,训练数据由140万对经过人工标注而组成。因而在计算匹配结果方面能够达到88%的准确率。
步骤S140,根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句。
具体地,根据上述所获得的主题组,基于惩罚系数矩阵,从而在候选问句中进一步选取出与主题组中主题在不同维度的第一问句,再根据匹配结果(如,相似值),再从这些第一问句中筛选出与问句最匹配且又在不同维度的目标问句。例如,用户输入“原发性高血压可以做手术吗?”,则根据主题组“原发性高血压”和“手术”,基于惩罚系数矩阵模型,从而去除掉一些与手术维度或原发性高血压维度相同的候选问句,进而获得一些维度不同的第一问句,如“原发性高血压可以吃什么?”、“原发性高血压患者在运动时应该注意什么?”等,再根据匹配结果(如相似值)从这些第一问句里筛选出目标问句。
采用本实施例中的问题生成方法,不仅考虑了问句在语义上与模板问句的匹配程度,还考虑了该问句的主题,从而可以既快速方便又准确高效的获取到该问句的相关问句,非常适合人机交互装置,这些相关问句也更符合用户的实际需求与想法。
在第二个实施例中,请参考图2,第一个实施例中的步骤S120包括:
步骤S210,根据预先创建的问句的分类体系,依次识别出所述问句中的各主题。
具体地,该预先创建的问句的分类体系通常是两层,对于特殊问句为层,根据该分类体系,从而识别出该问句中的各主题。其中,该分类体系由分类器构成。每一个分类器都是一个独立的最近线性组合分类器(Nearest Linear Combination,NLC),分别负责当前层的分类。例如,当用户输入“妊娠糖尿病应该吃什么?”,该问句的分类体系为两层,即妊娠糖尿病-饮食。即有两个分类器,分别对妊娠糖尿病和饮食进行识别分类。那么,对 该问句进行预处理后,获得该问句中各词条的词向量,再将各词向量作为分类器的输入。则在妊娠糖尿病这一层,一个分类器识别出该问句中的“妊娠糖尿病”这一主题,在饮食这一层,另一个分类器识别出该问句中的“吃”这一主题。当用户输入“老年人得了高血压应该怎么治疗?”该问句的分类体系为三层,即高血压综合-特殊人群-治疗。即有三个分类器,分别对高血压综合、特殊人群和治疗进行识别分类。那么,在高血压综合这一层,一个分类器识别出该问句中的“高血压”这一主题,在特殊人群这一层,一个分类器识别出“老年人”这一主题,在治疗这一层,另一个分类器识别出“治疗”这一主题。
其中,该分类体系是基于每种疾病特点而创建。例如,糖尿病第一层分类为糖尿病综合、妊娠糖尿病、一型糖尿病及二型糖尿病。糖尿病第二层分类为饮食、治疗、运动、监测、常识、预防。每一种疾病各自有相应的分类体系,使得在用户提出问题时,针对问题中所提到的疾病,采用该疾病所对应的分类体系,对该问句的主题进行识别,使得更有针对性的对用户的问题找出相关问题。另外,分类体系中的每一个分类器都事先经过训练,保证单层识别分类的准确率。
步骤S220,拼接各所述主题,形成所述问句中的主题组。
具体地,将上述所识别出的各主题进行拼接,进而由该问句中的至多三个不同层级的主题所形成的主题组。例如,当用户输入“妊娠糖尿病应该吃什么?”,对于“妊娠糖尿病”和“吃”这两个主题进行拼接,形成该问句的主题组。当用户输入“老年人得了高血压应该怎么治疗?”,对于“高血压”、“老年人”及“治疗”这三个主题进行拼接,形成该问句的主题组。其中,该主题组包含了该问句中不同层级之间的主题,有利于为用户匹配出与主题不同维度的目标问句。
在第三个实施例中,请参考图3,第一个实施例中的步骤S130包括:
步骤S310,基于倒排索引记录表,从所述知识库中查询出与所述问句相关的候选问句。
其中,知识库中的每个模板问句和答案也进行预处理,可以得到每个模板问句和答案的各词条等文本特征信息。再根据文本特征信息,将每个问句和答案都映射到倒排记录表中,将具有同一词条的所有问题和答案都映射到该词条上,从而为知识库构建出倒排索引记录表。利用该倒排索引记录表,通过对问句进行分词获得各词条,再根据该各词条可以从知识库中查询出与该问句相关的候选问句。
步骤S320,基于双通道神经网络模型,根据所述问句和各所述候选问句,计算所述问句与各所述候选问句之间的相似值。
具体地,将该问句和候选问句用向量形式表示,并作为双通道神经网络模型的输入, 经过该双通道神经网络模型的嵌入、池化、连接、丢弃等网络层处理之后,计算出该问句与候选问句的一个相似值。其中,双通道神经网络模型是将所输入的两个问句看成一个双通道的问句。该双通道神经网络模型由三部分构成。第一部分时输入层。第二部分是由n个卷积层和池化层组成。第三部分是由一个全连接的多层感知机分类器构成。
步骤S330,根据所述相似值获取所述问句与各所述候选问句之间的匹配结果。
具体地,根据上述得到的相似值,从而知道该候选问句与该问句的匹配情况。例如,相似值较高,则说明该候选问句与该问句匹配程度较高,与该问句较相关。相似值较低,则说明该候选问句与该问句匹配程度较低,与该问句较不相关。
在第四个实施例,请参考图4,第三个实施例步骤中的S320包括:
步骤S410,将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示。
具体地,将用户提出的问句和一个模板问句作为第一通道神经网络的输入,通过该第一通道神经网络的处理后,提取出该问句和该一个模板问句的第一特征表示。
步骤S420,将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示。
具体地,将用户提出的问句和一个模板问句作为第二通道神经网络的输入,通过该第二通道神经网络的处理后,提取出该问句和该一个模板问句的第二特征表示。其中,第一特征表示不同于第二特征表示,使得可以从多维度提取该问句和模板问句的特征向量。
步骤S430,根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示。
具体地,根据预设的连接规则,将第一特征表示和第二特征表示进行连接,从而获取到该问句和该模板问句的最终特征表示。
步骤S440,根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值。
具体地,该最终特征表示经过损失函数计算后,得到该模板问句与用户提出的问句之间的相似值。
在第五个实施例中,请参考图5,该方法还包括:
步骤S510,基于惩罚系数矩阵,从所述候选问句中获取与所述主题组在不同维度的第一问句。
具体地,先通过一个基于句式的模糊匹配,得到用户所提出的问句与各候选问句在结 构上的相似度,然后把这个相似度取倒数,从而得到一个结构相似值。
具体地,将该结构相似值添加到相应的惩罚系数矩阵中,经过该矩阵计算后,从而避免候选问题和问句本身结构内容过于雷同,从而获取到与主题组中主题在不同维度上的第一问句。例如,用户输入问句是“糖尿病肾病应该吃什么”,候选问题为,“糖尿病肾病可以吃香蕉吗”和“得了糖尿病肾病可以做些什么运动”,在双通道神经网络模型加入该惩罚系数矩阵后,候选问题会选择后者作为第一问句,即运动维度,而不是饮食维度,从而能够保证在一个主题不变的情况下(本例是糖尿病肾病),尽可能选择主题在其他维度的问句作为第一问句。
步骤S520,根据所述匹配结果,从所述第一问句中筛选出所述目标问句。
具体地,匹配结果即是候选问句与问句之间的相似值,第一问句是从候选问句中筛选出与用户问句的主题在不同维度的问句。根据相似值,进一步对第一问句进行选择,从而筛选出目标问句,。例如可选择相似值高的第一问句作为目标问句,从而可以推送出更符合用户实际需求的问句。
在第六个实施例中,请参考图6,步骤S140之后,该方法还包括:
步骤S610,根据所述相似值,对所述目标问句排序,获取排列在预设名次之前的所述目标问句。
具体地,相似值用百分比表示,根据该百分比的大小,对与该百分比相对应的目标问句进行排序。即百分比越大,该目标问句的排列名次越靠前。对这些目标问句排序之后,从这些排列后的目标问句中选取预设名次之前的目标问句,如选取排列名次在前五名的目标问句。其中,相似度包括文本相似度,语义相似度,主题相似度及句法相似度等。目标问句与该问句之间的文本相似度的计算方法可以包括以下步骤:统计目标问句与该问句之间的多个指定特征,对该多个指定特征进行线性加权,从而得到文本相似度。其中,多个指定特征包括:目标问句与该问句的共同词条的数量及长度,目标问句和该问句的长度等。语义相似度的计算方法可以采用word2vec算法将目标问句和该问句分别分词后的各词条表示为词向量,将问句中各词向量取平均值得到句子向量,计算两个句子向量之间的余弦相似度,得到目标问句与该问句之间的语义相似度。主题相似度和句法相似度的计算方法均为现有技术,就不在此一一陈述。
步骤S620,从所述预设名次之前的所述目标问句中随机选取,推送至所述用户。
例如,从排列名次在前五名的目标问句中进行随机选取,可从中选取出一个目标问句,或两个目标问句,或三个目标问句等,从而将随机选取的这些目标问句再推送至用户。
在第七个实施例中,提供了一种问题生成装置700。该问题生成装置700包括问句获取模块710、主题识别模块720、语义识别模块730及问题选取模块740。
所述问句获取模块710用于获取用户输入的问句。具体地,该输入的问句可以是文字信息,也可以是语音信息,在此不作限定。该信息的获取方式可以通过通讯软件获取,如微信、短信或语音等聊天软件,还可以通过输入法软件获取,如用户通过输入法软件输入的文字等信息,在此不做限定。
所述主题识别模块720用于根据预先创建的问句的分类体系,依次识别出所述问句中的各主题。具体地,该预先创建的问句的分类体系通常是两层,对于特殊问句为三层,根据该分类体系,从而识别出该问句中的各主题。其中,该分类体系由分类器构成。每一个分类器都是一个独立的最近线性组合分类器(Nearest Linear Combination,NLC),分别负责当前层的分类。例如,当用户输入“妊娠糖尿病应该吃什么?”,该问句的分类体系为两层,即妊娠糖尿病-饮食。即有两个分类器,分别对妊娠糖尿病和饮食进行识别分类。那么,对该问句进行预处理后,获得该问句中各词条的词向量,再将各词向量作为分类器的输入。则在妊娠糖尿病这一层,一个分类器识别出该问句中的“妊娠糖尿病”这一主题,在饮食这一层,另一个分类器识别出该问句中的“吃”这一主题。当用户输入“老年人得了高血压应该怎么治疗?”该问句的分类体系为三层,即高血压综合-特殊人群-治疗。即有三个分类器,分别对高血压综合、特殊人群和治疗进行识别分类。那么,在高血压综合这一层,一个分类器识别出该问句中的“高血压”这一主题,在特殊人群这一层,一个分类器识别出“老年人”这一主题,在治疗这一层,另一个分类器识别出“治疗”这一主题。
其中该分类体系是基于每种疾病特点而创建。例如,糖尿病第一层分类为糖尿病综合、妊娠糖尿病、一型糖尿病及二型糖尿病。糖尿病第二层分类为饮食、治疗、运动、监测、常识、预防。每一种疾病各自有相应的分类体系,使得在用户提出问题时,针对问题中所提到的疾病,采用该疾病所对应的分类体系,对该问句的主题进行识别,使得更有针对性的对用户的问题找出相关问题。另外,分类体系中的每一个分类器都事先经过训练,保证单层识别分类的准确率。
所述主题识别模块720还用于拼接各所述主题,形成所述问句中的主题组。具体地,将上述所识别出的各主题进行拼接,进而由该问句中的至多三个不同层级的主题所形成的主题组。例如,当用户输入“妊娠糖尿病应该吃什么?”,对于“妊娠糖尿病”和“吃”这两个主题进行拼接,形成该问句的主题组。当用户输入“老年人得了高血压应该怎么治疗?”,对于“高血压”、“老年人”及“治疗”这三个主题进行拼接,形成该问句的主题 组。其中,该主题组包含了该问句中不同层级之间的主题,有利于为用户匹配出与主题不同维度的目标问句。
基于此,该主题识别模块720由一个三层分类器构成,每一个分类器都是一个独立的最近先行组合分类器(Nearest Linear Combination,NLC),其底层结构为卷积神经网络(Convolutional Neural Network,CNN),该卷积神经网络是一种前馈神经网络,它的人工神经元可以响应一部分覆盖范围内的周围单元,对于大型图像处理有出色表现。它包括输入层、隐藏层、输出层,其中,隐藏层有包括卷积层(alternating convolutional layer)和池层(pooling layer)。卷积层用于提取特征,池化层也就是下采样。另外,还针对不同兵种的特点加了相应的人工规则和字典,以保证各层分类器能够取得更好的效果。
所述语义识别模块730用于将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示。所述语义识别模块730用于将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示。所述语义识别模块730用于根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示。及所述语义识别模块730还用于根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值。
所述语义识别模块730是由双通道卷积神经网络构成。其中,双通道神经网络是将所输入的两个问句看成一个双通道的问句。该双通道神经网络由三部分构成。第一部分时输入层。第二部分是由n个卷积层和池化层组成。第三部分是由一个全连接的多层感知机分类器构成。
所述问题选取模块740用于根据所述主题组和所述相似值,选取与所述问句相关的目标问句。
具体地,根据上述所获得的主题组,基于惩罚系数矩阵,从而在候选问句中选取与主题组中主题不同维度的目标问句。例如,用户输入“原发性高血压可以做手术吗?”,则根据主题组“原发性高血压”和“手术”,基于惩罚系数矩阵模型,从而去除掉一些与手术维度或原发性高血压维度相同的候选问句,进而获得一些维度不同的目标问句,如“原发性高血压可以吃什么?”、“原发性高血压患者在运动时应该注意什么?”等。
采用本实施例中的问题生成装置700,不仅考虑了问句在语义上与模板问句的匹配程度,还考虑了该问句的主题,从而可以既快速方便又准确高效的获取到该问句的相关问句,非常适合人机交互装置,这些相关问句也更符合用户的实际需求与想法。
本申请还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。本实施例的计算机设备至少包括但不限于:可通过装置总线相互通信连接的存储器、处理器等。
本实施例还提供一种非易失性计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机可读指令,程序被处理器执行时实现相应功能。本实施例的非易失性计算机可读存储介质用于存储电子装置,被处理器执行时实现本申请的基于主题识别的问题生成方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种问题生成方法,所述方法包括步骤:
    获取用户输入的问句;
    根据所述问句获取所述问句中的主题组;
    将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果;及
    根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句。
  2. 如权利要求1所述的问题生成方法,所述根据所述问句,获取所述问句中的主题组的步骤包括:
    根据预先创建的问句的分类体系,依次识别出所述问句中的各主题;及
    拼接各所述主题形成所述问句中的主题组。
  3. 如权利要求2所述的问题生成方法,所述分类体系是基于每种疾病特点而创建。
  4. 如权利要求1所述的问题生成方法,所述将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果的步骤包括:
    基于倒排索引记录表,从所述知识库中查询出与所述问句相关的候选问句;
    基于双通道神经网络模型,根据所述问句和各所述候选问句,计算所述问句与各所述候选问句之间的相似值;及
    根据所述相似值获取所述问句与各所述候选问句之间的匹配结果。
  5. 如权利要求4所述的问题生成方法,所述基于双通道神经网络模型,计算所述问句与各所述模板问句的相似值的步骤包括:
    将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示;
    将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示;
    根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示;及
    根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值。
  6. 如权利要求1所述的问题生成方法,所述根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的的目标问句的步骤包括:
    基于惩罚系数矩阵,从所述候选问句中获取与所述主题组在不同维度的第一问句;及
    根据所述匹配结果,从所述第一问句中筛选出所述目标问句。
  7. 如权利要求4所述的问题生成方法,所述根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句的步骤之后,所述方法还包括:
    根据所述相似值,对所述目标问句排序,获取排列在预设名次之前的所述目标问句;及
    从所述预设名次之前的所述目标问句中随机选取,推送至所述用户。
  8. 一种问题生成装置,所述问题生成装置包括问句获取模块、主题识别模块、语义识别模块、问题选取模块;
    所述问句获取模块用于获取用户输入的问句;
    所述主题识别模块用于根据预先创建的问句的分类体系,依次识别出所述问句中的各主题;还用于拼接各所述主题,形成所述问句中的主题组;
    所述语义识别模块用于将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示;用于将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示;用于根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示;及还用于根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值;
    所述问题选取模块用于根据所述主题组和所述相似值,选取与所述问句相关的目标问句。
  9. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现问题生成方法包括步骤:
    获取用户输入的问句;
    根据所述问句获取所述问句中的主题组;
    将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果;及
    根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句。
  10. 如权利要求9所述的计算机设备,所述根据所述问句,获取所述问句中的主题组的步骤包括:
    根据预先创建的问句的分类体系,依次识别出所述问句中的各主题;及
    拼接各所述主题形成所述问句中的主题组。
  11. 如权利要求10所述的计算机设备,所述分类体系是基于每种疾病特点而创建。
  12. 如权利要求9所述的计算机设备,所述将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果的步骤包括:
    基于倒排索引记录表,从所述知识库中查询出与所述问句相关的候选问句;
    基于双通道神经网络模型,根据所述问句和各所述候选问句,计算所述问句与各所述候选问句之间的相似值;及
    根据所述相似值获取所述问句与各所述候选问句之间的匹配结果。
  13. 如权利要求12所述的计算机设备,所述基于双通道神经网络模型,计算所述问句与各所述模板问句的相似值的步骤包括:
    将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示;
    将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示;
    根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示;及
    根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值。
  14. 如权利要求9所述的计算机设备,所述根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的的目标问句的步骤包括:
    基于惩罚系数矩阵,从所述候选问句中获取与所述主题组在不同维度的第一问句;及
    根据所述匹配结果,从所述第一问句中筛选出所述目标问句。
  15. 如权利要求12所述的计算机设备,所述根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句的步骤之后,所述方法还包括:
    根据所述相似值,对所述目标问句排序,获取排列在预设名次之前的所述目标问句;及
    从所述预设名次之前的所述目标问句中随机选取,推送至所述用户。
  16. 一种非易失性计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现问题生成方法步包括骤:
    获取用户输入的问句;
    根据所述问句获取所述问句中的主题组;
    将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果;及
    根据所述主题组和所述匹配结果,从所述候选问句中选取与所述问句相关的目标问句。
  17. 如权利要求16所述的非易失性计算机可读存储介质,所述根据所述问句,获取所述问句中的主题组的步骤包括:
    根据预先创建的问句的分类体系,依次识别出所述问句中的各主题;及
    拼接各所述主题形成所述问句中的主题组。
  18. 如权利要求17所述的非易失性计算机可读存储介质,所述分类体系是基于每种疾病特点而创建。
  19. 如权利要求16所述的非易失性计算机可读存储介质,所述将所述问句与预先创建的知识库中的模板问句相匹配,获取各候选问句,并计算各所述候选问句与所述问句之间的匹配结果的步骤包括:
    基于倒排索引记录表,从所述知识库中查询出与所述问句相关的候选问句;
    基于双通道神经网络模型,根据所述问句和各所述候选问句,计算所述问句与各所述候选问句之间的相似值;及
    根据所述相似值获取所述问句与各所述候选问句之间的匹配结果。
  20. 如权利要求19所述的非易失性计算机可读存储介质,所述基于双通道神经网络模型,计算所述问句与各所述模板问句的相似值的步骤包括:
    将所述问句和各所述模板问句中的一个模板问句输入第一通道神经网络,获取所述问句和一个所述模板问句的第一特征表示;
    将所述问句和各所述模板问句中的一个模板问句输入第二通道神经网络,获取所述问句和一个所述模板问句的第二特征表示;
    根据预设的连接规则,连接所述第一特征表示和所述第二特征表示,获取所述问句和一个所述模板问句的最终特征表示;及
    根据损失函数,计算所述问句与一个所述模板问句的最终特征表示的相似值。
PCT/CN2019/117965 2019-07-31 2019-11-13 问题生成方法、装置、计算机设备及存储介质 WO2021017300A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910699299.7A CN110543553B (zh) 2019-07-31 2019-07-31 问题生成方法、装置、计算机设备及存储介质
CN201910699299.7 2019-07-31

Publications (1)

Publication Number Publication Date
WO2021017300A1 true WO2021017300A1 (zh) 2021-02-04

Family

ID=68710377

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117965 WO2021017300A1 (zh) 2019-07-31 2019-11-13 问题生成方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN110543553B (zh)
WO (1) WO2021017300A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061851B (zh) * 2019-12-12 2023-08-08 中国科学院自动化研究所 基于给定事实的问句生成方法及系统
WO2021128246A1 (zh) * 2019-12-27 2021-07-01 拉克诺德(深圳)科技有限公司 语音数据处理方法、装置、计算机设备及存储介质
CN111984774B (zh) * 2020-08-11 2024-02-27 北京百度网讯科技有限公司 搜索方法、装置、设备以及存储介质
CN113469048A (zh) * 2021-06-30 2021-10-01 平安科技(深圳)有限公司 一种乘员状态确定方法、装置、计算机设备及存储介质
CN116089589B (zh) * 2023-02-10 2023-08-29 阿里巴巴达摩院(杭州)科技有限公司 问句生成方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140164303A1 (en) * 2012-12-11 2014-06-12 International Business Machines Corporation Method of answering questions and scoring answers using structured knowledge mined from a corpus of data
CN104050256A (zh) * 2014-06-13 2014-09-17 西安蒜泥电子科技有限责任公司 基于主动学习的问答方法及采用该方法的问答系统
CN104331523A (zh) * 2014-11-27 2015-02-04 韩慧健 一种基于概念对象模型的问句检索方法
CN105528437A (zh) * 2015-12-17 2016-04-27 浙江大学 一种基于结构化文本知识提取的问答系统构建方法
US20180196921A1 (en) * 2017-01-12 2018-07-12 International Business Machines Corporation Abbreviation Expansion in Clinical Notes Using Frequency and Context
CN108595619A (zh) * 2018-04-23 2018-09-28 海信集团有限公司 一种问答方法及设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9153142B2 (en) * 2011-05-26 2015-10-06 International Business Machines Corporation User interface for an evidence-based, hypothesis-generating decision support system
JP6007088B2 (ja) * 2012-12-05 2016-10-12 Kddi株式会社 大量のコメント文章を用いた質問回答プログラム、サーバ及び方法
CN104166648A (zh) * 2013-05-16 2014-11-26 百度在线网络技术(北京)有限公司 基于标签的推荐数据挖掘方法及装置
CN107329967B (zh) * 2017-05-12 2019-09-24 北京邮电大学 基于深度学习的问答系统以及方法
CN108345672A (zh) * 2018-02-09 2018-07-31 平安科技(深圳)有限公司 智能应答方法、电子装置及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140164303A1 (en) * 2012-12-11 2014-06-12 International Business Machines Corporation Method of answering questions and scoring answers using structured knowledge mined from a corpus of data
CN104050256A (zh) * 2014-06-13 2014-09-17 西安蒜泥电子科技有限责任公司 基于主动学习的问答方法及采用该方法的问答系统
CN104331523A (zh) * 2014-11-27 2015-02-04 韩慧健 一种基于概念对象模型的问句检索方法
CN105528437A (zh) * 2015-12-17 2016-04-27 浙江大学 一种基于结构化文本知识提取的问答系统构建方法
US20180196921A1 (en) * 2017-01-12 2018-07-12 International Business Machines Corporation Abbreviation Expansion in Clinical Notes Using Frequency and Context
CN108595619A (zh) * 2018-04-23 2018-09-28 海信集团有限公司 一种问答方法及设备

Also Published As

Publication number Publication date
CN110543553A (zh) 2019-12-06
CN110543553B (zh) 2024-06-14

Similar Documents

Publication Publication Date Title
WO2021017300A1 (zh) 问题生成方法、装置、计算机设备及存储介质
CN111415740B (zh) 问诊信息的处理方法、装置、存储介质及计算机设备
CN107330049B (zh) 一种新闻热度预估方法及系统
CN111615706A (zh) 基于子流形稀疏卷积神经网络分析空间稀疏数据
CN112313642A (zh) 助理系统进行的用于代理匹配的意图识别
WO2021218029A1 (zh) 基于人工智能的面试方法、装置、计算机设备及存储介质
WO2023029506A1 (zh) 病情分析方法、装置、电子设备及存储介质
CN106649739B (zh) 多轮交互信息继承识别方法、装置以及交互系统
CN111368075A (zh) 文章质量预测方法、装置、电子设备及存储介质
CN110705247B (zh) 基于χ2-C的文本相似度计算方法
CN113722438B (zh) 基于句向量模型的句向量生成方法、装置及计算机设备
US11232260B2 (en) Updating a document utilizing trusted new information
WO2024036840A1 (zh) 基于主题增强的开放域对话回复方法及系统
WO2021121020A1 (zh) 问答方法、装置及设备
CN112926308B (zh) 匹配正文的方法、装置、设备、存储介质以及程序产品
US20220245358A1 (en) Creating a superset of knowledge
CN112686051A (zh) 语义识别模型训练方法、识别方法、电子设备、存储介质
CN112307190A (zh) 医学文献排序方法、装置、电子设备及存储介质
WO2021000400A1 (zh) 导诊相似问题对生成方法、系统及计算机设备
CN115878750A (zh) 信息处理方法、装置、设备及计算机可读存储介质
Baldwin et al. UniMelb at SemEval-2016 Task 3: Identifying similar questions by combining a CNN with string similarity measures
WO2022061877A1 (zh) 事件抽取和抽取模型训练的方法和装置、设备、介质
CN114328800A (zh) 文本处理方法、装置、电子设备和计算机可读存储介质
CN114116965A (zh) 评论文本的观点提取方法以及电子设备
CN113743079A (zh) 一种基于共现实体交互图的文本相似度计算方法及装置

Legal Events

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

Ref document number: 19939245

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19939245

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19939245

Country of ref document: EP

Kind code of ref document: A1