Movatterモバイル変換


[0]ホーム

URL:


CN110309281A - Question answering method, device, computer equipment and storage medium based on knowledge graph - Google Patents

Question answering method, device, computer equipment and storage medium based on knowledge graph
Download PDF

Info

Publication number
CN110309281A
CN110309281ACN201910452305.9ACN201910452305ACN110309281ACN 110309281 ACN110309281 ACN 110309281ACN 201910452305 ACN201910452305 ACN 201910452305ACN 110309281 ACN110309281 ACN 110309281A
Authority
CN
China
Prior art keywords
feature vector
input
output
prediction output
question
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910452305.9A
Other languages
Chinese (zh)
Inventor
朱威
梁欣
周晓峰
李春宇
倪渊
谢国彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co LtdfiledCriticalPing An Technology Shenzhen Co Ltd
Priority to CN201910452305.9ApriorityCriticalpatent/CN110309281A/en
Publication of CN110309281ApublicationCriticalpatent/CN110309281A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention discloses answering method, device, computer equipment and the storage mediums of a kind of knowledge based map.This method comprises: obtaining input information, and according to the input acquisition of information input feature value;Based on deep learning model, first prediction output of the input feature value in the knowledge mapping being pre-created is calculated;Based on width learning model, second prediction output of the input feature value in the knowledge mapping being pre-created is calculated;According to the first prediction output and the second prediction output, the prediction output of the input feature value is obtained;And exported according to the prediction, obtain the corresponding answer of the input information.This method can also drop effectively using external resources such as the synonym of the relationship fact or upper and lower clictions and obtain the higher answer of matching degree when data volume is less.

Description

Translated fromChinese
基于知识图谱的问答方法、装置、计算机设备及存储介质Question answering method, device, computer equipment and storage medium based on knowledge graph

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种基于知识图谱的问答方法、问答装置、计算机设备及存储介质。The present invention relates to the field of computer technology, in particular to a question answering method based on a knowledge graph, a question answering device, computer equipment and a storage medium.

背景技术Background technique

传统的问答装置分为问句处理和答案检索两大部分。其中,问句处理的基础是分词。答案检索多采用评分机制,即从海量文本数据中选取一系列候选答案,然后构建选择函数从候选答案中选取最接近的答案。这些问答装置和问答方法的基础是文本信息,对以实体为中心的一些问题处理上并不合适。比如,“湖北省荆州市人口是多少”。如果问答装置的数据集中并没有直接答案写出“荆州市人口是……万人”,那么这个问题就无法回答。但是这个问题的答案却存在于知识库中,只要我们能够建立一个自然语言到知识库的映射,那么我们就可以得到答案。The traditional question answering device is divided into two parts: question sentence processing and answer retrieval. Among them, the basis of question processing is word segmentation. Answer retrieval mostly uses a scoring mechanism, that is, a series of candidate answers are selected from massive text data, and then a selection function is constructed to select the closest answer from the candidate answers. The basis of these question-answering devices and methods is text information, which is not suitable for dealing with some entity-centered questions. For example, "What is the population of Jingzhou City, Hubei Province". If there is no direct answer in the data set of the question answering device, "Jingzhou City's population is... 10,000", then this question cannot be answered. But the answer to this question exists in the knowledge base, as long as we can establish a mapping from natural language to the knowledge base, then we can get the answer.

目前,基于知识图谱的问答装置主要有两类。第一类:基于深度学习的端到端方法。这一类方法依托数据量,应用深度神经网络对问题进行语义理解,然后在知识库中找到与问句语义最相近的关系事实。这一类方法可以在数据量足够充分的情况下达到很大的精度,但是局限性在于,对于一个新的领域,构建知识库问答装置训练所需要的训练集,耗时很长。第二类:属于传统机器学习,依托于人工定义的特征。这一类方法首先会在外部资源中搜集关系事实的同义词,上下文词等信息,然后对问句进行解析,提取一些相似度特征,构成特征向量,然后通过机器学习排序等算法对候选答案排序。这一类方法所需的问答数据少,但是缺陷是无法做语义理解,尤其是无法区分一个问句中哪些词是重要的,哪些是不重要的。例如,“阿司匹林是哪些病人吃的”这个问句是问阿司匹林的适应症(适应人群),但是传统学习方法可能会因为“吃”这个关键词,将这句话分为“用法用量”这个关系。At present, there are two main types of question answering devices based on knowledge graphs. The first category: end-to-end methods based on deep learning. This type of method relies on the amount of data, applies the deep neural network to understand the semantics of the question, and then finds the relational facts that are closest to the semantics of the question in the knowledge base. This type of method can achieve great accuracy when the amount of data is sufficient, but the limitation is that for a new field, it takes a long time to construct the training set required for the training of the knowledge base question answering device. The second category: belongs to traditional machine learning, relying on manually defined features. This type of method first collects synonyms of related facts, context words and other information from external resources, then parses the question sentence, extracts some similarity features to form a feature vector, and then sorts the candidate answers through algorithms such as machine learning sorting. This type of method requires less question and answer data, but the defect is that it cannot do semantic understanding, especially it cannot distinguish which words in a question sentence are important and which are not. For example, the question "Which patients take aspirin" is to ask the indications of aspirin (adapted to the population), but the traditional learning method may divide this sentence into the relationship of "usage and dosage" because of the keyword "eat". .

发明内容Contents of the invention

有鉴于此,本发明提出一种基于知识图谱的问答方法、问答装置、计算机设备及存储介质,所需数据量不多,可以在较短的时间内训练出所需的训练集,同时可以区分出关键词,找到最匹配的答案。In view of this, the present invention proposes a question-and-answer method, question-and-answer device, computer equipment, and storage medium based on knowledge graphs. The amount of data required is small, and the required training set can be trained in a relatively short period of time. At the same time, it can distinguish Key words to find the best matching answer.

首先,为实现上述目的,本发明提出一种基于知识图谱的问答方法,该方法包括步骤:First of all, in order to achieve the above purpose, the present invention proposes a question answering method based on knowledge graph, the method includes steps:

获取输入信息,并根据所述输入信息获取输入特征向量;Obtain input information, and obtain an input feature vector according to the input information;

基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出;Based on the deep learning model, calculating the first predicted output of the input feature vector in the pre-created knowledge map;

基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出;Based on the width learning model, calculating a second predicted output of the input feature vector in the pre-created knowledge map;

根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出;及obtaining a predicted output of the input feature vector based on the first predicted output and the second predicted output; and

根据所述预测输出,获取所述输入信息对应的答案。According to the predicted output, an answer corresponding to the input information is obtained.

进一步地,所述获取输入信息,并根据所述输入信息获取输入特征向量的步骤包括:Further, the step of obtaining input information and obtaining an input feature vector according to the input information includes:

获取输入信息;及obtain input information; and

提取所述输入信息中的特征信息,并根据所述特征信息生成对应的输入特征向量。Extract feature information in the input information, and generate a corresponding input feature vector according to the feature information.

进一步地,所述输入特征向量包括根据用户输入的问句信息而获取的第一输入特征向量、基于预先创建的知识图谱而获取的第二输入特征向量及基于人工定义的第三输入特征向量。Further, the input feature vectors include a first input feature vector obtained based on question information input by a user, a second input feature vector obtained based on a pre-created knowledge graph, and a third input feature vector based on a manual definition.

进一步地,所述基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出的步骤包括:Further, the step of calculating the first predicted output of the input feature vector in the pre-created knowledge map based on the deep learning model includes:

变换所述第一输入特征向量的维度,获取第一低维特征向量;Transforming the dimensions of the first input feature vector to obtain a first low-dimensional feature vector;

将所述第一低维特征向量作为卷积网络的输入,获取第一分类特征向量;Using the first low-dimensional feature vector as the input of the convolutional network to obtain the first classification feature vector;

变换所述第二输入特征向量的维度,获取第二低维特征向量;及Transforming the dimensions of the second input feature vector to obtain a second low-dimensional feature vector; and

根据所述第一分类特征向量、所述第二低维特征向量及所述知识图谱,获取第一预测输出。Acquiring a first prediction output according to the first classification feature vector, the second low-dimensional feature vector and the knowledge map.

进一步地,所述基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出的步骤包括:Further, the step of calculating the second predicted output of the input feature vector in the pre-created knowledge graph based on the width learning model includes:

将所述第三低维特征向量作为分类模型的输入,获取第二分类特征向量;及Using the third low-dimensional feature vector as an input of the classification model to obtain a second classification feature vector; and

根据所述第二分类特征向量和所述知识图谱,获取第二预测输出。Obtain a second prediction output according to the second classification feature vector and the knowledge graph.

进一步地,所述根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出的步骤包括:Further, the step of obtaining the predicted output of the input feature vector according to the first predicted output and the second predicted output includes:

加权求和所述第一预测输出和所述第二预测输出,获取中间预测输出;及weighting and summing the first prediction output and the second prediction output to obtain an intermediate prediction output; and

将所述中间预测输出作为逻辑回归函数的输入,获取所述预测输出。The intermediate prediction output is used as an input of a logistic regression function to obtain the prediction output.

进一步地,所述根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出的步骤之后,所述方法还包括:Further, after the step of obtaining the predicted output of the input feature vector according to the first predicted output and the second predicted output, the method further includes:

根据所述预测输出和所述输入信息的已知输出,确定误差梯度;及determining an error gradient based on said predicted output and a known output of said input information; and

根据所述误差梯度,反向传播并更新所述深度学习模型和宽度学习模型。Backpropagating and updating the deep learning model and the width learning model according to the error gradient.

为实现上述目的,本发明提出一种基于知识图谱的问答装置,该问答装置包括:In order to achieve the above object, the present invention proposes a question answering device based on knowledge graph, which includes:

第一获取模块,用于获取输入信息,并根据所述输入信息获取输入特征向量;A first obtaining module, configured to obtain input information, and obtain an input feature vector according to the input information;

第一计算模块,用于基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出;The first calculation module is used to calculate the first predicted output of the input feature vector in the pre-created knowledge map based on the deep learning model;

第二计算模块,用于基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出;The second calculation module is used to calculate the second predicted output of the input feature vector in the pre-created knowledge map based on the width learning model;

第二获取模块,用于根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出;及A second obtaining module, configured to obtain a predicted output of the input feature vector according to the first predicted output and the second predicted output; and

答案获取模块,用于根据所述预测输出,获取所述输入信息对应的答案。An answer obtaining module, configured to obtain an answer corresponding to the input information according to the predicted output.

为实现上述目的,本发明还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述方法的步骤。To achieve the above object, the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the above method is implemented when the processor executes the computer program A step of.

为实现上述目的,本发明还提供计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述方法的步骤。To achieve the above object, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are realized.

相较于传统技术,本发明所提出的基于知识图谱的问答方法、计算机设备及存储介质,能够有效的利用外部资源,通过宽度学习模型有效利用关系事实的同义词或上线文词等外部资源,这一部分外部资源可以通过文本挖掘或者直接利用中文词体等方式快速得到。也通过宽度学习模型和深度学习模型的结合,能够降低模型所需的数据量,在训练数据较少的时候也能得到较好的输出结果,这在开发新的垂直领域的知识图谱问答的时候有着非常重要的意义。Compared with the traditional technology, the knowledge map-based question answering method, computer equipment and storage media proposed in the present invention can effectively use external resources, and effectively use external resources such as synonyms of relational facts or online words through the breadth learning model. This part External resources can be quickly obtained through text mining or direct use of Chinese words. Also through the combination of the width learning model and the deep learning model, the amount of data required by the model can be reduced, and better output results can be obtained when the training data is small. has a very important meaning.

附图说明Description of drawings

图1是本发明第一实施例之基于知识图谱的问答方法的流程示意图;FIG. 1 is a schematic flow diagram of a question-and-answer method based on knowledge graphs in the first embodiment of the present invention;

图2是本发明第二实施例之基于知识图谱的问答方法的流程示意图;FIG. 2 is a schematic flow diagram of a question-and-answer method based on a knowledge graph according to a second embodiment of the present invention;

图3是本发明第三实施例之基于知识图谱的问答方法的流程示意图;Fig. 3 is a schematic flowchart of a question answering method based on a knowledge graph according to a third embodiment of the present invention;

图4是本发明第四实施例之基于知识图谱的问答方法的流程示意图;FIG. 4 is a schematic flowchart of a question answering method based on a knowledge graph according to a fourth embodiment of the present invention;

图5是本发明第五实施例之基于知识图谱的问答方法的流程示意图;Fig. 5 is a schematic flow chart of a question answering method based on a knowledge graph according to a fifth embodiment of the present invention;

图6是本发明第六实施例之基于知识图谱的问答方法的流程示意图;及FIG. 6 is a schematic flow diagram of a question-and-answer method based on a knowledge graph according to a sixth embodiment of the present invention; and

图7是本发明提供的基于知识图谱的问答装置的方框示意图。Fig. 7 is a schematic block diagram of a question answering device based on a knowledge graph provided by the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

需要说明的是,在本发明中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。It should be noted that the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and should not be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features . Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present invention.

请参考图1,第一实施例中提供了一种基于知识图谱的问答方法。该问答方法包括:Please refer to FIG. 1 , a question answering method based on a knowledge map is provided in the first embodiment. The question-and-answer method includes:

步骤S110:获取输入信息,并根据所述输入信息获取输入特征向量.Step S110: Obtain input information, and obtain an input feature vector according to the input information.

具体地,获取到用户输入的输入信息,该输入信息为用户所输入的问句,如为什么会咳嗽等,并根据用户输入的问句提取出相应的输入特征向量。其中,输入特征向量包括根据用户输入的问句信息而获取的第一输入特征向量、基于预先创建的知识图谱而获取的第二输入特征向量及基于人工定义的第三输入特征向量。第一输入特征向量是由用户输入的问句信息,经过分割,形成以字或词为单位的序列。第二输入特征向量是基于知识图谱中的关系事实,即实体及实体关系而构建。第三输入特征向量是基于人工定义,围绕关系事实的同义词集和上下文词集,计算用户输入的问句信息与关系事实的相似度,从而形成的特征向量。Specifically, the input information input by the user is obtained, and the input information is a question input by the user, such as why you cough, etc., and a corresponding input feature vector is extracted according to the question input by the user. Wherein, the input feature vector includes a first input feature vector obtained according to the question information input by the user, a second input feature vector obtained based on a pre-created knowledge map, and a third input feature vector based on a manual definition. The first input feature vector is the question sentence information input by the user, which is segmented to form a sequence in units of words or words. The second input feature vector is constructed based on the relational facts in the knowledge graph, ie entities and entity relationships. The third input feature vector is a feature vector formed by calculating the similarity between the question information input by the user and the relational fact based on the manual definition, surrounding the synonym set and the contextual word set of the relational fact.

步骤120:基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出。Step 120: Based on the deep learning model, calculate the first predicted output of the input feature vector in the pre-created knowledge graph.

具体地,利用深度学习模型,计算用户输入的问句信息在预先创建的知识图谱中在语义上的匹配程度,从而得到第一预测输出。在一实施例中,在用户输入“上火该吃什么药?”,利用深度学习模型,计算该问句与已知的药品知识图谱在语义上的相似度,即这句话与实施图谱中的某个(实体,关系)组的语义相似度,从而得出一个预测输出。其中该第一预测输出可以是一个概率值,也可是其他,在此不做限定。Specifically, the deep learning model is used to calculate the semantic matching degree of the question information input by the user in the pre-created knowledge graph, so as to obtain the first prediction output. In one embodiment, when the user inputs "what medicine should I take for getting angry?", the deep learning model is used to calculate the semantic similarity between the question sentence and the known drug knowledge map, that is, this sentence is consistent with the implementation map. Semantic similarity of a certain (entity, relation) group of , so as to obtain a prediction output. Wherein the first prediction output may be a probability value or other, which is not limited here.

步骤S130,基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。Step S130, based on the width learning model, calculate the second predicted output of the input feature vector in the pre-created knowledge graph.

具体地,利用深度学习模型,计算用户输入的问句信息在预先创建的知识图谱中的关系事实的匹配程度,从而得到第二预测概率。在一实施例中,在用户输入“上火该吃什么药?”,首先找出该问句中所提及的实体,如“上火”,在计算该实体“上火”在知识图谱中某个症状实体的别名匹配程度,那么可以得到该实体匹配度打分这个实体匹配特征,如果相匹配,则该实体匹配特征等于1,对于问句中的剩余部分“<sympton>吃什么药”与知识图谱中的存在的关系做特征提取,再加上之前的实体匹配特征,从而得到特征向量。将该特征向量作为深度学习模型的输入,从而得到一个预测输出,即预测打分。其中,宽度学习模型可以是广义线性模型,也可以是xgboost模型。在本实施例中,宽度学习模型是xgboost模型。Specifically, the deep learning model is used to calculate the matching degree of the question sentence information input by the user to the relational facts in the pre-created knowledge map, so as to obtain the second prediction probability. In one embodiment, when the user inputs "what medicine should I take for getting angry?", first find out the entity mentioned in the question, such as "getting angry", and calculate the entity "getting angry" in the knowledge graph The alias matching degree of a certain symptom entity, then the entity matching feature of the entity matching degree score can be obtained. If it matches, the entity matching feature is equal to 1. For the remaining part of the question "<sympton> what medicine to eat" and The existing relationship in the knowledge map is used for feature extraction, and the previous entity matching features are added to obtain the feature vector. The feature vector is used as the input of the deep learning model to obtain a predicted output, that is, the predicted score. Among them, the width learning model can be a generalized linear model or an xgboost model. In this embodiment, the width learning model is the xgboost model.

步骤S140,根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出。Step S140, according to the first predicted output and the second predicted output, the predicted output of the input feature vector is obtained.

具体地,对第一预测输出和第二预测输出进行加权求和,从而获取到用户所输入的问句信息在知识图谱中对应答案的最终预测输出。也就是说,最终预测输出融合了问句在知识图谱中在语义上与实体的相似度和在关系事实上的匹配程度,从而可以更准确的获取该问句在知识图谱中存在答案的准确度。其中,预测输出的表达式为:Specifically, weighted summing is performed on the first predicted output and the second predicted output, so as to obtain the final predicted output corresponding to the answer in the knowledge map of the question information input by the user. That is to say, the final prediction output combines the semantic similarity of the question sentence with the entity in the knowledge map and the matching degree of the relationship in fact, so that the accuracy of the answer of the question sentence in the knowledge map can be obtained more accurately . Among them, the expression of the predicted output is:

其中,Y是一个二值的类别标签,是sigmoid标签,表示交叉特征,b是一个bias项,Wwide是宽度学习模型的权值,Wdeep是深度学习模型的权值,即隐藏层到输出层的权值。Among them, Y is a binary category label, which is a sigmoid label, indicating cross features, b is a bias item, Wwide is the weight of the width learning model, and Wdeep is the weight of the deep learning model, that is, from the hidden layer to the output layer weights.

步骤S150,根据所述预测输出,获取所述输入信息对应的答案。Step S150, according to the predicted output, obtain the answer corresponding to the input information.

具体地,关于用户所输入的问句信息及在知识图谱中所查询到的答案的概率值,用户一方面可以知道该答案的准确性,另一方面也可以获取到该概率值所对应的答案,以供参考。例如,用户输入“上火该吃什么药?”,通过计算得到的预测概率有97%,有78%,有40%等,根据该预测概率值,用户可以知道97%对应的答案更符合自己的要求。Specifically, regarding the question information entered by the user and the probability value of the answer queried in the knowledge map, the user can know the accuracy of the answer on the one hand, and can also obtain the answer corresponding to the probability value on the other hand. ,for reference. For example, if the user enters "what medicine should I take for getting angry?", the predicted probability obtained through calculation is 97%, 78%, 40%, etc. According to the predicted probability value, the user can know that the answer corresponding to 97% is more suitable for himself requirements.

总之,该问答方法能够有效的利用外部资源,通过宽度学习模型有效利用关系事实的同义词或上线文词等外部资源,这一部分外部资源可以通过文本挖掘或者直接利用中文词体等方式快速得到。也通过宽度学习模型和深度学习模型的结合,能够降低模型所需的数据量,在训练数据较少的时候也能得到较好的输出结果,这在开发新的垂直领域的知识图谱问答的时候有着非常重要的意义。In short, the question answering method can effectively use external resources, such as synonyms of relational facts or online words, etc., through the breadth learning model. This part of external resources can be quickly obtained through text mining or directly using Chinese word styles. Also through the combination of the width learning model and the deep learning model, the amount of data required by the model can be reduced, and better output results can be obtained when the training data is small. has a very important meaning.

在第二个实施例中,请参考图2,相比于图1所述的第一实施例,在本实施例中,该方法包括步骤S210-S260,其中,本实施例中步骤S230-S260与第一实施例中步骤S120-S150相同,在此不再一一赘述。In the second embodiment, please refer to FIG. 2. Compared with the first embodiment described in FIG. 1, in this embodiment, the method includes steps S210-S260, wherein, in this embodiment, steps S230-S260 It is the same as steps S120-S150 in the first embodiment, and will not be repeated here.

步骤S210,获取输入信息。Step S210, acquiring input information.

在本实施例中,该输入信息可以是文字信息,也可以是语音信息或图片信息,在此不作限定。该信息的获取方式可以通过通讯软件获取,如微信、短信或语音等聊天软件,还可以通过输入法软件获取,如用户通过输入法软件输入的文字等信息,在此不做限定。In this embodiment, the input information may be text information, voice information or picture information, which is not limited here. This information can be obtained through communication software, such as chat software such as WeChat, SMS or voice, or through input method software, such as text and other information entered by users through input method software, which is not limited here.

步骤S220,提取所述输入信息中的特征信息,并根据所述特征信息生成对应的输入特征向量。Step S220, extracting feature information in the input information, and generating a corresponding input feature vector according to the feature information.

具体地,从用户的输入信息中进行提取,如为什么会咳嗽,将会提取出“为什么”、“咳嗽”特征信息,并根据这两个特征信息利用一些转向量的方法将其转换为相应的输入特征向量。其中,将该特征信息转换为用向量表示的输入特征向量的方法可以有:从预先设置的信息与向量的对应表格中,查找获取与该输入信息对应的输入向量,从而将该输入信息转化为用向量表示的输入向量,还可以通过向量空间模型来将该输入信息转换为用向量表示的输入向量,在此不做限定。Specifically, extracting from the user's input information, such as why you cough, will extract the "why" and "cough" feature information, and use some steering vector methods to convert it into the corresponding Input feature vector. Wherein, the method for converting the feature information into an input feature vector represented by a vector may include: searching and obtaining an input vector corresponding to the input information from a table corresponding to preset information and vectors, thereby converting the input information into The input vector represented by a vector may also convert the input information into an input vector represented by a vector through a vector space model, which is not limited here.

步骤S230,基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出。Step S230, based on the deep learning model, calculate the first predicted output of the input feature vector in the pre-created knowledge graph.

步骤S240,基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。Step S240, based on the width learning model, calculate the second predicted output of the input feature vector in the pre-created knowledge graph.

步骤S250,根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出。Step S250, according to the first predicted output and the second predicted output, the predicted output of the input feature vector is obtained.

步骤S260,根据所述预测输出,获取所述输入信息对应的答案。Step S260, according to the predicted output, obtain the answer corresponding to the input information.

在第三个实施例中,请参考图3,相比于图1所述的第一实施例,在本实施例中,该方法包括步骤S310-S380,其中,本实施例中步骤S310与步骤S360-S380与第一实施例中步骤S110与步骤S130-S150相同,在此不再一一赘述。In a third embodiment, please refer to FIG. 3. Compared with the first embodiment described in FIG. S360-S380 are the same as step S110 and step S130-S150 in the first embodiment, and will not be repeated here.

步骤S310,获取输入信息,并根据所述输入信息获取输入特征向量。Step S310, obtaining input information, and obtaining an input feature vector according to the input information.

步骤S320,变换所述第一输入特征向量的维度,获取第一低维特征向量。Step S320, transforming the dimensions of the first input feature vector to obtain a first low-dimensional feature vector.

具体地,由于第一输入特征向量的维度是根据预先创建的知识图谱而确定的,为保证知识图谱中各个字对应的输入特征向量不重复,从而根据知识图谱中的字数来确定维度,一般都是几千或者上万维度,维度较高,不利于后期计算,从而让这些高维度的第一输入特征向量经过嵌入层的变换,从而获得相对应的低纬度的特征向量,便于后期计算。Specifically, since the dimension of the first input feature vector is determined according to the pre-created knowledge map, in order to ensure that the input feature vectors corresponding to each word in the knowledge map are not repeated, and thus determine the dimension according to the number of words in the knowledge map, generally It is thousands or tens of thousands of dimensions, and the dimension is high, which is not conducive to later calculations, so that these high-dimensional first input feature vectors are transformed by the embedding layer to obtain corresponding low-latitude feature vectors, which is convenient for later calculations.

其中,深度学习模型包括多个神经元“层”,即输入层、隐藏层及输出层。输入层负责接收输入信息并分别发送至隐藏层,隐藏层主要负责计算及输出结果至输出层。一般隐藏层的参数大小和隐藏层的维度大小有关,当隐藏层的输入向量的维度经过嵌入层后,维度会变小,隐藏层的参数设置就可以变得更小。例如没有嵌入层,第一输入特征向量的维度可能是4000,隐藏层大约需要设置500节点数,才能获得比较好的结果,而增加了嵌入层后,将第一输入特征向量的维度由4000变成了100,隐藏层大约只需要50个节点就可以得到不错的结果,即通过设置嵌入层来降低维度,能减少隐藏层所需节点数,使得深度学习模型的运行速度大大提升,减少深度学习模型的资源消耗。Among them, the deep learning model includes multiple neuron "layers", namely the input layer, hidden layer and output layer. The input layer is responsible for receiving the input information and sending them to the hidden layer respectively, and the hidden layer is mainly responsible for calculating and outputting the results to the output layer. Generally, the parameter size of the hidden layer is related to the dimension of the hidden layer. When the dimension of the input vector of the hidden layer passes through the embedding layer, the dimension will become smaller, and the parameter setting of the hidden layer can become smaller. For example, if there is no embedding layer, the dimension of the first input feature vector may be 4000, and the hidden layer needs to set about 500 nodes to obtain better results. After adding the embedding layer, the dimension of the first input feature vector is changed from 4000 to It becomes 100, and the hidden layer only needs about 50 nodes to get good results. That is, by setting the embedding layer to reduce the dimension, the number of nodes required for the hidden layer can be reduced, which greatly improves the running speed of the deep learning model and reduces the number of deep learning models. The resource consumption of the model.

例如,知识图谱中有:为、病、什、么、咳、嗽等4000个汉字,为了区分知识图谱中的信息,需要保证知识图谱中各个汉字对应的向量不出现重复,故需要预设每个汉字对应的向量至少为4000维,如“为”字对应的向量为(1,0,0,0,0,0,0,…0),“病”字对应的向量为(0,1,0,0,0,0,0,…0)等,当输入信息为“为什么咳嗽”,则“为”字向量为(1,0,0,0,0,0,0,…0),“什”字向量为(0,0,1,0,0,0,0,…0),“么”字向量为(0,0,0,1,0,0,0,…0),“咳”字向量为(0,0,0,0,1,0,0,…0),“嗽”字向量为(0,0,0,0,0,1,0,…0)。“为什么咳嗽”对应的就是这五个向量的组合,但这五个向量的维度太高了,每个向量是4000维,导致向量形式的输入信息较大,计算该输入信息时需消耗的资源多,计算速度慢,故为了提高计算及预测的效率,利用嵌入层来进行维度转换,将上述五个向量变成维度更低的向量,如100维,从而减少计算该输入信息时所消耗的资源,进而提高隐藏层的计算效率。For example, there are 4,000 Chinese characters in the knowledge graph: for, disease, what, what, cough, cough, etc. In order to distinguish the information in the knowledge graph, it is necessary to ensure that the vectors corresponding to each Chinese character in the knowledge graph do not appear repeated, so it is necessary to preset each The vector corresponding to a Chinese character is at least 4000 dimensions. For example, the vector corresponding to the word "Wei" is (1,0,0,0,0,0,0,...0), and the vector corresponding to the word "disease" is (0,1 ,0,0,0,0,0,…0), etc., when the input information is “why cough”, then the “is” word vector is (1,0,0,0,0,0,0,…0) , "what" word vector is (0,0,1,0,0,0,0,...0), "what" word vector is (0,0,0,1,0,0,0,...0) , "cough" word vector is (0,0,0,0,1,0,0,...0), "cough" word vector is (0,0,0,0,0,1,0,...0) . "Why cough" corresponds to the combination of these five vectors, but the dimensions of these five vectors are too high, each vector is 4000 dimensions, resulting in a large input information in the form of vectors, which consumes resources when calculating the input information Many, the calculation speed is slow, so in order to improve the efficiency of calculation and prediction, the embedding layer is used to perform dimension conversion, and the above five vectors are converted into vectors with lower dimensions, such as 100 dimensions, so as to reduce the consumption of calculating the input information resources, thereby improving the computational efficiency of the hidden layer.

步骤S330,将所述第一低维特征向量作为卷积网络的输入,获取第一分类特征向量。Step S330, using the first low-dimensional feature vector as an input of the convolutional network to obtain a first classification feature vector.

具体地,第一低维特征向量作为卷积网络的输入,通过卷积网络中卷积层、池化层、全连接层的作用,从而形成了第一分类特征向量。其中,卷积网络,由卷积层、池化层、全连接层组成。其中卷积层与池化层配合,组成多个卷积组,逐层提取特征,最终通过若干个全连接层来完成分类。通过卷积来模拟特征区分,并且通过卷积的权值共享及池化,来降低网络参数的数量级,最后通过传统神经网络完成分类等任务。Specifically, the first low-dimensional feature vector is used as the input of the convolutional network, and the first classification feature vector is formed through the functions of the convolutional layer, the pooling layer, and the fully connected layer in the convolutional network. Among them, the convolutional network consists of a convolutional layer, a pooling layer, and a fully connected layer. Among them, the convolution layer cooperates with the pooling layer to form multiple convolution groups, extract features layer by layer, and finally complete the classification through several fully connected layers. Convolution is used to simulate feature distinction, and the weight sharing and pooling of convolution are used to reduce the order of magnitude of network parameters. Finally, tasks such as classification are completed through traditional neural networks.

步骤S340,变换所述第二输入特征向量的维度,获取第二低维特征向量。Step S340, transforming the dimensions of the second input feature vector to obtain a second low-dimensional feature vector.

具体地,由于第二输入特征向量的维度是根据预先创建的知识图谱而确定的,为保证知识图谱中各个字对应的输入特征向量不重复,从而根据知识图谱中的字数来确定维度,一般都是几千或者上万维度,维度较高,不利于后期计算,从而让这些高维度的第二输入特征向量经过嵌入层的变换,从而获得相对应的低纬度的特征向量,便于后期计算。Specifically, since the dimension of the second input feature vector is determined according to the pre-created knowledge map, in order to ensure that the input feature vectors corresponding to each word in the knowledge map are not repeated, and thus determine the dimension according to the number of words in the knowledge map, generally It is thousands or tens of thousands of dimensions, and the dimension is high, which is not conducive to later calculations, so that these high-dimensional second input feature vectors are transformed by the embedding layer to obtain corresponding low-latitude feature vectors, which is convenient for later calculations.

步骤S350,根据所述第一分类特征向量、所述第二低维特征向量及所述知识图谱,获取第一预测输出。Step S350, obtaining a first prediction output according to the first classification feature vector, the second low-dimensional feature vector and the knowledge graph.

具体地,第一分类特征向量和第二低维特征向量在融合层进行交互,并作为似然函数likelihood的输入,知识图谱作为参照,从而经过该似然函数计算后,输出一个预测概率,该预测概率表示了用户所输入的问句在知识图谱中在语义上的匹配程度。其中融合层通常为softmax回归。Specifically, the first classification feature vector and the second low-dimensional feature vector interact at the fusion layer, and are used as the input of the likelihood function likelihood, and the knowledge map is used as a reference, so that after the calculation of the likelihood function, a prediction probability is output, which The prediction probability indicates the semantic matching degree of the question entered by the user in the knowledge graph. The fusion layer is usually softmax regression.

步骤S360,基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。Step S360, based on the width learning model, calculate the second predicted output of the input feature vector in the pre-created knowledge graph.

步骤S370,根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出。Step S370, according to the first predicted output and the second predicted output, obtain the predicted output of the input feature vector.

步骤S380,根据所述预测输出,获取所述输入信息对应的答案。Step S380, according to the predicted output, obtain the answer corresponding to the input information.

在第四实施例中,请参考图4,第一实施例中的步骤S130包括:In the fourth embodiment, please refer to FIG. 4, step S130 in the first embodiment includes:

步骤S410,将所述第三低维特征向量作为分类模型的输入,获取第二分类特征向量。Step S410, using the third low-dimensional feature vector as an input of the classification model to obtain a second classification feature vector.

具体地,将获取到的第三低维特征向量作为分类模型得输入,经过分类模型一系列的计算,得到第二分类特征向量。其中,分类模型主要有xgboost分类和logistic分类等。在本实施例中,主要介绍logistic分类。logistic分类的步骤主要有线性求和,sigmoid函数激活,计算误差,修正参数这4个步骤。前两部用于判断,后两步用于修正。Specifically, the obtained third low-dimensional feature vector is used as an input of the classification model, and a second classification feature vector is obtained through a series of calculations of the classification model. Among them, the classification models mainly include xgboost classification and logistic classification. In this embodiment, logistic classification is mainly introduced. The steps of logistic classification mainly include linear summation, activation of sigmoid function, calculation of error, and correction of parameters. The first two steps are used for judgment, and the last two steps are used for correction.

在本实施例中,仅以二分类法为例,将第三输入特征向量分为0和1两类。例如,第三输入特征向量为n维的X向量,也有一个n维的参数向量W和一个bias(偏置)项,线性求和得到Z=WTX+b,求和之后再将其代入sigmoid函数,即σ(Z)=σ(WTX+b),在σ(Z)大于0.5时,X向量属于1类,在σ(Z)小于0.5时,X向量属于0类。再利用损失函数C(a,y),通过修正W和b的值来使得C最小化,这是一个优化问题,从而获取到第二分类特征向量。多分类法类似,本发明就不再详细阐述。In this embodiment, only the binary classification method is taken as an example, and the third input feature vector is classified into two types: 0 and 1. For example, the third input feature vector is an n-dimensional X vector, and there is also an n-dimensional parameter vector W and a bias (bias) item, and the linear summation results in Z=WT X+b, and then substitutes it into The sigmoid function, that is, σ(Z)=σ(WT X+b), when σ(Z) is greater than 0.5, the X vector belongs to category 1, and when σ(Z) is less than 0.5, the X vector belongs to category 0. Then use the loss function C(a, y) to minimize C by correcting the values of W and b, which is an optimization problem, so as to obtain the second classification feature vector. The multi-classification method is similar, and the present invention will not elaborate again.

步骤S420,根据所述第二分类特征向量和所述知识图谱,获取第二预测输出。Step S420, obtaining a second prediction output according to the second classification feature vector and the knowledge graph.

具体地,以知识图谱中的事实关系为标准,确定该第二分类特征向量与该知识图谱的匹配程度,从而得到第二预测输出。Specifically, the degree of matching between the second classification feature vector and the knowledge graph is determined based on the factual relationship in the knowledge graph, so as to obtain a second prediction output.

在第五个实施例中,请参考图5,相比于图1所述的第一实施例,在本实施例中,该方法包括步骤S510-S560,其中,本实施例中步骤S510-S530与步骤S560与第一实施例中步骤S110-S130与步骤S150相同,在此不再一一赘述。In a fifth embodiment, please refer to FIG. 5. Compared with the first embodiment described in FIG. 1, in this embodiment, the method includes steps S510-S560, wherein, in this embodiment, steps S510-S530 It is the same as step S560 and steps S110-S130 and step S150 in the first embodiment, and will not be repeated here.

步骤S510,获取输入信息,并根据所述输入信息获取输入特征向量。Step S510, acquiring input information, and acquiring an input feature vector according to the input information.

步骤S520,基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出。Step S520, based on the deep learning model, calculate the first predicted output of the input feature vector in the pre-created knowledge graph.

步骤S530,基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。Step S530, based on the width learning model, calculate the second predicted output of the input feature vector in the pre-created knowledge graph.

步骤S540,加权求和所述第一预测输出和所述第二预测输出,获取中间预测输出。Step S540, weighting and summing the first prediction output and the second prediction output to obtain an intermediate prediction output.

具体地,将第一预测输出和第二预测输出相加求和,即得到中间预测输出。该中间预测输出的表达式为其中,表示宽度学习模型的第二预测输出,表示深度学习模型的第一预测输出,相加求和即得到中间预测输出。Specifically, the first prediction output and the second prediction output are added and summed to obtain an intermediate prediction output. The expression for this intermediate prediction output is in, Denotes the second predicted output of the width learning model, Indicates the first prediction output of the deep learning model, and the intermediate prediction output is obtained by adding and summing.

步骤S550,将所述中间预测输出作为逻辑回归函数的输入,获取所述预测输出。Step S550, using the intermediate prediction output as an input of a logistic regression function to obtain the prediction output.

具体地,将该中间预测输出作为逻辑回归函数的输入,经过该逻辑回归函数的一系列计算可得到预测输出。其中逻辑回归函数为logistic回归。该logistic回归是一种分类方法,用于两分类问题。其基本思想为:一是寻找合适的假设函数,即分类函数,用以预测输入数据的判断结果;二是构造代价函数,即损失函数,用以表示预测的输出结果与训练数据的实际类别之间的偏差;三是最小化代价函数,从而获取最优的模型参数。经过逻辑函数(sigmoid函数)、假设函数(分类函数)、代价函数等函数来计算出预测输出。Specifically, the intermediate prediction output is used as an input of a logistic regression function, and a prediction output can be obtained through a series of calculations of the logistic regression function. The logistic regression function is logistic regression. The logistic regression is a classification method for two classification problems. The basic idea is: one is to find a suitable hypothesis function, that is, a classification function, to predict the judgment result of the input data; the other is to construct a cost function, that is, a loss function, to represent the difference between the predicted output result and the actual category of the training data. The third is to minimize the cost function to obtain the optimal model parameters. The prediction output is calculated by functions such as logic function (sigmoid function), hypothesis function (classification function), and cost function.

步骤S560,根据所述预测输出,获取所述输入信息对应的答案.Step S560, according to the predicted output, obtain the answer corresponding to the input information.

在第六个实施例中,请参考图6,相比于图1所述的第一实施例,在本实施例中,该方法包括步骤S610-S660,其中,本实施例中步骤S610-S640与第一实施例中步骤S110-S140相同,在此不再一一赘述。In the sixth embodiment, please refer to FIG. 6. Compared with the first embodiment described in FIG. 1, in this embodiment, the method includes steps S610-S660, wherein, in this embodiment, steps S610-S640 It is the same as steps S110-S140 in the first embodiment, and will not be repeated here.

步骤S610,获取输入信息,并根据所述输入信息获取输入特征向量。Step S610, acquiring input information, and acquiring an input feature vector according to the input information.

步骤S620,基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出。Step S620, based on the deep learning model, calculate the first predicted output of the input feature vector in the pre-created knowledge graph.

步骤S630,基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。Step S630, based on the width learning model, calculate the second predicted output of the input feature vector in the pre-created knowledge graph.

步骤S640,根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出。Step S640: Obtain a predicted output of the input feature vector according to the first predicted output and the second predicted output.

步骤S650,根据所述预测输出和所述输入信息的已知输出,确定误差梯度。Step S650, determining an error gradient according to the predicted output and the known output of the input information.

具体地,在获取到预测输出之后,根据该输入信息的已知输出,来计算该预测输出和该输入信息的已知输出之间的差距,从而确定一个误差梯度。Specifically, after the predicted output is acquired, the difference between the predicted output and the known output of the input information is calculated according to the known output of the input information, so as to determine an error gradient.

步骤S660,根据所述误差梯度,反向传播并更新所述深度学习模型和宽度学习模型。Step S660, backpropagating and updating the deep learning model and the width learning model according to the error gradient.

具体地,根据该误差梯度,通过最小批随机梯度再反向传播至深度学习模型,使得深度学习模型调整其内部参数,如卷积网络的嵌入层的函数,通过最小批随机梯度再反向传播至宽度学习模型,使得宽度学习模型也调整其内部的参数。如此以来,可以确保深度学习模型和宽度学习模型可根据用户问题不断调整内部参数,使得用户可以获得更准确的答案。其中,我们使用带L1的FTRL算法作为宽度学习模型的优化器,使用Adam更新深度学习模型。使用最小批量随机优化来调整所述宽度学习模型的方式为具有L1正则化的跟随正则化引导(FTRL)算法来调整宽度学习模型的参数的当前值。使用最小批量随机优化来调整所述深度学习模型的方式为使用具有自适应学习速率的随机梯度优化来调整深度机器学习模型的参数的当前值。Specifically, according to the error gradient, it is backpropagated to the deep learning model through the minimum batch stochastic gradient, so that the deep learning model adjusts its internal parameters, such as the function of the embedding layer of the convolutional network, and then backpropagates through the minimum batch stochastic gradient To the width learning model, so that the width learning model also adjusts its internal parameters. In this way, it can be ensured that the deep learning model and the wide learning model can continuously adjust internal parameters according to user questions, so that users can obtain more accurate answers. Among them, we use the FTRL algorithm with L1 as the optimizer of the width learning model, and use Adam to update the deep learning model. The way to tune the width learning model using mini-batch stochastic optimization is to adjust the current values of the parameters of the width learning model with L1 regularization follow regularization bootstrapping (FTRL) algorithm. The way of using the mini-batch stochastic optimization to adjust the deep learning model is to use the stochastic gradient optimization with an adaptive learning rate to adjust the current values of the parameters of the deep machine learning model.

请参考图7,本发明还提供一种基于知识图谱的问答装置700,所述问答装置700包括:Please refer to FIG. 7 , the present invention also provides a question answering device 700 based on a knowledge map, and the question answering device 700 includes:

第一获取模块710,用于获取输入信息,并根据所述输入信息获取输入特征向量。具体地,第一获取模块710获取到用户输入的输入信息,该输入信息为用户所输入的问句,如为什么会咳嗽等,并根据用户输入的问句提取出相应的输入特征向量。The first obtaining module 710 is configured to obtain input information, and obtain an input feature vector according to the input information. Specifically, the first acquisition module 710 acquires the input information input by the user, the input information is the question sentence input by the user, such as why you cough, etc., and extracts the corresponding input feature vector according to the question sentence input by the user.

第一计算模块720,用于基于深度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第一预测输出。具体地,利用深度学习模型,第一计算模块720计算用户输入的问句信息在预先创建的知识图谱中在语义上的匹配程度,从而得到第一预测输出。The first calculation module 720 is configured to calculate the first predicted output of the input feature vector in the pre-created knowledge graph based on the deep learning model. Specifically, using the deep learning model, the first calculation module 720 calculates the semantic matching degree of the question information input by the user in the pre-created knowledge graph, so as to obtain the first prediction output.

第二计算模块730,用于基于宽度学习模型,计算所述输入特征向量在预先创建的知识图谱中的第二预测输出。具体地,利用深度学习模型,第二计算模块730计算用户输入的问句信息在预先创建的知识图谱中的关系事实的匹配程度,从而得到第二预测概率。The second calculation module 730 is configured to calculate a second predicted output of the input feature vector in the pre-created knowledge graph based on the width learning model. Specifically, using the deep learning model, the second calculation module 730 calculates the matching degree of the question information input by the user with the relational facts in the pre-created knowledge graph, so as to obtain the second prediction probability.

第二获取模块740,用于根据所述第一预测输出和所述第二预测输出,获取所述输入特征向量的预测输出。具体地,第二获取模块740对第一预测输出和第二预测输出进行加权求和,从而获取到用户所输入的问句信息在知识图谱中对应答案的最终预测输出。The second obtaining module 740 is configured to obtain a predicted output of the input feature vector according to the first predicted output and the second predicted output. Specifically, the second obtaining module 740 performs weighted summation of the first prediction output and the second prediction output, so as to obtain the final prediction output corresponding to the answer in the knowledge graph of the question information input by the user.

答案获取模块750,用于根据所述预测输出,获取所述输入信息对应的答案。具体地,关于用户所输入的问句信息及在知识图谱中所查询到的答案的概率值,用户一方面可以知道该答案的准确性,另一方面也可以获取到该概率值所对应的答案,以供参考。An answer obtaining module 750, configured to obtain an answer corresponding to the input information according to the predicted output. Specifically, regarding the question information entered by the user and the probability value of the answer queried in the knowledge map, the user can know the accuracy of the answer on the one hand, and can also obtain the answer corresponding to the probability value on the other hand. ,for reference.

本发明还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。本实施例的计算机设备至少包括但不限于:可通过系统总线相互通信连接的存储器、处理器等。The present invention 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 an independent server, or a multi- A server cluster composed of servers), etc. The computer device in this embodiment at least includes but is not limited to: a memory, a processor, and the like that can be communicatively connected to each other through a system bus.

本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于存储电子装置20,被处理器执行时实现本发明的基于知识图谱的问答方法。This embodiment also provides a 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), only Read memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application store, etc., on which computer programs are stored, The corresponding functions are realized when the program is executed by the processor. The computer-readable storage medium in this embodiment is used to store the electronic device 20, and when executed by a processor, implements the question answering method based on the knowledge graph of the present invention.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products are stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in various embodiments of the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process conversion made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related technical fields , are all included in the scope of patent protection of the present invention in the same way.

Claims (10)

CN201910452305.9A2019-05-282019-05-28 Question answering method, device, computer equipment and storage medium based on knowledge graphPendingCN110309281A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910452305.9ACN110309281A (en)2019-05-282019-05-28 Question answering method, device, computer equipment and storage medium based on knowledge graph

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910452305.9ACN110309281A (en)2019-05-282019-05-28 Question answering method, device, computer equipment and storage medium based on knowledge graph

Publications (1)

Publication NumberPublication Date
CN110309281Atrue CN110309281A (en)2019-10-08

Family

ID=68075194

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910452305.9APendingCN110309281A (en)2019-05-282019-05-28 Question answering method, device, computer equipment and storage medium based on knowledge graph

Country Status (1)

CountryLink
CN (1)CN110309281A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112231454A (en)*2020-10-142021-01-15中国平安人寿保险股份有限公司Question prediction and answer feedback method, device, computer equipment and storage medium
CN113254550A (en)*2021-06-292021-08-13浙江大华技术股份有限公司Knowledge graph-based recommendation method, electronic device and computer storage medium
CN114428848A (en)*2021-12-292022-05-03航天科工网络信息发展有限公司Intelligent class case pushing method and system based on incidence relation
CN116975206A (en)*2023-09-252023-10-31华云天下(南京)科技有限公司Vertical field training method and device based on AIGC large model and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108596645A (en)*2018-03-132018-09-28阿里巴巴集团控股有限公司 A method, device and equipment for information recommendation
CN108647251A (en)*2018-04-202018-10-12昆明理工大学The recommendation sort method of conjunctive model is recycled based on wide depth door
CN109196527A (en)*2016-04-132019-01-11谷歌有限责任公司Breadth and depth machine learning model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109196527A (en)*2016-04-132019-01-11谷歌有限责任公司Breadth and depth machine learning model
CN108596645A (en)*2018-03-132018-09-28阿里巴巴集团控股有限公司 A method, device and equipment for information recommendation
CN108647251A (en)*2018-04-202018-10-12昆明理工大学The recommendation sort method of conjunctive model is recycled based on wide depth door

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112231454A (en)*2020-10-142021-01-15中国平安人寿保险股份有限公司Question prediction and answer feedback method, device, computer equipment and storage medium
CN112231454B (en)*2020-10-142024-02-09中国平安人寿保险股份有限公司Question prediction and answer feedback method, device, computer equipment and storage medium
CN113254550A (en)*2021-06-292021-08-13浙江大华技术股份有限公司Knowledge graph-based recommendation method, electronic device and computer storage medium
CN114428848A (en)*2021-12-292022-05-03航天科工网络信息发展有限公司Intelligent class case pushing method and system based on incidence relation
CN116975206A (en)*2023-09-252023-10-31华云天下(南京)科技有限公司Vertical field training method and device based on AIGC large model and electronic equipment
CN116975206B (en)*2023-09-252023-12-08华云天下(南京)科技有限公司Vertical field training method and device based on AIGC large model and electronic equipment

Similar Documents

PublicationPublication DateTitle
CN109783817B (en) A Computational Model of Text Semantic Similarity Based on Deep Reinforcement Learning
CN113392209B (en)Text clustering method based on artificial intelligence, related equipment and storage medium
US11874862B2 (en)Community question-answer website answer sorting method and system combined with active learning
US11544474B2 (en)Generation of text from structured data
CN109376222B (en)Question-answer matching degree calculation method, question-answer automatic matching method and device
US20230102337A1 (en)Method and apparatus for training recommendation model, computer device, and storage medium
CN112819023B (en)Sample set acquisition method, device, computer equipment and storage medium
CN109948149B (en)Text classification method and device
CN110309281A (en) Question answering method, device, computer equipment and storage medium based on knowledge graph
CN111259647A (en)Question and answer text matching method, device, medium and electronic equipment based on artificial intelligence
CN111160000B (en)Composition automatic scoring method, device terminal equipment and storage medium
JP6172317B2 (en) Method and apparatus for mixed model selection
CN117236410B (en)Trusted electronic file large language model training and reasoning method and device
CN113420139B (en) A text matching method, device, electronic device and storage medium
CN113051368A (en)Double-tower model training method, double-tower model searching device and electronic equipment
CN115062718A (en) Language model training method, device, electronic device and storage medium
CN115730597A (en)Multi-level semantic intention recognition method and related equipment thereof
CN114781611A (en)Natural language processing method, language model training method and related equipment
CN110674293A (en) A text classification method based on semantic transfer
CN112101484B (en) Incremental event identification method, system and device based on knowledge consolidation
CN110969005A (en)Method and device for determining similarity between entity corpora
CN113821571A (en) Food safety relation extraction method based on BERT and improved PCNN
CN117874168A (en) Similar test question retrieval method, system, device and storage medium
US20240265207A1 (en)Training of an object linking model
CN110059219A (en)A kind of video preference prediction technique, device, equipment and readable storage medium storing program for executing

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20191008

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp