Knowledge-fused aspect-level traffic safety event network public opinion analysis method

By generating a syntax mask matrix and integrating an emotion enhancement matrix, the problem of low accuracy of emotion analysis in the prior art is solved, and a higher accuracy of emotional text recognition of emotional tendency is achieved.

CN119474374APending Publication Date: 2025-02-18CHANGAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411543276.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing methods of public opinion and emotional analysis of traffic accidents are not accurate when identifying emotional tendencies, mainly due to the lack of a deep understanding of the linguistic information characteristics in the sentence and the failure to effectively use emotional knowledge to guide the classification process.

Method used

By generating a syntax mask matrix, a graph convolutional network is used to integrate syntax and semantic information, combined with emotion enhancement matrix, and fusing semantic context representation vectors and emotion enhancement matrix to identify emotion polarity.

Benefits of technology

The accuracy of emotional tendency recognition of emotional texts is improved, syntactic mask matrix is ​​created through different word distances and emotional scores are injected into syntactic dependency diagrams, which enhances the understanding of emotional information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474374A_ABST
    Figure CN119474374A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge-fused aspect-level traffic safety event network public opinion analysis method, which comprises the following steps of: generating a syntactic mask matrix of an emotional text according to a word distance of every two words in the emotional text in a syntactic dependency graph and a comprehensive attention matrix of the emotional text; inputting the syntactic mask matrix into a graph convolution network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the emotion text; determining an emotion enhancement matrix of the emotion text according to the dependency relationship between every two words in the emotion text, the emotion score and the aspect word score; and fusing the semantic context representation vector and the sentiment enhancement matrix to obtain the sentiment polarity of the sentiment text. According to the method provided by the invention, the syntactic mask matrix is created through different word distances, so that grammar and semantic information can be fully supplemented in the syntactic dependency graph, and the emotion score is injected into the syntactic dependency graph, so that the understanding of the emotion information can be enhanced, and the recognition accuracy of the emotion tendency of the emotion text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and in particular relates to a knowledge-integrated aspect-level network public opinion analysis method for traffic safety incidents. Background Art

[0002] With the rapid development of the Internet and social media, traffic accident information spreads rapidly, triggering extensive public discussion. These online opinions not only reflect public emotions and opinions, but also have an important impact on traffic management, accident response and safety education. However, sentiment analysis still faces many challenges in practical applications, including language diversity, subjectivity caused by individual differences, and noisy data in online opinions, which increase the difficulty of accurately extracting sentiment information from user comments.

[0003] Most current traffic accident public opinion sentiment analysis methods solve the syntactic dependency problem of comment sentences by constructing syntactic graphs. The basic idea is: first use natural language processing tools to segment and syntactically analyze the text, then construct a syntactic dependency graph to identify the grammatical relationship between each word in the sentence. Then, by analyzing these dependency relationships, the key information in the text can be determined. Based on the syntactic graph, machine learning or deep learning models are further used to train and predict the sentiment tendency of the text.

[0004] Since these methods mainly rely on syntactic dependency graphs to represent syntactic relations in texts, they lack a deep understanding of the inherent linguistic information characteristics in sentences. Moreover, without sentiment knowledge specific to the characteristics of sentiment analysis tasks to guide the classification process, the models usually find it difficult to accurately capture the true emotions of these comments. As a result, current methods have low accuracy in identifying sentiment tendencies. Summary of the invention

[0005] The embodiment of the present invention provides a method for analyzing network public opinion on traffic safety incidents at the aspect level by integrating knowledge, which can solve the problem that the current method has low recognition accuracy for emotional tendency.

[0006] In a first aspect, an embodiment of the present invention provides a method for analyzing network public opinion on traffic safety incidents at an aspect level by integrating knowledge, the method comprising:

[0007] Generate a syntactic mask matrix of the sentiment text according to the word distance between every two words in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text;

[0008] The syntactic mask matrix is ​​input into the graph convolutional network to perform graph convolution on the syntactic mask matrix to obtain the semantic context representation vector of the sentiment text;

[0009] Determine the sentiment enhancement matrix of the sentiment text according to the dependency relationship between every two words in the sentiment text, the sentiment score and the aspect word score;

[0010] The sentiment polarity of sentiment text is obtained by fusing the semantic context representation vector and the sentiment enhancement matrix.

[0011] In a second aspect, an embodiment of the present invention provides a knowledge-integrated aspect-level network public opinion analysis device for traffic safety incidents, comprising:

[0012] The feature supplement extraction module is used to generate a syntactic mask matrix of the sentiment text according to the word distance between every two words in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text; the syntactic mask matrix is ​​input into the graph convolution network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the sentiment text;

[0013] The sentiment module is used to determine the sentiment enhancement matrix of the sentiment text according to the dependency relationship between every two words in the sentiment text, the sentiment score and the aspect word score;

[0014] Hierarchical fusion module,The hierarchical fusion module is used to fuse the updated hidden state vector and the,sentiment enhancement matrix to obtain the sentiment polarity of the sentiment text.

[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store computer programs; the processor can be used to execute the computer program (instructions) stored in the memory to implement the method of the first aspect above.

[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method of the first aspect described above can be implemented.

[0017] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0018] The beneficial effects of the embodiments of the present invention compared with the prior art are: the method provided by the present invention can fully supplement the grammatical and semantic information in the syntactic dependency graph by creating a syntactic mask matrix through different word distances, and injecting the sentiment score into the syntactic dependency graph can enhance the understanding of the sentiment information, thereby improving the recognition accuracy of the sentiment tendency of the sentiment text. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the implementation process of a knowledge-integrated aspect-level network public opinion analysis method for traffic safety incidents;

[0020] Figure 2 A schematic diagram of a syntactic dependency graph provided by an embodiment of the present invention;

[0021] Figure 3 A schematic diagram of the structure of a knowledge-integrated aspect-level network public opinion analysis device for traffic safety incidents provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0025] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0026] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.

[0027] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0028] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0029] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0030] The aspect-level traffic safety incident network public opinion analysis method integrating knowledge provided in the embodiment of the present invention can be applied to electronic devices such as mobile terminals, personal laptops, supercomputers, etc. The embodiment of the present invention does not impose any restrictions on the specific type of electronic devices.

[0031] Figure 1 The flowchart shown is a method for analyzing network public opinion on traffic safety incidents at the aspect level with integrated knowledge provided by an embodiment of the present invention. As an example but not a limitation, the analysis method can be applied to the above electronic device, and the method can include steps S101-S104, each of which is described below.

[0032] S101, generating a syntactic mask matrix of the sentiment text according to the word distance between every two words in the syntactic dependency graph in the sentiment text and the comprehensive attention matrix of the sentiment text.

[0033] In one possible implementation, advanced natural language processing technology may be first used to perform syntactic analysis on network public opinion data (ie, sentimental text) related to traffic accidents to obtain a syntactic dependency graph.

[0034] Exemplarily, the syntactic dependency graph may be converted into an undirected graph, and then the undirected graph is stored in a table format. The syntactic dependency graph stored in a table format is convenient for checking and updating.

[0035] For example, when the sentiment text is: "The accident was serious, but fortunately there were no casualties", the syntactic dependency graph of the sentiment text can be stored in the manner of Table 1 or Table 2 below (see Figure 2 ).

[0036] Table 1

[0037] Word Part of Speech Dependencies Depends on word The DET det accident accident NOUN nsubj was was AUX cop serious serious ADJ amod accident , PUNCT punct serious but CONJ cc was fortunately ADV advmod was there PRON expl were were VERB aux no no DET det casualties casualties NOUN nsubj were . PUNCT Punct were

[0038] Table 2

[0039]

[0040] In a possible implementation, the global-local features of the sentiment text can be determined based on the syntactic distance threshold and the word distance between every two nodes (i.e., every two words) in the syntactic dependency graph, and then the global-local features and the comprehensive attention matrix are merged, and the merged matrix is ​​activated by an activation function to obtain a syntactic mask matrix.

[0041] In one example, the shortest word distance between every two nodes in the syntactic dependency graph may be calculated, and then the global-local features of the sentiment text may be determined based on the shortest word distance and the syntactic distance threshold.

[0042] Exemplarily, the global-local feature M may satisfy the following formula:

[0043]

[0044]

[0045] Among them, I is the total number of words in the syntactic dependency graph, p is the syntactic distance threshold, D(i,j)=mind(vi,vj) is the shortest word distance between node vi and node vj, that is, the shortest word distance between the i-th and j-th words in the syntactic dependency graph, and d(vi,vj) represents the word distance between node vi and node vj.

[0046] In one example, the global-local features and the comprehensive attention matrix can be combined to obtain a syntactic mask matrix. The syntactic mask matrix constructed based on different word distances can supplement the comprehensive attention matrix that focuses more on syntactic relations in terms of syntax and semantics.

[0047] Exemplarily, the syntax mask matrix may satisfy the following formula:

[0048] Amask = softmax(A′+M)

[0049] Among them, Amask is the syntactic mask matrix, softmax(·) is the activation function, and A′ is the comprehensive attention matrix.

[0050] S102, input the syntactic mask matrix into the graph convolutional network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the sentiment text.

[0051] In one example, the syntactic mask matrix can be used as the input of the graph convolutional network, and the graph convolutional network is allowed to update the nodes in the graph convolutional layer according to the hidden representation of its neighborhood, thereby integrating the local neighborhood information of each word in the sentiment text into the representation of each node and obtaining the semantic context representation vector of the sentiment text.

[0052] For example, the semantic context representation vector of the sentiment text can be the vector output by the highest layer of the graph convolutional network n is the total number of words in the sentiment text.

[0053] For example, the vector output by the tth layer of the graph convolutional network can satisfy the following formula:

[0054]

[0055] in, is the vector output by the i′th node in the tth layer of the graph convolutional network, is the vector output by the i′th node in the t-1th layer of the graph convolutional network, is the adjacency matrix of the i′th node in the graph convolutional network, Wt is the linear transformation weight matrix of the tth layer of the graph convolutional network, and bt is the bias term of the tth layer of the graph convolutional network.

[0056] S103, determining a sentiment enhancement matrix of the sentiment text according to the dependency relationship between every two words in the sentiment text, the sentiment score and the aspect word score.

[0057] In a possible implementation, the sentiment enhancement matrix of the sentiment text can be determined according to the dependency relationship between every two words in the sentiment text, the sentiment score and the aspect word score. By injecting the sentiment score into the syntactic dependency graph, a new dependency graph (i.e., sentiment enhancement matrix) containing sentiment weights can be created, thereby enhancing the understanding of sentiment information.

[0058] Exemplarily, the emotion enhancement matrix may satisfy the following relationship:

[0059] A=Dij×(Sij+Zij+1)

[0060] Among them, A is the sentiment enhancement matrix, Dij represents the dependency relationship between the i-th word and the j-th word in the syntactic dependency graph, Sij represents the sentiment degree between the i-th word and the j-th word in the syntactic dependency graph, and Zij represents whether the i-th word or the j-th word in the syntactic dependency graph is an aspect word.

[0061] In one example, whether there is a dependency relationship between two words can be determined based on the syntactic dependency graph of the sentiment text. If so, Dij=1 is set, otherwise Dij=0, and the dependency relationship between a word and itself is set to Dii=Djj=1.

[0062] In one example, the sentiment score in the sentiment dictionary may be combined to represent the sentiment degree between two words.

[0063] Exemplarily, the sentiment dictionary may be a preset sentiment word lookup table, and each word has a corresponding score.

[0064] In an example, if the ith word or the jth word in the syntactic dependency graph is an aspect word, Zij=1 may be set; otherwise, Zij=0 may be set.

[0065] Exemplarily, an aspect word may be a subject in a sentence, for example, the sentiment text is: "This restaurant has a good environment, but the food is terrible", wherein "restaurant environment" and "food" are aspect words.

[0066] S104, fusing the semantic context representation vector and the sentiment enhancement matrix to obtain the sentiment polarity of the sentiment text.

[0067] In one example, the semantic context representation vector obtained in step S102 and the sentiment enhancement matrix obtained in step S103 can be concatenated to obtain concatenated features; then the concatenated features are input into a multi-layer perceptron to make the multi-layer perceptron learn the features between aspect words and context in the sentiment text, integrate the sentiment features obtained from different perspectives, strengthen the coordinated optimization of aspect words and context, and obtain the output result; finally, the output result is activated by an activation function to obtain the sentiment polarity of the sentiment text.

[0068] Exemplarily, the number of layers of the multilayer perceptron can be set to 3, and the number of nodes in each layer can be set to {300, 150, 3}.

[0069] Exemplarily, a Softmax activation function may be used to activate the output result. After activation, the probability of the sentiment text belonging to each sentiment polarity may be output, and the one with the highest probability is taken as the sentiment polarity of the sentiment text.

[0070] According to the method provided by the present invention, creating a syntactic mask matrix through different word distances can fully supplement the grammatical and semantic information in the syntactic dependency graph, and injecting the sentiment scores in the sentiment dictionary into the syntactic dependency graph can enhance the understanding of the sentiment information, thereby improving the recognition accuracy of the sentiment tendency of the sentiment text.

[0071] In some embodiments, before step S101 of the above analysis method, the sentiment text may be decomposed into words, and then the decomposed words may be mapped into a high-dimensional feature space using a pre-trained word embedding model to obtain high-dimensional feature vectors of the words. The high-dimensional feature vectors are input into a bidirectional long short-term memory network to generate a context-related representation for each word to obtain a hidden state vector of the sentiment text.

[0072] Exemplarily, the hidden state vector may include a plurality of column vectors corresponding one-to-one to each word in the sentiment text.

[0073] In some embodiments, similarly, before step S101 of the above analysis method, the hidden state vector can be input into the aspect-aware attention model and the self-attention model, and the aspect-aware attention model is made to perform aspect-aware attention operation on the aspect hidden state vector to obtain the language information features of the aspect words; the self-attention model is made to perform self-attention operation on the hidden state vector to obtain the language information attention matrix, and then the language information features and the language information attention matrix are combined to obtain the comprehensive attention matrix of the sentiment text. The specific language information association of different terms can be simulated through the attention mechanism.

[0074] Exemplarily, the aspect hidden state vector may be a column vector corresponding to the aspect words in the hidden state vector.

[0075] In one example, the language information feature may satisfy the following formula:

[0076]

[0077] in, is the language information feature output by the i′′′-th attention head of the network model that performs aspect-aware attention operation, is the aspect hidden state vector, K is the key value vector generated according to the hidden state vector, Wk, Wa represent the weight matrix of the network model used for aspect-aware attention operation, T represents transpose, and b is the bias term.

[0078] In one example, the comprehensive attention matrix can satisfy the following formula:

[0079]

[0080] in, is the language information attention matrix output by the i″th attention head of the network model for self-attention operation, Q is the query vector generated according to the hidden state vector, and WQ represents the weight matrix of the network model for self-attention operation.

[0081] Optionally, the key-value vector K and the query vector Q may be obtained by performing a linear transformation on the hidden state vector.

[0082] Figure 3 The structure diagram of a knowledge-integrated aspect-level traffic safety incident network public opinion analysis device provided by an embodiment of the present invention is shown. As an example but not a limitation, the device 300 may include a feature supplement extraction module 310 , an emotion module 320 , and a hierarchical fusion module 330 .

[0083] Exemplarily, the feature supplementation extraction module 310 can be used to generate a syntactic mask matrix of the sentiment text based on the word distance between every two words in the sentiment text in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text; the syntactic mask matrix is ​​input into the graph convolution network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the sentiment text; the sentiment module 320 can be used to determine the sentiment enhancement matrix of the sentiment text based on the dependency relationship between every two words in the sentiment text, the sentiment score and the aspect word score; the hierarchical fusion module 330 can be used to fuse the semantic context representation vector and the sentiment enhancement matrix to obtain the sentiment polarity of the sentiment text.

[0084] In order to better illustrate the beneficial effects of the present invention, the following simulation experiments were conducted:

[0085] For example, the deep learning framework Pytorch-GPU 2.6 can be used to conduct experiments on a CPU with a 12th Gen Intel(R) Core(TM) i7-12650H CPU, an NVIDIA GeForce RTX 3060 Laptop GPU, and a Windows 11 operating system. The emotional text is derived from crawling traffic accident-related comments on major platforms, and the required data information is filtered and sorted out.

[0086] Exemplarily, the method provided by the present invention can be compared with a method for encoding context (LSTM), a method for interacting between context and aspect using an attention mechanism (IAN), and a method for processing syntactic dependency graphs using a graph convolutional neural network (ASGCN) to verify the sentiment analysis capability of the method provided by the present invention, and the results shown in Table 3 below are obtained.

[0087] Table 3

[0088] method Accuracy Macro-F1 LSTM 69.56 67.70 IAN 72.50 70.81 ASGCN 72.15 70.40 The present invention 75.92 74.26

[0089] Referring to Table 3 above, it can be seen that the recognition accuracy and Macro-F1 index of the method provided by the present invention are higher than those of other methods. Therefore, according to the method provided by the present invention, creating a syntactic mask matrix through different word distances can fully supplement grammatical and semantic information in the syntactic dependency graph, and injecting the sentiment scores in the sentiment dictionary into the syntactic dependency graph can enhance the understanding of sentiment information, thereby improving the recognition accuracy of the sentiment tendency of the sentiment text.

[0090] Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 The electronic device 400 shown may include: at least one processor 410 ( Figure 4Only one processor is shown in the figure), a memory 420, and a computer program 430 stored in the memory 420 and executable on the at least one processor 410, wherein the processor 410 implements the steps of any of the above-mentioned method embodiments when executing the computer program 430.

[0091] The electronic device 400 may be a processing device such as a robot that can implement the above method. The embodiment of the present invention does not impose any limitation on the specific type of the electronic device.

[0092] Those skilled in the art will understand that Figure 4 The electronic device 400 is merely an example and does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 400 may also include an input and output interface.

[0093] The processor 410 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASTC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0094] The memory 420 may be an internal storage unit in some embodiments, such as a hard disk or a memory. The memory 420 may also be an external storage device in other embodiments, such as a plug-in hard disk, a smart memory card (SmartMemory Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 420 may also include both an internal storage unit and an external storage device. The memory 420 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 420 may also be used to temporarily store data that has been output or is to be output.

[0095] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0096] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0097] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0098] An embodiment of the present invention provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0101] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

Claims

1. A knowledge-integrated aspect-level network public opinion analysis method for traffic safety incidents, characterized in that: include: Generate a syntactic mask matrix of the sentiment text according to the word distance between every two words in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text; Inputting the syntactic mask matrix into a graph convolutional network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the sentiment text; Determine the emotion enhancement matrix of the emotion text according to the dependency relationship between every two words in the emotion text, the emotion score and the aspect word score; The semantic context representation vector and the sentiment enhancement matrix are fused to obtain the sentiment polarity of the sentiment text.

2. The method according to claim 1, characterized in that Before generating the syntactic mask matrix of the sentiment text according to the word distance between every two words in the sentiment text in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text, the method further includes: Performing aspect-aware attention operation on the aspect hidden state vector of the sentiment text to obtain language information features of aspect words in the sentiment text; Performing a self-attention operation on the hidden state vector of the sentiment text to obtain a language information attention matrix of the sentiment text, wherein the hidden state vector includes a plurality of column vectors corresponding to each word in the sentiment text, and the aspect hidden state vector is a column vector corresponding to the aspect word in the hidden state vector; The language information features and the language information attention matrix are combined to obtain the comprehensive attention matrix.

3. The method according to claim 2, characterized in that The language information feature satisfies the following formula: in, The language information features output by the i′′′ attention head of the network model that performs all-aspect-aware attention operations, is the aspect hidden state vector, K is the key value vector generated according to the hidden state vector, W k , W a represents the weight matrix of the network model used to perform the aspect-aware attention operation, T represents the transpose, and b is the bias term; The language information attention matrix satisfies the following formula: in, is the language information attention matrix output by the i″th attention head of the network model for performing the self-attention operation, Q is the query vector generated according to the hidden state vector, and W Q Represents the weight matrix of the network model used to perform the self-attention operation.

4. The method according to claim 1, characterized in that The method generates a syntactic mask matrix of the sentiment text according to the word distance between every two words in the sentiment text in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text, including: Determining the global-local features of the sentiment text according to the syntactic distance threshold and the word distance; Combining the global-local features and the comprehensive attention matrix to obtain the syntactic mask matrix; The global-local matrix satisfies the following formula: M={M 1,1 1 ,…,M i,j k ,...,M n,n p } M is the global-local matrix, n is the total number of words in the syntactic dependency graph; in: D(i,j)=min d(v i ,v j ) v i 、v j Respectively represent the i-th and j-th words in the syntactic dependency graph, d(v i ,v j ) represents the word distance between the ith word and the jth word in the syntactic dependency graph, and p is the syntactic distance threshold.

5. The method according to claim 1, characterized in that The semantic context representation vector of the emotional text is the vector output by the highest layer of the graph convolutional network, and the vector output by the tth layer of the graph convolutional network satisfies the following formula: in, is the vector output by the i′th node of the tth layer of the graph convolutional network, is the vector output by the i′th node in the t-1th layer of the graph convolutional network, is the adjacency matrix of the i′th node in the graph convolutional network, W t is the linear transformation weight matrix of the tth layer of the graph convolutional network, b t is the bias term of the tth layer of the graph convolutional network.

6. The method according to claim 1, characterized in that The emotion enhancement matrix satisfies the following formula: A=D ij ×(S ij +Z ij +1) Where A is the emotion enhancement matrix, D ij represents the dependency relationship between the i-th word and the j-th word in the syntactic dependency graph, S ij represents the sentiment degree between the i-th word and the j-th word in the syntactic dependency graph, Z ij Indicates whether the i-th word or the j-th word in the syntactic dependency graph is an aspect word.

7. The method according to claim 1, characterized in that The step of fusing the semantic context representation vector and the emotion enhancement matrix to obtain the emotion polarity of the emotion text includes: Concatenating the semantic context representation vector and the sentiment enhancement matrix to obtain a concatenated feature; Inputting the concatenated features into a multi-layer perceptron to learn features between aspect words and context in the sentiment text to obtain an output result; The output result is activated by an activation function to obtain the sentiment polarity.

8. A knowledge-integrated aspect-level network public opinion analysis device for traffic safety incidents, characterized in that: include: A feature supplementation extraction module, wherein the feature supplementation extraction module is used to generate a syntactic mask matrix of the sentiment text according to the word distance between every two words in the sentiment text in the syntactic dependency graph and the comprehensive attention matrix of the sentiment text; Inputting the syntactic mask matrix into a graph convolutional network to perform graph convolution on the syntactic mask matrix to obtain a semantic context representation vector of the sentiment text; A sentiment module, wherein the sentiment module is used to determine a sentiment enhancement matrix of the sentiment text according to a dependency relationship between every two words in the sentiment text, a sentiment score and an aspect word score; A hierarchical fusion module is used to fuse the semantic context representation vector and the sentiment enhancement matrix to obtain the sentiment polarity of the sentiment text.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the electronic device, the method according to any one of claims 1 to 7 is implemented.