CN109598000B - Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium - Google Patents

Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium Download PDF

Info

Publication number
CN109598000B
CN109598000B CN201811624158.0A CN201811624158A CN109598000B CN 109598000 B CN109598000 B CN 109598000B CN 201811624158 A CN201811624158 A CN 201811624158A CN 109598000 B CN109598000 B CN 109598000B
Authority
CN
China
Prior art keywords
semantic
word
semantic relation
vectors
recognition model
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
CN201811624158.0A
Other languages
Chinese (zh)
Other versions
CN109598000A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201811624158.0A priority Critical patent/CN109598000B/en
Publication of CN109598000A publication Critical patent/CN109598000A/en
Application granted granted Critical
Publication of CN109598000B publication Critical patent/CN109598000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a semantic relation identification method, a semantic relation identification device, computer equipment and a storage medium. The method comprises the following steps: acquiring basic semantic unit sentence pairs to be identified; and taking the basic semantic unit sentence pair to be recognized as the input of a semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pair to be recognized. The method can realize the identification of the explicit semantic relation and the implicit semantic relation, and can ensure the semantic relation identification effect.

Description

Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium
Technical Field
The present invention relates to the field of natural language processing, and in particular, to a semantic relationship identification method, apparatus, computer device, and computer readable storage medium.
Background
The chapter semantic relationship recognition task is a basic task of natural language processing, and generally refers to the recognition of semantic relationships among basic semantic units of natural language, for example, "despite the fact that the real estate is spell resistant and the price is reduced, a yield relationship is indicated," police recognizes that he lies, and they find a wallet lost by a owner in his residence "indicates a causal relationship. Words or phrases in such tasks that can indicate semantic relationships, if any, are called related words, such as "… for …", "although …". The recognition effect of the related words is obviously increased compared with the recognition effect of the related words which do not appear.
In the related art, the semantic relation recognition task is mainly divided into an explicit semantic relation recognition task and an implicit semantic relation recognition task. For the explicit semantic relation recognition task, the associated words among the basic semantic units are recognized through the associated word recognition model, and then the associated words are used as important features to model the basic semantic units to recognize semantic relations. For the task of identifying the implicit semantic relation, the basic semantic units are directly encoded and then the semantic relation is identified.
But the problems existing at present are: the explicit semantic relation recognition is seriously dependent on the associated word recognition model, and if the associated word recognition is in error, error conduction can be caused, so that the explicit semantic relation recognition effect is reduced; for the implicit semantic relation recognition, the recognition effect cannot be improved through the associated word. Therefore, how to recognize the explicit semantic relationship and recognize the implicit semantic relationship and ensure the semantic relationship recognition effect has become a urgent problem to be solved.
Disclosure of Invention
The object of the present invention is to solve at least to some extent one of the above-mentioned technical problems.
To this end, a first object of the present invention is to propose a semantic relationship identification method. The method can realize the identification of the explicit semantic relation and the implicit semantic relation, and can ensure the semantic relation identification effect.
A second object of the present invention is to provide a semantic relationship identification apparatus.
A third object of the invention is to propose a computer device.
A fourth object of the present invention is to propose a computer readable storage medium.
In order to achieve the above object, a semantic relationship identification method according to an embodiment of a first aspect of the present invention includes: acquiring basic semantic unit sentence pairs to be identified; and taking the basic semantic unit sentence pair to be recognized as the input of a semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pair to be recognized.
According to the semantic relation recognition method, the basic semantic unit sentence pair to be recognized can be obtained, and the basic semantic unit sentence pair to be recognized is used as the input of the pre-trained semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pair to be recognized. The related word recognition task and the semantic relation recognition task are simultaneously learned through a joint learning mode to train a semantic relation recognition model in advance, so that the semantic relation recognition model can process an explicit semantic relation recognition task and an implicit semantic relation recognition task simultaneously, and meanwhile, the semantic relation recognition effect can be guaranteed.
In order to achieve the above object, a semantic relationship identifying apparatus according to an embodiment of the second aspect of the present invention includes: the sentence acquisition module is used for acquiring basic semantic unit sentence pairs to be identified; and the recognition model is used for inputting the basic semantic unit sentence pairs to be recognized as a semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pairs to be recognized.
According to the semantic relation recognition device provided by the embodiment of the invention, the basic semantic unit sentence pair to be recognized can be obtained through the sentence obtaining module, the recognition model takes the basic semantic unit sentence pair to be recognized as the input of the pre-trained semantic relation recognition model, and the semantic relation of the basic semantic unit sentence pair to be recognized is obtained. The related word recognition task and the semantic relation recognition task are simultaneously learned through a joint learning mode to train a semantic relation recognition model in advance, so that the semantic relation recognition model can process an explicit semantic relation recognition task and an implicit semantic relation recognition task simultaneously, and meanwhile, the semantic relation recognition effect can be guaranteed.
To achieve the above object, a computer device according to an embodiment of a third aspect of the present invention includes: the semantic relationship identification method comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the semantic relationship identification method according to the embodiment of the first aspect of the invention when executing the computer program.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, where the computer program when executed by a processor implements the semantic relationship identification method according to the first aspect of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of a semantic relationship identification method according to one embodiment of the present invention;
FIG. 2 is a flow chart of a semantic relationship identification method according to one specific embodiment of the present invention;
FIG. 3 is a schematic architecture diagram of a semantic relationship identification model according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a network architecture of a generator according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a network architecture of a calibrator according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a semantic relationship identification apparatus according to one embodiment of the present invention;
FIG. 7 is a schematic structural view of a semantic relationship identifying apparatus according to another embodiment of the present invention;
fig. 8 is a schematic structural view of a computer device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
The following describes a semantic relationship recognition method, a semantic relationship recognition device, a semantic relationship recognition computer device and a semantic relationship recognition computer storage medium according to an embodiment of the present invention with reference to the accompanying drawings.
FIG. 1 is a flow chart of a semantic relationship identification method according to one embodiment of the present invention. It should be noted that, the semantic relationship recognition method according to the embodiment of the present invention may be applied to the semantic relationship recognition apparatus according to the embodiment of the present invention, where the semantic relationship recognition apparatus may be configured on a computer device. For example, the computer device may be a server device having natural language processing capabilities.
As shown in fig. 1, the semantic relationship identification method may include:
s110, acquiring basic semantic unit sentence pairs to be recognized.
For example, when semantic relation recognition is required for a sentence in a certain article, each basic semantic unit sentence pair in the article may be obtained, for example, a symbol of a period may be used as an identifier, and text between two periods may be used as a basic semantic unit sentence pair, so that all basic semantic unit sentence pairs in the article may be obtained, and thus the basic semantic unit sentence pairs may be used as basic semantic unit sentence pairs to be recognized, so as to perform semantic relation recognition on the basic semantic unit sentence pairs.
As another example, assuming that the semantic relationship recognition method of the embodiment of the present invention is applied to a search engine, the search engine may provide an input interface for a user, through which the user may input text, which may be understood to have a semantic relationship. When the user confirmation input is monitored, the text input by the user can be obtained and used as a basic semantic unit sentence pair to be recognized so as to recognize the semantic relation of the basic semantic unit sentence pair, so that the search engine can conveniently and accurately know the intention of the user according to the recognized semantic relation, and more accurate search results are provided for the user.
In this embodiment of the present invention, the basic semantic unit sentence pair may be understood as a unit sentence pair indicating a semantic relationship, where the basic semantic unit sentence pair includes a first sentence and a second sentence, and the sentence pair formed by the first sentence and the second sentence can indicate a semantic relationship, for example, "although the producers spell resistant, the price is eventually reduced" is a basic semantic unit sentence pair, where the first sentence and the second sentence in the sentence pair may be distinguished according to commas, such as text before the commas (i.e., "although the producers spell resistant") is the first sentence, and text after the commas (i.e., "the price is eventually reduced") is the second sentence.
S120, taking the basic semantic unit sentence pairs to be recognized as the input of a semantic relation recognition model, and obtaining the semantic relation of the basic semantic unit sentence pairs to be recognized.
It should be noted that, in the embodiment of the present invention, the semantic relationship recognition model is a semantic relationship recognition model obtained by training in advance. In the embodiment of the invention, the semantic relation recognition model can be a model obtained by simultaneously learning the related word recognition task and the semantic relation recognition task in a joint learning manner so as to be trained in advance. The implementation of training the semantic relationship identification model can be seen from the description of the subsequent embodiments.
That is, the semantic relation recognition model can be trained in advance, when the semantic relation recognition is required to be performed on the text, the basic semantic unit sentence pair to be recognized can be obtained, and the semantic relation recognition is performed on the basic semantic unit sentence pair to be recognized by utilizing the semantic relation recognition model trained in advance, so that the semantic relation of the basic semantic unit sentence pair can be obtained.
According to the semantic relation recognition method, the basic semantic unit sentence pair to be recognized can be obtained, and the basic semantic unit sentence pair to be recognized is used as the input of the pre-trained semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pair to be recognized. The related word recognition task and the semantic relation recognition task are simultaneously learned through a joint learning mode to train a semantic relation recognition model in advance, so that the semantic relation recognition model can process an explicit semantic relation recognition task and an implicit semantic relation recognition task simultaneously, and meanwhile, the semantic relation recognition effect can be guaranteed.
FIG. 2 is a flow chart of a semantic relationship identification method according to one specific embodiment of the present invention.
As shown in fig. 2, the semantic relationship identification method may include:
s210, constructing a semantic relation recognition model.
The semantic relationship recognition model in this embodiment may include a generator, a classifier, and a arbiter. In the embodiment of the invention, the generator is used for generating corresponding first semantic relation features according to the input first basic semantic unit sentence pairs; the classifier is used for carrying out semantic relation recognition according to the first semantic relation features generated by the generator to obtain a corresponding semantic relation recognition result; the discriminator is used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model.
In one embodiment of the invention, the generator may be specifically configured to: the method comprises the steps of performing word segmentation processing on input first basic semantic unit sentence pairs to obtain a plurality of word segments, performing vector conversion on the plurality of word segments to correspondingly obtain a plurality of word segment vectors, classifying the plurality of word segments according to the plurality of word segment vectors to obtain associated word class word vectors of the plurality of word segments, and generating corresponding first semantic relation features according to the plurality of word segment vectors and the associated word class word vectors of the plurality of word segments.
As an example, the specific implementation procedure of the generator to generate the corresponding first semantic relationship feature according to the plurality of word segmentation vectors and the associated word class word vectors of the plurality of words may be as follows: combining the related word category word vectors of the plurality of segmented words, randomly sampling through normal distribution to generate a related word vector, splicing the plurality of segmented word vectors, the related word category word vectors of the plurality of segmented words and the related word vector, and determining the mutual influence relation among words in the vectors obtained after splicing through an attention mechanism to obtain a first semantic relation feature.
Wherein, in the embodiment of the invention, the first basic semantic unit sentence pair is understood as a unit sentence pair indicating a semantic relationship, the basic semantic unit sentence pair includes a first sentence and a second sentence, the sentence pair composed of the first sentence and the second sentence can indicate a semantic relationship, for example, "though the producers spell resistant, the price is eventually reduced" is a basic semantic unit sentence pair, wherein, the first sentence and the second sentence in the sentence pair can be distinguished according to commas, such as text before the commas (i.e., "though the producers spell resistant") is the first sentence, and text after the commas (i.e., "the price is eventually reduced") is the second sentence.
For example, fig. 3 is a schematic diagram of the architecture of the semantic relationship recognition model according to the embodiment of the present invention, and as shown in fig. 3, arg1 and arg2 are input parts of the model, and are a basic semantic unit sentence pair. The generator performs word segmentation on sentences respectively, performs vector transformation on a plurality of word segments respectively to obtain corresponding word segmentation vectors, classifies the plurality of word segments according to the plurality of word segmentation vectors to obtain associated word class word vectors of the plurality of word segments, and generates corresponding first semantic relation features according to the plurality of word segmentation vectors and the associated word class word vectors of the plurality of word segments. Fig. 4 is a schematic diagram of a network architecture of a generator according to an embodiment of the present invention, where the generator includes: two word vector layers (i.e., unbedding 1 and unbedding 2), two bi-directional recurrent neural network (i.e., bilstm1 and bilstm 2) layers, an associative word classification layer (i.e., connectivessifier), an associative word generation layer (i.e., connectivegenerator), two coding layers (i.e., encodblock 1 and encodblock 2), an interaction layer (i.e., interaction block), and a Pair representation layer (i.e., pair presentation). The word vector layer respectively carries out vector conversion on the word segmentation in the sentences arg1 and arg2 in the sentence pair to obtain corresponding word vectors. The bidirectional cyclic neural network layer encodes each word vector input by the word vector layer and then transmits the encoded word vector to the associated word classification layer. The related word classification layer is used for judging whether each word in the input arg1/arg2 is a related word or not. Wherein the related words are mainly divided into two types, and one type is that adjacent related words are represented by groups, such as 'concrete'; the other is non-adjacent related words, expressed by intra, such as "… on the one hand and …" on the other hand. The classifier class is 8 classes S-group representing single word as related word, B-group representing first word of non-single word in group type, I-group representing intermediate word of non-single word in group type, E-group representing last word of non-single word in group type, B-intra representing first word of intra-type related word, I-intra representing intermediate word of intra-type related word, E-intra representing last word of intra-type related word, O representing non-related word. The class output by the related word classifier is transmitted to the related word generation layer and the encoderblock1/encoderblock2 by using a class word vector.
The related word generating layer (namely the connectivegenerator) combines the two input parts given by the related word classifying layer, and generates a related word vector through normal distribution random sampling. The purpose of the associated word vector is to represent its associated word features for an implicit associated word recognition task, which enhances model robustness by data perturbation for an explicit associated word recognition task. The related word generation layer outputs the generated related word vector to the encoderblock1/encoderblock2. That is, two parts of input given by the related word classifying layer are combined respectively, a related word vector is generated from the vectors of the parts through normal distribution random sampling, and the related word vector is output to the encoderblock1 layer and the encoderblock2 layer respectively.
The input of the encodblock 1 layer in the encoding layer is derived from the output of the bilstm1 layer and the combination of the related word generation word vector and the related word category word vector, and the input of the encodblock 2 layer is derived from the output of the bilstm layer and the combination of the related word generation word vector and the combination of the related word category word vector. The coding layers respectively code the spliced vectors. The interaction layer is a vector layer obtained by interaction of the encoderblock1 layer and the encoderblock2 layer through an attention mechanism. The Pair representation layer is a vector layer obtained by comprehensively considering a plurality of interaction layers, the representation layer outputs semantic relation features corresponding to the input basic unit sentence pairs, and finally the vector layer is output to a classifier and a discriminator.
The classifier can recognize the semantic relation according to the semantic relation features output by the generator to obtain a corresponding semantic relation recognition result. The discriminator can be used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model.
S220, carrying out consistency training on the semantic relation recognition model to obtain a trained semantic relation recognition model, and using the trained semantic relation recognition model as a new semantic relation recognition model.
In one embodiment of the invention, the semantic relationship identification model further comprises: a calibrator; the calibrator is used for generating corresponding second semantic relation features according to the input second basic semantic unit sentence pairs; the second basic semantic unit sentence pair includes an explicit association word. In the embodiment of the present invention, the implementation process of performing consistency training on the semantic relationship recognition model to obtain the trained semantic relationship recognition model may be as follows: calculating the similarity of the first semantic relation feature and the second semantic relation feature; when the similarity is smaller than a preset threshold, adjusting parameters of the generator according to parameters of the calibrator until the similarity is larger than or equal to the preset threshold; and saving the adjustment result of the parameters of the generator to obtain the trained semantic relation recognition model.
It should be noted that, in the embodiment of the present invention, the calibrator may be understood as a model for guiding the generator to learn. Wherein the flow of the internal components of the calibrator is similar to the flow of the internal components of the generator. For example, as shown in fig. 5, the calibrator may include: two word vector layers (i.e., ebedding 1 and ebedding 2), two bi-directional recurrent neural network (i.e., bilstm1 and bilstm 2) layers, an associative word classification layer (i.e., connectivesifier), two coding layers (i.e., encodblock 1 and encodblock 2), an interaction layer (i.e., interaction block) and a Pair representation layer (i.e., pair presentation). The functions of each network layer included in the calibrator are consistent with the functions of each network layer included in the generator, and reference may be made to the foregoing description of the functions of each network layer included in the generator, which is not repeated herein. The difference is that the calibrator has no related word generation layer, because the basic semantic unit sentence pairs used by the calibrator contain the displayed related words, namely the material has obvious related words, and the corresponding related word vectors can be obtained by classifying the related words through the related word classification layer. In this way, when training the semantic relation recognition model, materials with implicit related words can be input into the generator to obtain corresponding semantic relation features, and materials with explicit related words are input into the calibrator to obtain corresponding semantic relation features. And then, calculating the similarity between the semantic relation features generated by the generator and the semantic relation features output by the calibrator, adjusting the parameters of the generator according to the parameters of the calibrator when the similarity is smaller than a preset threshold value until the similarity is larger than or equal to the preset threshold value, and finally, storing the adjustment result of the parameters of the generator, thereby obtaining the trained semantic relation recognition model. The calibrator is a model that has been trained, so that the parameters of the generator can be adjusted by using the parameters of the calibrator as a standard.
S230, acquiring basic semantic unit sentence pairs to be recognized.
S240, taking the basic semantic unit sentence pairs to be recognized as the input of a semantic relation recognition model, and obtaining the semantic relation of the basic semantic unit sentence pairs to be recognized.
The semantic relation recognition method can construct a semantic relation recognition model, wherein the semantic relation recognition model comprises a generator, a classifier and a discriminator, and the generator is used for generating corresponding first semantic relation features according to input first basic semantic unit sentence pairs; the classifier is used for carrying out semantic relation recognition according to the first semantic relation features generated by the generator to obtain a corresponding semantic relation recognition result; the discriminator is used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model; and then, consistency training is carried out on the semantic relation recognition model, and a trained semantic relation recognition model is obtained. The method has the advantages that the related word recognition task and the semantic relation recognition task are simultaneously learned in a joint learning mode to train a semantic relation recognition model in advance, error transfer of independent learning of the two tasks is reduced, the semantic relation recognition model can generate related word vectors for the implicit relation recognition task in a countermeasure generation mode, the explicit semantic relation recognition task and the implicit semantic relation recognition task can be processed simultaneously, and meanwhile the semantic relation recognition effect can be guaranteed.
Corresponding to the information promotion methods provided by the above embodiments, an embodiment of the present invention further provides an information promotion device, and since the information promotion device provided by the embodiment of the present invention corresponds to the information promotion method provided by the above embodiments, implementation of the foregoing information promotion method is also applicable to the information promotion device provided by the embodiment, and will not be described in detail in the embodiment. Fig. 6 is a schematic structural view of a semantic relationship identifying apparatus according to one embodiment of the present invention. As shown in fig. 6, the semantic relationship identifying apparatus 600 may include: a sentence acquisition module 610 and a recognition model 620.
Specifically, the sentence acquisition module 610 is configured to acquire a basic semantic unit sentence pair to be identified.
The recognition model 620 is used for taking the basic semantic unit sentence pairs to be recognized as the input of the semantic relation recognition model, and obtaining the semantic relation of the basic semantic unit sentence pairs to be recognized.
It should be noted that, in an embodiment of the present invention, the semantic relationship identification model may include: a generator, a classifier and a discriminator; the generator is used for generating corresponding first semantic relation features according to the input first basic semantic unit sentence pairs; the classifier is used for carrying out semantic relation recognition according to the first semantic relation features generated by the generator to obtain a corresponding semantic relation recognition result; the discriminator is used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model.
In an embodiment of the invention, the generator is specifically configured to: word segmentation processing is respectively carried out on the input first basic semantic unit sentence pairs to obtain a plurality of segmented words; vector conversion is carried out on the plurality of word segmentation, and a plurality of word segmentation vectors are correspondingly obtained; performing associated word classification on the plurality of segmented words according to the plurality of segmented word vectors to obtain associated word category word vectors of the plurality of segmented words; and generating corresponding first semantic relation features according to the word segmentation vectors and the associated word category word vectors of the word segmentation vectors.
As an example, the generator is specifically configured to: combining the related word category word vectors of the plurality of segmented words, and generating a related word vector through normal distribution random sampling; splicing the word segmentation vectors, the associated word category word vectors of the word segmentation vectors and the associated word vectors; and determining the mutual influence relation among words in the vectors obtained after splicing through an attention mechanism, and obtaining the first semantic relation features.
Optionally, in an embodiment of the present invention, as shown in fig. 7, the semantic relationship identifying apparatus 600 may further include: model training module 630. The model training module 630 is configured to perform consistency training on the semantic relationship recognition model, obtain a trained semantic relationship recognition model, and use the trained semantic relationship recognition model as a new semantic relationship recognition model.
Optionally, in one embodiment of the present invention, the semantic relationship identification model further includes: a calibrator; the calibrator is used for generating corresponding second semantic relation features according to the input second basic semantic unit sentence pairs; the second basic semantic unit sentence pair contains an explicit association word. Wherein, in the embodiment of the present invention, the model training module 630 is specifically configured to: calculating the similarity of the first semantic relation feature and the second semantic relation feature; when the similarity is smaller than a preset threshold, adjusting parameters of the generator according to parameters of the calibrator until the similarity is larger than or equal to the preset threshold; and saving the adjustment result of the parameters of the generator to obtain the trained semantic relation recognition model.
According to the semantic relation recognition device provided by the embodiment of the invention, the basic semantic unit sentence pair to be recognized can be obtained through the sentence obtaining module, the recognition model takes the basic semantic unit sentence pair to be recognized as the input of the pre-trained semantic relation recognition model, and the semantic relation of the basic semantic unit sentence pair to be recognized is obtained. The related word recognition task and the semantic relation recognition task are simultaneously learned through a joint learning mode to train a semantic relation recognition model in advance, so that the semantic relation recognition model can process an explicit semantic relation recognition task and an implicit semantic relation recognition task simultaneously, and meanwhile, the semantic relation recognition effect can be guaranteed.
In order to implement the above embodiment, the present invention also proposes a computer device.
Fig. 8 is a schematic structural view of a computer device according to an embodiment of the present invention. As shown in fig. 8, the computer device 800 may include: memory 810, processor 820, and computer program 830 stored on memory 810 and executable on processor 820, processor 820 implements the semantic relationship recognition method described in any one of the embodiments of the present invention when executing computer program 830.
In order to achieve the above embodiments, the present invention further proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the semantic relationship recognition method according to any of the above embodiments of the present invention.
In the description of the present invention, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.

Claims (10)

1. A semantic relationship identification method, comprising:
acquiring basic semantic unit sentence pairs to be identified;
the basic semantic unit sentence pairs to be recognized are used as the input of a semantic relation recognition model, so that the semantic relation of the basic semantic unit sentence pairs to be recognized is obtained;
the semantic relation recognition model comprises a generator, a classifier and a discriminator, wherein the generator comprises two word vector layers, two bidirectional cyclic neural network layers, an associated word classification layer, an associated word generation layer, two coding layers, an interaction layer and a representation layer; wherein,,
the generator is used for generating corresponding first semantic relation features according to the input first basic semantic unit sentence pairs;
the classifier is used for carrying out semantic relation recognition according to the first semantic relation features generated by the generator to obtain a corresponding semantic relation recognition result;
the discriminator is used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model;
the generator is specifically configured to:
word segmentation processing is respectively carried out on the input first basic semantic unit sentence pairs to obtain a plurality of segmented words;
vector conversion is carried out on the plurality of word segmentation, and a plurality of word segmentation vectors are correspondingly obtained;
performing associated word classification on the plurality of segmented words according to the plurality of segmented word vectors to obtain associated word category word vectors of the plurality of segmented words;
and generating corresponding first semantic relation features according to the word segmentation vectors and the associated word category word vectors of the word segmentation vectors.
2. The semantic relationship identification method of claim 1, wherein the method further comprises:
and carrying out consistency training on the semantic relation recognition model to obtain a trained semantic relation recognition model, and using the trained semantic relation recognition model as a new semantic relation recognition model.
3. The semantic relationship identification method of claim 1, wherein generating corresponding first semantic relationship features from the plurality of word segmentation vectors and associated word class word vectors of the plurality of word segmentation comprises:
combining the related word category word vectors of the plurality of segmented words, and generating a related word vector through normal distribution random sampling;
splicing the word segmentation vectors, the associated word category word vectors of the word segmentation vectors and the associated word vectors;
and determining the mutual influence relation among words in the vectors obtained after splicing through an attention mechanism, and obtaining the first semantic relation features.
4. A semantic relationship recognition method according to any one of claims 2 to 3, wherein the semantic relationship recognition model further comprises: a calibrator; the calibrator is used for generating corresponding second semantic relation features according to the input second basic semantic unit sentence pairs; the second basic semantic unit sentence pair comprises an explicit related word;
performing consistency training on the semantic relation recognition model to obtain a trained semantic relation recognition model, wherein the method comprises the following steps:
calculating the similarity of the first semantic relation feature and the second semantic relation feature;
when the similarity is smaller than a preset threshold, adjusting parameters of the generator according to parameters of the calibrator until the similarity is larger than or equal to the preset threshold;
and saving the adjustment result of the parameters of the generator to obtain the trained semantic relation recognition model.
5. A semantic relationship identification apparatus, comprising:
the sentence acquisition module is used for acquiring basic semantic unit sentence pairs to be identified;
the recognition model is used for taking the basic semantic unit sentence pair to be recognized as the input of the semantic relation recognition model to obtain the semantic relation of the basic semantic unit sentence pair to be recognized;
the semantic relation recognition model comprises a generator, a classifier and a discriminator, wherein the generator comprises two word vector layers, two bidirectional cyclic neural network layers, an associated word classification layer, an associated word generation layer, two coding layers, an interaction layer and a representation layer; wherein,,
the generator is used for generating corresponding first semantic relation features according to the input first basic semantic unit sentence pairs;
the classifier is used for carrying out semantic relation recognition according to the first semantic relation features generated by the generator to obtain a corresponding semantic relation recognition result;
the discriminator is used for discriminating the authenticity of the semantic relation recognition result output by the classifier in the training stage of the semantic relation recognition model;
the generator is specifically configured to:
word segmentation processing is respectively carried out on the input first basic semantic unit sentence pairs to obtain a plurality of segmented words;
vector conversion is carried out on the plurality of word segmentation, and a plurality of word segmentation vectors are correspondingly obtained;
performing associated word classification on the plurality of segmented words according to the plurality of segmented word vectors to obtain associated word category word vectors of the plurality of segmented words;
and generating corresponding first semantic relation features according to the word segmentation vectors and the associated word category word vectors of the word segmentation vectors.
6. The semantic relationship identification apparatus of claim 5, wherein the apparatus further comprises:
the model training module is used for carrying out consistency training on the semantic relation recognition model to obtain a trained semantic relation recognition model, and using the trained semantic relation recognition model as a new semantic relation recognition model.
7. The semantic relationship identification apparatus of claim 5, wherein the generator is specifically configured to:
combining the related word category word vectors of the plurality of segmented words, and generating a related word vector through normal distribution random sampling;
splicing the word segmentation vectors, the associated word category word vectors of the word segmentation vectors and the associated word vectors;
and determining the mutual influence relation among words in the vectors obtained after splicing through an attention mechanism, and obtaining the first semantic relation features.
8. The semantic relationship identification apparatus according to any one of claims 6 to 7, wherein the semantic relationship identification model further comprises: a calibrator;
the calibrator is used for generating corresponding second semantic relation features according to the input second basic semantic unit sentence pairs; the second basic semantic unit sentence pair comprises an explicit related word;
the model training module is specifically configured to:
calculating the similarity of the first semantic relation feature and the second semantic relation feature;
when the similarity is smaller than a preset threshold, adjusting parameters of the generator according to parameters of the calibrator until the similarity is larger than or equal to the preset threshold;
and saving the adjustment result of the parameters of the generator to obtain a trained semantic relation recognition model.
9. A computer device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the semantic relationship identification method according to any one of claims 1 to 4 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the semantic relationship identification method according to any one of claims 1 to 4.
CN201811624158.0A 2018-12-28 2018-12-28 Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium Active CN109598000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811624158.0A CN109598000B (en) 2018-12-28 2018-12-28 Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811624158.0A CN109598000B (en) 2018-12-28 2018-12-28 Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109598000A CN109598000A (en) 2019-04-09
CN109598000B true CN109598000B (en) 2023-06-16

Family

ID=65962817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811624158.0A Active CN109598000B (en) 2018-12-28 2018-12-28 Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109598000B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188202B (en) * 2019-06-06 2021-07-20 北京百度网讯科技有限公司 Training method and device of semantic relation recognition model and terminal
CN111709244B (en) * 2019-11-20 2023-09-26 中共南通市委政法委员会 Deep learning method for identifying cause and effect relationship of contradictory dispute
CN111428525B (en) * 2020-06-15 2020-09-15 华东交通大学 Implicit discourse relation identification method and system and readable storage medium
CN111897929B (en) * 2020-08-04 2021-05-14 腾讯科技(深圳)有限公司 Method and device for processing multiple rounds of questions, storage medium and electronic equipment
CN113392648B (en) * 2021-06-02 2022-10-18 北京三快在线科技有限公司 Entity relationship acquisition method and device
CN113255371B (en) * 2021-07-14 2021-09-24 华东交通大学 Semi-supervised Chinese-English implicit discourse relation recognition method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916294A (en) * 2010-08-27 2010-12-15 黄斌 Method for realizing exact search by utilizing semantic analysis
CN102087669A (en) * 2011-03-11 2011-06-08 北京汇智卓成科技有限公司 Intelligent search engine system based on semantic association
CN102945230A (en) * 2012-10-17 2013-02-27 刘运通 Natural language knowledge acquisition method based on semantic matching driving
CN106777050A (en) * 2016-12-09 2017-05-31 大连海事大学 It is a kind of based on bag of words and to take into account the footwear stamp line expression and system of semantic dependency
CN107315737A (en) * 2017-07-04 2017-11-03 北京奇艺世纪科技有限公司 A kind of semantic logic processing method and system
CN107526967A (en) * 2017-07-05 2017-12-29 阿里巴巴集团控股有限公司 A kind of risk Address Recognition method, apparatus and electronic equipment
CN108009182A (en) * 2016-10-28 2018-05-08 京东方科技集团股份有限公司 A kind of information extracting method and device
CN109033073A (en) * 2018-06-28 2018-12-18 中国科学院自动化研究所 Text contains recognition methods and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462066B (en) * 2014-12-24 2017-10-03 北京百度网讯科技有限公司 Semantic character labeling method and device
CN107562752B (en) * 2016-06-30 2021-05-28 富士通株式会社 Method and device for classifying semantic relation of entity words and electronic equipment
CN107273358B (en) * 2017-06-18 2020-06-05 北京理工大学 End-to-end English chapter structure automatic analysis method based on pipeline mode
CN107491534B (en) * 2017-08-22 2020-11-20 北京百度网讯科技有限公司 Information processing method and device
CN107832290B (en) * 2017-10-19 2020-02-28 中国科学院自动化研究所 Method and device for identifying Chinese semantic relation
CN107943784B (en) * 2017-11-02 2020-12-29 南华大学 Relationship extraction method based on generation of countermeasure network
CN108520298A (en) * 2018-04-09 2018-09-11 中国民航大学 A kind of land sky call semantic consistency method of calibration based on improvement LSTM-RNN
CN108875000B (en) * 2018-06-14 2021-12-28 广东工业大学 Semantic relation classification method fusing multi-syntax structure
CN109086269B (en) * 2018-07-19 2020-08-21 大连理工大学 Semantic bilingual recognition method based on semantic resource word representation and collocation relationship

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916294A (en) * 2010-08-27 2010-12-15 黄斌 Method for realizing exact search by utilizing semantic analysis
CN102087669A (en) * 2011-03-11 2011-06-08 北京汇智卓成科技有限公司 Intelligent search engine system based on semantic association
CN102945230A (en) * 2012-10-17 2013-02-27 刘运通 Natural language knowledge acquisition method based on semantic matching driving
CN108009182A (en) * 2016-10-28 2018-05-08 京东方科技集团股份有限公司 A kind of information extracting method and device
CN106777050A (en) * 2016-12-09 2017-05-31 大连海事大学 It is a kind of based on bag of words and to take into account the footwear stamp line expression and system of semantic dependency
CN107315737A (en) * 2017-07-04 2017-11-03 北京奇艺世纪科技有限公司 A kind of semantic logic processing method and system
CN107526967A (en) * 2017-07-05 2017-12-29 阿里巴巴集团控股有限公司 A kind of risk Address Recognition method, apparatus and electronic equipment
CN109033073A (en) * 2018-06-28 2018-12-18 中国科学院自动化研究所 Text contains recognition methods and device

Also Published As

Publication number Publication date
CN109598000A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
CN109598000B (en) Semantic relation recognition method, semantic relation recognition device, computer equipment and storage medium
CN110188202B (en) Training method and device of semantic relation recognition model and terminal
KR20190013011A (en) Apparatus and method for generating training data used to training student model from teacher model
CN111263238B (en) Method and equipment for generating video comments based on artificial intelligence
CN111738016A (en) Multi-intention recognition method and related equipment
WO2023115761A1 (en) Event detection method and apparatus based on temporal knowledge graph
US20220230061A1 (en) Modality adaptive information retrieval
CN117079299B (en) Data processing method, device, electronic equipment and storage medium
CN113656561A (en) Entity word recognition method, apparatus, device, storage medium and program product
Zhang et al. Disengagement cause-and-effect relationships extraction using an nlp pipeline
CN117312562A (en) Training method, device, equipment and storage medium of content auditing model
CN113515593A (en) Topic detection method and device based on clustering model and computer equipment
CN115081452B (en) Method for extracting entity relationship
CN115964484A (en) Legal multi-intention identification method and device based on multi-label classification model
CN115273856A (en) Voice recognition method and device, electronic equipment and storage medium
US11475529B2 (en) Systems and methods for identifying and linking events in structured proceedings
CN114626463A (en) Language model training method, text matching method and related device
CN114610887A (en) Seat illegal speech recognition method and device, electronic equipment and storage medium
CN114446434A (en) Report generation method, system and terminal equipment
CN116955628B (en) Complaint event classification method, complaint event classification device, computer equipment and storage medium
CN115658964B (en) Training method and device for pre-training model and somatosensory wind identification model
CN117611845B (en) Multi-mode data association identification method, device, equipment and storage medium
Chen et al. Reason induced visual attention for explainable autonomous driving
Rekanar et al. Subjective Scoring Framework for VQA Models in Autonomous Driving
CN114281938A (en) Relationship extraction method, device, 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