CN111984765B - Knowledge base question-answering process relation detection method and device - Google Patents

Knowledge base question-answering process relation detection method and device Download PDF

Info

Publication number
CN111984765B
CN111984765B CN201910422428.8A CN201910422428A CN111984765B CN 111984765 B CN111984765 B CN 111984765B CN 201910422428 A CN201910422428 A CN 201910422428A CN 111984765 B CN111984765 B CN 111984765B
Authority
CN
China
Prior art keywords
representation
relation
neural network
relationship
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.)
Active
Application number
CN201910422428.8A
Other languages
Chinese (zh)
Other versions
CN111984765A (en
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.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201910422428.8A priority Critical patent/CN111984765B/en
Publication of CN111984765A publication Critical patent/CN111984765A/en
Application granted granted Critical
Publication of CN111984765B publication Critical patent/CN111984765B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The disclosure relates to a method and a device for detecting a relation of a knowledge base question-answering process, wherein the method comprises the following steps: acquiring question expression and a corresponding relation to be detected; determining an initial relation representation of the relation to be detected in a knowledge base; mapping the initial relation representation to a registered relation representation of a knowledge base question-answer space to obtain a mapped relation representation; determining word level representations corresponding to the relation to be detected; determining a global level representation of the mapped relationship representation; determining a final relationship representation; and determining a detection result of the relation to be detected according to the similarity of the final relation representation and the question representation. By utilizing the embodiments of the present disclosure, the accuracy of the relationship detection can be improved.

Description

Knowledge base question-answering process relation detection method and device
Technical Field
The disclosure relates to the technical field of knowledge base questions and answers, and in particular relates to a knowledge base questions and answers process relation detection method, device and storage medium.
Background
With the continuous development of information technology, the society has undergone various changes. Under this trend, technologies represented by knowledge base questions and answers play an increasingly important role in the production and life of people. Knowledge base questions and answers refer to questions which can accept natural language and give correct and concise answers.
The prior knowledge base questions and answers rely on a large-scale open domain knowledge base to perform questions and answers. The organization form of the knowledge base is generally in the form of a triplet, namely "< head entity, relationship, tail entity >", wherein the relationship is generally a direct semantic connection representing two entities, the head entity is generally a theme representing objective existence, the tail entity is either entity or attribute, and the general method of open domain intelligent question-answering based on the knowledge base is as follows: the method comprises the steps of firstly carrying out entity recognition on a question to obtain a main body of the question, then carrying out relation detection on the question, and finally carrying out inquiry according to the obtained entity and a relation structured knowledge base to obtain a final triplet, wherein the last dimension of the triplet is an answer corresponding to the question.
However, the existing knowledge base has huge scale and larger labeling difficulty, so that the relations in the training set are insufficient to cover the relations in all the knowledge bases, and a large number of unlabeled relations exist in the knowledge bases. The relationship not marked in the common knowledge base is called as a non-login relationship, and the marked relationship is called as a login relationship. In the existing knowledge base question-answering method, the detection accuracy of the unregistered relation is low, and even the unregistered relation cannot be detected.
Disclosure of Invention
The disclosure provides a method, a device and a storage medium for detecting a relation in a knowledge base question-answering process, so as to improve the accuracy of relation detection, in particular to improve the accuracy of detection of an unregistered relation.
According to a first aspect of the present disclosure, there is provided a knowledge base question-answering process relationship detection method, which is characterized in that the method includes:
acquiring question expression and a corresponding relation to be detected;
obtaining an initial relation representation of the relation to be detected in a knowledge base according to the relation to be detected;
mapping the initial relation representation to a registered relation representation of a knowledge base question-answer space to obtain a mapped relation representation;
processing the relation to be detected to obtain word level representation corresponding to the relation to be detected;
processing the mapped relationship representation to obtain a global level representation of the mapped relationship representation;
processing the word level representation and the global level representation to obtain a final relationship representation;
and determining a detection result of the relation to be detected according to the similarity of the final relation representation and the question representation.
In one possible implementation, mapping the relationship representation to a knowledge base question-answer space logged relationship representation, and obtaining the mapped relationship representation includes:
and inputting the initial relation representation into a first neural network, and obtaining a mapped relation representation after processing the initial relation representation through the first neural network.
In one possible implementation, the training of the first neural network includes:
inputting the initial relation representation into the first neural network to obtain a mapped relation representation;
determining a loss of the processing result of the first neural network according to the mapped relation representation and the corresponding registered relation representation;
the loss is counter-propagated to the first neural network to adjust network parameters of the first neural network.
In one possible implementation, the training of the first neural network further includes:
constructing the second neural network according to a first mapping function corresponding to the first neural network, wherein the mapping function of the second neural network is an inverse function of the first mapping function;
inputting the mapped relation representation into the second neural network, and processing the second neural network to obtain a reconstructed relation representation;
determining a loss of the processing result of the first neural network according to the reconstruction relationship representation and the initial relationship representation;
the loss is propagated to the first neural network to adjust a network parameter of the first neural network.
In one possible implementation manner, processing the relationship to be detected to obtain a word level representation corresponding to the relationship to be detected includes:
and inputting the relation to be detected into a third neural network, and outputting word level representation corresponding to the relation to be detected after processing the relation to be detected through the third neural network.
In one possible implementation, the third neural network includes a word embedding layer, an encoding layer.
In one possible implementation, processing the mapped relationship representation to obtain a global level representation of the mapped relationship representation includes:
and inputting the mapped relation representation into a fourth neural network, and outputting the global level representation of the mapped relation representation after the fourth neural network is processed.
In one possible implementation, the fourth neural network includes a relational embedding layer and the coding layer, the relational embedding layer being initialized by a pre-trained vector representation.
In one possible implementation manner, determining the detection result of the relationship to be detected according to the similarity between the final relationship representation and the question representation includes:
inputting the final relation representation and the question representation into a fifth neural network, and outputting a similarity detection result after processing by the fifth neural network;
and determining whether the relation to be detected is used as the output of the question corresponding to the question representation according to the similarity detection result.
In one possible implementation, the training of the fifth neural network includes:
determining the loss of the processing result of the fifth neural network according to the similarity detection result and the question expression;
the penalty is counter-propagated to the fifth neural network to adjust network parameters of the fifth neural network.
In one possible implementation, the loss of the processing result of the fifth neural network includes determining using the following loss function:
wherein L is rd Representing a loss of processing results of the fifth neural network;
gamma represents a predetermined minimum separation distance;
a score representing a positive relationship;
representing the relationship resulting from the negative sampling in the remaining set of relationships;
q f a question representation corresponding to the relation to be detected;
r represents a relation to be detected;
s represents a set of logged-in relationships;
s (·, ·) represents a function that calculates the cosine distance.
In one possible implementation manner, the acquiring manner of the question expression includes:
and inputting a natural language question into a sixth neural network, and obtaining the question representation after the sixth neural network is compressed.
In one possible implementation, the sixth neural network includes a word embedding layer, a shallow coding layer, a depth coding layer, a residual block, and a pooling layer.
In one possible implementation, the relationship to be detected is an unregistered relationship or a logged-in relationship.
According to a second aspect of the present disclosure, there is provided a knowledge base question-answering process relationship detection apparatus, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the method of the first aspect of the present disclosure.
According to a further aspect of the present disclosure there is provided a non-transitory computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions when executed by a processor implement the method of the first aspect of the present disclosure.
According to the embodiments described in the aspects of the present disclosure, by using the connection between the logged-in relationship and the unregistered relationship, through a specific process, a meaningful concrete representation of the unregistered relationship may be obtained, and based on the concrete representation, the unregistered relationship is identified and detected, so that the accuracy of the unregistered relationship detection may be effectively improved.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features and aspects of the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic flow chart of an embodiment of a knowledge base question-answering process relationship detection method provided in the present disclosure.
Fig. 2 is a schematic structural view of the sixth neural network provided in one embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a training process of the first neural network in one embodiment of the present disclosure.
Fig. 4 is a schematic diagram of a training process of the first neural network in another embodiment of the present disclosure.
Fig. 5 is a training flow diagram of another embodiment of the first neural network modified by the present disclosure on the basis of the corresponding embodiment of fig. 3.
Fig. 6 is a schematic structural diagram of a third neural network according to an embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of a fourth neural network according to an embodiment of the present disclosure.
Fig. 8 illustrates a data processing flow diagram of one embodiment of a knowledge base question-answering process relationship detection method provided by the present disclosure.
Fig. 9 is a block diagram illustrating an apparatus for performing the methods described in this disclosure, according to an example embodiment.
Fig. 10 is a block diagram illustrating another apparatus for performing the methods described in this disclosure, according to an example embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
In addition, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
Fig. 1 is a schematic flow chart of an embodiment of a knowledge base question-answering process relationship detection method provided in the present disclosure. As shown in fig. 1, an embodiment of a knowledge base question-answer process relationship detection method described in the present disclosure may include:
s1: and acquiring question expression and corresponding relation to be detected.
Wherein the question representation is a feature vector representation corresponding to a natural language question.
In one embodiment of the present disclosure, the acquiring manner of the question expression may include: and inputting a natural language question into a sixth neural network, and obtaining the question representation after the sixth neural network is compressed.
Fig. 2 is a schematic structural view of the sixth neural network provided in one embodiment of the present disclosure. As shown in fig. 2, the sixth neural network sequentially includes a word embedding layer, a shallow coding layer, a depth coding layer, a residual block, and a pooling layer. Wherein the word embedding layer is initialized with pre-trained word vectors and fine-tuned with training of the model. The shallow coding layer is a 256-dimensional Bi-directional long-short-time memory network (Bi-LSTM), and the deep coding layer is a 256-dimensional Bi-directional long-time memory network Bi-LSTM. The residual block is responsible for adding the outputs of the shallow coding layer and the deep coding layer, and finally the pooling layer uses maximum pooling to obtain question expression q f
The relation to be detected comprises a preliminarily determined candidate relation corresponding to the question. The relationship to be detected may be an unregistered relationship in the knowledge base or a registered relationship in the knowledge base. The un-logged-in relationship is the relationship which is not marked in the knowledge base.
S2: and obtaining an initial relation representation of the relation to be detected in a knowledge base according to the relation to be detected.
Specifically, in one embodiment of the present disclosure, the initial relationship representation e of the relationship to be detected in the knowledge base may be determined through unsupervised learning g . The data given in the unsupervised learning may be devoid of any labels and may be categorized according to sample-to-sample similarity, and thus may be used not only to generate an initial relationship representation e of the logged-in relationship g May also be used to generate an initial relationship representation e of the unregistered relationship g
S3: and mapping the initial relation representation to a registered relation representation of a knowledge base question-answer space to obtain a mapped relation representation.
In particular, the initial relationship may be represented as e g Inputting into a first neural network Adapter, and processing by the first neural network to obtain a mapped relationship expression G (e) g ). Wherein G (·) is a mapping function corresponding to the first neural network. The first neural network may be a layer of linear neural network, a layer of nonlinear neural network, a layer of two layers of nonlinear neural network, or the like. Specifically, the disclosure is not limited to the specific structure of the first neural network.
Wherein the logged-in relationshipRefers to the noted relationships contained in the pre-training set. By linking the logged-in relationship with the unregistered relationship, the relationship to be detected (including the unregistered detected relationship) may be mapped to the logged-in relationship, so that the mapped relationship representation of the relationship to be detected is as close as possible to the logged-in relationship, and the mapped relationship representation obtained based on the relationship representation is a more meaningful specific relationship representation.
Fig. 3 is a schematic diagram of a training process of the first neural network in one embodiment of the present disclosure. As shown in fig. 3, the training of the first neural network may include:
inputting the initial relation representation into the first neural network to obtain a mapped relation representation;
determining a loss of the processing result of the first neural network according to the mapped relation representation and the corresponding registered relation representation;
the loss is counter-propagated to the first neural network to adjust network parameters of the first neural network.
Wherein, the loss function for determining the loss of the processing result of the first neural network may be a mean square error loss function. The specific loss function is expressed as follows:
wherein, the liquid crystal display device comprises a liquid crystal display device,representing the loss function defined in terms of mean square error.
In one embodiment of the present disclosure, a discriminant may be used to guide the training process. Fig. 4 is a schematic diagram of a training process of the first neural network under the direction of the arbiter in this example. As shown in FIG. 4, in this example, a arbiter D (-) can be trained to distinguish between "real" representations and "false" representations. The expression "true" is the registered relation expression after fine tuningThe "false" representation is then a mapped relational representation G (e g ). G (-) acts as a generator. It tries to generate a representation close to the "true" representation +.>For any relation sampled from the training set, the objective function L of the generator and the arbiter D And L G The method comprises the following steps of:
L G =-E r∈s [D(G(e g ))]
where r represents any one of the relationships, and S and U represent a set of logged-in and unregistered relationships, respectively. e (r) or e represents an embedded representation of r.
Fig. 5 is a training flow diagram of another embodiment of the first neural network modified by the present disclosure on the basis of the corresponding embodiment of fig. 3.
In this example, as shown in fig. 5, on the basis of the training of the embodiment corresponding to fig. 3, the training of the first neural network may further include:
constructing the second neural network according to a first mapping function corresponding to the first neural network, wherein the mapping function of the second neural network is an inverse function of the first mapping function;
inputting the mapped relation representation into the second neural network, and processing the second neural network to obtain a reconstructed relation representation;
determining a loss of the processing result of the first neural network according to the reconstruction relationship representation and the initial relationship representation;
the loss is propagated to the first neural network to adjust a network parameter of the first neural network.
In this example, a further reconstruction penalty is used to enhance the first neural network Adapter. Specifically, using a reversed Adapter denoted G' (. Cndot.), G (e) g ) Mapping back e g . The advantages of introducing this inversion training are: the reversed adapter can be trained on the whole relation space; on the other hand, the reversed mapping may act as a regularization constraint for the forward mapping.
In this example, for the inverse Adapter, a linear mapping can be used simply, and the loss function can be reconstructed using the mean square error:
with previous loss functionThe reconstructed loss function is defined on both logged and unregistered relationships, except that the reconstructed loss function is defined on both logged and unregistered relationships.
S4: and processing the relation to be detected to obtain word level representation corresponding to the relation to be detected.
The word level representation refers to feature vector representation of each word corresponding to the generated relation by splitting the relation to be detected corresponding to the question into words.
Specifically, the relation to be detected is processed to obtain a word level representation r corresponding to the relation to be detected w May include:
inputting the relation to be detected into the firstThe three neural networks are used for outputting word level representation r corresponding to the relation to be detected after being processed by the third neural network w
Fig. 6 is a schematic structural diagram of a third neural network according to an embodiment of the present disclosure. As shown in fig. 6, the third neural network (global representation layer) word embeds the layer and the coding layer. The two layers and the corresponding word embedding layer and shallow coding layer in S1 are shared.
S5: and processing the mapped relation representation to obtain a global level representation of the mapped relation representation.
The global level representation refers to that a to-be-detected relation corresponding to a question sentence is taken as a whole, and a feature vector representation corresponding to the to-be-detected relation is generated.
Specifically, in one embodiment of the present disclosure, the mapped relationship representation is processed to obtain a global level representation r of the mapped relationship representation g May include:
inputting the mapped relation representation into a fourth neural network, and outputting a global level representation r of the mapped relation representation after processing by the fourth neural network g
Fig. 7 is a schematic structural diagram of a fourth neural network according to an embodiment of the present disclosure. As shown in fig. 7, the fourth neural network may include a relational embedding layer and an encoding layer, the relational embedding layer being initialized with a pre-trained vector representation. The coding layer is shared with the corresponding coding layer in S4.
S6: and processing the word level representation and the global level representation to obtain a final relation representation.
Specifically, the word level representation and the global level representation may be input into a pooling layer, and the final relationship representation r may be output after maximum pooling f
S7: representing r according to the final relationship f And the question represents q f And determining the detection result of the relation to be detected.
In one embodiment of the present disclosure, determining the detection result of the relationship to be detected according to the similarity between the final relationship representation and the question representation may include:
representing the final relationship r f And the question represents q f Inputting a fifth neural network, and outputting a similarity detection result after processing by the fifth neural network;
determining whether the relation to be detected is used as the question expression q according to the similarity detection result f And outputting a corresponding question.
In one embodiment of the present disclosure, the training of the fifth neural network may include:
determining the loss of the processing result of the fifth neural network according to the similarity detection result and the question expression;
the penalty is counter-propagated to the fifth neural network to adjust network parameters of the fifth neural network.
The loss of the fifth neural network may be a hinge loss, and the loss may make the scores of all negative relations and the scores of the positive relations differ by a certain distance. Specifically, the loss of the processing result of the fifth neural network may include determining using the following loss function:
wherein L is rd Representing a loss of processing results of the fifth neural network;
gamma represents a predetermined minimum separation distance;
a score representing a positive relationship;
representing the relationship resulting from the negative sampling in the remaining set of relationships;
q f representing the relationship to be detectedA corresponding question representation;
r represents a relation to be detected;
s represents a set of logged-in relationships;
s (·, ·) represents a function that calculates the cosine distance.
Fig. 8 illustrates a data processing flow diagram of one embodiment of a knowledge base question-answering process relationship detection method provided by the present disclosure. To better illustrate the specific data processing flow of the method of the present disclosure, a complete implementation of the method is further described herein with reference to fig. 8:
corresponding to the natural language question, the natural language question can be compressed into a question representation q through a question representation layer (a sixth neural network) f
For the relation r to be detected, the relation r is split into words, and word level representation r corresponding to the relation r is obtained through word level representation layer (third neural network) processing w
Obtaining an initial relation representation e of the relation to be detected in the knowledge base through unsupervised learning g The mapped relation representation is obtained through the processing of a mapping layer (mapping function G (.) and an Adapter/first neural network)Design loss optimization, let->And G (e) g ) As close as possible. The mapped relationship is then expressed +.>Obtaining global level representation r by global level representation layer (fourth neural network) processing g
By combining r g And r w Inputting into a pooling layer, and processing to obtain a final relation representation r f
Representing the final relationship r f And the question represents q f Inputting a fifth neural network, and outputting a similarity detection result after processing by the fifth neural network; can be used forThe highest relationship of similarity value is used as the output of the detection.
Based on the implementation of the knowledge base question-answering process relationship detection method provided by the embodiments, the connection between the logged-in relationship and the unregistered relationship can be utilized, the meaningful concrete representation of the unregistered relationship can be obtained through specific processing, and the accuracy of the unregistered relationship detection can be effectively improved by identifying and detecting the unregistered relationship based on the concrete representation.
Moreover, the training of each neural network disclosed by the disclosure can be free from the restriction of the size of the training set, can cover more relations, and is easier to expand. Meanwhile, the training of each neural network is based on the existing training data, and new training data do not need to be additionally marked.
The embodiment of the disclosure also provides a knowledge base question-answering process relationship detection device, which can comprise: a processor and a memory for storing processor-executable instructions; the specific working process and the setting manner of the processor for implementing any method embodiment of the present disclosure by invoking the executable instructions may refer to the specific description of the corresponding method embodiment of the present disclosure, which is limited in space and not repeated herein.
The disclosed embodiments also provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement any of the method embodiments described above. The computer readable storage medium may be a non-volatile computer readable storage medium.
Fig. 9 is a block diagram illustrating an apparatus 800 for performing the knowledge base question-answering process relationship detection method according to the above embodiments, according to an exemplary embodiment. For example, apparatus 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 9, apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the apparatus 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen between the device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 800 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the apparatus 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, an orientation or acceleration/deceleration of the device 800, and a change in temperature of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices, either in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including computer program instructions executable by processor 820 of apparatus 800 to perform the above-described methods.
Fig. 10 is a block diagram illustrating another apparatus 1900 for performing the knowledge base question-answering process relationship detection method according to the above embodiments, according to an exemplary embodiment. For example, the apparatus 1900 may be provided as a server. Referring to fig. 10, the apparatus 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that are executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The apparatus 1900 may further include a power component 1926 configured to perform power management of the apparatus 1900, a wired or wireless network interface 1950 configured to connect the apparatus 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1932, including computer program instructions executable by processing component 1922 of apparatus 1900 to perform the above-described methods.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement of the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. A knowledge base question-answering process relationship detection method, the method comprising:
acquiring question expression and a corresponding relation to be detected, wherein the relation to be detected is an unregistered relation or a logged relation, the unregistered relation is an unlabeled relation in a knowledge base, and the logged relation is a labeled relation in the knowledge base;
obtaining an initial relation representation of the relation to be detected in a knowledge base according to the relation to be detected;
mapping the initial relation representation to a registered relation representation of a knowledge base question-answer space to obtain a mapped relation representation;
processing the relation to be detected to obtain word level representation corresponding to the relation to be detected;
processing the mapped relationship representation to obtain a global level representation of the mapped relationship representation;
processing the word level representation and the global level representation to obtain a final relationship representation;
determining a detection result of the relation to be detected according to the similarity of the final relation representation and the question representation;
wherein mapping the relational representation to the relational representation registered in the knowledge base question-answer space, and obtaining the mapped relational representation comprises:
and inputting the initial relation representation into a first neural network, and processing the initial relation representation by the first neural network to obtain a mapped relation representation, wherein the first neural network is one of a layer of linear neural network, a layer of nonlinear neural network and a layer of two layers of nonlinear neural network.
2. The knowledge base question-answering process relationship detection method according to claim 1, wherein the training of the first neural network comprises:
inputting the initial relation representation into the first neural network to obtain a mapped relation representation;
determining a loss of the processing result of the first neural network according to the mapped relation representation and the corresponding registered relation representation;
the loss is counter-propagated to the first neural network to adjust network parameters of the first neural network.
3. The knowledge base question-answering process relationship detection method according to claim 2, wherein the training of the first neural network further comprises:
constructing a second neural network according to a first mapping function corresponding to the first neural network, wherein the mapping function of the second neural network is an inverse function of the first mapping function;
inputting the mapped relation representation into the second neural network, and processing the second neural network to obtain a reconstructed relation representation;
determining a loss of the processing result of the first neural network according to the reconstruction relationship representation and the initial relationship representation;
the loss is propagated to the first neural network to adjust a network parameter of the first neural network.
4. The method for detecting a relationship in a knowledge base question-answering process according to claim 1, wherein the processing the relationship to be detected to obtain a word level representation corresponding to the relationship to be detected includes:
and inputting the relation to be detected into a third neural network, and outputting word level representation corresponding to the relation to be detected after processing the relation to be detected through the third neural network.
5. The method for detecting a knowledge base question-answering process relationship according to claim 4, wherein the third neural network includes a word embedding layer and a coding layer.
6. The method of claim 5, wherein processing the mapped relationship representation to obtain a global level representation of the mapped relationship representation comprises:
and inputting the mapped relation representation into a fourth neural network, and outputting the global level representation of the mapped relation representation after the fourth neural network is processed.
7. The knowledge base question-answering process relationship detection method according to claim 6, wherein the fourth neural network includes a relationship embedding layer and the coding layer, the relationship embedding layer being initialized by a pre-trained vector representation.
8. The knowledge base question-answering process relationship detection method according to claim 1, wherein determining the detection result of the relationship to be detected according to the similarity between the final relationship representation and the question representation comprises:
inputting the final relation representation and the question representation into a fifth neural network, and outputting a similarity detection result after processing by the fifth neural network;
and determining whether the relation to be detected is used as the output of the question corresponding to the question representation according to the similarity detection result.
9. The knowledge base question-answering process relationship detection method according to claim 8, wherein the training of the fifth neural network comprises:
determining the loss of the processing result of the fifth neural network according to the similarity detection result and the question expression;
the penalty is counter-propagated to the fifth neural network to adjust network parameters of the fifth neural network.
10. The knowledge base question-answering process relationship detection method according to claim 9, wherein the loss of the processing result of the fifth neural network includes determination using the following loss function:
wherein L is rd Representing a loss of processing results of the fifth neural network;
gamma represents a predetermined minimum separation distance;
a score representing a positive relationship;
representing the relationship resulting from the negative sampling in the remaining set of relationships;
q f a question representation corresponding to the relation to be detected;
r represents a relation to be detected;
s represents a set of logged-in relationships;
s (·, ·) represents a function that calculates the cosine distance.
11. A method for detecting a knowledge base question-answering process relationship according to any one of claims 1, 8, and 9, wherein the question representation is obtained by a method comprising:
and inputting a natural language question into a sixth neural network, and obtaining the question representation after the sixth neural network is compressed.
12. The knowledge base question-answering process relationship detection method according to claim 11, wherein the sixth neural network comprises a word embedding layer, a shallow coding layer, a depth coding layer, a residual block and a pooling layer.
13. A knowledge base question-answering process relationship detection device, characterized in that the device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1 to 12 by invoking the executable instructions.
14. A non-transitory computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 12.
CN201910422428.8A 2019-05-21 2019-05-21 Knowledge base question-answering process relation detection method and device Active CN111984765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910422428.8A CN111984765B (en) 2019-05-21 2019-05-21 Knowledge base question-answering process relation detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910422428.8A CN111984765B (en) 2019-05-21 2019-05-21 Knowledge base question-answering process relation detection method and device

Publications (2)

Publication Number Publication Date
CN111984765A CN111984765A (en) 2020-11-24
CN111984765B true CN111984765B (en) 2023-10-24

Family

ID=73435824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910422428.8A Active CN111984765B (en) 2019-05-21 2019-05-21 Knowledge base question-answering process relation detection method and device

Country Status (1)

Country Link
CN (1) CN111984765B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113449038B (en) * 2021-06-29 2024-04-26 东北大学 Mine intelligent question-answering system and method based on self-encoder
CN113468314B (en) * 2021-08-31 2022-02-08 阿里巴巴达摩院(杭州)科技有限公司 Relationship prediction and question-answering method and device, electronic equipment and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059323A (en) * 2007-09-04 2009-03-19 Omron Corp Knowledge generating system
CN101566998A (en) * 2009-05-26 2009-10-28 华中师范大学 Chinese question-answering system based on neural network
CN102567306A (en) * 2011-11-07 2012-07-11 苏州大学 Acquisition method and acquisition system for similarity of vocabularies between different languages
CN105184307A (en) * 2015-07-27 2015-12-23 蚌埠医学院 Medical field image semantic similarity matrix generation method
US9348815B1 (en) * 2013-06-28 2016-05-24 Digital Reasoning Systems, Inc. Systems and methods for construction, maintenance, and improvement of knowledge representations
CN109408804A (en) * 2018-09-03 2019-03-01 平安科技(深圳)有限公司 The analysis of public opinion method, system, equipment and storage medium
CN109492666A (en) * 2018-09-30 2019-03-19 北京百卓网络技术有限公司 Image recognition model training method, device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10762297B2 (en) * 2016-08-25 2020-09-01 International Business Machines Corporation Semantic hierarchical grouping of text fragments

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059323A (en) * 2007-09-04 2009-03-19 Omron Corp Knowledge generating system
CN101566998A (en) * 2009-05-26 2009-10-28 华中师范大学 Chinese question-answering system based on neural network
CN102567306A (en) * 2011-11-07 2012-07-11 苏州大学 Acquisition method and acquisition system for similarity of vocabularies between different languages
US9348815B1 (en) * 2013-06-28 2016-05-24 Digital Reasoning Systems, Inc. Systems and methods for construction, maintenance, and improvement of knowledge representations
CN105184307A (en) * 2015-07-27 2015-12-23 蚌埠医学院 Medical field image semantic similarity matrix generation method
CN109408804A (en) * 2018-09-03 2019-03-01 平安科技(深圳)有限公司 The analysis of public opinion method, system, equipment and storage medium
CN109492666A (en) * 2018-09-30 2019-03-19 北京百卓网络技术有限公司 Image recognition model training method, device and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Peng Wu等.Learning representation mapping for relation detection in knowledge base question answering.《Computer and Language》.2019,1-10. *
武鹏.表示映射及其在关系抽取和知识库问答的应用.《中国优秀硕士学位论文全文数据库 信息科技辑》.2019, I138-1510. *
谢志文.基于深度学习的知识库问答技术研究.《中国优秀硕士学位论文全文数据库 信息科技辑》.2019,I138-5327. *

Also Published As

Publication number Publication date
CN111984765A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN111445493B (en) Image processing method and device, electronic equipment and storage medium
US20220292265A1 (en) Method for determining text similarity, storage medium and electronic device
CN110909815B (en) Neural network training method, neural network training device, neural network processing device, neural network training device, image processing device and electronic equipment
CN111612070B (en) Image description generation method and device based on scene graph
CN113792207B (en) Cross-modal retrieval method based on multi-level feature representation alignment
CN111524521A (en) Voiceprint extraction model training method, voiceprint recognition method, voiceprint extraction model training device, voiceprint recognition device and voiceprint recognition medium
CN111242303B (en) Network training method and device, and image processing method and device
CN109165738B (en) Neural network model optimization method and device, electronic device and storage medium
CN111539410B (en) Character recognition method and device, electronic equipment and storage medium
CN111582383B (en) Attribute identification method and device, electronic equipment and storage medium
CN110633470A (en) Named entity recognition method, device and storage medium
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
CN112001364A (en) Image recognition method and device, electronic equipment and storage medium
CN110781813A (en) Image recognition method and device, electronic equipment and storage medium
CN111984765B (en) Knowledge base question-answering process relation detection method and device
CN110569329B (en) Data processing method and device, electronic equipment and storage medium
CN109447258B (en) Neural network model optimization method and device, electronic device and storage medium
CN112559673A (en) Language processing model training method and device, electronic equipment and storage medium
CN110633715A (en) Image processing method, network training method and device and electronic equipment
CN116166843B (en) Text video cross-modal retrieval method and device based on fine granularity perception
CN110070046B (en) Face image recognition method and device, electronic equipment and storage medium
CN111046780A (en) Neural network training and image recognition method, device, equipment and storage medium
CN116484828A (en) Similar case determining method, device, apparatus, medium and program product
CN110659625A (en) Training method and device of object recognition network, electronic equipment and storage medium
CN114842404A (en) Method and device for generating time sequence action nomination, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant