WO2020258487A1 - 一种问答关系排序方法、装置、计算机设备及存储介质 - Google Patents

一种问答关系排序方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020258487A1
WO2020258487A1 PCT/CN2019/102783 CN2019102783W WO2020258487A1 WO 2020258487 A1 WO2020258487 A1 WO 2020258487A1 CN 2019102783 W CN2019102783 W CN 2019102783W WO 2020258487 A1 WO2020258487 A1 WO 2020258487A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
vector
relationship
candidate
training data
Prior art date
Application number
PCT/CN2019/102783
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 WO2020258487A1 publication Critical patent/WO2020258487A1/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/35Clustering; Classification
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of knowledge graphs, and in particular to a method, device, computer equipment and storage medium for sorting question and answer relations.
  • Question Answering System is an advanced form of information retrieval system. 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 system 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.
  • Knowledge base is a new technology for storing complex structured information.
  • a large amount of fact-based knowledge is stored in the knowledge base, and the knowledge graph model is used internally to model the entity and the relationship information between the entities.
  • knowledge bases mostly store data in the format of RDF (Resource Description Framework).
  • a fact is represented as a (S, P, O) triplet in the form of (subject,predicate,object), where the subject ( Subject and object are named entities. Object is sometimes an attribute value.
  • Predicate is the relationship between subject and object.
  • the research of knowledge graph question answering system generally adopts the network structure based on the attention mechanism, but the time complexity and space complexity of the algorithm based on the attention mechanism are relatively high.
  • question answering systems based on knowledge graphs generally use LSTM or GRU models, and their training speed is much slower than CNN.
  • the time efficiency requirements for initial research and exploration are not high, but if you want to apply these models to commercial use, efficiency issues are very important. Therefore, proposing a highly accurate knowledge graph question and answer system model is very important for actual deployment.
  • the purpose of this application is to provide a method, device, computer equipment, and storage medium for sorting question and answer relationships, which are used to solve the problems existing in the prior art.
  • this application provides a method for ranking question and answer relations, which includes the following steps:
  • the convolutional neural network model is used to score the question relation pair of the knowledge graph, the question relation pair is a set between the question sentence and the mapping candidate relation, and the candidate relation is the All the relationships of the question entities linked in the knowledge graph;
  • the candidate relationship with the highest correlation score is selected as the prediction output.
  • this application also provides a question-and-answer relationship sorting device, which includes:
  • the convolutional neural network model building module is used to score question relation pairs in the knowledge graph.
  • the question relation pairs are a collection of question sentences and mapped candidate relations.
  • the candidate relation is the entity of the question sentence. All the relationships linked in the knowledge graph, including:
  • the first training data collection sub-module is used to collect first training data, where the first training data is question text;
  • the question vector obtaining submodule is used to obtain the question vector of the first training data
  • Candidate relation vector obtaining sub-module used to obtain the candidate relation vector of the first training data
  • An interaction submodule configured to interact the question vector with the candidate relationship vector, and determine the element-wise product and the element-wise difference absolute value of the question vector and the candidate relationship vector;
  • the numerator module is used to map the spliced vector to a value from 0 to 1 via a fully connected network layer, and the value is used to score the relevance of question relation pairs;
  • a convolutional neural network model training module for training the convolutional neural network model
  • Question relation scoring module for relevance scoring module for inputting the question to be processed into the trained convolutional neural network model, and the convolutional neural network scores the relevance of the question relation pair of the question to be processed ;
  • the output module is used to select the candidate relationship with the highest correlation score as the prediction output.
  • the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements a method for sorting question and answer relationships when the computer program is executed The following steps:
  • the convolutional neural network model is used to score the question relation pair of the knowledge graph, the question relation pair is a set between the question sentence and the mapping candidate relation, and the candidate relation is the All the relationships of the question entities linked in the knowledge graph;
  • the candidate relationship with the highest correlation score is selected as the prediction output.
  • the present application 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 following steps of the question-and-answer relationship ranking method are realized:
  • the convolutional neural network model is used to score the question relation pair of the knowledge graph, the question relation pair is a set between the question sentence and the mapping candidate relation, and the candidate relation is the All the relationships of the question entities linked in the knowledge graph;
  • the candidate relationship with the highest correlation score is selected as the prediction output.
  • FIG. 1 is a flowchart of an embodiment of a method for sorting question and answer relationships in an application
  • FIG. 2 is a flowchart of an embodiment of constructing a convolutional neural network model in the method for sorting question and answer relations in this application;
  • FIG. 3 is a schematic diagram of program modules of an embodiment of an apparatus for sorting question and answer relationships according to the application;
  • FIG. 4 is a schematic diagram of the hardware structure implemented by an apparatus for sorting question and answer relations according to the present application.
  • This application discloses a method for ordering question and answer relations, including:
  • S1 Construct a convolutional neural network model, the convolutional neural network model is used to score the question relation pair of the knowledge graph, the question relation pair is a set between the question sentence and the candidate relation of the mapping, the candidate relation Are all the relationships linked by the entities of the question in the knowledge graph; please refer to Figure 2, including:
  • step S11 Collect first training data, where the first training data is question text; in step S11, the question text can be crawled from the Internet through a crawler tool to obtain the first training data.
  • the question vector is a single vector; as a preferred solution, encoding the training data via the text-CNN network model includes: inputting the training data into the embedding layer and expressing it as a list of low-dimensional vectors; then convolution The layer and maximum pooling layer represents a column of low-dimensional vectors as a single vector.
  • the above candidate relationship is all the relationships linked by the entity of the first training data in the knowledge graph, namely Candidates for the relationship of question entities in the corresponding knowledge graph.
  • step S13 for the first training data, the entity in each question can be obtained based on the NER model, and then the knowledge graph is queried through the cypher sentence of neo4j, and all the link relationships in the knowledge graph corresponding to the entity are obtained as the corresponding question Candidate relations, and then all candidate relations are represented as a single vector.
  • the candidate relationship expressed as a single vector by random initialization is the simplest and most efficient way.
  • the model can be easily extended, but if some candidate relationships appear frequently (such as less than 10 times), then directly initialize randomly It will lead to insufficient training of the subsequent model. Therefore, in step S13, if the direct random initialization leads to insufficient training, the candidate relationship is encoded based on the text-CNN network model, and the candidate relationship is expressed as a single vector, including the candidate relationship through a
  • the embedding layer is expressed as a column of low-dimensional vectors; then a column of low-dimensional vectors is expressed as a single vector through the convolutional layer and the maximum pooling layer.
  • the above two encoding methods complement each other. If the model result is good enough, you can only choose the random initialization method to express the candidate relationship as a single vector; if the random initialization method is directly used, the model result is not good enough, you can add the second one as Supplement and strengthen.
  • S14 Interacting the question vector with the candidate relationship vector to determine the element-wise product and the element-wise difference absolute value of the question vector and the candidate relationship vector.
  • step S14 the question vector and the candidate relationship vector are interacted to measure the relevance of the two parts from various aspects, including calculating the element-wise product of the question vector and the candidate relationship vector and the absolute value of the element-wise difference.
  • the element-wise product vector and the element-wise difference absolute value vector are spliced together; among them, each element in the two matrices of the question vector and the candidate relationship vector is correspondingly multiplied to obtain the element-wise product vector;
  • the vector and the candidate relationship vector are subtracted from each element of the two matrices and the absolute value is calculated to obtain the absolute value of the element-wise difference.
  • step S16 Map the spliced vector to a value from 0 to 1 via the fully connected network layer, and the value is used to score the relevance of question relation pairs; in step S16, the spliced vector is passed through a fully connected network layer Mapped to a value from 0 to 1, this value is used to score the relevance of question relation pairs, where the question relation pair is a set of question sentences and candidate relations corresponding to the question entity, and the question relation scores the relevance The higher the corresponding value, the better the correlation between the candidate relationship and the question sentence in the question relation pair.
  • training the convolutional neural network model includes:
  • the second training data is also question text, manually label the second training data as positive samples and negative samples, where the positive sample is the question relation pair, and the question sentence corresponds to the question sentence
  • the correct relationship such as: "Who is Li Na's husband?", the corresponding correct relationship is "husband”, then the positive sample is (Who is Li Na's husband?, husband); the negative sample is the question and question
  • the other relations corresponding to the sentence except the correct relation are randomly sampled based on the preset number, that is, the negative sample is the question relation pair except the positive sample in the question relation pair.
  • other relationships in the negative sample are randomly selected.
  • it can be selected first from the relationships linked by the question entity in the knowledge graph. If the linked relationships are less than the preset number (such as less Less than 10), it is randomly selected among other relationships, and there is no need to limit the value range of the preset number too much.
  • S22 Set a loss function, compare the positive sample with each negative sample based on the loss function, and establish the difference between the positive sample and each negative sample;
  • the above loss function optimization process is the process of convolutional neural network model training and the process of parameter update of the convolutional neural network model. After the loss function is optimized, the score of positive samples will be higher than the score of negative samples, which can be used for judgment Which is the correct relationship?
  • the question-and-answer relationship sorting method shown in this application is used to sort the question-and-answer relationship of knowledge graphs by constructing and training a convolutional neural network model.
  • the convolutional neural network model absorbs the text-CNN model widely used in text classification algorithms.
  • the ability of text representation and the uniquely designed interaction layer can effectively interact with the candidate relationship and the user’s question.
  • the candidate relationship and the user’s question are calculated for correlation, and the relationship with the highest score is selected as the predictive output.
  • the ability of convolutional neural network model question relation pair to be correlated or uncorrelated is significantly improved, the accuracy is improved, and the speed is also improved.
  • this application shows a question-and-answer relationship sorting device.
  • the question-and-answer relationship sorting device 10 may include or be divided into one or more program modules, and one or more program modules are stored. It is stored in a storage medium and executed by one or more processors to complete the application and realize the above-mentioned question-and-answer relationship sorting method.
  • the program module referred to in the present application refers to a series of computer program instruction segments that can complete specific functions, and is more suitable for describing the execution process of the question-and-answer relationship sorting device 10 in the storage medium than the program itself.
  • the convolutional neural network model building module is used to score question relation pairs in the knowledge graph.
  • the question relation pairs are a collection of question sentences and mapped candidate relations.
  • the candidate relation is the entity of the question sentence. All the relationships linked in the knowledge graph, including:
  • the first training data collection sub-module is used to collect first training data, where the first training data is question text;
  • the question vector obtaining submodule is used to obtain the question vector of the first training data
  • Candidate relation vector obtaining sub-module used to obtain the candidate relation vector of the first training data
  • An interaction submodule configured to interact the question vector with the candidate relationship vector, and determine the element-wise product and the element-wise difference absolute value of the question vector and the candidate relationship vector;
  • the numerator module is used to map the spliced vector to a value from 0 to 1 via a fully connected network layer, and the value is used to score the relevance of question relation pairs;
  • a convolutional neural network model training module for training the convolutional neural network model
  • Question relation scoring module for relevance scoring module for inputting the question to be processed into the trained convolutional neural network model, and the convolutional neural network scores the relevance of the question relation pair of the question to be processed ;
  • the output module is used to select the candidate relationship with the highest correlation score as the prediction output.
  • the question vector obtaining sub-module is used to encode the first training data via a text-CNN network model to represent the first training data as a single vector, including:
  • a column of low-dimensional vector acquisition units configured to input the first training data into the embedding layer of the text-CNN network model to be expressed as a column of low-dimensional vectors
  • the single vector acquisition unit is used to express the column of low-dimensional vectors as a single vector via the convolutional layer and the maximum pooling layer of the text-CNN network model.
  • the candidate relationship vector obtaining sub-module further includes a candidate relationship obtaining unit for obtaining entities in the question text based on the NER model, and querying the knowledge graph via neo4j's cypher sentence to obtain the knowledge graph corresponding to the entity All link relations of, as candidate relations of the question sentence.
  • the candidate relationship vector obtaining sub-module further includes a candidate relationship vectorization unit for converting the candidate relationship vector into a single vector, including randomly initializing the candidate relationship to express the candidate relationship as a single Vector; if random initialization leads to insufficient training, the candidate relationship is encoded based on the text-CNN network model to represent the candidate relationship as a single vector.
  • a candidate relationship vectorization unit for converting the candidate relationship vector into a single vector, including randomly initializing the candidate relationship to express the candidate relationship as a single Vector; if random initialization leads to insufficient training, the candidate relationship is encoded based on the text-CNN network model to represent the candidate relationship as a single vector.
  • the convolutional neural network model training module includes:
  • the second training data receipt submodule is used to collect second training data, where the second training data is question text,
  • the positive sample and negative sample determination sub-module is used to label the second training data as a positive sample and a negative sample, and the positive sample is the correct text relationship between the question sentence and the question sentence in the question relation pair
  • the negative sample is a text relationship other than the correct text relationship corresponding to the question sentence in the question relationship pair, and the other text relationship is randomly sampled based on a preset number;
  • the difference establishment sub-module is used to set a loss function, compare the positive sample with each negative sample based on the loss function, and establish the difference between the positive sample and each negative sample;
  • the other textual relationship is preferentially selected from the candidate relationships of the question entity, and if the number of candidate relationships is less than a preset number, then the other relationships random selection.
  • the question-and-answer relationship sorting device shown in this application constructs and trains a convolutional neural network model for knowledge graph question-and-answer relationship sorting.
  • the convolutional neural network model absorbs the text-CNN model widely used in text classification algorithms.
  • the ability of text representation and the uniquely designed interaction layer can effectively interact with the candidate relationship and the user’s question.
  • the candidate relationship and the user’s question are calculated for correlation, and the relationship with the highest score is selected as the predictive output.
  • the ability of convolutional neural network model question relation pair to be correlated or uncorrelated is significantly improved, the accuracy is improved, and the speed is also improved.
  • 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 device 20 of this embodiment at least includes but is not limited to: a memory 21 and a processor 22 that can be communicatively connected to each other through a system bus, as shown in FIG. 4. It should be pointed out that FIG. 3 only shows the computer device 20 with components 21-22, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead.
  • the memory 21 (ie, readable storage medium) includes 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, etc.
  • the memory 21 may be an internal storage unit of the computer device 20, such as a hard disk or memory of the computer device 20.
  • the memory 21 may also be an external storage device of the computer device 20, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD card, Flash Card, etc.
  • the memory 21 may also include both an internal storage unit of the computer device 20 and an external storage device thereof.
  • the memory 21 is generally used to store an operating system and various application software installed in the computer device 20, such as the program code of the question-and-answer relationship sorting apparatus 10 in the first embodiment.
  • the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 22 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 22 is generally used to control the overall operation of the computer device 20.
  • the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the question-and-answer relation sorting apparatus 10, to implement the question-and-answer relation sorting method of the first embodiment.
  • This application 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), read only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), Magnetic Memory, Disk, CD, Server, App Store, etc., on which computer programs are stored
  • ROM read only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • PROM Programmable Read-Only Memory
  • Magnetic Memory Disk, CD, Server, App Store, etc.

Abstract

一种问答关系排序方法,包括:构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分(S1),所述问句关系对为问句与映射的候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;训练所述卷积神经网络模型(S2);将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分(S3);选取相关性打分最高的候选关系作为预测输出(S4),可有效提升卷积神经网络模型问句关系对的相关或非相关性的能力,提高精确度。

Description

一种问答关系排序方法、装置、计算机设备及存储介质
本申请申明享有2019年06月25日递交的申请号为CN2019105532854、名称为“一种问答关系排序方法、装置、计算机设备及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及知识图谱领域,尤其涉及一种问答关系排序方法、装置、计算机设备及存储介质。
背景技术
问答系统(Question Answering System,QA)是信息检索系统的一种高级形式。它能用准确、简洁的自然语言回答用户用自然语言提出的问题。其研究兴起的主要原因是人们对快速、准确地获取信息的需求。问答系统是目前人工智能和自然语言处理领域中一个倍受关注并具有广泛发展前景的研究方向。
随着大规模网络数据资源的出现,尤其是知识图谱的出现,使得基于知识图谱的问答系统更加智能化,知识库是一种储存复杂结构化信息的新型技术。知识库中存储了大量事实型知识,其内部使用知识图谱(knowledge graph)模型对实体及实体间的关系间的关系信息进行建模。如今,知识库多以RDF(Resource Description Framework)的格式存储数据,一条事实(fact)被表示为一个(S,P,O)三元组,形如(subject,predicate,object),其中主体(subject)和客体(object)为命名实体,客体(object)有时会是属性值,述语(predicate)是主体(subject)和客体(object)间的关系。
目前知识图谱问答系统的研究,一般采用基于注意力机制的网络结构,但是基于注意力机制的算法时间复杂度和空间复杂度都较高。另外,基于知识图谱的问答系统一般采用LSTM或者GRU模型,其训练速度较CNN要慢很多。对于初期研究探索时间效率要求并不高,但是如果想要将这些模型应用到商用,效率问题显得非常重要,所以,提出一个精确度高知识图谱问答系统模型对实际部署非常重要。
发明内容
本申请的目的是提供一种问答关系排序方法、装置、计算机设备及存储介质,用于解决现有技术存在的问题。
为实现上述目的,本申请提供一种问答关系排序方法,包括以下步骤:
构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
收集第一训练数据,所述第一训练数据为问句文本;
获取所述第一训练数据的问句向量;
获取所述第一训练数据的候选关系向量;
确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
训练所述卷积神经网络模型;
将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
选取相关性打分最高的候选关系作为预测输出。
为实现上述目的,本申请还提供一种问答关系排序装置,其包括:
卷积神经网络模型构建模块,用于知识图谱问句关系对的打分,所述问句关系对为问句与映射的候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系,其包括:
第一训练数据收集子模块,用于收集第一训练数据,所述第一训练数据为问句文本;
问句向量获取子模块,用于获取所述第一训练数据的问句向量;
候选关系向量获取子模块,用于获取所述第一训练数据的候选关系向量;
交互子模块,用于将所述问句向量与所述候选关系向量进行交互,确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
拼接子模块,用于拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
打分子模块,用于经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
卷积神经网络模型训练模块,用于训练所述卷积神经网络模型;
问句关系对相关性打分模块,用于将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
以及输出模块,用于选取相关性打分最高的候选关系作为预测输出。
为实现上述目的,本申请还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现问答关系排序方法的以下步骤:
构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
收集第一训练数据,所述第一训练数据为问句文本;
获取所述第一训练数据的问句向量;
获取所述第一训练数据的候选关系向量;
确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
训练所述卷积神经网络模型;
将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络 对所述待处理问句的问句关系对的相关性打分;
选取相关性打分最高的候选关系作为预测输出。
为实现上述目的,本申请还提供计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现问答关系排序方法的以下步骤:
构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
收集第一训练数据,所述第一训练数据为问句文本;
获取所述第一训练数据的问句向量;
获取所述第一训练数据的候选关系向量;
确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
训练所述卷积神经网络模型;
将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
选取相关性打分最高的候选关系作为预测输出。
附图说明
图1为本申请问答关系排序方法一实施例的流程图;
图2为本申请问答关系排序方法中构建卷积神经网络模型一实施例中的流程图;
图3为本申请问答关系排序装置的一实施例程序模块示意图;
图4为本申请问答关系排序装置一实施的硬件结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例一
请参阅图1,本申请公开了一种问答关系排序方法,包括:
S1:构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射的候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;请参阅图2,包括:
S11,收集第一训练数据,所述第一训练数据为问句文本;步骤S11中,可通过爬虫工具从网络上爬取问句文本以获取第一训练数据。
S12,获取所述第一训练数据的问句向量;
步骤S12中,问句向量为单一的向量;作为一优选方案,可经由text-CNN网络模型对训练数据进行编码包括:将训练数据输入至嵌入层,表示为一列低维向量;然后经由卷积层与极大池化层将一列低维向量表示为单一的向量。
S13,获取第一训练数据的候选关系向量;
确定第一训练数据中的候选关系,并对候选候选关系向量随机初始化,以将候选关系表示为单一的向量,上述候选关系为第一训练数据的实体在知识图谱中所链接的所有关系,即问句实体在对应知识图谱中的关系的候选者。
步骤S13中,对于第一训练数据,可先基于NER模型获取各问句中的实体,然后通过neo4j的cypher语句查询知识图谱,获取该实体对应的知识图谱中的所有链接关系作为对应问句的候选关系,然后将所有的候选关系表示为单一的向量。
其中候选关系经由随机初始化表示为单一的向量是最简单、最高效的方式,可以很方便地扩展的模型,但是如果有的候选关系出现频率较低(如低于10次),那么直接随机初始化会导致后续模型训练的不足,故步骤S13中,若直接随机初始化导致训练不足,则选择基于text-CNN网络模型对候选关系进行编 码,将候选关系表示为单一的向量,包括将候选关系经由一嵌入层表示为一列低维向量;然后经由卷积层与极大池化层将一列低维向量表示为单一的向量。上述两种编码方式相互补充,如果模型结果足够好,可以只选择随机初始化方式将候选关系表示为单一的向量;如果是直接使用随机初始化方式导致模型结果不够好,可以加入第二种,以作为补充和加强。
S14,将所述问句向量与所述候选关系向量进行交互,确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值。
步骤S14中,将问句向量与候选关系向量进行交互,以从多方面衡量两个部分的相关性,包括计算问句向量与候选关系向量的element-wise乘积和element-wise差值绝对值,并将得到的element-wise乘积向量与element-wise差值绝对值向量进行拼接;其中将问句向量与候选关系向量两个矩阵中每个元素对应相乘获取element-wise乘积向量;将问句向量与候选关系向量两个矩阵中每个元素对应相减后并计算绝对值获取element-wise差值绝对值。
S15,拼接所述element-wise乘积向量与所述element-wise差值绝对值向量。
S16,经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;步骤S16中,将拼接后的向量经由一全连接网络层映射为0到1的数值,该数值用于对问句关系对的相关性打分,其中问句关系对为问句以及该问句实体对应的候选关系的集合,问句关系对相关性打分所对应的数值越高,说明该问句关系对中候选关系与问句的相关性越好。
S2,训练卷积神经网络模型;
本实施例中,训练卷积神经网络模型包括:
S21,收集第二训练数据,第二训练数据也为问句文本,将第二训练数据人工标注为正样本和负样本,其中,正样本为问句关系对中,问句与问句对应的正确关系,比如:"李娜的老公是谁?",对应的正确关系是“丈夫”,则正样本为(李娜的老公是谁?,丈夫);负样本为问句关系对中问句与问句对应的除正确关系之外的其他关系,其他关系基于预设数量随机采样获取,即负样本为问句关系对中除正样本外其他的问句关系对。
本实施例中,负样本中的其他关系为随机选取的,作为一优选方案,可优 先从问句实体在知识图谱中所链接的关系中选择,若链接的关系少于预设数量(如少于10个),则在其他关系中随机选择,此外无需对预设数量的取值范围做过多限制。
S22,设置损失函数,基于损失函数将正样本与每个负样本进行比较,建立正样本与每个负样本之间的差异性;
本实施例中,损失函数为triplet loss损失函数,triplet loss=max(0,margin+m_0-m_1),其中,m_0为正样本在模型中的打分,m_1为负样本在模型中的打分,margin为triplet loss超参数。通过选取triplet loss作为损失函数,相当于将正样本与每个负样本进行比较,在其之间建立差异性。假设问句与其对应的正确关系即正样本在模型中的打分为m_0,问句与某个错误关即负样本在模型中的打分为m_1,triplet loss的超参数设置为margin,则triplet loss=max(0,margin+m_0-m_1)。
S23,经由梯度下降算法,最优化损失函数;本实施例中,梯度算法选取ADAM算法,训练的目标为最小化所有正负样本组的平均triplet loss。
上述损失函数优化的过程即为卷积神经网络模型训练的过程,也是卷积神经网络模型的参数更新的过程,损失函数优化后,正样本打分会高于比负样本打分,即可以用于判断正确的关系是哪一个。
S3,将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分。
S4,选取相关性打分最高的候选关系作为预测输出。
本申请所示的一种问答关系排序方法,通过构建并训练卷积神经网络模型用于知识图谱问答关系排序,该卷积神经网络模型吸收了文本分类算法中被广泛使用的text-CNN模型的文本表示能力,且采用独特设计的交互层,可有效的对候选关系与用户问句做交互,最后将候选关系与与用户问句做相关性计算,选取得分最高的关系作为预测输出,使得卷积神经网络模型问句关系对的相关或非相关性的能力显著提升,提高精确度,同时速度也得到提升。
实施例二
请继续参阅图3,本申请示出了一种问答关系排序装置,在本实施例中, 问答关系排序装置10可以包括或被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本申请,并可实现上述问答关系排序方法。本申请所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序本身更适合于描述问答关系排序装置10在存储介质中的执行过程。
以下描述将具体介绍本实施例各程序模块的功能:
卷积神经网络模型构建模块,用于知识图谱问句关系对的打分,所述问句关系对为问句与映射的候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系,其包括:
第一训练数据收集子模块,用于收集第一训练数据,所述第一训练数据为问句文本;
问句向量获取子模块,用于获取所述第一训练数据的问句向量;
候选关系向量获取子模块,用于获取所述第一训练数据的候选关系向量;
交互子模块,用于将所述问句向量与所述候选关系向量进行交互,确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
拼接子模块,用于拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
打分子模块,用于经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
卷积神经网络模型训练模块,用于训练所述卷积神经网络模型;
问句关系对相关性打分模块,用于将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
以及输出模块,用于选取相关性打分最高的候选关系作为预测输出。
优选的,所述问句向量获取子模块用于经由text-CNN网络模型对所述第一训练数据进行编码,以将所述第一训练数据表示为单一的向量,包括:
一列低维向量获取单元,用于将所述第一训练数据输入至所述text-CNN网络模型的嵌入层以表示为一列低维向量;
单一向量获取单元,用于经由所述text-CNN网络模型的卷积层与极大池化层将所述一列低维向量表示为单一的向量。
优选的,所述候选关系向量获取子模块还包括候选关系获取单元,用于基于NER模型获取问句文本中的实体,并经由neo4j的cypher语句查询知识图谱,获取所述实体对应的知识图谱中的所有链接关系,以作为所述问句的候选关系。
优选的,所述候选关系向量获取子模块还包括候选关系向量化单元,用于将所述候选关系向量为单一的向量,包括对所述候选关系随机初始化以将所述候选关系表示为单一的向量;若随机初始化导致训练不足,则基于text-CNN网络模型对所述候选关系进行编码以将所述候选关系表示为单一的向量。
优选的,卷积神经网络模型训练模块包括:
第二训练数据收据子模块,用于收集第二训练数据,所述第二训练数据为问句文本,
正样本和负样本确定子模块,用于将所述第二训练数据标注为正样本和负样本,所述正样本为所述问句关系对中问句与所述问句对应的正确文本关系;所述负样本为所述问句关系对中问句与所述问句对应的除正确文本关系之外的其他文本关系,所述其他文本关系基于预设数量随机采样获取;
差异性建立子模块,用于设置损失函数,基于所述损失函数将所述正样本与每个所述负样本进行比较,建立所述正样本与每个负样本之间的差异性;
以及优化模块,用于经由梯度下降算法,最优化所述损失函数;
进一步的,所述正样本和负样本确定子模块中,所述其他文本关系优先从所述问句实体的候选关系中选择,若所述候选关系数量少于预设数量,则在其他关系中随机选择。
进一步的,所述差异性建立子模块中,所述损失函数为triplet loss损失函数,triplet loss=max(0,margin+m_0-m_1),其中,m_0为问句与其对应的正确关系在模型中的打分,m_1为问句与某个错误关系在模型中的打分,margin为triplet loss超参数。
本申请所示的一种问答关系排序装置,通过构建并训练卷积神经网络模型用于知识图谱问答关系排序,该卷积神经网络模型吸收了文本分类算法中被广泛使用的text-CNN模型的文本表示能力,且采用独特设计的交互层,可有效的 对候选关系与用户问句做交互,最后将候选关系与与用户问句做相关性计算,选取得分最高的关系作为预测输出,使得卷积神经网络模型问句关系对的相关或非相关性的能力显著提升,提高精确度,同时速度也得到提升。
实施例三
本申请还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。本实施例的计算机设备20至少包括但不限于:可通过系统总线相互通信连接的存储器21、处理器22,如图4所示。需要指出的是,图3仅示出了具有组件21-22的计算机设备20,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器21(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器21可以是计算机设备20的内部存储单元,例如该计算机设备20的硬盘或内存。在另一些实施例中,存储器21也可以是计算机设备20的外部存储设备,例如该计算机设备20上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备20的内部存储单元也包括其外部存储设备。本实施例中,存储器21通常用于存储安装于计算机设备20的操作系统和各类应用软件,例如实施例一的问答关系排序装置10的程序代码等。此外,存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制计算机设备20的总体操作。本实施例中,处理器22用于运行存储器21中存储的程序代码或者处理数据,例如运行问答关系排序装置10,以实现实施例一的问答关系排序方法。
实施例四
本申请还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于存储问答关系排序装置10,被处理器执行时实现实施例一的问答关系排序方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种问答关系排序方法,其特征在于,包括:
    构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
    收集第一训练数据,所述第一训练数据为问句文本;
    获取所述第一训练数据的问句向量;
    获取所述第一训练数据的候选关系向量;
    确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
    拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
    经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
    训练所述卷积神经网络模型;
    将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
    选取相关性打分最高的候选关系作为预测输出。
  2. 根据权利要求1所述问答关系排序方法,其特征在于,所述问句向量为单一的向量,经由text-CNN网络模型对所述第一训练数据进行编码,以将所述第一训练数据表示为单一的向量,包括:
    将所述训练数据输入至所述text-CNN网络模型的嵌入层以表示为一列低维向量;
    经由所述text-CNN网络模型的卷积层与极大池化层将所述一列低维向量表示为单一的向量。
  3. 根据权利要求1所述问答关系排序方法,其特征在于,所述候选关系的确定包括如下步骤:
    基于NER模型获取问句文本中的实体;
    经由neo4j的cypher语句查询知识图谱,获取所述实体对应的知识图谱 中的所有链接关系,以作为所述问句的候选关系。
  4. 根据权利要求1所述问答关系排序方法,其特征在于,所述候选关系向量为单一的向量,对所述候选关系随机初始化以将所述候选关系表示为单一的向量;若随机初始化导致训练不足,则基于text-CNN网络模型对所述候选关系进行编码以将所述候选关系表示为单一的向量。
  5. 根据权利要求1所述问答关系排序方法,其特征在于,训练所述卷积神经网络模型包括:
    收集第二训练数据,所述第二训练数据为问句文本,将所述第二训练数据标注为正样本和负样本,所述正样本为所述问句关系对中问句与所述问句对应的正确文本关系;所述负样本为所述问句关系对中问句与所述问句对应的除正确文本关系之外的其他文本关系,所述其他文本关系基于预设数量随机采样获取;
    设置损失函数,基于所述损失函数将所述正样本与每个所述负样本进行比较,建立所述正样本与每个负样本之间的差异性;
    经由梯度下降算法,最优化所述损失函数。
  6. 根据权利要求5所述问答关系排序方法,其特征在于,所述其他文本关系优先从所述问句实体的候选关系中选择,若所述候选关系数量少于预设数量,则在其他关系中随机选择。
  7. 根据权利要求5所述问答关系排序方法,其特征在于,所述损失函数为triplet loss损失函数,triplet loss=max(0,margin+m_0-m_1),其中,m_0为问句与其对应的正确关系在模型中的打分,m_1为问句与某个错误关系在模型中的打分,margin为triplet loss超参数。
  8. 一种问答关系排序装置,其特征在于,包括:
    卷积神经网络模型构建模块,用于知识图谱问句关系对的打分,所述问句关系对为问句与映射的候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系,其包括:
    第一训练数据收集子模块,用于收集第一训练数据,所述第一训练数据为问句文本;
    问句向量获取子模块,用于获取所述第一训练数据的问句向量;
    候选关系向量获取子模块,用于获取所述第一训练数据的候选关系向量;
    交互子模块,用于将所述问句向量与所述候选关系向量进行交互,确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
    拼接子模块,用于拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
    打分子模块,用于经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
    卷积神经网络模型训练模块,用于训练所述卷积神经网络模型;
    问句关系对相关性打分模块,用于将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
    以及输出模块,用于选取相关性打分最高的候选关系作为预测输出。
  9. 根据权利要求8所述问答关系排序装置,其特征在于,所述问句向量获取子模块用于经由text-CNN网络模型对所述第一训练数据进行编码,以将所述第一训练数据表示为单一的向量,包括:
    一列低维向量获取单元,用于将所述第一训练数据输入至所述text-CNN网络模型的嵌入层(embedding层)以表示为一列低维向量;
    单一向量获取单元,用于经由所述text-CNN网络模型的卷积层与极大池化层将所述一列低维向量表示为单一的向量。
  10. 根据权利要求8所述问答关系排序装置,其特征在于,所述候选关系向量获取子模块还包括候选关系获取单元,用于基于NER模型获取问句文本中的实体,并经由neo4j的cypher语句查询知识图谱,获取所述实体对应的知识图谱中的所有链接关系,以作为所述问句的候选关系。
  11. 根据权利要求8所述问答关系排序装置,其特征在于,所述候选关系向量获取子模块还包括候选关系向量化单元,用于将所述候选关系向量为单一的向量,包括对所述候选关系随机初始化以将所述候选关系表示为单一的向量;若随机初始化导致训练不足,则基于text-CNN网络模型对所述候选关系进行编码以将所述候选关系表示为单一的向量。
  12. 根据权利要求8所述问答关系排序装置,其特征在于,卷积神经网络模型训练模块包括:
    第二训练数据收据子模块,用于收集第二训练数据,所述第二训练数据为问句文本,
    正样本和负样本确定子模块,用于将所述第二训练数据标注为正样本和负样本,所述正样本为所述问句关系对中问句与所述问句对应的正确文本关系;所述负样本为所述问句关系对中问句与所述问句对应的除正确文本关系之外的其他文本关系,所述其他文本关系基于预设数量随机采样获取;
    差异性建立子模块,用于设置损失函数,基于所述损失函数将所述正样本与每个所述负样本进行比较,建立所述正样本与每个负样本之间的差异性;
    以及优化模块,用于经由梯度下降算法,最优化所述损失函数。
  13. 根据权利要求12所述问答关系排序装置,其特征在于,所述正样本和负样本确定子模块中,所述其他文本关系优先从所述问句实体的候选关系中选择,若所述候选关系数量少于预设数量,则在其他关系中随机选择。
  14. 根据权利要求12所述问答关系排序装置,其特征在于,所述差异性建立子模块中,所述损失函数为triplet loss损失函数,triplet loss=max(0,margin+m_0-m_1),其中,m_0为问句与其对应的正确关系在模型中的打分,m_1为问句与某个错误关系在模型中的打分,margin为triplet loss超参数。
  15. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现问答关系排序方法的以下步骤:
    构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
    收集第一训练数据,所述第一训练数据为问句文本;
    获取所述第一训练数据的问句向量;
    获取所述第一训练数据的候选关系向量;
    确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
    拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
    经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
    训练所述卷积神经网络模型;
    将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
    选取相关性打分最高的候选关系作为预测输出。
  16. 根据权利要求15所述计算机设备,其特征在于,所述问句向量为单一的向量,经由text-CNN网络模型对所述第一训练数据进行编码,以将所述第一训练数据表示为单一的向量,包括:
    将所述训练数据输入至所述text-CNN网络模型的嵌入层以表示为一列低维向量;
    经由所述text-CNN网络模型的卷积层与极大池化层将所述一列低维向量表示为单一的向量。
  17. 根据权利要求15所述计算机设备,其特征在于,所述候选关系的确定包括如下步骤:
    基于NER模型获取问句文本中的实体;
    经由neo4j的cypher语句查询知识图谱,获取所述实体对应的知识图谱中的所有链接关系,以作为所述问句的候选关系。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于:
    所述计算机程序被处理器执行时实现问答关系排序方法的以下步骤:
    构建卷积神经网络模型,所述卷积神经网络模型用于知识图谱问句关系对的打分,所述问句关系对为问句与映射候选关系之间的集合,所述候选关系为所述问句的实体在知识图谱中所链接的所有关系;
    收集第一训练数据,所述第一训练数据为问句文本;
    获取所述第一训练数据的问句向量;
    获取所述第一训练数据的候选关系向量;
    确定所述问句向量与所述候选关系向量的element-wise乘积和element-wise差值绝对值;
    拼接所述element-wise乘积向量与所述element-wise差值绝对值向量;
    经由全连接网络层将拼接后的向量映射为0到1的数值,所述数值用于对问句关系对的相关性打分;
    训练所述卷积神经网络模型;
    将待处理问句输入至训练完毕的卷积神经网络模型中,所述卷积神经网络对所述待处理问句的问句关系对的相关性打分;
    选取相关性打分最高的候选关系作为预测输出。
  19. 根据权利要求18所述计算机可读存储介质,其特征在于,所述问句向量为单一的向量,经由text-CNN网络模型对所述第一训练数据进行编码,以将所述第一训练数据表示为单一的向量,包括:
    将所述训练数据输入至所述text-CNN网络模型的嵌入层以表示为一列低维向量;
    经由所述text-CNN网络模型的卷积层与极大池化层将所述一列低维向量表示为单一的向量。
  20. 根据权利要求18所述计算机可读存储介质,其特征在于,所述候选关系的确定包括如下步骤:
    基于NER模型获取问句文本中的实体;
    经由neo4j的cypher语句查询知识图谱,获取所述实体对应的知识图谱中的所有链接关系,以作为所述问句的候选关系。
PCT/CN2019/102783 2019-06-25 2019-08-27 一种问答关系排序方法、装置、计算机设备及存储介质 WO2020258487A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910553285.4A CN110442689A (zh) 2019-06-25 2019-06-25 一种问答关系排序方法、装置、计算机设备及存储介质
CN201910553285.4 2019-06-25

Publications (1)

Publication Number Publication Date
WO2020258487A1 true WO2020258487A1 (zh) 2020-12-30

Family

ID=68428330

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/102783 WO2020258487A1 (zh) 2019-06-25 2019-08-27 一种问答关系排序方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN110442689A (zh)
WO (1) WO2020258487A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032580A (zh) * 2021-03-29 2021-06-25 浙江星汉信息技术股份有限公司 关联档案推荐方法、系统及电子设备
CN114153993A (zh) * 2022-02-07 2022-03-08 杭州远传新业科技有限公司 一种用于智能问答的知识图谱自动化构建方法及系统
CN114357193A (zh) * 2022-01-10 2022-04-15 中国科学技术大学 一种知识图谱实体对齐方法、系统、设备与存储介质
CN116011548A (zh) * 2023-03-24 2023-04-25 北京澜舟科技有限公司 一种多知识图谱问答模型训练方法、系统及存储介质
CN117273151A (zh) * 2023-11-21 2023-12-22 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及系统

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111008272A (zh) * 2019-12-04 2020-04-14 深圳市新国都金服技术有限公司 基于知识图谱的问答方法、装置、计算机设备及存储介质
CN111209351B (zh) * 2020-01-02 2023-08-08 北京沃东天骏信息技术有限公司 对象关系预测、对象推荐方法及装置、电子设备、介质
CN111221952B (zh) * 2020-01-06 2021-05-14 百度在线网络技术(北京)有限公司 建立排序模型的方法、查询自动补全的方法及对应装置
CN111324743A (zh) * 2020-02-14 2020-06-23 平安科技(深圳)有限公司 文本关系抽取的方法、装置、计算机设备及存储介质
CN111563159B (zh) * 2020-07-16 2021-05-07 智者四海(北京)技术有限公司 文本排序方法及装置
CN113204973A (zh) * 2021-04-30 2021-08-03 平安科技(深圳)有限公司 答非所问识别模型的训练方法、装置、设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845990A (zh) * 2018-06-12 2018-11-20 北京慧闻科技发展有限公司 基于双向注意力机制的答案选择方法、装置和电子设备
US20180349350A1 (en) * 2017-06-01 2018-12-06 Beijing Baidu Netcom Science And Technology Co., Ltd. Artificial intelligence based method and apparatus for checking text
CN109522557A (zh) * 2018-11-16 2019-03-26 中山大学 文本关系抽取模型的训练方法、装置及可读存储介质
CN109697228A (zh) * 2018-12-13 2019-04-30 平安科技(深圳)有限公司 智能问答方法、装置、计算机设备及存储介质
CN109815339A (zh) * 2019-01-02 2019-05-28 平安科技(深圳)有限公司 基于TextCNN知识抽取方法、装置、计算机设备及存储介质
CN109857860A (zh) * 2019-01-04 2019-06-07 平安科技(深圳)有限公司 文本分类方法、装置、计算机设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844530A (zh) * 2016-12-29 2017-06-13 北京奇虎科技有限公司 一种问答对分类模型的训练方法和装置
CN108446286B (zh) * 2017-02-16 2023-04-25 阿里巴巴集团控股有限公司 一种自然语言问句答案的生成方法、装置及服务器
CN108304437B (zh) * 2017-09-25 2020-01-31 腾讯科技(深圳)有限公司 一种自动问答方法、装置及存储介质
US20190122111A1 (en) * 2017-10-24 2019-04-25 Nec Laboratories America, Inc. Adaptive Convolutional Neural Knowledge Graph Learning System Leveraging Entity Descriptions
CN109408627B (zh) * 2018-11-15 2021-03-02 众安信息技术服务有限公司 一种融合卷积神经网络和循环神经网络的问答方法及系统
CN109710923B (zh) * 2018-12-06 2020-09-01 浙江大学 基于跨媒体信息的跨语言实体匹配方法
CN109710744B (zh) * 2018-12-28 2021-04-06 合肥讯飞数码科技有限公司 一种数据匹配方法、装置、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180349350A1 (en) * 2017-06-01 2018-12-06 Beijing Baidu Netcom Science And Technology Co., Ltd. Artificial intelligence based method and apparatus for checking text
CN108845990A (zh) * 2018-06-12 2018-11-20 北京慧闻科技发展有限公司 基于双向注意力机制的答案选择方法、装置和电子设备
CN109522557A (zh) * 2018-11-16 2019-03-26 中山大学 文本关系抽取模型的训练方法、装置及可读存储介质
CN109697228A (zh) * 2018-12-13 2019-04-30 平安科技(深圳)有限公司 智能问答方法、装置、计算机设备及存储介质
CN109815339A (zh) * 2019-01-02 2019-05-28 平安科技(深圳)有限公司 基于TextCNN知识抽取方法、装置、计算机设备及存储介质
CN109857860A (zh) * 2019-01-04 2019-06-07 平安科技(深圳)有限公司 文本分类方法、装置、计算机设备及存储介质

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032580A (zh) * 2021-03-29 2021-06-25 浙江星汉信息技术股份有限公司 关联档案推荐方法、系统及电子设备
CN113032580B (zh) * 2021-03-29 2023-07-25 浙江星汉信息技术股份有限公司 关联档案推荐方法、系统及电子设备
CN114357193A (zh) * 2022-01-10 2022-04-15 中国科学技术大学 一种知识图谱实体对齐方法、系统、设备与存储介质
CN114357193B (zh) * 2022-01-10 2024-04-02 中国科学技术大学 一种知识图谱实体对齐方法、系统、设备与存储介质
CN114153993A (zh) * 2022-02-07 2022-03-08 杭州远传新业科技有限公司 一种用于智能问答的知识图谱自动化构建方法及系统
CN116011548A (zh) * 2023-03-24 2023-04-25 北京澜舟科技有限公司 一种多知识图谱问答模型训练方法、系统及存储介质
CN117273151A (zh) * 2023-11-21 2023-12-22 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及系统
CN117273151B (zh) * 2023-11-21 2024-03-15 杭州海康威视数字技术股份有限公司 基于大语言模型的科学仪器使用分析方法、装置及系统

Also Published As

Publication number Publication date
CN110442689A (zh) 2019-11-12

Similar Documents

Publication Publication Date Title
WO2020258487A1 (zh) 一种问答关系排序方法、装置、计算机设备及存储介质
CN109558477B (zh) 一种基于多任务学习的社区问答系统、方法及电子设备
WO2020140386A1 (zh) 基于TextCNN知识抽取方法、装置、计算机设备及存储介质
US11900064B2 (en) Neural network-based semantic information retrieval
WO2021012519A1 (zh) 基于人工智能的问答方法、装置、计算机设备及存储介质
WO2019075123A1 (en) SEARCH METHOD AND TREATMENT DEVICE
WO2021121198A1 (zh) 基于语义相似度的实体关系抽取方法、装置、设备及介质
US11551437B2 (en) Collaborative information extraction
US20220100963A1 (en) Event extraction from documents with co-reference
CN112287069B (zh) 基于语音语义的信息检索方法、装置及计算机设备
WO2020232898A1 (zh) 文本分类方法、装置、电子设备及计算机非易失性可读存储介质
WO2023207096A1 (zh) 一种实体链接方法、装置、设备及非易失性可读存储介质
US20220100772A1 (en) Context-sensitive linking of entities to private databases
US11874798B2 (en) Smart dataset collection system
WO2022174496A1 (zh) 基于生成模型的数据标注方法、装置、设备及存储介质
CN113761868B (zh) 文本处理方法、装置、电子设备及可读存储介质
TW202001621A (zh) 語料庫產生方法及裝置、人機互動處理方法及裝置
CN111563097A (zh) 一种无监督式的题目聚合方法、装置、电子设备及存储介质
US11797281B2 (en) Multi-language source code search engine
CN113158051B (zh) 一种基于信息传播和多层上下文信息建模的标签排序方法
US20220100967A1 (en) Lifecycle management for customized natural language processing
CN117216114A (zh) 一种数据流关联方法、装置、设备及其存储介质
WO2023178979A1 (zh) 问题标注方法、装置、电子设备及存储介质
US20230153335A1 (en) Searchable data structure for electronic documents
CN115309865A (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: 19934570

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: 19934570

Country of ref document: EP

Kind code of ref document: A1