Patent ID: 11868730
Assignee: JINGDONG DIGITS TECHNOLOGY HOLDING CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 9:
10. A method comprising:
receiving, by a computing device, a sentence having an aspect term and context, the aspect term having a classification label, wherein the computing device comprises a processor and a storage device storing computer executable code, and wherein the computer executable code comprises a plurality of graph diffusion transformer (GDT) layers;
converting, by the computing device, the sentence into a dependency tree graph;
calculating, by using an l-th GDT layer of the plurality of GDT layers, an attention matrix of the dependency tree graph based on one-hop attention between any two of the plurality of the nodes in the dependency tree graph;
calculating, by the computing device, graph attention diffusion from multi-hop attention between any two of the plurality of nodes in the dependency tree graph based on the attention matrix;
obtaining, by the computing device, an embedding of the dependency tree graph using the graph attention diffusion;
classifying, by the computing device, the aspect term based on the embedding of the dependency tree graph to obtain predicted classification of the aspect term;
calculating, by the computing device, a loss function based on the predicted classification of the aspect term and the classification label of the aspect term; and
adjusting, by the computing device, parameters of models in the computer executable code,
wherein the step of calculating the attention matrix comprises:
calculating an attention score si,j(l)=σ2 (v*σ1(Whhi(l)∥Wthj(l))) for nodes i and node j in the dependency tree graph, wherein Wh, Wt∈d×d and v∈2×d are learnable weights, hi(l) is a feature of node i at the l-th graph diffusion attention (GDT) layer of the plurality of GDT layers, d is a hidden dimension of hi(l), ∥ is a concatenation operation, σ1 is a ReLU activation function, and σ2 is a LeakyReLU activation function;
obtaining attention score matrix S(l) by:, S
          
            (
            l
            )
          
        
        =
        
          {
          
            
              
                
                  
                    
                      
                        s
                        
                          i
                          ,
                          j
                        
                        
                          (
                          l
                          )
                        
                      
                      ,
                    
                    ⁢
                    
                      
                    
                  
                
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    there
                    ⁢
                    
                      
                    
                    ⁢
                    is
                    ⁢
                    
                      
                    
                    ⁢
                    an
                    ⁢
                    
                      
                    
                    ⁢
                    edge
                    ⁢
                    
                      
                    
                    ⁢
                    between
                    ⁢
                    
                      
                    
                    ⁢
                    i
                    ⁢
                    
                      
                    
                    ⁢
                    and
                    ⁢
                    
                      
                    
                    ⁢
                    j
                  
                
              
              
                
                  
                    
                      -
                      ∞
                    
                    ,
                  
                
                
                  otherwise
                
              
            
            ;
          
        
      
    
    
      
        
      
    
  

calculating the attention matrix A(l) by: A(l)=softmax(S(l)).