CN110276066B - Entity association relation analysis method and related device - Google Patents

Entity association relation analysis method and related device Download PDF

Info

Publication number
CN110276066B
CN110276066B CN201810217272.5A CN201810217272A CN110276066B CN 110276066 B CN110276066 B CN 110276066B CN 201810217272 A CN201810217272 A CN 201810217272A CN 110276066 B CN110276066 B CN 110276066B
Authority
CN
China
Prior art keywords
vector
text
predicted
word
speech sequence
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
CN201810217272.5A
Other languages
Chinese (zh)
Other versions
CN110276066A (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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201810217272.5A priority Critical patent/CN110276066B/en
Priority to PCT/CN2019/073664 priority patent/WO2019174422A1/en
Publication of CN110276066A publication Critical patent/CN110276066A/en
Application granted granted Critical
Publication of CN110276066B publication Critical patent/CN110276066B/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/20Natural language analysis
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an entity incidence relation analysis method and a related device, wherein in the entity incidence relation analysis method, after a part of speech sequence of a text to be predicted is obtained by performing word segmentation processing on the text to be predicted, a vector of each word segmentation in the part of speech sequence of the text to be predicted is obtained, and a prediction model of entity incidence relation predicts the vector of each word segmentation in the part of speech sequence of the text to be predicted, so that a prediction result of the incidence relation between an entity and a corresponding attribute in the text to be predicted can be obtained. In the process, the text to be predicted is subjected to word segmentation processing to obtain a part-of-speech sequence, and a vector of each word segmentation in the part-of-speech sequence is obtained, and the manual word selection and the word feature extraction are not performed, so that the problem of accuracy of a test result of the incidence relation between the entity and the attribute, which is influenced by the manual word selection and the provision of the word feature, is solved.

Description

Entity association relation analysis method and related device
Technical Field
The present invention relates to the field of text analysis technologies, and in particular, to an entity association relationship analysis method and a related apparatus.
Background
The text emotion analysis is mainly used for reflecting the emotional tendency of a user about certain events, characters, enterprises, products and the like in social media. Entity sentiment analysis refers to analyzing sentiment tendencies of certain entities in a text, but not tendencies of the whole text, and has the advantage of enabling the analysis granularity of sentiment objects to be clearer. In entity emotion analysis, it is more important to know the association relationship between entities and attributes in a text, that is, to determine the entities (such as bmw, gallow, audi, etc.) associated with each attribute (such as trim, engine, etc.) in the text.
The existing scheme generally mainly relies on manual feature extraction to perform a traditional machine learning classification algorithm. Specifically, words between the entities and the attributes in the text are manually selected, the characteristics of the words are extracted and input into the classifier, and the classifier analyzes the association relationship to obtain a test result of the association relationship between the entities and the attributes in the text.
The words are manually selected and the characteristics of the words are extracted, so that the characteristic extraction process has strong subjectivity, and the accuracy of the test result of the incidence relation between the entities and the attributes in the text can be influenced.
Disclosure of Invention
In view of the above problems, the present invention is proposed to provide an analysis method and related apparatus for entity association relationship, which overcome the above problems or at least partially solve the above problems.
An entity incidence relation analysis method comprises the following steps:
acquiring a text to be predicted;
performing word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between the entity and the corresponding attribute in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm until a prediction result obtained by predicting the feature vector of the training text by using the neural network algorithm after updating the parameters is equal to an artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
Optionally, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word segmentation in the part of speech sequence of the text to be predicted;
or, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word in the part of speech sequence of the text to be predicted and a part of speech vector and/or a word packet vector of each word in the part of speech sequence of the text to be predicted; and combining the word vector of each word in the part of speech sequence of the text to be predicted and the part of speech vector and/or the word packet vector of each word in the part of speech sequence of the text to be predicted to obtain the vector of each word in the part of speech sequence of the text to be predicted.
Optionally, the predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using the prediction model of the entity association relationship to obtain a prediction result of the association relationship between the target entity and the corresponding attribute in the text to be predicted includes:
performing network representation of sequence relation on the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
carrying out weighted average processing on the second matrix according to the weight corresponding to the numerical value of each position in the second matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and the probability value of the association relationship between the target entity and the corresponding attribute in the text to be predicted under the preset category.
Optionally, the building process of the prediction model of the entity association relationship includes:
performing word segmentation processing on a training text to obtain a part-of-speech sequence of the training text;
obtaining a vector of each word segmentation in the part of speech sequence of the training text;
performing network representation of the sequence relation on the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
carrying out weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
performing cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
optimizing the loss function, and updating a first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function.
An apparatus for analyzing entity association relationship, comprising:
the device comprises an acquisition unit, a prediction unit and a prediction unit, wherein the acquisition unit is used for acquiring a text to be predicted;
the word segmentation unit is used for carrying out word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
the generating unit is used for obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
the prediction unit is used for predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between a target entity and corresponding attributes in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm, so that the neural network algorithm after updating the parameters is used for predicting the feature vectors of the training text, and the predicted result is equal to the artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
Optionally, the generating unit includes:
the first obtaining unit is used for obtaining a word vector of each participle in the part of speech sequence of the text to be predicted;
alternatively, it comprises: a second obtaining unit, configured to obtain a word vector of each participle in the part-of-speech sequence of the text to be predicted, and a part-of-speech vector and/or a word-packet vector of each participle in the part-of-speech sequence of the text to be predicted; and combining the word vector of each word in the part-of-speech sequence of the text to be predicted and the part-of-speech vector and/or the word packet vector of each word in the part-of-speech sequence of the text to be predicted to obtain the vector of each word in the part-of-speech sequence of the text to be predicted.
Optionally, the prediction unit includes:
a third obtaining unit, configured to perform network characterization on the sequence relationship of the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
a fourth obtaining unit, configured to perform weighted average processing on the second matrix according to a weight corresponding to a numerical value of each position in the second matrix, so as to obtain a feature vector;
the prediction subunit is used for processing the feature vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and the probability value of the association relationship between the target entity and the corresponding attribute in the training text under the preset category.
Optionally, the word segmentation unit is further configured to perform word segmentation processing on a training text to obtain a part-of-speech sequence of the training text;
the generating unit is further used for obtaining a vector of each participle in the part of speech sequence of the training text;
the third obtaining unit is further configured to perform network characterization on the sequence relationship of the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
the fourth obtaining unit is further configured to perform weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector;
the prediction subunit is further configured to process the feature vector by using a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
further comprising: the comparison unit is used for carrying out cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
an optimization unit for optimizing the loss function;
the updating unit is used for updating the first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
the construction unit is used for taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function.
A storage medium comprising a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the entity association relationship analysis method according to any one of the above.
A processor for running a program, wherein the program when running performs the method of analyzing entity associations as described in any one of the above.
By means of the technical scheme, in the method and the related device for analyzing the entity association relationship, after the word segmentation processing is carried out on the text to be predicted to obtain the part-of-speech sequence of the text to be predicted, the vector of each word segmentation in the part-of-speech sequence of the text to be predicted is obtained, the vector of each word segmentation in the part-of-speech sequence of the text to be predicted is predicted by the prediction model of the entity association relationship, and the prediction result of the association relationship between the entity and the corresponding attribute in the text to be predicted can be obtained. In the process, the text to be predicted is subjected to word segmentation processing to obtain a part-of-speech sequence, and a vector of each word segmentation in the part-of-speech sequence is obtained, and the manual word selection and the word feature extraction are not performed, so that the problem of accuracy of a test result of the incidence relation between the entity and the attribute, which is influenced by the manual word selection and the provision of the word feature, is solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart illustrating a process for constructing a predictive model of entity associations as disclosed in an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a specific implementation manner of step S102 disclosed in the embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for analyzing entity association relationship disclosed in an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a specific implementation manner of step S303 disclosed in the embodiment of the present invention;
FIG. 5 is a flowchart illustrating a specific implementation manner of step S304 disclosed in the embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an apparatus for analyzing entity association relationship disclosed in the embodiments of the present invention;
FIG. 7 is a schematic structural diagram of a generating unit disclosed in the embodiment of the invention;
fig. 8 shows a schematic structural diagram of a prediction unit disclosed in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the embodiment of the application, the text to be predicted needs to be predicted by adopting a prediction model of entity association relation. Therefore, before the method for analyzing the entity association relationship disclosed in the embodiment of the present application is performed, a prediction model of the entity association relationship needs to be constructed.
Referring to fig. 1, the process of constructing the prediction model of the entity association relationship includes:
s101, performing word segmentation processing on the training text to obtain a part-of-speech sequence of the training text.
Wherein a training document is prepared, the training document comprising at least one training text. The training text is the evaluation sentence of the user about certain events, people, enterprises, products and the like.
For each training text in the training document, performing word segmentation by using open source tool software, such as LTP (Language Technology Platform ), and acquiring a part-of-speech sequence of a corresponding word segmentation, wherein the part-of-speech sequence includes a word segmentation sequence, a part-of-speech result, and a dependency relationship sequence. The word segmentation sequence comprises each word segmentation obtained by segmenting the training text; the part-of-speech result includes parts-of-speech of the respective participles. The dependency relationship series is an association relationship among the participles obtained after the training text is participled.
For example: the training text is the Benz's front face Weiwu Baqi, and the word segmentation sequence obtained by performing word segmentation processing on the training text is [ Benz, front face, Weiwu, Baqi ]. H; the part-of-speech result is [ nz, u, nd, n, a, a, wp ]; the part-of-speech result is [ n, n, v, a, n ], and in the obtained part-of-speech result, n represents general noun; v represents verbs, verbs; a represents an adjective; the dependency relationship sequence is [ ATT, RAD, ATT, SBV, HED, COO, WP ], in the obtained dependency relationship sequence, ATT represents attribute, and the relation is centered; RAD represents right add, right add; SBV stands for, HED stands for head, core relation, COO stands for coordinate, parallel relation, WP stands for branching, punctuation.
And S102, obtaining a vector of each word segmentation in the part of speech sequence of the training text.
Each participle in the part-of-speech sequence of the training text needs to be expressed in a characteristic vector mode. Therefore, for each participle in the part-of-speech sequence of the training text, a vector of the participle needs to be obtained. The training text comprises an entity and the attribute of the entity, and the part of speech sequence after the word segmentation processing is carried out on the training text also comprises the word segmentation corresponding to the entity and the word segmentation corresponding to the attribute of the entity.
It should be noted that, for each training text, before obtaining the vector of each participle in the part-of-speech sequence, it needs to determine that the participle length thereof cannot be too large. Therefore, the word segmentation length of each training text in the training document is counted, and whether the training document has an ultralong outlier length text is judged. Specifically, the standard deviation of the mean value of the word segmentation lengths of the training texts is calculated, and the overlength outlier length text is the training text which is beyond a plurality of multiples of the standard deviation of the mean value whether the word segmentation lengths exceed the mean value. The specific multiple requirement can be set according to the actual situation.
If the training document is judged to have no ultralong outlier length text, the length of the word segmentation of the training text with the longest length in the training document is taken as the length of the part of speech sequence of the training document, and then each word segmentation in the part of speech sequence of the training text is obtained. And if the training document is judged to have the overlong outlier length text, taking the length of the word segmentation of the training text with the longest length in the remaining training texts except the overlong outlier length text in the training document as the length of the part of speech sequence of the training document. And intercepting the overlong outlier length text in the training document according to the length of the part of speech sequence of the training document. Specifically, the method and the device extend forwards and backwards respectively by taking a target entity in the training text as a center until the length of the word segmentation reaches the length of the part-of-speech sequence of the training document, and then obtain a vector of each word segmentation in the part-of-speech sequence of the text after the training text is intercepted.
For example: the training documents comprise 10 training texts, the word segmentation length of each training text is different, but the word segmentation length of the longest training text is 50, and then 50 is taken as the length of the part of speech sequence of the training documents. If a training text exists in the training document, and the word segmentation length of the training text is 1000, the training text is an ultralong outlier length text.
Optionally, in an implementation manner of step S102, the step includes:
and obtaining a word vector of each word segmentation in the part of speech sequence of the training text.
And screening each word segmentation in the part-of-speech sequence of the training text in a word vector model respectively to obtain a word vector of the current word segmentation in the word vector model.
And performing word segmentation on each text sentence in the text library by using open source tool software, and performing word vector training by using a word vector model, namely generating the word vector model. The text base comprises an industry corpus and a general corpus, wherein the general corpus refers to the text base which is personalized out of industry. The word vector model has the function of mapping words into a space with a certain latitude and can represent similarity between words. Meanwhile, the word vector model includes low-frequency long-tail words (the low-frequency long-tail words refer to words with a frequency lower than a certain threshold value in all words) appearing in the corpus, and the words are collectively denoted as UNK (unknown keyword), and the UNK has a unique word vector in the word vector model.
And if a word in the part of speech sequence of the training text has no corresponding word vector in the word vector model, using the UNK word vector as the word vector of the word.
Optionally, in another implementation manner of step S102, referring to fig. 2, the step includes:
s1022, obtaining a word vector of each participle in the part of speech sequence of the training text, and a part of speech vector and/or a word packet vector of each participle in the part of speech sequence of the training text.
Each word in the part-of-speech sequence of the training text, with different parts-of-speech, will also result in different prediction results for the association between the entity and the corresponding attribute. Thus, a part-of-speech vector for each participle in the sequence of parts-of-speech of the training text may also be obtained.
Specifically, a random vector with a certain number of dimensions on the part of speech, for example, the number of parts of speech is 5 [ a, b, c, d, e ], then a may be represented by a random vector Va, and similarly, b may be represented by a random vector Vb, and the number of dimensions of Va and Vb may be arbitrarily specified. For each word segmentation in the part-of-speech sequence of the training text, a corresponding part-of-speech vector can be obtained according to the part-of-speech.
Similarly, the word packet to which the participle belongs may also affect the judgment of the prediction result of the association relationship between the entity and the corresponding attribute, and particularly, a word in a part-of-speech sequence of the training text does not find a corresponding word vector in the word vector model, and the participle can be comprehensively reflected by the word packet vector of the participle. Therefore, a word package vector for each participle in the part-of-speech sequence of the training text may also be obtained.
Specifically, the relationship between each word in the part-of-speech sequence of the training text and the word package in the industry field is encoded to obtain a word package vector of each word in the part-of-speech sequence of the training text. For example: and judging whether each participle in the part-of-speech sequence of the training text is in an entity word packet or not and whether each participle is in an evaluation word packet or not. And coding the judgment result to obtain a word packet vector of each word in the part of speech sequence of the training text.
1023. And combining the word vector of each word in the part of speech sequence of the training text and the part of speech vector and/or the word packet vector of each word in the part of speech sequence of the training text to obtain the vector of each word in the part of speech sequence of the training text.
And for each participle in the part-of-speech sequence of the training text, respectively splicing and combining a word vector, the part-of-speech vector and/or a word packet vector to form a vector of the participle.
S103, performing network representation of the sequence relation on the third matrix to obtain a fourth matrix.
And combining the vectors of each word segmentation in the part of speech sequence of the training text to obtain the third matrix. And performing network characterization of a sequence relationship on the third matrix by using a bidirectional Bi-LSTM (Long-Short Term Memory) to obtain the fourth matrix.
S104, carrying out weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector.
Specifically, normalization is performed by combining a neural network algorithm attention mechanism, and different weights are given to each position of the fourth matrix. Specifically, some word segments do not need much attention, the weight is weakened, and some word segments should strengthen attention. And then carrying out weighted average on the numerical value of each position in the fourth matrix to obtain a feature vector.
And S105, processing the characteristic vector by adopting a softmax function to obtain a probability output vector.
The probability output vector is a two-dimensional vector and comprises probability values of two categories, and the probability value of each category is used for expressing the probability that the association relation between the participles of the corresponding entity and the participles of the corresponding attribute belongs to the corresponding category. Specifically, one of the two categories is a pair, which indicates that the participle corresponding to the entity and the participle corresponding to the attribute have an association relationship; one category is unpaired, indicating that the participles of the corresponding entity and the participles of the corresponding attribute do not have an associative relationship.
Before processing the feature vector by using the softmax function, positive samples and negative samples in the part of speech sequence of the training samples are obtained. Specifically, the participles of the corresponding entity in the part-of-speech sequence of the training text and the participles belonging to the entity and corresponding to the attribute are manually input. And combining the participles corresponding to the entities with the participles belonging to the entities and corresponding to the attributes to form a positive sample. And then, carrying out cross combination on the participles of each corresponding entity in the training text and the participles which belong to each entity and have corresponding attributes to obtain a negative sample set, and then selecting partial or all negative samples in the negative sample set.
For example: the training text is: the interior of GS8 looks more sick. Phase-proud quality but no other interior. In the training text, the first entity is GS8, the corresponding attribute is interior, the second entity is Erytherd, and the corresponding attribute is quality. The positive sample resulting from combining the first entity and the corresponding attribute is: GS8, interior trim. The positive sample resulting from combining the second entity and the corresponding attribute is: ohandde, quality. The first entity, the second entity, the attribute corresponding to the first entity and the attribute corresponding to the second entity are combined in a cross mode, and the obtained negative sample set comprises: GS8, quality and euryale, interior trim.
For each sample (including a positive sample and a negative sample), processing the feature vector by using a softmax function, wherein the feature vector corresponds to a probability output vector of each sample respectively, and the probability values of two categories in the probability output vector can respectively indicate the probability values that the association relationship between the entity and the attribute included in each sample is pairing and unpairing.
It should be further noted that, for each participle in the part-of-speech sequence in the training text, special identification symbols are added on two sides of the participle corresponding to the entity and the participle corresponding to the attribute, and the symbols are used as special indexes for indicating the positions of the entity and the attribute. As "< e2> front face < \ e2> wiwu baqi of < e1> speed < \ e1>, the special identification < e1> < \ e1> < e2> < \ e2> identifies the participles of the corresponding entity and the participles of the corresponding attribute.
In the process of processing the feature vector by adopting a softmax function to obtain a probability output vector, the participle of the entity corresponding to each sample in the part of speech sequence in the training text and the participle of the corresponding attribute need to be determined by identifying the added special identifier.
And S106, performing cross entropy operation on the probability output vector and the artificial labeling type of the training text to obtain a loss function.
For each training text in the training document, the incidence relation between the entity and the attribute in the training text is manually identified, and the manual labeling type of the training text is obtained.
And performing cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function, wherein the loss function is used for indicating the difference between the probability output vector and the artificial labeling category of the training text.
And S107, optimizing the loss function, and updating the first parameter according to the optimized loss function until the probability output vector obtained by predicting the training text by using the feature vector obtained by the updated parameter is basically the same as the manual labeling type of the training text.
Wherein the first parameters comprise the Bi-LSTM, an attention mechanism of the neural network algorithm, the softmax function, and a vector for each participle in the sequence of parts of speech of the training text.
Specifically, the loss function can be optimized through a random gradient descent method or an Adam optimization algorithm, so as to obtain an optimized loss function, and updated parameters are obtained by recursion layer by layer according to the optimized loss function.
It should be noted that, in this step, the equivalent means are: from the perspective of one skilled in the art, the probability output vector may be considered equivalent compared to the manually labeled class of training text.
S108, taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the Bi-LSTM, the softmax function, and an attention mechanism of the neural network algorithm.
Based on the entity association relationship prediction model constructed by the method of the embodiment, the entity association relationship analysis can be performed on the text to be predicted. Specifically, referring to fig. 3, the method for analyzing entity association relationship includes:
s301, obtaining a text to be predicted.
The text to be predicted is an evaluation statement of a user about certain events, persons, enterprises, products and the like. And acquiring the text to be predicted to analyze the emotional tendency of the text about the target entity in the text.
S302, performing word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted.
And performing word segmentation processing on the text to be predicted by adopting open source tool software, and acquiring a part-of-speech sequence of corresponding words. The specific execution process of this step can be seen in the embodiment corresponding to fig. 1, and the content of step S101 is not described herein again.
S303, obtaining a vector of each participle in the part of speech sequence of the text to be predicted.
Optionally, in an implementation manner of step S303, the step includes:
and obtaining a word vector of each participle in the part of speech sequence of the text to be predicted.
Optionally, in another implementation manner of step S303, referring to fig. 4, the step includes:
s3031, obtaining a word vector of each participle in the part of speech sequence of the text to be predicted, and a part of speech vector and/or a word packet vector of each participle in the part of speech sequence of the text to be predicted.
S3032, combining the word vector of each participle in the part of speech sequence of the text to be predicted and the part of speech vector and/or the word packet vector of each participle in the part of speech sequence of the text to be predicted to obtain the vector of each participle in the part of speech sequence of the text to be predicted.
Specific contents of the two implementation manners may refer to the contents of the specific implementation manner of step S102 in the embodiment corresponding to fig. 1, and are not described herein again.
S304, predicting the vector of each participle in the part of speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of incidence relation between an entity and corresponding attributes in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm until a prediction result obtained by predicting the feature vector of the training text by using the neural network algorithm after updating the parameters is equal to an artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
In the method for analyzing the entity association relationship disclosed in this embodiment, after a part-of-speech sequence of a text to be predicted is obtained by performing word segmentation processing on the text to be predicted, a vector of each word in the part-of-speech sequence of the text to be predicted is obtained, and a prediction model of the entity association relationship predicts the vector of each word in the part-of-speech sequence of the text to be predicted, so that a prediction result of the association relationship between an entity and a corresponding attribute in the text to be predicted can be obtained. In the process, the text to be predicted is subjected to word segmentation processing to obtain a part-of-speech sequence, and a vector of each word segmentation in the part-of-speech sequence is obtained, and the manual word selection and the word feature extraction are not performed, so that the problem of accuracy of a test result of the incidence relation between the entity and the attribute, which is influenced by the manual word selection and the provision of the word feature, is solved.
Optionally, in another embodiment of the present application, referring to fig. 5, step S304 includes:
s3041, performing network representation of the sequence relation on the first matrix to obtain a second matrix; wherein the first matrix comprises: and the vector of each participle in the part of speech sequence of the text to be predicted.
For a specific implementation manner of this step, reference may be made to the content of step S103 in the embodiment corresponding to fig. 1, which is not described herein again.
S3042, performing weighted average processing on the second matrix according to the weight corresponding to the value of each position in the second matrix, to obtain a feature vector.
For a specific implementation manner of this step, reference may be made to the content of step S104 in the embodiment corresponding to fig. 1, which is not described herein again.
S3043, processing the feature vector by adopting a softmax function to obtain a probability output vector.
The probability output vector includes: and probability values of association relations between the target entities and the corresponding attributes in the text to be predicted under two categories.
For a specific implementation manner of this step, reference may be made to the content of step S105 in the embodiment corresponding to fig. 1, which is not described herein again.
Another embodiment of the present application further discloses an entity association relationship analysis apparatus, and specific working processes of each unit included in the apparatus can be referred to the content of the embodiment corresponding to fig. 3. Specifically, referring to fig. 6, the apparatus for analyzing entity association relationship includes:
an obtaining unit 601, configured to obtain a text to be predicted.
A word segmentation unit 602, configured to perform word segmentation processing on the text to be predicted, so as to obtain a part-of-speech sequence of the text to be predicted.
A generating unit 603, configured to obtain a vector of each participle in the part-of-speech sequence of the text to be predicted.
Optionally, in another embodiment of the present application, the generating unit 603, see fig. 7, includes:
a first obtaining unit 6031, configured to obtain a word vector of each participle in the part of speech sequence of the text to be predicted.
Alternatively, the generation unit 603 includes: a second obtaining unit 6032, configured to obtain a word vector of each participle in the part-of-speech sequence of the text to be predicted, and a part-of-speech vector and/or a word-packet vector of each participle in the part-of-speech sequence of the text to be predicted; and combining the word vector of each word in the part-of-speech sequence of the text to be predicted and the part-of-speech vector and/or the word packet vector of each word in the part-of-speech sequence of the text to be predicted to obtain the vector of each word in the part-of-speech sequence of the text to be predicted.
For a specific working process of each unit in the generating unit 603 disclosed in this embodiment, reference may be made to the content of the embodiment corresponding to fig. 4, which is not described herein again.
The predicting unit 604 is configured to predict a vector of each word segmentation in the part-of-speech sequence of the text to be predicted by using a prediction model of entity association, so as to obtain a prediction result of association between a target entity and a corresponding attribute in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm, so that the neural network algorithm after updating the parameters is used for predicting the feature vectors of the training text, and the predicted result is equal to the artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
Optionally, in another embodiment of the present application, the prediction unit 604, as shown in fig. 8, includes:
a third obtaining unit 6041, configured to perform network characterization on the sequence relationship of the first matrix to obtain a second matrix; wherein the first matrix comprises: and the vector of each participle in the part of speech sequence of the text to be predicted.
A fourth obtaining unit 6042, configured to perform weighted average processing on the second matrix according to a weight corresponding to a numerical value of each position in the second matrix, so as to obtain a feature vector.
A predictor 6043 configured to process the feature vector by a softmax function to obtain a probability output vector, where the probability output vector includes: and probability values of association relations between the target entities and the corresponding attributes in the training texts under two categories.
For a specific working process of each unit in the prediction unit 604 disclosed in this embodiment, reference may be made to the content of the embodiment corresponding to fig. 5, which is not described herein again.
In this embodiment, the text to be predicted is subjected to word segmentation processing by the word segmentation unit to obtain a part-of-speech sequence, and the vector of each word segmentation in the part-of-speech sequence is obtained by the generation unit, but manual word selection and word feature extraction are not performed, so that the problem of accuracy of a test result of an association relationship between an entity and an attribute, which is influenced by the manual word selection and the provision of the word features, is solved.
Optionally, in another embodiment of the present application, the analysis device for entity association may further predict the training text to obtain a prediction model for entity association.
Specifically, the method comprises the following steps: the word segmentation unit 602 is further configured to perform word segmentation processing on the training text to obtain a part-of-speech sequence of the training text.
The generating unit 603 is further configured to obtain a vector of each participle in the part-of-speech sequence of the training text.
A third obtaining unit 6041, configured to perform network characterization on the sequence relationship of the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector for each participle in the sequence of parts of speech of the training text.
The fourth obtaining unit 6042 is further configured to perform weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix, so as to obtain a feature vector.
A predictor 6043, configured to process the feature vector by using a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and probability values of association relations between the target entities and the corresponding attributes in the training texts under two categories.
The apparatus for analyzing entity association further includes: and the comparison unit is used for carrying out cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function.
An optimization unit for optimizing the loss function.
The updating unit is used for updating the first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is basically equal to the artificial labeling category of the training text; wherein the first parameters include the softmax function and a vector for each participle in the sequence of parts of speech of the training text.
The construction unit is used for taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function.
For the specific working process of each unit in the above embodiment, reference may be made to the content of the embodiment corresponding to fig. 1, and details are not described here again.
The analysis device for entity incidence relation comprises a processor and a memory, wherein the acquisition unit, the word segmentation unit, the generation unit, the prediction unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the analysis process of the incidence relation between the entity and the corresponding attribute in the text to be predicted is realized by adjusting the kernel parameters, so that the prediction result of the incidence relation between the entity and the corresponding attribute in the text to be predicted is obtained.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements a method for analyzing an entity association relationship.
The embodiment of the invention provides a processor, which is used for running a program, wherein the method for analyzing the entity association relation is executed when the program runs.
The embodiment of the invention provides equipment, and the equipment can be a server, a PC, a PAD, a mobile phone and the like. The device comprises a processor, a memory and a program stored on the memory and capable of running on the processor, and the processor realizes the following steps when executing the program:
an entity incidence relation analysis method comprises the following steps:
acquiring a text to be predicted;
performing word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between the entity and the corresponding attribute in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm until a prediction result obtained by predicting the feature vector of the training text by using the neural network algorithm after updating the parameters is equal to an artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
Optionally, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word segmentation in the part of speech sequence of the text to be predicted;
or, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word in the part of speech sequence of the text to be predicted and a part of speech vector and/or a word packet vector of each word in the part of speech sequence of the text to be predicted; and combining the word vector of each word in the part of speech sequence of the text to be predicted and the part of speech vector and/or the word packet vector of each word in the part of speech sequence of the text to be predicted to obtain the vector of each word in the part of speech sequence of the text to be predicted.
Optionally, the predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using the prediction model of the entity association relationship to obtain a prediction result of the association relationship between the target entity and the corresponding attribute in the text to be predicted includes:
performing network representation of sequence relation on the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
carrying out weighted average processing on the second matrix according to the weight corresponding to the numerical value of each position in the second matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and the probability value of the association relationship between the target entity and the corresponding attribute in the text to be predicted under the preset category.
Optionally, the building process of the prediction model of entity association relationship includes:
performing word segmentation processing on a training text to obtain a part-of-speech sequence of the training text;
obtaining a vector of each word segmentation in the part of speech sequence of the training text;
performing network representation of the sequence relation on the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
carrying out weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
performing cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
optimizing the loss function, and updating a first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function.
The invention also provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
an entity incidence relation analysis method comprises the following steps:
acquiring a text to be predicted;
performing word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between the entity and the corresponding attribute in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm until a prediction result obtained by predicting the feature vector of the training text by using the neural network algorithm after updating the parameters is equal to an artificial labeling result; and obtaining the feature vector of the training text according to the vector of each word segmentation of the part of speech sequence of the training text.
Optionally, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word segmentation in the part of speech sequence of the text to be predicted;
or, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word in the part of speech sequence of the text to be predicted and a part of speech vector and/or a word packet vector of each word in the part of speech sequence of the text to be predicted; and combining the word vector of each word in the part of speech sequence of the text to be predicted and the part of speech vector and/or the word packet vector of each word in the part of speech sequence of the text to be predicted to obtain the vector of each word in the part of speech sequence of the text to be predicted.
Optionally, the predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using the prediction model of the entity association relationship to obtain a prediction result of the association relationship between the target entity and the corresponding attribute in the text to be predicted includes:
performing network representation of sequence relation on the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
carrying out weighted average processing on the second matrix according to the weight corresponding to the numerical value of each position in the second matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and probability values of association relations between the target entities and the corresponding attributes in the text to be predicted under two categories.
Optionally, the building process of the prediction model of entity association relationship includes:
performing word segmentation processing on a training text to obtain a part-of-speech sequence of the training text;
obtaining a vector of each word segmentation in the part of speech sequence of the training text;
performing network representation of the sequence relation on the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
carrying out weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
performing cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
optimizing the loss function, and updating a first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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 specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (6)

1. An entity incidence relation analysis method is characterized by comprising the following steps:
acquiring a text to be predicted;
performing word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between the entity and the corresponding attribute in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm until a prediction result obtained by predicting the feature vector of the training text by using the neural network algorithm after updating the parameters is equal to an artificial labeling result; the feature vector of the training text is obtained according to the vector of each word segmentation of the part of speech sequence of the training text;
the construction process of the prediction model of the entity incidence relation comprises the following steps:
performing word segmentation processing on a training text to obtain a part-of-speech sequence of the training text;
obtaining a vector of each word segmentation in the part of speech sequence of the training text;
performing network representation of the sequence relation on the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
carrying out weighted average processing on the fourth matrix according to the weight corresponding to the numerical value of each position in the fourth matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
performing cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
optimizing the loss function, and updating a first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function;
the obtaining of the vector of each participle in the part-of-speech sequence of the text to be predicted includes: obtaining a word vector of each word segmentation in the part of speech sequence of the text to be predicted;
or, the obtaining a vector of each participle in the part of speech sequence of the text to be predicted includes: obtaining a word vector of each word in the part of speech sequence of the text to be predicted and a part of speech vector and/or a word packet vector of each word in the part of speech sequence of the text to be predicted; and combining the word vector of each word in the part of speech sequence of the text to be predicted and the part of speech vector and/or the word packet vector of each word in the part of speech sequence of the text to be predicted to obtain the vector of each word in the part of speech sequence of the text to be predicted.
2. The method according to claim 1, wherein the predicting a vector of each participle in the part-of-speech sequence of the text to be predicted by using the prediction model of entity association to obtain a prediction result of association between a target entity and a corresponding attribute in the text to be predicted comprises:
performing network representation of sequence relation on the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
carrying out weighted average processing on the second matrix according to the weight corresponding to the numerical value of each position in the second matrix to obtain a feature vector;
processing the characteristic vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and the probability value of the association relationship between the target entity and the corresponding attribute in the text to be predicted under the preset category.
3. An apparatus for analyzing entity association relationship, comprising:
the device comprises an acquisition unit, a prediction unit and a prediction unit, wherein the acquisition unit is used for acquiring a text to be predicted;
the word segmentation unit is used for carrying out word segmentation processing on the text to be predicted to obtain a part-of-speech sequence of the text to be predicted;
the generating unit is used for obtaining a vector of each participle in the part of speech sequence of the text to be predicted;
the prediction unit is used for predicting the vector of each participle in the part-of-speech sequence of the text to be predicted by using a prediction model of entity incidence relation to obtain a prediction result of the incidence relation between a target entity and corresponding attributes in the text to be predicted; the entity incidence relation prediction model is constructed on the basis of a first principle; the first principle includes: iteratively updating parameters in the neural network algorithm, so that the neural network algorithm after updating the parameters is used for predicting the feature vectors of the training text, and the predicted result is equal to the artificial labeling result; the feature vector of the training text is obtained according to the vector of each word segmentation of the part of speech sequence of the training text;
the word segmentation unit is further used for carrying out word segmentation processing on the training text to obtain a part-of-speech sequence of the training text;
the generating unit is further used for obtaining a vector of each participle in the part of speech sequence of the training text;
the third obtaining unit is used for performing network representation of the sequence relation on the third matrix to obtain a fourth matrix; wherein the third matrix comprises: a vector of each participle in the part-of-speech sequence of the training text;
a fourth obtaining unit, configured to perform weighted average processing on the fourth matrix according to a weight corresponding to a numerical value of each position in the fourth matrix, so as to obtain a feature vector;
the prediction subunit is further used for processing the feature vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: probability values of incidence relations between the target entities and the corresponding attributes in the training texts under preset categories;
the comparison unit is used for carrying out cross entropy operation on the probability output vector and the artificial labeling category of the training text to obtain a loss function;
an optimization unit for optimizing the loss function;
the updating unit is used for updating the first parameter according to the optimized loss function until a probability output vector obtained by predicting the training text by using a feature vector obtained by using the updated parameter is equal to the artificial labeling category of the training text; wherein the first parameters comprise the softmax function and a vector for each participle in the sequence of parts of speech of the training text;
the construction unit is used for taking the updated second parameter as a parameter in a prediction model of the entity incidence relation; wherein the second parameter comprises: the softmax function;
wherein the generating unit includes:
the first obtaining unit is used for obtaining a word vector of each participle in the part of speech sequence of the text to be predicted;
alternatively, it comprises: a second obtaining unit, configured to obtain a word vector of each participle in the part-of-speech sequence of the text to be predicted, and a part-of-speech vector and/or a word-packet vector of each participle in the part-of-speech sequence of the text to be predicted; and combining the word vector of each word in the part-of-speech sequence of the text to be predicted and the part-of-speech vector and/or the word packet vector of each word in the part-of-speech sequence of the text to be predicted to obtain the vector of each word in the part-of-speech sequence of the text to be predicted.
4. The apparatus of claim 3, wherein the prediction unit comprises:
a third obtaining unit, configured to perform network characterization on the sequence relationship of the first matrix to obtain a second matrix; wherein the first matrix comprises: a vector of each participle in the part of speech sequence of the text to be predicted;
a fourth obtaining unit, configured to perform weighted average processing on the second matrix according to a weight corresponding to a numerical value of each position in the second matrix, so as to obtain a feature vector;
the prediction subunit is used for processing the feature vector by adopting a softmax function to obtain a probability output vector; wherein the probability output vector comprises: and the probability value of the association relationship between the target entity and the corresponding attribute in the training text under the preset category.
5. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the entity association relationship analysis method according to any one of claims 1-2.
6. A processor, wherein the processor is configured to execute a program, wherein the program executes the method for analyzing entity association relationship according to any one of claims 1-2.
CN201810217272.5A 2018-03-16 2018-03-16 Entity association relation analysis method and related device Active CN110276066B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810217272.5A CN110276066B (en) 2018-03-16 2018-03-16 Entity association relation analysis method and related device
PCT/CN2019/073664 WO2019174422A1 (en) 2018-03-16 2019-01-29 Method for analyzing entity association relationship, and related apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810217272.5A CN110276066B (en) 2018-03-16 2018-03-16 Entity association relation analysis method and related device

Publications (2)

Publication Number Publication Date
CN110276066A CN110276066A (en) 2019-09-24
CN110276066B true CN110276066B (en) 2021-07-27

Family

ID=67907352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810217272.5A Active CN110276066B (en) 2018-03-16 2018-03-16 Entity association relation analysis method and related device

Country Status (2)

Country Link
CN (1) CN110276066B (en)
WO (1) WO2019174422A1 (en)

Families Citing this family (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704576B (en) * 2019-09-30 2022-07-01 北京邮电大学 Text-based entity relationship extraction method and device
CN110837731A (en) * 2019-10-12 2020-02-25 创新工场(广州)人工智能研究有限公司 Word vector training method and device
CN110795934B (en) * 2019-10-31 2023-09-19 北京金山数字娱乐科技有限公司 Sentence analysis model training method and device and sentence analysis method and device
CN111104791B (en) * 2019-11-14 2024-02-20 北京金堤科技有限公司 Industry information acquisition method and device, electronic equipment and medium
CN110908709B (en) * 2019-11-25 2023-05-02 中山大学 Code submission annotation prediction method based on code modification key class judgment
CN111008279B (en) * 2019-11-27 2023-11-14 云知声智能科技股份有限公司 Entity relation extraction method and device
CN111027291B (en) * 2019-11-27 2024-03-26 达观数据有限公司 Method and device for adding mark symbols in text and method and device for training model, and electronic equipment
CN111079433B (en) * 2019-11-29 2023-10-27 北京奇艺世纪科技有限公司 Event extraction method and device and electronic equipment
CN111192682B (en) * 2019-12-25 2024-04-09 上海联影智能医疗科技有限公司 Image exercise data processing method, system and storage medium
CN111160034B (en) * 2019-12-31 2024-02-27 东软集团股份有限公司 Entity word labeling method, device, storage medium and equipment
CN111145906B (en) * 2019-12-31 2024-04-30 清华大学 Project judging method, related device and readable storage medium
CN111192692B (en) * 2020-01-02 2023-12-08 上海联影智能医疗科技有限公司 Entity relationship determination method and device, electronic equipment and storage medium
CN111210233B (en) * 2020-01-02 2023-12-26 联想(北京)有限公司 User characteristic determining method and device and electronic equipment
CN111325016B (en) * 2020-02-04 2024-02-02 深圳证券信息有限公司 Text processing method, system, equipment and medium
CN111444714B (en) * 2020-02-29 2023-04-07 新华三大数据技术有限公司 Text analysis device and method and model training method
CN111460807B (en) * 2020-03-13 2024-03-12 平安科技(深圳)有限公司 Sequence labeling method, device, computer equipment and storage medium
CN111462893B (en) * 2020-03-13 2023-08-04 云知声智能科技股份有限公司 Chinese medical record auxiliary diagnosis method and system for providing diagnosis basis
CN111523318A (en) * 2020-04-02 2020-08-11 言图科技有限公司 Chinese phrase analysis method, system, storage medium and electronic equipment
CN111626291B (en) * 2020-04-07 2023-04-25 上海交通大学 Image visual relationship detection method, system and terminal
CN113553841B (en) * 2020-04-26 2024-02-20 顺丰科技有限公司 Word characterization method, word characterization device, electronic equipment and storage medium
CN111476035B (en) * 2020-05-06 2023-09-05 中国人民解放军国防科技大学 Chinese open relation prediction method, device, computer equipment and storage medium
CN111611799B (en) * 2020-05-07 2023-06-02 北京智通云联科技有限公司 Entity attribute extraction method, system and equipment based on dictionary and sequence labeling model
CN111832290B (en) * 2020-05-25 2024-04-02 北京三快在线科技有限公司 Model training method and device for determining text relevance, electronic equipment and readable storage medium
CN111611810B (en) * 2020-05-29 2023-08-04 河北数云堂智能科技有限公司 Multi-tone word pronunciation disambiguation device and method
CN111694945A (en) * 2020-06-03 2020-09-22 北京北大软件工程股份有限公司 Legal association recommendation method and device based on neural network
CN111859965A (en) * 2020-06-11 2020-10-30 北京三快在线科技有限公司 Entity recognition model training method, entity recognition method and device
CN111860981B (en) * 2020-07-03 2024-01-19 航天信息(山东)科技有限公司 Enterprise national industry category prediction method and system based on LSTM deep learning
CN112001178A (en) * 2020-08-27 2020-11-27 广东工业大学 Long-tail entity identification and disambiguation method
CN112016299B (en) * 2020-08-31 2023-11-14 支付宝(杭州)信息技术有限公司 Method and device for generating dependency syntax tree by using neural network and executed by computer
CN112131366B (en) * 2020-09-23 2024-02-09 腾讯科技(深圳)有限公司 Method, device and storage medium for training text classification model and text classification
CN112445876B (en) * 2020-11-25 2023-12-26 中国科学院自动化研究所 Entity alignment method and system for fusing structure, attribute and relationship information
CN112560463B (en) * 2020-12-15 2023-08-04 中国平安人寿保险股份有限公司 Text multi-labeling method, device, equipment and storage medium
CN112966808A (en) * 2021-01-25 2021-06-15 咪咕音乐有限公司 Data analysis method, device, server and readable storage medium
CN112835798B (en) * 2021-02-03 2024-02-20 广州虎牙科技有限公司 Clustering learning method, testing step clustering method and related devices
CN113535912B (en) * 2021-05-18 2023-12-26 北京邮电大学 Text association method and related equipment based on graph rolling network and attention mechanism
CN113535973B (en) * 2021-06-07 2023-06-23 中国科学院软件研究所 Event relation extraction and language-to-language relation analysis method and device based on knowledge mapping
CN113468878A (en) * 2021-07-13 2021-10-01 腾讯科技(深圳)有限公司 Part-of-speech tagging method and device, electronic equipment and storage medium
CN113569559B (en) * 2021-07-23 2024-02-02 北京智慧星光信息技术有限公司 Short text entity emotion analysis method, system, electronic equipment and storage medium
CN113722439B (en) * 2021-08-31 2024-01-09 福州大学 Cross-domain emotion classification method and system based on antagonism class alignment network
CN113792539B (en) * 2021-09-15 2024-02-20 平安科技(深圳)有限公司 Entity relationship classification method and device based on artificial intelligence, electronic equipment and medium
CN114047693B (en) * 2021-10-22 2023-12-22 合肥工业大学 Self-adaptive prevention method and system for fire disaster of automobile battery facing charging process
CN114462383B (en) * 2022-04-12 2022-07-08 江西少科智能建造科技有限公司 Method, system, storage medium and equipment for obtaining design specification of building drawing
CN117057345B (en) * 2023-10-11 2024-01-30 腾讯科技(深圳)有限公司 Role relation acquisition method and related products

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899304A (en) * 2015-06-12 2015-09-09 北京京东尚科信息技术有限公司 Named entity identification method and device
CN106407211A (en) * 2015-07-30 2017-02-15 富士通株式会社 Method and device for classifying semantic relationships among entity words
CN106649275A (en) * 2016-12-28 2017-05-10 成都数联铭品科技有限公司 Relation extraction method based on part-of-speech information and convolutional neural network
CN106855853A (en) * 2016-12-28 2017-06-16 成都数联铭品科技有限公司 Entity relation extraction system based on deep neural network

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9406020B2 (en) * 2012-04-02 2016-08-02 Taiger Spain Sl System and method for natural language querying
US9792549B2 (en) * 2014-11-21 2017-10-17 International Business Machines Corporation Extraction of semantic relations using distributional relation detection
US10394803B2 (en) * 2015-11-13 2019-08-27 International Business Machines Corporation Method and system for semantic-based queries using word vector representation
CN107562752B (en) * 2016-06-30 2021-05-28 富士通株式会社 Method and device for classifying semantic relation of entity words and electronic equipment
CN106886516A (en) * 2017-02-27 2017-06-23 竹间智能科技(上海)有限公司 The method and device of automatic identification statement relationship and entity
CN106970981B (en) * 2017-03-28 2021-01-19 北京大学 Method for constructing relation extraction model based on transfer matrix
CN107239446B (en) * 2017-05-27 2019-12-03 中国矿业大学 A kind of intelligence relationship extracting method based on neural network Yu attention mechanism

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899304A (en) * 2015-06-12 2015-09-09 北京京东尚科信息技术有限公司 Named entity identification method and device
CN106407211A (en) * 2015-07-30 2017-02-15 富士通株式会社 Method and device for classifying semantic relationships among entity words
CN106649275A (en) * 2016-12-28 2017-05-10 成都数联铭品科技有限公司 Relation extraction method based on part-of-speech information and convolutional neural network
CN106855853A (en) * 2016-12-28 2017-06-16 成都数联铭品科技有限公司 Entity relation extraction system based on deep neural network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于LM 算法的领域概念实体属性关系抽取;刘丽佳 等;《中文信息学报》;20141130;第28卷(第6期);第216-222页 *

Also Published As

Publication number Publication date
WO2019174422A1 (en) 2019-09-19
CN110276066A (en) 2019-09-24

Similar Documents

Publication Publication Date Title
CN110276066B (en) Entity association relation analysis method and related device
CN110287477B (en) Entity emotion analysis method and related device
US10740380B2 (en) Incremental discovery of salient topics during customer interaction
US9542477B2 (en) Method of automated discovery of topics relatedness
CN112860841B (en) Text emotion analysis method, device, equipment and storage medium
CN110069545B (en) Behavior data evaluation method and device
CN110619044A (en) Emotion analysis method, system, storage medium and equipment
US20220092262A1 (en) Text classification using models with complementary granularity and accuracy
Silva et al. Exploring convolutional neural networks for voice activity detection
CN110532773B (en) Malicious access behavior identification method, data processing method, device and equipment
CN112667803A (en) Text emotion classification method and device
US20230351121A1 (en) Method and system for generating conversation flows
CN108733672A (en) The method and apparatus for realizing network information quality evaluation
CN111353626A (en) Data auditing method, device and equipment
CN115186057A (en) Method and device for obtaining text classification model
US11514311B2 (en) Automated data slicing based on an artificial neural network
CN112579768A (en) Emotion classification model training method, text emotion classification method and text emotion classification device
CN116738298B (en) Text classification method, system and storage medium
Miller et al. Seeing the Forest: Applying Latent Semantic Analysis to Smartphone Discourse
CN112308453B (en) Risk identification model training method, user risk identification method and related devices
CN117332090B (en) Sensitive information identification method, device, equipment and storage medium
CN116610804B (en) Text recall method and system for improving recognition of small sample category
CN113743431B (en) Data selection method and device
US20230259653A1 (en) Personal information redaction and voice deidentification
US20220398397A1 (en) Automatic rule prediction and generation for document classification and validation

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