Geometric graph neural network case recommendation method, system, device and medium

CN122570683BActive Publication Date: 2026-10-09CENT SOUTH UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611054778.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-09
Estimated Expiration
2046-07-16

AI Technical Summary

Technical Problem

[0004]本发明提出一种几何图神经网络类案推荐方法、系统、设备及介质,以解决传统大模型类案推荐算法只匹配案件文本语义相似度,而无法捕捉案件要素之间拓扑关联的问题,通过引入几何空间坐标,基于几何算子驱动图神经网络的特征按几何规则进行传递,不仅能提升类案推荐方法的结构感知能力,还能在一定程度上抑制减缓图神经网络在特征传递过程中的过平滑问题,从而整体提升类案推荐的效果

Benefits of technology

(1)本发明所提供的一种几何图神经网络类案推荐方法,通过引入几何空间坐标,基于几何算子驱动图神经网络的特征按几何规则进行传递,不仅能提升类案推荐方法的结构感知能力,还能在一定程度上抑制或减缓图神经网络在特征传递过程中的过平滑问题,从而整体提升类案推荐的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122570683B_ABST
    Figure CN122570683B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of data information processing, and specifically provides a geometric graph neural network case recommendation method, system, device and medium, which comprises the following steps: constructing an original node text data set and an original node type data set; obtaining a logical representation of a heterogeneous graph comprising a node text list, a node type list, a normalized node original feature matrix, a node quality list and an edge weight matrix; sparse modeling of a legal heterogeneous graph; gravity-oriented distribution geometric space modeling; constructing a geometric operator to drive the forward propagation and feature evolution of the graph neural network, obtaining a node geometric feature matrix; similarity matching and case recommendation, obtaining a case recommendation list. By introducing the geometric space modeling and the geometric operator driven feature transmission method of the graph neural network, the case recommendation algorithm can not only enhance the perception ability of the case element correlation structure, but also alleviate the over-smoothing problem of the graph neural network, thereby improving the overall recommendation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of discretionary supervision, artificial intelligence and data information processing technology, and relates to a geometric graph neural network case recommendation method, system, device and medium. Background Technology

[0002] Case recommendation is one of the core functions of judicial support systems. Its goal is to match historical cases with similar legal structures to the case under investigation, assisting judges in making adjudicative decisions. With the accumulation of legal big data, case recommendation methods based on large language models and graph neural networks have become a research hotspot. Large language models can capture the semantic features of case texts, but they cannot capture the topological relationships between case elements or the deep semantic information of the structured representation of case texts. Therefore, they cannot be applied to case recommendation of heterogeneous graph data composed of case elements and data based on structured text representations, thus limiting their case recommendation capabilities. Although graph neural network recommendation algorithms can capture certain topological structure information through neighborhood aggregation, their neighborhood aggregation is an unconstrained Euclidean space feature diffusion, and node features are prone to oversmoothing. Therefore, they cannot effectively distinguish the topological differences of different node data in heterogeneous graphs. Moreover, graph neural networks are limited by the scale of data computation, and their high computational complexity limits their application in case recommendation in big data scenarios, which to some extent limits their recommendation capabilities.

[0003] To address the aforementioned issues, a geometric graph neural network-based case recommendation method and system are urgently needed. This method introduces geometric space modeling based on graph structures, defines a geometric weight matrix using the gravity distribution coordinates of heterogeneous graphs, and constructs a geometric graph Laplacian matrix using this weight matrix. Then, it drives feature transmission in the graph neural network based on the geometric graph Laplacian operator, and combines Mahalanobis distance or cosine similarity of geometric features to achieve case recommendation. This method not only effectively overcomes the problems of weak structure awareness, difficulty in explicitly modeling entity relationships, and neglect of topological association patterns of legal elements in traditional large language model case recommendation algorithms, but also drives the feature transmission of the graph neural network according to geometric rules through geometric operators. To a certain extent, geometric constraints can alleviate or suppress the oversmoothing problem of graph neural network features, thus improving the overall accuracy of case recommendation. Summary of the Invention

[0004] This invention proposes a geometric graph neural network-based case recommendation method, system, device, and medium to address the problem that traditional large-model case recommendation algorithms only match the semantic similarity of case texts and cannot capture the topological relationships between case elements. By introducing geometric spatial coordinates, the features of the graph neural network driven by geometric operators are transmitted according to geometric rules. This not only improves the structural perception ability of the case recommendation method but also, to a certain extent, suppresses and mitigates the oversmoothing problem in the feature transmission process of the graph neural network, thereby improving the overall effect of case recommendation.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: The geometric graph neural network-based case recommendation method provided by this invention includes the following steps: Step 1: For each query case and all its corresponding candidate cases, construct the original node text dataset and the original node type dataset; The original node text dataset contains a query case and multiple node texts for all its corresponding candidate cases; The original node type dataset includes the type of each node, which includes, but is not limited to, case facts, legal provisions, evidence, points of contention, and concatenated text of case facts and points of contention. Semantic encoding is performed on the node text, node quality is assigned according to node type, edge weights of the heterogeneous graph are calculated, and a logical representation of the heterogeneous graph including a list of node texts, a list of node types, a normalized original feature matrix of nodes, a list of node quality, and an edge weight matrix is ​​obtained. Step 2: For a massive number of candidate cases, sparse modeling of the heterogeneous graph can be used for initial screening to narrow down the range of candidate cases and improve computational efficiency; specifically, this is based on the edge weight matrix. To achieve sparse modeling of the heterogeneous legal graph, we obtain the logical representation of the heterogeneous graph subgraphs; Step 3: Based on the logical representation of the heterogeneous graph subgraph, realize the gravity-guided distribution geometric space modeling; the gravity-guided distribution geometric space is a high-dimensional real space containing node coordinates. ,in, Represents real space, This represents the dimension of the real space, and the node coordinates are in the higher-dimensional real space. The points in the matrix are used to calculate the gravitational force between node pairs using node mass. The initial coordinates of the nodes and the gravitational force between them are used to calculate the gravity coordinates of the nodes using an iterative formula. These gravity coordinates are then arranged row-wise to form a node gravity-oriented coordinate matrix. , Row index and node quality list in the logical representation of heterogeneous graph subgraphs Edge weight matrix Original feature matrix of nodes The node indexes in the graph are in a completely consistent order, with each row representing the geometric space coordinates of the corresponding node in the heterogeneous graph subgraph; furthermore, the gravity-guided coordinate matrix is ​​used. Node coordinates and edge weight matrix The geometric weight matrix is ​​calculated. ; Step 4: Based on the gravity-guided distribution geometric space model, calculate the geometric graph Laplacian matrix. Then, using the geometric graph Laplacian operator to drive the forward propagation and feature evolution of the graph neural network, obtain the node feature matrix. ; Step 5, Similarity Matching and Case Recommendation: Case recommendation based on geometric features can be achieved through distance or similarity ranking.

[0006] Step 6: Layered mesh parameter search and test recommendation; Based on the feature propagation characteristics of geometric graph neural networks (updating without gradient backpropagation and without modifying the propagation structure), the training and optimization of model parameters are accomplished through grid parameter search, that is, the optimal parameters are selected only through hierarchical grid hyperparameter search.

[0007] As a further aspect of the present invention, the specific process for obtaining the logical representation of the heterogeneous graph is as follows: Step 1.1: Represent both the original node text dataset and the original node type dataset as lists. Different types of nodes in the same case are arranged adjacently in the order of case facts, legal provisions, evidence, points of contention, and concatenated text of case facts and points of contention. Output the original node text list and the node type list. Step 1.2: Use the SAILER model (Structure-aware Pre-trained Language Model for Legal Case Retrieval) to encode all node texts in the original node text dataset to obtain multi-dimensional semantic features of the node texts (specifically, the dimension of the semantic features can be adjusted according to the actual situation based on the large model used and the feature dimension). Step 1.3: Perform L2 normalization on the multidimensional semantic features of the node text to obtain the normalized node semantic features. ; Node semantic features The expression is as follows: ; in, Let be the global node number of the heterogeneous graph, and , The global number of nodes in the heterogeneous graph; This is the dimensional index for the semantic features of the nodes, and , This refers to the dimension of the node features; specifically, for the SAILER model... ; Step 1.4: Convert the normalized node semantic features Arranged in the order of the original node text list, they form the original node feature matrix. ,in, , It is the space of real numbers; Step 1.5: Based on the characteristics of the original node text dataset and the original node type dataset, assess the quality of each node according to its importance. After assigning values ​​to the quality of each node in the heterogeneous graph, the node qualities are arranged in the order they appeared in the original node text list to obtain the node quality list. ; Step 1.6: Calculate the edge weight matrix and the edge weight matrix The element values ​​corresponding to unrelated nodes in the matrix are set to 0, and the edge weight matrix is... The elements corresponding to the associated nodes in the table are assigned values; among them... for 3D matrix, edge weight matrix It is a symmetric matrix. The element values ​​are The semantic similarity or legal relevance strength of the intervals; Step 1.7: Construct a logical representation of a standardized legal heterogeneous graph and output a normalized original feature matrix of nodes. Node quality list Edge weight matrix The data serves as the input for step 2.

[0008] As a further aspect of the present invention, regarding the node quality of general heterogeneous graphs... The assignment rules are as follows: The quality of core legal provisions is assigned 1.5, the quality of ordinary legal provisions is assigned 1.0, the quality of case fact nodes is assigned 0.9, and the quality of evidence nodes is assigned 0.5. As a further aspect of the present invention, based on the characteristics of the LeCARD dataset (containing only two types of text: case facts and points of contention), the node quality... The assignment rules are as follows: The quality of the case fact node is assigned a value of 0.9, the quality of the dispute focus node is assigned a value of 0.7, and the quality of the spliced ​​text node of the case facts and dispute focus is assigned a value of 1. As a further aspect of the present invention, the above-mentioned node quality assignment rules are for assignment reference. In practical applications, the node quality can be assigned according to the importance of the node in combination with the actual application scenario. The assignment principle is that the quality of nodes with high importance is greater than that of nodes with low importance.

[0009] As a further aspect of the present invention, the edge weight matrix... The rules for assigning values ​​to elements corresponding to associated nodes are any of the following: ① Assignment rules for cosine similarity based on text semantic features: Specifically: Calculate the first in the heterogeneous graph The semantic features of the node text of the nth node and the nth node Cosine similarity between the semantic features of the node text of each node cosine similarity The calculation formula is as follows: ; in, This represents the original feature matrix of the nodes in the normalized form. The Middle The semantic features of the nth node dimensional semantic feature components, This represents the original feature matrix of the nodes in the normalized form. The Middle The semantic features of the nth node dimensional components, for The square of, for The square of, These are all global node numbers in the heterogeneous graph, used to traverse two different nodes, and their values ​​range from [value range missing]. , , Indicates the total number of nodes in the heterogeneous graph; and the edge weight matrix elements Defined as This is to adjust the edge weight values ​​to the [0,1] range; ② Assignment rules based on the intensity of judicial co-occurrence: If the node text of legal provisions and points of contention is category-labeled data with a limited range of types, then the edge weights between legal provisions and nodes, between legal provisions and points of contention nodes, and between points of contention nodes are assigned according to the intensity of judicial co-occurrence. elements Defined as the first in a heterogeneous graph The node and the first The intensity of judicial co-occurrence among nodes Divide by the maximum value of the judicial co-occurrence intensity among all node pairs; Judicial Co-occurrence Intensity The expression is as follows: ; in, Indicates the simultaneous occurrence of the first The node and the first The number of text cases for each node. Indicates the occurrence of the first The total number of cases for the text of each node. For the appearance of the first The total number of text cases for each node, and the edge weight matrix. elements Represents the first in the heterogeneous graph The node and the first Edge weights between nodes; ③ Assignment rules based on user settings: First, an initial edge weight matrix is ​​obtained using assignment rule ① or ②. Then, based on this initial edge weight matrix, it is modified according to user-defined rules to obtain the final edge weight matrix. The rules for modifying the initial edge weight matrix are as follows: If the user sets a uniform assignment of edge weights between a certain type of nodes: then the edge weights between that type of nodes in the initial edge weight matrix are uniformly assigned according to the user-defined rules, and the edge weight values ​​are set to zero for negative values ​​and adjusted to the [0,1] interval for positive values, resulting in the edge weight matrix. .

[0010] As a further aspect of the present invention, the specific process for constructing the logical representation of a standardized legal heterogeneous graph is as follows: The basic logical representation of a legal heterogeneous graph consists of a list of node texts, a list of node types, and an edge weight matrix. The numerical representation of heterogeneous graph nodes and edges, further enhanced by node text encoding and node quality assignment, can expand the logical representation of the legal heterogeneous graph into a list of node texts, a list of node types, and a normalized original feature matrix of nodes. Node quality list and edge weight matrix The numerical representation of a heterogeneous graph, consisting of information about its nodes and edges (the logical representation of a heterogeneous graph contains its numerical information and can be used for subsequent numerical calculations), includes the normalized original feature matrix of the nodes. Node quality list and edge weight matrix The core data for the logical representation of heterogeneous graphs is used for subsequent calculations.

[0011] As a further aspect of the present invention, the specific process of step 2 is as follows: Step 2.1: Determine whether to perform sparse modeling of the heterogeneous graph based on the number of candidate cases. The process is as follows: If the number of candidate cases is small, for example, the number of candidate cases does not exceed 30, then it is not necessary to perform edge weight filtering. The logical representation of the heterogeneous graph subgraph can be directly taken as the heterogeneous graph logical representation obtained in step 1. If the number of candidate cases exceeds 30 or the candidate case data is massive, then sparse modeling of the heterogeneous graph is required: Specifically, the edge weight matrix Perform block partitioning, i.e., edge weight matrix The matrix is ​​divided into blocks based on the case, resulting in several block matrices. ; Block matrix The expression is as follows: ; in, This is the total number of cases that include each query case and all its candidate cases; edge weight matrix Chinese Case Case Studies The corresponding submatrix, i.e. To record the case All nodes and cases A submatrix of edge weights between all nodes; The value ranges from 1 to Positive integers; Step 2.2, Calculation Case Case Studies The sum of edge weights between nodes of the same type ; Sum of edge weights The expression is as follows: ; in, edge weight submatrix The Line number Column diagonal elements, edge weight submatrix The order of (i.e., the number of node types in the heterogeneous graph); Step 2.3: Calculate the edge weight threshold And utilize edge weight threshold Sum of edge weights The present invention performs filtering; by using threshold filtering, it deletes the node information of weakly associated cases, realizes the initial screening of candidate cases and the extraction of heterogeneous graph subgraphs, and obtains the logical representation of the heterogeneous graph subgraphs.

[0012] As a further aspect of the present invention, a threshold based on quantile-side weights is provided. The rules for assigning values ​​are as follows: In the edge weight matrix In the process, a submatrix is ​​extracted between the query case and all candidate case nodes, and the trace of the extracted submatrix is ​​calculated. The traces of the submatrix are sorted in descending order, and the value of the 30th or 50th position in the sorted submatrix is ​​extracted as the edge weight threshold. .

[0013] As a further aspect of the present invention, a percentage-based edge weight threshold is used. The rules for assigning values ​​are as follows: In the edge weight matrix In the process, extract the submatrix between the query case and all candidate case nodes, and calculate the trace of the extracted submatrix. The maximum value of the trace of the submatrix is ​​denoted as [value missing]. Set the edge weight threshold Assigned value .

[0014] Further preferred, the maximum value of the trace of the submatrix The expression is as follows: ; in, To search for cases The set of all corresponding candidate cases, To query the case index, This serves as an index for candidate cases. As a further aspect of the invention, only case pairs between query cases and candidate cases are filtered, i.e., for the query case index... With candidate case index ,when Pick and Pick (i.e., submatrix) )hour, like This indicates that there are candidate cases. Query Case The correlation between them is weak, so candidate cases are removed from the heterogeneous graph. All node information, and from the original feature matrix Node quality list and edge weight matrix Remove candidate cases The corresponding data is used to obtain the logical representation of the heterogeneous graph subgraph; like Then the candidate cases are considered Query Case The relationships between them are strong, and the node information of the corresponding candidate cases is retained to obtain the logical representation of the heterogeneous graph subgraph.

[0015] As a further aspect of the present invention, the logical representation of the heterogeneous graph subgraph includes the original feature matrix of the nodes. Node quality list and edge weight matrix .

[0016] As a further aspect of the present invention, the specific process of step 3 is as follows: Step 3.1: Using the NumPy library, iteratively calculate the gravitational force and net external force between nodes using gravity-oriented coordinates until the forces reach equilibrium or the maximum number of iterations is reached, thus obtaining the gravity-oriented coordinate matrix. ; Step 3.2: Using the gravity-guided coordinate matrix and edge weight matrix The geometric weight matrix is ​​calculated by multiplying the edge weights by the Gaussian kernel. elements Geometric weight matrix The matrix describes the edge connections and geometric structure information of a heterogeneous graph, and satisfies symmetry, where, and The geometric weight matrices of the heterogeneous graph subgraphs are respectively Global row indexes and global column indexes.

[0017] As a further aspect of the present invention, a gravity-guided coordinate matrix is ​​obtained. The specific process is as follows: Based on the logical representation of the heterogeneous graph subgraph output in step 2, initialize the node coordinates. ;in, This is the global node index for the heterogeneous graph subgraph. For nodes in a heterogeneous graph subgraph The initial node coordinates, , This represents a high-dimensional normal distribution with a mean of 0, where the mean of each dimension is 0. for The order covariance matrix, where for Unit matrix of order, The dimension of the node coordinates. for A 1-dimensional vector; For the Gravity-guided node coordinates of the step Perform iterative updates; Iteration of gravity-guided node coordinates The expression is as follows: ; ; in, For the iteration step index, For the heterogeneous graph subgraph Gravity-guided node coordinates of each node The iteration step size, For nodes The resultant external force is expressed as: ;in, The first subgraph of the heterogeneous graph A set of neighbor node indices for each node. The first subgraph of the heterogeneous graph The node and the first The gravitational vector between nodes is expressed as follows: ; in, For gravitational constant, This is the distance attenuation coefficient. For the normalized edge weight matrix Quantity; The iteration terminates when the average resultant external force modulus of all nodes is less than a set threshold or the number of iterations exceeds the upper limit, yielding the gravity-guided coordinate matrix. .

[0018] As a further aspect of the present invention, the geometric weight matrix... elements The expression is as follows: ; in, For the heterogeneous graph subgraph, the first Gravity-guided node coordinates of each node For the heterogeneous graph subgraph, the first Gravity-guided node coordinates, Gaussian kernel parameters , and The geometric weight matrices of the heterogeneous graph subgraphs are respectively Global row index and global column index, geometric weight matrix of heterogeneous graph subgraphs Global row index Global first subgraph of heterogeneous graph The geometric weight matrix of each node corresponding to a heterogeneous graph subgraph Global column index Global first subgraph of heterogeneous graph Each node corresponds to one node.

[0019] As a further aspect of the present invention, the specific process of step 4 is as follows: Step 4.1: Adjust the geometric weight matrix. Normalization is performed to obtain the normalized geometric weight matrix. ; Using normalized geometric weight matrix Constructing the Laplace matrix of the geometric graph Specifically, the geometric Laplace matrix. The diagonal elements are Geometric Laplace matrix Off-diagonal elements are .

[0020] Preferred, normalized geometric weight matrix The expression is as follows: ; in, and For heterogeneous graph subgraphs including geometric weight matrices Normalized geometric weight matrix Geometric Laplace matrix All Global row index and global column index of a matrix. , The number of nodes in a heterogeneous graph subgraph; related to heterogeneous graph subgraphs. Global row index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a global column index. Global first subgraph of heterogeneous graph Each node corresponds to one of the following: Normalized geometric weight matrix The Line number Column elements, Geometric weight matrix The The sum of all elements in the row. The calculation formula is ; Geometric weight matrix The Sum of all elements in the list. The calculation formula is Normalized geometric weight matrix The Rows and Heterogeneous Graph Subgraphs Each node corresponds to a normalized geometric weight matrix. The Columns and Heterogeneous Graph Subgraphs Each node corresponds to one other node; Preferably, the geometric Laplace matrix The diagonal elements are The expression is as follows: ; in, and For heterogeneous graph subgraphs including geometric weight matrices Normalized geometric weight matrix Geometric Laplace matrix All Global row and column indices of a matrix, and related information about heterogeneous graph subgraphs. Global row index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a heterogeneous graph subgraph. Global column index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to one; Normalized geometric weight matrix The diagonal of Line number The element at the column position, and , The first subgraph representing the heterogeneous graph The set of column indices in the geometric weight matrix corresponding to all neighboring nodes of a node.

[0021] Preferably, the geometric Laplace matrix Off-diagonal elements are The expression is as follows: ; in, Normalized geometric weight matrix The Line number Column elements, The first subgraph representing the heterogeneous graph The set of column indices in the geometric weight matrix corresponding to all neighboring nodes of a node.

[0022] Step 4.2: Obtain the original feature matrix of the nodes. With gravity-guided coordinate matrix By splicing ; The expression is as follows: ; in, , , For splicing operations, Let be the dimension of the node features. The dimension of the node coordinates. for and The splicing matrix; Step 4.3: Obtain initial features of uniform dimension using the stochastic linear projection dimensionality reduction method. ; The expression is as follows: ; in, This is the initial feature matrix of the nodes in the heterogeneous graph subgraph; Let be a random projection matrix whose elements follow a uniform distribution, and elements in All are independent and identically distributed, meaning they all follow a uniform distribution. , Let be the dimension of the input features, and ; for Uniform distribution over the interval, and , , To standardize the representation of the initial feature dimension, hidden layer dimension, and first-order dimension of a geometric graph neural network (GBR), The global dimension variable is the node geometric feature dimension output by the layer, and in the calculation, the initial feature dimension, the hidden layer dimension, and the first layer dimension of the geometric graph neural network are also considered. Dimension of node geometric features output by the layer Dimension of Gravity-Guided Distribution Node Coordinates The values ​​are equal. For the row index of the random projection matrix, is the column index of the random projection matrix.

[0023] Step 4.4: Using the geometric Laplace matrix Perform feature updates to obtain the first... Layer feature matrix ; No. Layer feature matrix The simplified feature update expression is as follows: ; in, For evolutionary step size, For activation functions, you can choose ReLU, LeakyReLU, GELU, etc., and after each layer of feature update, follow the layer normalization operation; No. Layer feature matrix The optimized feature update expression is as follows: ; in, This is the regularization coefficient for gravity coordinates; other symbols remain the same as before.

[0024] Step 4.5: The features of the geometric graph neural network are driven by the geometric graph Laplacian operator, evolving according to the feature update formula. After multiple layers of feature iteration, the node feature matrix is ​​output. ,in, This represents the number of layers in the geometric graph neural network. The feature propagation characteristics of a geometric graph neural network are that it is driven by geometric operators, only outputs features through forward propagation, and does not update or modify the propagation structure through gradient backpropagation.

[0025] As a further aspect of the present invention, the similarity matching and case recommendation methods include any one of distance-based recommendation, similarity-based recommendation, and recommendation using a fusion model.

[0026] As a further embodiment, the specific method for recommending based on distance is as follows: Step 5.11, from the geometric graph neural network... Feature matrix of layer Extract query cases from each The Rows corresponding to class nodes (i.e., query case) The (Geometric feature vectors of class nodes) and candidate cases The Rows corresponding to class nodes (i.e., candidate cases) The (geometric feature vectors of class nodes), where, It is a node type, and This is an index of node type, representing any type of node such as case facts, legal provisions, evidence, points of contention, or a concatenated text of case facts and points of contention. The number of node types (consistent with the dimension of the submatrix of the block matrix in step 2); Step 5.12: Calculate the query case The Geometric feature vectors of class nodes With candidate cases The Geometric feature vectors of class nodes Mahalanobis distance between (i.e., approximate geodesic distance); Mahalanobis distance The expression is as follows: ; Where trans denotes the transpose of the matrix, The output feature matrix of a geometric graph neural network The covariance matrix (which describes local geometric structure information), let... The Line number Column elements are ; The Line number Column elements are The expression is as follows: ; ; ; in, For the first The mean of the dimensional features, For the first The mean of the dimensional features, The output geometric feature matrix of the geometric graph neural network The Middle The first row feature dimensional element, The output geometric feature matrix of the geometric graph neural network The Middle The first row feature dimensional elements, The number of nodes in the heterogeneous graph subgraph. The Rows and geometric feature matrices The first in Corresponding to the dimensional features, The Columns and geometric feature matrices The first in Corresponding to dimensional features; Step 5.13: Repeat step 5.12 to obtain the query case. and candidate cases Mahalanobis distances between various types of nodes; then, for the query case... With candidate cases The average Mahalanobis distances between various types of nodes are used to obtain the query cases. With candidate cases The average Mahalanobis distance between various types of nodes ; Mean Mahalanobis distance The expression is as follows: ; Step 5.14: Review candidate cases According to the average Mahalanobis distance Sort the candidate cases in ascending order to obtain the candidate cases. A list of sorted items; Based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

[0027] Preferably, the threshold It can be taken as 5, 10, 20, 30, etc.

[0028] As a further aspect of the present invention, the specific process of recommending based on similarity is as follows: Step 5.21, from the geometric graph neural network... Layer feature matrix Extract query cases and candidate cases Geometric features of nodes are used to extract query cases. The Rows corresponding to class nodes (i.e., query case) The (Geometric feature vectors of class nodes) and candidate cases The Rows corresponding to class nodes (i.e., candidate cases) The (geometric feature vectors of class nodes), where, It is a node type, and This is an index of node type, representing any type of node such as case facts, legal provisions, evidence, points of contention, or a concatenated text of case facts and points of contention. The number of node types (consistent with the dimension of the submatrix of the block matrix in step two); Step 5.22: Calculate the query case The Geometric feature vectors of class nodes With candidate cases The Geometric feature vectors of class nodes Geometric feature cosine similarity between ; Cosine similarity The expression is as follows: ; in, For feature vectors The dimensional components, For feature vectors The dimensional components, The geometric dimension; Step 5.23: Repeat step 5.22 to obtain the query case. and candidate cases The geometric feature cosine similarity between various types of nodes; For query cases With candidate cases The average of the geometric feature cosine similarity between various nodes is used to obtain the query cases. With candidate cases Geometric feature mean cosine similarity between various types of nodes ; Cosine similarity The expression is as follows: ; Step 5.24: Review candidate cases According to cosine similarity Sort the candidate cases in descending order to obtain the candidate cases. Arrange in a list; Based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

[0029] Preferably, the threshold It can be taken as 5, 10, 20, 30, etc.

[0030] As a further solution in this embodiment, the specific process of using the fusion model for recommendation is as follows: Step 5.31, from the geometric graph neural network... Layer feature matrix Extract query cases and candidate cases Geometric features of nodes are used to extract query cases. The Rows corresponding to class nodes and candidate cases The Rows corresponding to class nodes ,in, It is a node type, and This is an index of node type, representing any type of node such as case facts, legal provisions, evidence, points of contention, or a concatenated text of case facts and points of contention. The number of node types; From the original feature matrix of the nodes Extract query cases and candidate cases Semantic features of nodes are used to extract query cases. The Original semantic features of class nodes and candidate cases The Original semantic features of class nodes ,in, It is a node type, and This is an index of node type, representing any type of node such as case facts, legal provisions, evidence, points of contention, or a concatenated text of case facts and points of contention. The number of node types; Step 5.32: Calculate the geometric eigenvectors respectively. and geometric eigenvectors Geometric feature cosine similarity between and original semantic features and original semantic features Cosine similarity of semantic features between ; Geometric feature cosine similarity The expression is as follows: ; in, For feature vectors The dimensional components, For feature vectors The dimensional components, The geometric dimension; Semantic feature cosine similarity The expression is as follows: ; in, For feature vectors The dimensional components, For feature vectors The dimensional components, The dimension of the semantic features; Step 5.33: Repeat step 5.32 to obtain the query case. and candidate cases The geometric feature cosine similarity between the geometric feature vectors of all types of nodes and the semantic feature cosine similarity between all original semantic features; For query cases With candidate cases The average of the geometric feature cosine similarity between various nodes is used to obtain the query cases. and candidate cases Geometric eigenvector mean cosine similarity ; For query cases With candidate cases The average of the cosine similarity of the original semantic features among various nodes is used to obtain the query cases. and candidate cases The average cosine similarity of the original semantic feature vectors ; Geometric eigenvector mean cosine similarity The expression is as follows: ; Mean cosine similarity of original semantic feature vectors The expression is as follows: ; Step 5.34: Utilize the fusion weights of the geometric graph neural network (In this embodiment, )right and We perform weighted similarity calculations to obtain weighted similarity scores. ; Weighted similarity The expression is as follows: ; Step 5.35: Review candidate cases According to weighted similarity Sort the candidate cases in descending order to obtain the candidate cases. A list of sorted items; Based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

[0031] As a further aspect of the present invention, the specific process of step 6 is as follows: Step 6.1: Construct a hyperparameter mesh covering geometric space modeling, feature evolution, recommendation matching modules, and model fusion weights. The parameters for geometric space modeling include the gravitational constant. Distance attenuation coefficient and node coordinate dimension ; The parameters of feature evolution include the evolution step size. Gravity coordinate canonical coefficient Number of layers in a geometric graph neural network ; The parameters for the recommended matching module include query cases. With candidate cases Geometric feature vectors of various nodes and Matching methods (Mahanobis distance, Euclidean distance, cosine similarity, vector dot product), and Top-K thresholding. ; The parameters of the model fusion weights include the fusion weights of the geometric graph neural network. .

[0032] Preferred, gravitational constant The range of values ​​for is: ; Distance attenuation coefficient The range of values ​​for is: ; Node coordinate dimension The range of values ​​for is: ; evolution step size The range of values ​​for is: ; Gravity coordinate canonical coefficient The range of values ​​for is: ; Number of layers in a geometric graph neural network The range of values ​​for is: ; Match type: ; Top-K threshold The range of values ​​is: ; Among them, the initial feature dimension, the hidden layer dimension, and the first dimension of the geometric graph neural network. Dimension of node geometric features output by the layer Dimension of node coordinates The values ​​are equal.

[0033] If a fusion model is used for recommendation, then the weights of the geometric graph neural network... It also participates in the mesh parameter search and the fusion weights of the geometric graph neural network. The recommended value range is: That is, weight values ​​are taken at equal intervals of 0.05. The value range can also be optimized based on the data type of the recommendation task. For example, the LeCARD dataset is plain text data, not heterogeneous graph or structured text data. Such datasets, dominated by semantic similarity of plain text, are more advantageous in recommendation tasks. In this case, the fusion weights of the geometric graph neural network... The range of values ​​should be narrowed; for example, when searching for grid parameters, a range of values ​​could be used. This not only reduces the amount of computation but also better reflects the advantages of the model.

[0034] Step 6.2: Use a two-step hierarchical search strategy to optimize hyperparameters; The specific method is as follows: Step 6.2.1: Fix the weight parameters of feature evolution, recommendation matching and model fusion. On the training set, with the Calinski-Harabasz index as the objective function, execute the forward inference process of geometric space modeling, feature evolution and case recommendation in steps 3 to 5. The optimal geometric space modeling parameters are selected by maximizing the Calinski-Harabasz index. Specifically, in this embodiment, the Calinski-Harabasz index is calculated by calling the calinski_harabasz_score function in the sklearn.metrics package.

[0035] A further preferred expression for the Calinski-Harabasz exponent is as follows: ; ; ; in, It is the trace of the intra-cluster deviation matrix (i.e., the sum of squared distances from all intra-cluster samples to their cluster centers); It is the trace of the inter-class deviation matrix (i.e., the weighted sum of squared distances from each cluster center to the global center). It is a cluster The number of samples; It is a cluster The center of all samples, This represents the total number of samples (consistent with the number of nodes in the heterogeneous graph subgraph and the number of rows in the original feature matrix of the nodes in the heterogeneous graph subgraph mentioned earlier). for The number of clusters formed by clustering a sample.

[0036] Step 6.2.2: Fix the optimal geometric space modeling parameters. On the training set, with the normalized cumulative gain NDCG@K, a core indicator in the field of case recommendation, as the objective function, execute the geometric space modeling, feature evolution, and case recommendation forward inference process from Step 3 to Step 5. Maximize NDCG@K to select the optimal feature evolution, recommendation matching, and model fusion weight parameters.

[0037] Preferred, The expression is as follows: ; ; ; in, For the first The relevance labels of each recommendation result. For the ideal sorting, the first The relevance labels of each recommendation result. For the total number of truly relevant items, when Take all real and relevant items at that time. Take the previous time One related item.

[0038] Step 6.3: Using the optimal parameter combination obtained by the hierarchical grid parameter search, execute the complete forward reasoning process of geometric space modeling, feature evolution and case recommendation from Step 3 to Step 5 on the test set, and output the Top-K case recommendation list.

[0039] As a further aspect of the present invention, the present invention also provides a geometric graph neural network-based case recommendation system, comprising: Heterogeneous graph preprocessing module: completes the generation and standardization of logical representation data of legal heterogeneous graphs; Heterogeneous graph sparse modeling: For a massive number of candidate cases, the edge weight matrix of the heterogeneous graph is divided into blocks, and threshold filtering and initial screening of cases are performed based on the trace of the edge weight submatrix of the query and candidate cases. Candidate case nodes that are weakly associated with the query case are deleted to improve the computational efficiency of class case recommendation; subgraphs of the heterogeneous graph are extracted and the original feature matrix of nodes, node quality list and edge weight matrix are updated. Gravity-guided distribution geometric space modeling module: Iteratively calculates the gravitational forces and coordinates between nodes, and outputs the gravity-guided coordinate matrix and geometric weight matrix; Geometric graph neural network feature evolution module: Constructs the geometric graph Laplacian matrix, uses the random linear projection method to fuse the original features of the nodes with the node coordinates, and drives the feature evolution of the geometric graph neural network based on the geometric graph Laplacian operator, outputting the geometric graph Laplacian matrix and geometric feature matrix; The case recommendation module calculates the distance or similarity between cases and sorts candidate cases in ascending order of distance or descending order of similarity, outputting a Top-K candidate case list. It uses a geometric graph neural network and large model features to perform weighted fusion at the similarity level, and integrates the node geometric features and semantic features of heterogeneous graphs to achieve case recommendation based on a fusion model with both structural awareness and semantic dimensions.

[0040] The grid parameter search optimization and test recommendation module performs hierarchical network parameter search on the training set, using the Calinski-Harabasz index and the core metric for case recommendation, NDCG@K, as objective functions. It executes the forward inference process from step 3 to step 5, extracts the optimal parameter combination through hierarchical grid parameter search, and uses the optimal parameter combination to perform case recommendation on an independent test set, outputting Top-K recommended cases.

[0041] As a further aspect of the present invention, the present invention also provides an electronic device, including a memory, one or more processors, and one or more programs stored in the memory, said one or more programs including instructions for executing the geometric graph neural network case recommendation method as described above.

[0042] As a further aspect of the present invention, the present invention also provides a storage medium including one or more programs executable by one or more processors of a device, the one or more programs including instructions for performing the geometric graph neural network case recommendation method as described above.

[0043] Compared with the prior art, the present invention has the following beneficial effects: (1) The geometric graph neural network case recommendation method provided by the present invention introduces geometric space coordinates and drives the features of the graph neural network to be transmitted according to geometric rules based on geometric operators. This not only improves the structural perception ability of the case recommendation method, but also suppresses or alleviates the over-smoothing problem of the graph neural network in the feature transmission process to a certain extent, thereby improving the overall effect of case recommendation.

[0044] (2) The perception of legal relationship structure is realized through geometric modeling, which makes up for the shortcomings of traditional case recommendation algorithms based on large language models that cannot capture the relationship structure of legal elements: This invention uses geometric space modeling based on gravity-oriented distribution to arrange the nodes of the legal heterogeneous graph according to gravity distribution, and realizes the association aggregation between legal elements based on gravity. The geometric weight matrix is ​​used to construct the geometric graph Laplace matrix, and then realizes the feature evolution of graph neural network driven by geometric operators. The output features can capture the semantic and legal relationship between nodes, realize the perception function of graph structure, and make up for the shortcomings of large model case recommendation algorithms that can only capture the semantics of case text but ignore the relationship structure of legal elements.

[0045] (3) By driving the geometric operator to aggregate the features of the constrained graph neural network according to geometric rules, the problem of oversmoothing of graph neural network features can be alleviated: In the feature evolution module of the geometric graph neural network, the node features of the heterogeneous graph are driven to propagate forward by the geometric graph Laplacian operator. The node feature propagation is not the neighborhood aggregation of the traditional graph neural network, but is aggregated under geometric constraints. Therefore, it can alleviate or suppress the problem of oversmoothing of graph neural network features to a certain extent, improve the feature discrimination, and help improve the performance of case recommendation.

[0046] (4) The fusion model of large language model and geometric graph neural network can realize dual information mining of semantic-legal element association, which can effectively improve the accuracy of case recommendation: The semantic features output by the legal pre-trained model and the structurally perceptual geometric features output by the geometric graph neural network are fused at the similarity level. The similarity between cases can be mined from the dual dimensions of semantic and legal element association structure, which helps to improve the structural perception ability and recommendation performance of the case recommendation algorithm and improve the interpretability of the recommendation results. In the embodiment, the LeCARD public dataset in the field of case recommendation was tested. The core case recommendation indicators of the fusion model of legal pre-trained model and geometric graph neural network are all better than those of pure large language model and baseline models such as BM25 and TF-IDF.

[0047] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description

[0048] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart illustrating a geometric graph neural network-based case recommendation method according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram showing the connection of each step in a geometric graph neural network case recommendation method according to Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the gravity-guided distribution geometry of the heterogeneous graph constructed in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the framework of a geometric graph neural network case recommendation system in Embodiment 4 of the present invention. Detailed Implementation

[0049] To make the above-mentioned objects, features, and advantages of the present invention clearer and easier to understand, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the accompanying drawings of the present invention are all in a simplified form and use non-precise proportions, and are only used to facilitate and clearly assist in illustrating the implementation of the present invention.

[0050] Example 1: This embodiment provides a geometric graph neural network-based case recommendation method, which can be applied to similar case recommendation for various types of cases based on text and graph structure data, as well as other recommendation tasks based on text and graph structure data.

[0051] This embodiment's case data includes 1 query case and 9 candidate cases, totaling 10 cases. The corresponding heterogeneous graph data contains 30 nodes, with 10 nodes each for case nodes, legal provision nodes, and evidence nodes. Mahalanobis distance based on the output features of the geometric graph neural network is used for case recommendation, and NDCG@5 is used to quantify the recommendation effect. This embodiment uses a fixed parameter combination (gravitational constant). Distance attenuation coefficient Dimension of node coordinates Number of layers in a geometric graph neural network Distance type: Mahalanobis distance, gravity coordinate regularization coefficient Evolutionary step size The Top-5 recommended case result for this type of case is NDCG@5=1 (see Table 1). See also... Figures 1 to 3 As shown, it mainly includes the following steps: Step 1: Heterogeneous graph preprocessing; The specific process is as follows: Step 1.1: Collect a heterogeneous graph original node text dataset and node type dataset containing 10 nodes each of case nodes, legal provision nodes, and evidence nodes.

[0052] Step 1.2: Arrange different types of nodes in the same case in the order of case facts, legal provisions, evidence, points of contention, and spliced ​​text of case facts and points of contention, and output the original node text list and node type list; The SAILER model is used to encode the node text in the original text dataset to obtain 768-dimensional semantic features of the node text (the large model and feature dimensions used can be adjusted according to the actual situation); The node semantic features are subjected to L2 normalization to obtain the normalized node semantic features; The L2-normalized node semantic features are arranged in order according to the original node text list to form the original node feature matrix. ; Based on the characteristics of the original node text dataset and node type dataset, node quality is evaluated according to node importance. Assign a value using any of the following rules: ① The general rules for assigning node quality values ​​to heterogeneous graphs are as follows: core legal provisions nodes are assigned a quality value of 1.5, ordinary legal provisions nodes are assigned a quality value of 1.0, case fact nodes are assigned a quality value of 0.8, and evidence nodes are assigned a quality value of 0.5. ② Based on the characteristics of the LeCARD dataset (containing only two types of text: case facts and disputed points), the node quality can be assigned according to the following rules: the quality of case fact nodes is assigned 0.9, the quality of disputed point nodes is assigned 0.7, and the quality of spliced ​​text nodes of case facts and disputed points is assigned 1.

[0053] Step 1.3: Calculate the edge weight matrix Specifically, the edge weight matrix It is a symmetric matrix. The element values ​​are taken as semantic similarity or legal association strength between nodes in the heterogeneous graph, and the values ​​are adjusted to the interval [0,1]. The element value corresponding to unrelated nodes is 0. The edge weight matrix is... The assignment rules are as follows: ① The assignment rule of cosine similarity based on text semantic features: If the node text is the case long text data, the edge weight is assigned according to the cosine similarity of the text semantic features, and the cosine similarity value is adjusted to the range of [0,1]. ② Assignment rules based on the intensity of judicial co-occurrence: If the node text of legal provisions and points of contention is category label data with limited types, then the edge weights between legal provisions and nodes, between legal provisions and points of contention nodes, and between points of contention nodes are assigned according to the intensity of judicial co-occurrence. ③ Assign values ​​based on user-input assignment rules, specifically as follows: If the user sets a uniform assignment for edge weights between a certain type of nodes: then the edge weights between that type of nodes in the initial edge weight matrix will be uniformly assigned according to the user-defined rules. The user-defined assignment requirements are within the range [0,1]. Negative values ​​will be set to zero, and edge weights exceeding 1 will be normalized to the range [0,1] by dividing by the maximum edge weight value in the matrix, thus obtaining the edge weight matrix. .

[0054] Step 1.4: Construct the logical representation of the standardized heterogeneous graph. The logical representation of the legal heterogeneous graph includes a list of node texts, a list of node types, and a normalized original feature matrix of nodes. Node quality list and edge weight matrix Among them, the normalized original feature matrix of the nodes Node quality list and edge weight matrix The core data for the logical representation of heterogeneous graphs is used for subsequent calculations.

[0055] Step 2: For a massive number of candidate cases, sparse modeling of the heterogeneous graph can be used for initial screening to narrow down the range of candidate cases and improve computational efficiency. Therefore, this application designs a method based on the edge weight matrix. The specific process for achieving sparse modeling of legal heterogeneous graphs is as follows: Step 2.1: Determine whether to perform sparse modeling of the heterogeneous graph based on the number of candidate cases. The process is as follows: If the number of candidate cases is small, for example, the number of candidate cases does not exceed 30, then it is not necessary to perform edge weight filtering. The logical representation of the heterogeneous graph subgraph can be directly taken as the heterogeneous graph logical representation obtained in step 1. If the number of candidate cases exceeds 30 or the candidate case data is massive, then sparse modeling of the heterogeneous graph is required: The specific process of sparse modeling of heterogeneous graphs is as follows: edge weight matrix Perform block partitioning (i.e., edge weight matrix) (Divide the matrix into blocks using cases as units) to obtain the block matrix. ; Step 2.2: Calculate the query case With candidate cases Corresponding edge weight submatrix traces , submatrix The Line number Column diagonal elements, edge weight submatrix The order of the graph (i.e., the number of node types in the heterogeneous graph). Representative query case With candidate cases The sum of edge weights between nodes of the same type; Step 2.3: Apply the following method to the edge weight threshold. Assign a value: The assignment rule based on quantiles: in the edge weight matrix In the process, a submatrix is ​​extracted between the query case and all candidate case nodes, and the trace of the extracted submatrix is ​​calculated. The traces of the submatrix are sorted in descending order, and the value of the 30th or 50th position in the sorted submatrix is ​​extracted as the edge weight threshold. ; Percentage-based assignment rules: in the edge weight matrix In the process, extract the submatrix between the query case and all candidate case nodes, and calculate the trace of the extracted submatrix. The maximum value of the trace of the submatrix is ​​denoted as [value missing]. Set the edge weight threshold Assigned value .

[0056] Using the threshold set by the system right Perform filtering; like This indicates that there are candidate cases. Query Case The correlation between them is weak, so candidate cases are removed from the heterogeneous graph. All node information, and from the original feature matrix Node quality list Candidate cases are removed from the edge weight matrix. The corresponding data; like Then the candidate cases are considered Query Case The relationships between them are strong, and the node information of the corresponding candidate cases is retained.

[0057] This invention uses threshold filtering to remove node information from weakly associated cases, achieving initial screening of candidate cases and extraction of heterogeneous graph subgraphs. It obtains the logical representation of the heterogeneous graph subgraphs, which includes the original feature matrix of the nodes. Node quality list and edge weight matrix .

[0058] Step 3: Based on the heterogeneous graph subgraph output in Step 2, initialize the node coordinates. ; coordinates of gravity-guided nodes Perform iterative updates; The gravity-orientation coordinates of the nodes are calculated iteratively until the average resultant external force modulus of all nodes is less than a set threshold or the number of iterations reaches the upper limit, thus obtaining the gravity-orientation coordinate matrix. Specifically, a three-dimensional spatial diagram of the heterogeneous graph's gravity distribution geometry is shown below. Figure 3 As shown (the actual gravity distribution geometry in this embodiment is 128-dimensional), it embodies the legal clustering based on node importance (node ​​quality) and inter-node association (edge ​​weight); Specifically, the iteration termination condition is set as follows: The average resultant external force modulus of all nodes is less than the threshold. (The threshold value can be adjusted according to the specific data) or the number of iterations exceeds the upper limit.

[0059] Calculate the geometric weight matrix Assume that the nodes in the heterogeneous graph subgraph are distributed in a high-dimensional geometric space according to gravity, and use the final gravity-oriented coordinate matrix. and edge weight matrix Calculate the geometric weight matrix Geometric weight matrix Describes the local geometry of a subgraph of a heterogeneous graph, and this matrix satisfies symmetry.

[0060] Step 4: Adjust the geometric weight matrix Normalization is performed to obtain the normalized geometric weight matrix. ; Using the normalized geometric weight matrix Constructing the Laplace matrix of the geometric graph ; The original feature matrix of the node is obtained by concatenating it with the gravity orientation coordinate matrix. Furthermore, the initial feature matrix of uniform dimension is obtained by using the stochastic linear projection dimensionality reduction method. ; With the initial characteristic matrix As input features for geometric graph neural networks, the geometric graph Laplacian matrix is ​​used. Perform feature updates to obtain the first... Layer feature matrix ; No. Layer feature matrix The simplified feature update expression is as follows: ; in, For evolutionary step size, For activation functions, you can choose ReLU, LeakyReLU, GELU, etc., and after each layer of feature update, follow the layer normalization operation; No. Layer feature matrix The optimized feature update expression is as follows: ; The features of a geometric graph neural network driven by the geometric graph Laplacian operator evolve according to the feature update formula of the geometric graph neural network, and output the node feature matrix after multiple feature iterations. , This represents the number of layers in the geometric graph neural network. The feature propagation characteristics of a geometric graph neural network are that it is driven by geometric operators, only outputs features through forward propagation, and does not update or modify the propagation structure through gradient backpropagation.

[0061] Step 5: Case recommendation based on geometric features can be achieved through distance ranking.

[0062] Recommended by distance: For query examples and candidate cases The geometric graph neural network output from step 4 Layer feature matrix Extract query cases from the middle. The Class nodes and candidate cases The Rows corresponding to class nodes and (referred to as geometric eigenvectors), calculate geometric eigenvectors and The distance between them. and Distance between The distance can be calculated using Mahalanobis distance (approximate geodesic distance), cosine distance, or Euclidean distance; for the query case... With candidate cases The average Mahalanobis distances between various types of nodes are used to obtain the query cases. With candidate cases The average Mahalanobis distance between various types of nodes ; During the sorting process, candidate cases Mean Mahalanobis distance Sort the cases in ascending order. For the system-defined Top-K threshold K, extract the top K candidate cases as the recommendation results and output the Top-K recommended case list. The recommendation parameter K can be 5. Calculate the normalized depreciation cumulative gain NDCG@K to measure the recommendation effect, where: ; ; ; For the first The relevance labels of each recommendation result. For the ideal sorting, the first The relevance labels of each recommendation result For the total number of truly relevant items, when Take all real and relevant items at that time. Take the first K relevant terms.

[0063] Example 2: This embodiment contains 100 cases: 10 query cases and 90 candidate cases. Each query case corresponds to 9 candidate cases. The heterogeneous graph corresponding to the case data contains 300 nodes, including 100 nodes each for case facts, legal provisions, and evidence. The Mahalanobis distance of the output features from the geometric graph neural network is used for case recommendation, and NDCG@5 is used to quantify the recommendation results. This embodiment conducted two experiments. The first experiment did not divide the training and test sets, and did not perform the grid parameter search in step 6. For all heterogeneous graph data, a fixed parameter combination (gravitational constant) was used. Distance attenuation coefficient Dimension of node coordinates Number of layers in a geometric graph neural network Distance type: Mahalanobis distance, gravity coordinate regularization coefficient Evolutionary step size The first experiment involved executing the forward inference process of steps 1-5, using Mahalanobis distance to recommend the Top-5 cases. The Top-5 case recommendation result for the overall data was NDCG@5 = 0.9468 (see Table 1). The second experiment involved randomly partitioning the case data into training and test sets (the ratio of training to test set data was 7:3), executing the entire process of steps 1-6, optimizing the grid parameters, and calculating the normalized cumulative gain NDCG@5. This experiment conducted a total of 5 independent random trials (5 random partitions of training and test sets). The NDCG@5 values ​​of the 5 independent random trials were 0.8543, 0.8372, 0.9109, 0.8567, and 0.8385, respectively, and the average NDCG@5 of the 5 independent random trials was 0.8595 (see Table 2).

[0064] Specifically, the detailed steps for steps 1-5 are described in Example 1.

[0065] Step 6, Hierarchical Grid Parameter Search Optimization and Testing Recommendation: The training and optimization of model hyperparameters are accomplished through grid hyperparameter search, that is, the optimal parameters for the process are selected through hierarchical grid hyperparameter search.

[0066] Hierarchical mesh hyperparameter search: (1) Construct a hyperparameter mesh covering geometric space modeling, feature evolution, and recommendation matching, where the suggested range of values ​​for geometric space modeling parameters is: gravitational constant {0.01, 0.05, 0.1, 0.2}, Distance attenuation coefficient : {1.0, 1.5, 2.0, 2.5}, Node coordinate dimension The suggested range for the feature evolution parameters is {64, 128, 256, 512}, where the evolution step size is [missing value]. : {0.005, 0.01, 0.05, 0.1}, Gravity coordinate regularization coefficient {0.1, 0.3, 0.5, 0.7}, Number of layers in a geometric graph neural network : {2, 3, 4, 5}, the recommended range of values ​​for the matching parameters is: distance type: {Mahathir's distance, cosine distance, Euclidean distance}.

[0067] A two-step hierarchical search strategy is used to optimize hyperparameters; The first step is to fix the feature evolution and recommend matching parameters, and then use the Calinski-Harabasz index to select the optimal geometric space modeling parameters on the training set. The second step is to fix the optimal geometric space modeling parameters and then, on the training set, maximize the core recommendation metrics such as Normalized Decay Cumulative Gain (NDCG@K) to select the optimal feature evolution and recommend matching parameters. In the second step of the hierarchical grid parameter search: feature evolution and optimization of recommendation matching parameters, the objective function NDCG@K can be replaced with other core indicators in the field of case recommendation, such as F1 score, accuracy Acc@K, mean reciprocal ranking (MRR), mean precision (MAP), etc., according to actual needs.

[0068] Test Recommendation: Fix the optimal hyperparameter combination, and execute the geometric space modeling, feature evolution and case recommendation forward reasoning process of steps 3 to 5 on an independent test set. The feature evolution and similarity calculation are completed only based on the fixed geometric weight matrix and geometric graph Laplacian matrix, and case recommendation is performed.

[0069] Example 3: This example uses the LeCARD public dataset for class case recommendation, which contains 107 query cases and 100 candidate cases for each query case. Since each case in the LeCARD dataset only contains factual and issue text, this example utilizes the factual, issue text, and cross-text of the factual and issue texts to construct a heterogeneous graph containing three types of nodes. The SAILER model, commonly used in class case recommendation, is employed for node text encoding, and cosine similarity is adjusted to the [0, 1] interval as edge weights. This example uses sparse modeling of the heterogeneous graph, considering both text semantics and the similarity of the heterogeneous graph's geometric structure. A fusion model combining a geometric graph neural network and a legal pre-trained model is used for class case recommendation. Table 3 lists the recommendation accuracy of the fusion model of the SAILER model and the geometric graph neural network, the pure SAILER model, and the baseline models of class case recommendation based on Jieba segmentation (BM25 and TF-IDF). Experimental results show that the fusion model of legal pre-trained model and geometric graph neural network has the best recommendation effect, and its NDCG@5, NDCG@10 and NDCG@30 indicators are better than the pure legal pre-trained model and the baseline model.

[0070] This embodiment conducted two experiments. The first experiment: without dividing the training and test sets, only fixed parameters were used, executing the forward inference process of steps 1-5, omitting the grid parameter search in step 6. A fusion model of the SAILER model and a geometric graph neural network was adopted, using the cosine similarity of the fusion model for Top-K case recommendations. K can take values ​​of 5, 10, or 30. The Top-K case recommendation results of the fusion model (see Table 3) and the parameter combinations are as follows: Top-5 recommendation: NDCG@5=0.7572; Parameter combination: gravitational constant Distance attenuation coefficient Dimension of node coordinates Number of layers in a geometric graph neural network Matching type: cosine similarity, gravity coordinate regularization coefficient Evolutionary step size Fusion weights of geometric graph neural networks ; Top-10 recommendation: NDCG@10=0.7653; Parameter combination: gravitational constant Distance attenuation coefficient Dimension of node coordinates Number of layers in a geometric graph neural network Matching type: cosine similarity, gravity coordinate regularization coefficient Evolutionary step size Fusion weights of geometric graph neural networks ; Top-30 recommendation: NDCG@30=0.7621, parameter combination: gravitational constant. Distance attenuation coefficient Dimension of node coordinates Number of layers in a geometric graph neural network Matching type: cosine similarity, gravity coordinate regularization coefficient Evolutionary step size Fusion weights of geometric graph neural networks ); The second experiment involved randomly partitioning the data into training and test sets (with a 4:1 ratio). Steps 1-6 were executed, and grid parameter search optimization was performed. The normalized cumulative gain (NDCG@30) was calculated. Three independent randomized trials were conducted (each with a separate training and test set). The NDCG@30 values ​​for the three trials were 0.7920, 0.7815, and 0.8027, respectively, with an average NDCG@30 of 0.7921 (see Table 2). The experimental results of the fusion model were all higher than those of the pure SAILER model and other baseline models in terms of case recommendation.

[0071] Specifically, the specific steps for steps 1-4 are described in Example 1.

[0072] Step 5: Case recommendation based on geometric and semantic features is achieved by similarity ranking of the fusion model.

[0073] Fusion model recommendation: for query cases and candidate cases The geometric graph neural network output from step 4 Layer feature matrix Extract query cases from the middle. With candidate cases The The row where the class node is located and The original feature matrix of the nodes output from step 2 Extract query cases from the middle. and candidate cases The The row where the class node is located and (i.e., the original semantic features of the node text); calculate respectively and Geometric feature cosine similarity between ,as well as and Cosine similarity of semantic features between ; Traversal query case and candidate cases All node types, respectively for and Take the average to get and ; Using the fusion weights of geometric graph neural networks right and We perform weighted similarity calculations to obtain weighted similarity scores. ; Candidate cases are ranked by weighted similarity Sort the candidate cases in descending order. Based on the Top-K threshold K set by the system, take the top K candidate cases as the recommendation results and output the Top-K case recommendation list. K can be 5, 10, 30, etc.

[0074] Step 6: Layered mesh parameter search optimization and testing recommendations: (1) Construct a hyperparameter mesh covering geometric space modeling, feature evolution, recommendation matching, and fusion models. The suggested range of values ​​for the geometric space modeling parameters is: gravitational constant. {0.01, 0.05, 0.1, 0.2}, Distance attenuation coefficient : {1.0, 1.5, 2.0, 2.5}, Node coordinate dimension The suggested range of values ​​for the feature evolution parameters is {64, 128, 256, 512}, where the evolution step size is [missing value]. : {0.005, 0.01, 0.05, 0.1}, Gravity coordinate regularization coefficient {0.1, 0.3, 0.5, 0.7}, Number of layers in a geometric graph neural network {2, 3, 4, 5}, the suggested value range for the recommended matching parameters is: Matching type: cosine similarity, Top-K threshold K: 30, fusion weights of the geometric graph neural network. The recommended value range is That is, weight values ​​with equal intervals of 0.05.

[0075] (2) A two-step hierarchical search strategy is adopted to optimize hyperparameters; The first step is to fix the feature evolution, recommend matching parameters and model fusion weights, and select the optimal geometric space modeling parameters on the training set using the Calinski-Harabasz index; The second step involves fixing the optimal geometric space modeling parameters and then, on the training set, maximizing core recommendation metrics such as Normalized Diminished Cumulative Gain (NDCG@K) to select the optimal feature evolution, recommendation matching parameters, and model fusion weights. In the second step of the hierarchical grid parameter search: the optimization of feature evolution, recommendation matching and model fusion weight parameters, the objective function NDCG@K can be replaced with other core indicators in the field of case recommendation, such as F1 score, accuracy Acc@K, mean reciprocal ranking (MRR), mean precision (MAP), etc., according to actual needs.

[0076] Test Recommendation: Fix the optimal hyperparameter combination, and execute the geometric space modeling, feature evolution and case recommendation forward reasoning process of steps 3 to 5 on an independent test set. The feature evolution and similarity calculation are completed only based on the fixed geometric weight matrix and geometric graph Laplacian matrix, and case recommendation is performed.

[0077] This invention uses three sets of legal case datasets to verify the geometric graph neural network case recommendation method. Examples 1-3 include datasets of small, medium and large sizes, covering application scenarios of heterogeneous graphs, public datasets of case retrieval, and plain text data, as well as case recommendation based on fixed parameters (steps 1-5) and parameter-optimized case recommendation methods based on grid parameter search (steps 1-6).

[0078] As shown in Tables 1, 2, and 3, the experimental results demonstrate that the geometric graph neural network-based case recommendation method provided in this invention exhibits superior performance in case recommendation tasks. The fusion model of the legal pre-trained model and the geometric graph neural network effectively captures semantic-topological dual-dimensional information to achieve structural awareness of legal element associations, improving the accuracy of case retrieval. The NDCG@K (K=5,10,30) index of the fusion model outperforms the case recommendation accuracy of the pure legal pre-trained model and the baseline model. In the application of pure text case recommendation, this invention can also structurally represent case texts through named entity recognition and relation extraction, legal case element extraction, etc., transforming them into a graph form, assigning node quality values ​​based on node importance, and applying the geometric graph neural network-based case recommendation method to achieve case recommendation of text data.

[0079] Table 1: Examples of recommendation performance of the geometric graph neural network case recommendation method on datasets of different sizes (without grid parameter search, only steps 1-5 are performed).

[0080]

[0081] Table 2: Examples of recommendation performance of the geometric graph neural network case recommendation method on datasets of different sizes (including grid parameter search, execution steps 1-6).

[0082]

[0083] Table 3: Comparison examples of various case recommendation methods on the LeCARD dataset.

[0084]

[0085] This invention focuses on a legal case recommendation method based on geometric graph neural networks using heterogeneous graph data. By modeling the heterogeneous legal graph using gravity-guided geometric space and driving the feature transfer of the graph neural network based on the geometric graph Laplacian operator, it fully mines and captures the geometric topological structure information of the heterogeneous graph, achieving structural perception of legal element relationships. This overcomes the limitation of traditional large language model case recommendation algorithms in capturing the relationship structure of legal elements. This invention uses geometric operators to drive the graph neural network's features to perform neighborhood aggregation according to geometric constraints, which to some extent alleviates or suppresses the oversmoothing problem of graph neural networks and achieves structural perception of legal elements. The sparse modeling of the heterogeneous graph enables initial screening of candidate cases, greatly improving the overall model's computational efficiency and solving the problem of high-complexity computation with large-scale data. The integration of geometric graph neural networks with a pre-trained legal model can capture semantic-topological similarity from both semantic and legal relationship structure dimensions, achieving refined modeling from semantic relevance to legal relationship structure relevance. This effectively improves the structural perception capability and recommendation accuracy of case recommendations, and enhances the model's interpretability.

[0086] Example 4: See Figure 4 As shown, the present invention also discloses a geometric graph neural network-based case recommendation system, comprising: 1. Heterogeneous Graph Preprocessing Module: This module constructs and standardizes legal heterogeneous graphs. An exemplary algorithm flow for the heterogeneous graph preprocessing module is shown below: Input: Case element text data, case element type data, edge weight matrix or edge weight assignment rules (optional); Output: Normalized original feature matrix of nodes of the heterogeneous graph, list of node quality, and edge weight matrix.

[0087] Execution steps: Extract the number of cases, number of nodes, node type, and query / candidate case type information based on the case element text data and case element type data.

[0088] Based on the node type, generate a list of node quality; encode the node text to generate a node feature matrix; normalize the node feature matrix to generate a normalized node feature matrix.

[0089] If the user inputs an edge weight matrix or edge weight assignment rules, then the edge weights are assigned according to the user's input edge weight matrix or edge weight assignment rules. For assignments outside the [0,1] interval, the edge weights are adjusted to the [0,1] interval, and then the next step is executed. If the user does not input an edge weight matrix, then the cosine similarity / dot product between node features is calculated, and the similarity value is adjusted to the [0,1] interval as the edge weight, generating an edge weight matrix.

[0090] Output the normalized original feature matrix of the heterogeneous graph, the list of node quality, and the edge weight matrix.

[0091] 2. Heterogeneous Graph Sparse Modeling Module: For a massive number of candidate cases, the edge weight matrix of the heterogeneous graph is divided into blocks. Threshold filtering and initial screening of cases are performed based on the trace of the edge weight submatrices between the query and candidate cases, deleting candidate case nodes that are weakly associated with the query case to improve the computational efficiency of class-based case recommendation. Subgraphs of the heterogeneous graph are extracted and the original feature matrix of nodes, the node quality list, and the edge weight matrix are updated. An exemplary algorithm flow of the heterogeneous graph sparse modeling module is shown below: Input: Original feature matrix of heterogeneous graph nodes, list of node quality, edge weight matrix, threshold; Output: Original feature matrix of nodes in the heterogeneous graph subgraph, list of node quality, and edge weight matrix; Execution steps: (This step is optional. It can be performed for data with a large number of nodes. If the number of nodes is small, this step can be skipped and the heterogeneous graph gravity-guided distribution geometric space modeling in step 3 can be performed directly.) The edge weight matrix is ​​divided into blocks according to the case, and the trace of the submatrix after the block is calculated; The trace of the edge weight submatrix corresponding to the query case and the candidate case is filtered using a threshold. If the trace of the submatrix is ​​greater than or equal to the threshold, the node features, node quality and edge weight of the corresponding candidate case are retained; otherwise, the node corresponding to the candidate case is deleted from the heterogeneous graph, and the index corresponding to the node of the candidate case is recorded in a list / dictionary.

[0092] Based on the list of deleted candidate case node indices, update the node features, node quality, and edge weight information of the corresponding deleted candidate cases, and extract the original feature matrix, node quality list, and edge weight matrix of the heterogeneous graph subgraph nodes.

[0093] 3. Gravity-Oriented Distribution Geometric Space Modeling Module: This module iteratively calculates the gravitational forces and coordinates between nodes, outputting a gravity-oriented coordinate matrix and a geometric weight matrix. An exemplary algorithm flow for this module is shown below: Input: The original feature matrix of the nodes in the heterogeneous graph subgraph, the node quality list, the edge weight matrix, and the geometric space modeling parameters: gravitational constant. Distance attenuation coefficient Dimension of node coordinates .

[0094] Output: The coordinate matrix of the node gravity distribution and the geometric weight matrix of the heterogeneous graph subgraph; Execution steps: Initialize node coordinates, normalize edge weight matrix; Execute the loop: using the node coordinates of the current step, the normalized edge weight matrix, and the node mass list, calculate the node gravity of the current loop and the average resultant external force modulus of all nodes.

[0095] Judgment: If the average resultant external force modulus of all nodes is less than the set threshold. If the number of iterations exceeds the upper limit, terminate the loop and output the node coordinates of the current iteration; otherwise, use the gravity of the current step and the node coordinates of the current step to calculate the node coordinates of the next step.

[0096] The geometric weight matrix is ​​calculated using the node coordinates and the normalized edge weight matrix.

[0097] Output the node gravity distribution coordinate matrix and geometric weight matrix of the heterogeneous graph subgraph.

[0098] 4. Geometric Graph Neural Network Feature Evolution Module: This module calculates the normalized geometric weight matrix and the geometric graph Laplacian matrix based on the geometric weight matrix; it concatenates the original node features with the node coordinates and fuses them using a random linear projection method; it drives the feature evolution of the geometric graph neural network based on the geometric graph Laplacian operator, outputting the geometric feature matrix. An exemplary algorithm flow for the feature evolution module of the geometric graph neural network is shown below: Input: The original feature matrix of the nodes in the heterogeneous graph subgraph Nodal gravity distribution coordinate matrix Geometric weight matrix Feature evolution parameters of geometric graph neural networks: evolution step size Gravity coordinate canonical coefficient Number of layers in a geometric graph neural network and geometric dimension ; Output: Geometric feature matrix output by the geometric graph neural network. ; Execution steps: Calculate the normalized geometric weight matrix using G reuse Computational geometric Laplace matrix .

[0099] The original feature matrix of the nodes in the heterogeneous graph With node coordinate matrix The features are then stitched together, and a random linear projection method is used to fuse and reduce the dimensionality of the stitched features, outputting the initial feature matrix of the fused nodes. .

[0100] Initial feature matrix of nodes Input geometric graph neural network, using discrete coordinates of nodal gravity distribution Geometric operator-driven feature aggregation is performed, and the geometric graph neural network outputs a geometric feature matrix. .

[0101] 5. Case Recommendation Module: This module calculates the distance or similarity between cases and sorts candidate cases in ascending order of distance or descending order of similarity, outputting a Top-K case list. It utilizes a geometric graph neural network and large model features for weighted fusion at the similarity level, integrating geometric and semantic feature similarities between nodes in the heterogeneous graph to achieve case recommendation based on a fusion model with both structural awareness and semantic dimensions. An exemplary algorithm flow for the similarity matching and case recommendation module is shown below: Input: Geometric feature matrix output by the geometric graph neural network The original feature matrix of nodes in a heterogeneous graph subgraph The model integrates indicator variables and recommends matching parameters: distance type, Top-K threshold K, and fusion weights of the geometric graph neural network. (Optional) Output: Top-K recommended case list, NDCG@K value; Execution steps: If the model fusion indicator variable is not specified, then perform the geometric graph neural network case recommendation in (1); otherwise, perform the fusion model case recommendation in (2).

[0102] (1) Recommended case studies for geometric graph neural networks: Traverse all candidate cases corresponding to the query case: calculate the geometric feature distance or cosine similarity between the query case and the candidate case of the same type based on the distance type, average the distance or cosine similarity between the query case and the candidate case of the same type by the node type, sort the average distance in ascending order or the average similarity in descending order, and output the Top-K recommendation list.

[0103] (2) Recommended examples of fusion models: Iterate through all candidate cases corresponding to the query case: calculate the geometric feature cosine similarity and the original semantic feature cosine similarity between nodes of the same type between the query case and the candidate cases. Average the geometric feature cosine similarity and the original semantic feature cosine similarity between the query case and the candidate cases according to node type to obtain the average geometric feature similarity and the average semantic feature similarity. Use model fusion weights to perform a weighted fusion of the average geometric feature similarity and the average semantic feature similarity, sort the fused similarities in descending order, and output the Top-K recommendation list.

[0104] 6. Grid Parameter Search Optimization and Test Recommendation Module: A hierarchical network parameter search is performed on the training set, using the Calinski-Harabasz index and the core metric for case recommendation, NDCG@K, as objective functions. The forward inference process in steps 3-5 of the geometric graph neural network case recommendation method shown in Examples 1-3 is executed. The optimal hyperparameter combination is extracted through hierarchical grid parameter search, and case recommendation is performed on an independent test set using the optimal hyperparameter combination, outputting Top-K recommended cases. An exemplary algorithm flow for the hierarchical grid parameter search optimization and test recommendation module is shown below: Input: The original feature matrices of nodes in the training and test sets of the heterogeneous graph subgraph. Node quality list Edge weight matrix Geometric space modeling parameters (gravitational constant) Distance attenuation coefficient Dimension of node coordinates The list of possible values ​​for the feature evolution parameter (evolutionary step size) Gravity coordinate canonical coefficient Number of layers in a geometric graph neural network The list of possible values ​​for the following parameters: matching type, Top-K threshold K; model fusion indicator variable; and fusion weights for the geometric graph neural network. A list of possible values ​​(optional).

[0105] Output: Top-K recommended case list; Execution steps: Constructing a parametric mesh: Modeling parameters (gravitational constant) using geometric space. Distance attenuation coefficient Dimension of node coordinates ), feature evolution parameters (evolutionary step size) Gravity coordinate canonical coefficient Number of layers in a geometric graph neural network The fusion weights of recommended matching parameters (matching type, Top-K threshold K) and geometric graph neural network. The list of possible values ​​is used to construct the hyperparameter grid.

[0106] The values ​​of the fixed feature evolution parameters and recommendation matching parameters are also fixed. If the model fusion indicator variable is positive, the fusion weights are also fixed. If the model fusion indicator variable is negative, then the fusion weights are ignored. Extract the parameter mesh of the geometric space modeling parameters. Traverse all parameter combinations in the geometric space modeling parameter mesh: For each geometric space modeling parameter combination, perform the calculation process in steps 3-5 of the geometric graph neural network case recommendation method shown in Examples 1-3 on the training set, and calculate the Calinski-Harabasz index for each geometric space modeling parameter combination. Extract the geometric space modeling parameter combination corresponding to the maximum value of the Calinski-Harabasz index, which is the optimal geometric space modeling parameter combination.

[0107] By fixing the optimal combination of geometric space modeling parameters, extract the parameter grid of feature evolution parameters and recommendation matching parameters. If the model fusion indicator variable is yes, then also extract the fusion weights of the geometric graph neural network. The parameter grid is used to ignore the fusion weights if the model fusion indicator variable is not specified. Traverse feature evolution parameters, recommendation matching parameters, and fusion weights. All parameter combinations in the parameter grid (optional): For each parameter combination, perform the calculation process in steps 3-5 of the geometric graph neural network case recommendation method as shown in Examples 1-3 on the training set, and calculate the NDCG@K value for each parameter combination. Extract the parameter combination corresponding to the maximum value of NDCG@K, which serves as the optimal feature evolution parameters, recommendation matching parameters, and fusion weights. Parameter combinations (optional).

[0108] Test Recommendation: On the test set, the optimal geometric space modeling parameters, feature evolution parameters, recommendation matching parameters, and the fusion weights of the geometric graph neural network are utilized. The parameters (optional) are combined to perform the calculation process in steps 3-5 of the geometric graph neural network case recommendation method as shown in Examples 1-3, and output the Top-K case recommendation list.

Claims

1. A geometric graph neural network-based case recommendation method, characterized in that, Includes the following steps: Step 1: For each query case and all its corresponding candidate cases, construct the original node text dataset and the original node type dataset; The original node text dataset contains a query case and multiple node texts for all its corresponding candidate cases; The original node type dataset includes the type of each node, which includes case facts, legal provisions, evidence, points of contention, and concatenated text of case facts and points of contention. Semantic encoding is performed on the node text, node quality is assigned according to node type, edge weights of the heterogeneous graph are calculated, and a logical representation of the heterogeneous graph including a list of node texts, a list of node types, a normalized original feature matrix of nodes, a list of node quality, and an edge weight matrix is ​​obtained. Step 2: Based on the edge weight matrix To achieve sparse modeling of the heterogeneous legal graph, we obtain the logical representation of the heterogeneous graph subgraphs; Step 3: Based on the logical representation of heterogeneous graph subgraphs, realize the geometric space modeling of gravity-guided distribution; The gravity-guided distribution geometric space model includes a gravity-guided coordinate matrix. and geometric weight matrix ; Step 4: Construct a geometric graph Laplacian operator based on the gravity-guided distribution geometric space model. Drive the forward propagation and feature evolution of the graph neural network features based on the geometric graph Laplacian operator to obtain the node geometric feature matrix. , For the real number space, The number of nodes in the heterogeneous graph subgraph. The geometric dimension, This represents the total number of layers in the geometric graph neural network. Step 5: Based on the node geometric feature matrix Perform similarity matching and similar case recommendation to obtain a list of similar case recommendations; The specific process of sparse modeling of the heterogeneous graph in step 2 is as follows: Edge weight matrix By dividing the matrix into blocks, multiple block-based submatrices are obtained. ;in, This is the total number of query cases and all candidate cases. edge weight matrix Chinese Case Case Study The corresponding submatrix; Values ​​range from 1 to Positive integers; Calculation Case Case Study The sum of edge weights between nodes of the same type , Representation submatrix traces; Calculate edge weight threshold And utilize edge weight threshold Sum of edge weights Perform filtering.

2. The geometric graph neural network case recommendation method according to claim 1, characterized in that, The process of obtaining the logical representation of the heterogeneous graph is as follows: Step 1.1: Represent both the original node text dataset and the original node type dataset as lists. Different types of nodes in the same case are arranged adjacently in the order of case facts, legal provisions, evidence, points of contention, and concatenated text of case facts and points of contention. The list of original node text dataset and the list of original node type dataset first contain all node information of the query case, followed by node information of all candidate cases. Output the list of original node text and the list of node types. Step 1.2: Use the SAILER model to encode all node text in the original text dataset to obtain the multidimensional semantic features of the node text; Step 1.3: Perform L2 normalization on the multidimensional semantic features of the node text to obtain the normalized node semantic features. , Represents the first in the heterogeneous graph The node of the first Semantic feature components; Let be the global node number of the heterogeneous graph, and ; This is the dimensional index for the semantic features of the nodes, and , The dimension of the node semantic features obtained after semantic encoding of the node text using the SAILER model. The global number of nodes in the heterogeneous graph; Step 1.4: Extract node semantic features Arranged in the order of the original node text list, the original node feature matrix is ​​formed. ; Step 1.5: Based on the characteristics of the original node text dataset and the original node type dataset, assess the quality of each node according to its importance. Assign values ​​to obtain the node quality list. ; Step 1.6: Calculate the edge weight matrix and the edge weight matrix The element values ​​corresponding to unrelated nodes in the matrix are set to 0, and the edge weight matrix is... Assign values ​​to the elements corresponding to the associated nodes in the table; Step 1.7: Construct a logical representation of a standardized legal heterogeneous graph and output a normalized original feature matrix of nodes. Node quality list and edge weight matrix data.

3. The geometric graph neural network case recommendation method according to claim 2, characterized in that, Quality of each node The specific rules for assigning values ​​are any of the following: ① Regarding the node quality of general heterogeneous graphs The assignment rules are as follows: The quality of core legal provisions is generally assigned 1.5, ordinary legal provisions 1.0, case factual points 0.8, and evidence points 0.

5. ② Based on the characteristics of the LeCARD dataset, node quality The assignment rules are as follows: The quality of the case fact node is assigned a value of 0.9, the quality of the dispute focus node is assigned a value of 0.7, and the quality of the spliced ​​text node of the case facts and dispute focus is assigned a value of 1.

4. The geometric graph neural network case recommendation method according to claim 3, characterized in that, Edge weight matrix The rules for assigning values ​​to elements corresponding to associated nodes are any of the following: ① Assignment rules based on cosine similarity of text semantic features: If the node text is a long text data example, then the cosine similarity of text semantic features is used. Assign values ​​to the edge weights and adjust the edge weight values ​​to the [0,1] range; Specifically: Calculate the first in the heterogeneous graph The semantic features of the node text of the nth node and the nth node Cosine similarity between the semantic features of the node text of each node ; ; in, This represents the original feature matrix of the nodes in the normalized form. Middle The semantic features of the nth node dimensional semantic feature components, This represents the original feature matrix of the nodes in the normalized form. Middle The semantic features of the nth node dimensional components, for The square of, for The square of, These are all global node numbers in the heterogeneous graph, used to traverse two different nodes, and their values ​​range from [value range missing]. , , Indicates the total number of nodes in the heterogeneous graph; and the edge weight matrix elements Defined as This is to adjust the edge weight values ​​to the [0,1] range; ② Assignment rules based on the intensity of judicial co-occurrence: If the node text of legal provisions and points of contention is categorized label data with limited types, then the edge weights between legal provisions and nodes, between legal provisions and points of contention nodes, and between points of contention nodes are assigned according to the intensity of judicial co-occurrence. The edge weight matrix is ​​as follows: elements Defined as the first in a heterogeneous graph The node and the first The intensity of judicial co-occurrence among nodes Divide by the maximum value of the judicial co-occurrence intensity of all node pairs in the heterogeneous graph; Judicial Co-occurrence Intensity The expression is as follows: ; in, Indicates the simultaneous occurrence of the first The node and the first The number of text cases for each node. Indicates the occurrence of the first The total number of cases for the text of each node. For the appearance of the first The total number of text cases for each node, and the edge weight matrix. elements Represents the first in the heterogeneous graph The node and the first Edge weights between nodes; ③ Assignment rules based on user settings: First, an initial edge weight matrix is ​​obtained using assignment rule ① or ②. Then, based on this initial edge weight matrix, it is modified according to user-defined rules to obtain the final edge weight matrix. The rules for modifying the initial edge weight matrix are as follows: If the user sets a uniform assignment of edge weights between a certain type of nodes: then the edge weights between that type of nodes in the initial edge weight matrix are uniformly assigned according to the user-defined rules, with negative values ​​set to zero and positive values ​​adjusted to the [0,1] interval, resulting in the edge weight matrix. .

5. The geometric graph neural network case recommendation method according to claim 4, characterized in that, Calculate edge weight threshold The specific method is any one of the following: ① Based on quantile-based edge weight threshold The rules for assigning values ​​are as follows: In the edge weight matrix In the process, a submatrix is ​​extracted between the query case and all candidate cases, and the trace of the extracted submatrix is ​​calculated. The traces of the submatrix are sorted in descending order, and the value of the 30th or 50th position in the sorted submatrix is ​​extracted as the edge weight threshold. ; ② Percentage-based edge weight threshold The rules for assigning values ​​are as follows: In the edge weight matrix In the process, extract the submatrix between the query case and all candidate cases, and calculate the trace of the extracted submatrix. The maximum value of the trace of the submatrix is ​​denoted as [value missing]. Set the edge weight threshold Assigned value .

6. The geometric graph neural network case recommendation method according to claim 4, characterized in that, Using edge weight threshold Sum of edge weights The filtering method is as follows: Only filter case pairs between query cases and candidate cases, i.e., for query case indexes. With candidate case index ,when Pick and Pick At that time, if This indicates that there are candidate cases. Query Case The correlation between them is weak, so candidate cases are removed from the heterogeneous graph. All node information, and from the normalized original node feature matrix Node quality list and edge weight matrix Remove candidate cases The corresponding data; Candidate cases Query Case The sum of the edge weights between them; like Then the candidate cases are considered Query Case The correlation between them is strong, so candidate cases are retained. Node information.

7. The geometric graph neural network case recommendation method according to claim 4, characterized in that, The logical representation of a heterogeneous graph subgraph includes the original feature matrix of the nodes of the heterogeneous graph subgraph. List of node quality in heterogeneous graph subgraphs and the edge weight matrix of heterogeneous graph subgraphs ,in, This represents the number of nodes in the heterogeneous graph subgraph.

8. The geometric graph neural network case recommendation method according to any one of claims 4-7, characterized in that, The specific process of step 3 is as follows: The gravity-oriented coordinates are calculated iteratively using the NumPy library. The calculation of the gravitational force and the net external force between nodes is performed iteratively until the forces reach equilibrium or the maximum number of iterations is reached, thus obtaining the gravity-oriented coordinate matrix. ; Using gravity-guided coordinate matrix Edge weight matrix of heterogeneous graph subgraph The geometric weight matrix is ​​calculated by multiplying the edge weights by the Gaussian kernel. elements ,in, and The geometric weight matrices of the heterogeneous graph subgraphs are respectively Global row indexes and global column indexes.

9. The geometric graph neural network case recommendation method according to claim 8, characterized in that, Obtain the gravity-guided coordinate matrix The specific process is as follows: Based on the heterogeneous graph subgraph output in step 2, the first... Initial node coordinates of each node ;in, This represents the global node number of the heterogeneous graph subgraph. For the heterogeneous graph subgraph, the first The initial coordinates of each node. obey distributed, This indicates that the mean is zero and the covariance matrix is... of 3D normal distribution For the heterogeneous graph subgraph, the first The quality of each node. for 1D identity matrix Let be the dimension of the coordinates of the nodes in the heterogeneous graph subgraph in the gravity-guided distribution geometry space. The range of values ​​is , for A 1-dimensional vector; For the first Gravity-guided node coordinates of the step Perform iterative updates; Iteration of gravity-guided node coordinates The expression is as follows: ; ; in, For the iteration step index, For the heterogeneous graph subgraph, the first The node at the th Gravity-guided node coordinates under round iteration, The iteration step size, For the heterogeneous graph subgraph, the first The expression for the resultant external force at each node is: ;in, For the first The node and the first The gravitational vector between nodes is expressed as follows: ; in, For gravitational constant, This is the distance attenuation coefficient. The normalized edge weight matrix represents the first element in the heterogeneous graph subgraph. The node and the first The elements of the normalized edge weights between nodes. For the heterogeneous graph subgraph, the first The set of node indices of all neighboring nodes of a node in the heterogeneous graph subgraph; For the heterogeneous graph subgraph, the first The node at the th Gravity-guided node coordinates under round iteration, For the heterogeneous graph subgraph, the first The quality of each node. The iteration terminates when the average resultant external force modulus of all nodes is less than a set threshold or the number of iterations exceeds the upper limit, yielding the gravity-guided coordinate matrix. .

10. The geometric graph neural network case recommendation method according to claim 9, characterized in that, In step 3, the geometric weight matrix Gravity-guided coordinate matrix Edge weight matrix of heterogeneous graph subgraph The calculation is performed by multiplying the edge weights by the Gaussian kernel, and the formula is as follows: ,in, and These are all global node indices of the heterogeneous graph subgraph, used to traverse any two distinct nodes. Represents the geometric weight matrix The first in Line 1 Column elements, corresponding to the first element in the heterogeneous graph subgraph. The node and the first Geometric weights between nodes and The geometric weight matrix is ​​a subgraph of a heterogeneous graph. Normalized geometric weight matrix Geometric Laplace matrix All Global row and column indices of a matrix, and related information about heterogeneous graph subgraphs. Global row index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a heterogeneous graph subgraph. Global column index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a geometric weight matrix. The order of rows and columns corresponds to the order of nodes in the heterogeneous graph subgraph. The normalized edge weight matrix represents the first element in the heterogeneous graph subgraph. The node and the first The elements of the normalized edge weights between nodes. Gravity-guided coordinate matrix The middle corresponds to the first in the heterogeneous graph subgraph. Geometric space coordinates of each node, Gravity-guided coordinate matrix The middle corresponds to the first in the heterogeneous graph subgraph. Geometric space coordinates of each node, These are the parameters of the Gaussian kernel.

11. The geometric graph neural network case recommendation method according to claim 10, characterized in that, The specific process of step 4 is as follows: For geometric weight matrix Normalization is performed to obtain the normalized geometric weight matrix. ; Using normalized geometric weight matrix Constructing the Laplace matrix of the geometric graph ; Geometric Laplace Matrix Including diagonal elements Off-diagonal elements ;in, and The geometric weight matrix is ​​a subgraph of a heterogeneous graph. Normalized geometric weight matrix Geometric Laplace matrix All Global row and column indices of a matrix; The original feature matrix of nodes in the heterogeneous graph subgraph With gravity-guided coordinate matrix By splicing ; The random linear projection dimensionality reduction method is used to obtain and output initial features of uniform dimension. ; Using the geometric Laplace matrix Perform feature updates to obtain the first... Layer feature matrix ; The features of a geometric graph neural network driven by the geometric graph Laplacian operator evolve according to the feature update formula, and after multiple layers of feature iteration, the output node geometric feature matrix is ​​obtained. ,in, This represents the total number of layers in a geometric graph neural network. To standardize the representation of initial feature dimension, hidden layer dimension of geometric graph neural network, and the first-order dimension of geometric graph neural network. The global dimension variable of the node geometric feature dimension output by the layer.

12. The geometric graph neural network case recommendation method according to claim 10, characterized in that, In step 3, the normalized geometric weight matrix elements in Represents the first subgraph of a heterogeneous graph. The node and the first Normalized geometric weights between nodes: ; ; ; in, and The geometric weight matrix is ​​a subgraph of a heterogeneous graph. Normalized geometric weight matrix Geometric Laplace matrix All Global row and column indices of a matrix, and related information about heterogeneous graph subgraphs. Global row index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a heterogeneous graph subgraph. Global column index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to one node. The number of nodes in the heterogeneous graph subgraph. Geometric weight matrix elements when From 1 to The sum of corresponding elements during iteration. Geometric weight matrix elements when From 1 to The sum of corresponding elements during traversal, and the normalized geometric weight matrix. The row and column numbers are arranged in the same order as the global node indexes of the heterogeneous graph subgraph; Using normalized geometric weight matrix Constructing the Laplace matrix of the geometric graph Its diagonal elements Defined as: ; Off-diagonal elements Defined as: ; in, Normalized geometric weight matrix The Line 1 The element at the column position, Represents the first subgraph of a heterogeneous graph. The node and the first The normalized geometric weights between each node itself, and ; The first subgraph representing the heterogeneous graph The set of column indices in the geometric weight matrix corresponding to the indices of all neighboring nodes of a node; Normalized geometric weight matrix The Line 1 The element at the column position represents the first element in the heterogeneous graph subgraph. The node and the first Normalized geometric weights between nodes, heterogeneous graph subgraph correlation Global row index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to a heterogeneous graph subgraph. Global column index of a matrix Global first subgraph of heterogeneous graph Each node corresponds to one node.

13. The geometric graph neural network case recommendation method according to claim 11, characterized in that, In step 4, the first Layer feature matrix The simplified formula is: ; in, The Laplace matrix of the geometric graph. For evolutionary step size, For the first geometric graph neural network Layer feature matrix, , This represents the total number of layers in a geometric graph neural network. To standardize the representation of initial feature dimension, hidden layer dimension of geometric graph neural network, and the first-order dimension of geometric graph neural network. The global dimension variable of the node geometric feature dimension output by the layer; Represents the activation function; the first Layer feature matrix The improved formula is: ; in, Given the gravity-oriented coordinate matrix, the initial feature dimension, hidden layer dimension, and dimensionality of the geometric graph neural network are calculated. Dimension of node geometric features output by the layer Dimension of Gravity-Guided Distribution Node Coordinates The values ​​are the same. These are the canonical coefficients for gravity coordinates; The feature propagation characteristics of geometric graph neural networks are as follows: driven by geometric operators, it only performs forward propagation for updating graph neural network features, does not update through gradient backpropagation, does not modify the propagation structure, and outputs features that reflect the topological structure of heterogeneous graph subgraphs and the spatial geometric features of clustering between nodes.

14. The geometric graph neural network case recommendation method according to any one of claims 9-13, characterized in that, The similarity matching and case recommendation methods include any one of distance-based recommendation, similarity-based recommendation, and recommendation using a fusion model.

15. The geometric graph neural network case recommendation method according to claim 13, characterized in that, The specific method for recommending based on distance is as follows: Step 5.11, from the node geometric feature matrix Extract query cases from the middle. and candidate cases The geometric feature vectors of all nodes are used to obtain the query case. The Geometric feature vectors of class nodes and candidate cases The Geometric feature vectors of class nodes ;in, It is a node type, and For node type indexes, The number of node types; Step 5.12: Calculate the query case The Geometric feature vectors of class nodes With candidate cases The Geometric feature vectors of class nodes Mahalanobis distance between ; Step 5.13: Repeat step 5.12 to obtain the query case. and candidate cases Mahalanobis distances between various types of nodes; then, for the query case... With candidate cases The average Mahalanobis distances between various types of nodes are used to obtain the query cases. With candidate cases The average Mahalanobis distance between various types of nodes ; Step 5.14: Review candidate cases According to the average Mahalanobis distance Sort the candidate cases in ascending order to obtain the candidate cases. Arrange in a list; Based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

16. The geometric graph neural network case recommendation method according to claim 13, characterized in that, The specific process of recommending based on similarity is as follows: Step 5.21: From the node geometric feature matrix Extract query cases from the middle. and candidate cases The geometric feature vectors of all nodes are used to obtain the query case. The Geometric feature vectors of class nodes and candidate cases The Geometric feature vectors of class nodes ,in, It is a node type, and For node type indexes, The number of node types; Step 5.22: Calculate the query case The Geometric feature vectors of class nodes With candidate cases The Geometric feature vectors of class nodes Cosine similarity between ; Step 5.23: Repeat step 5.22 to obtain the query case. and candidate cases The cosine similarity between the geometric feature vectors of various nodes; then, for the query case... With candidate cases The average of the cosine similarities among the geometric feature vectors of various nodes is used to obtain the query case. With candidate cases Geometric eigenvector mean cosine similarity ; Step 5.24: Review candidate cases Average cosine similarity based on geometric feature vectors Sort the candidate cases in descending order to obtain the candidate cases. Arrange in a list; Based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

17. The geometric graph neural network case recommendation method according to claim 13, characterized in that, The specific process of using the fusion model for recommendation is as follows: Step 5.31, from the node geometric feature matrix Extract query cases from the middle. and candidate cases The geometric feature vectors of all nodes are used to obtain the query case. The Geometric feature vectors of class nodes and candidate cases The Geometric feature vectors of class nodes ,in, It is a node type, and For node type indexes, The number of node types; From the original feature matrix of nodes in the heterogeneous graph subgraph Extract query cases from each and candidate cases The semantic feature vectors of all nodes are used to obtain the query case. The Original semantic features of class nodes and candidate cases The Original semantic features of class nodes ; Step 5.32: Calculate the geometric eigenvectors respectively. and geometric eigenvectors Cosine similarity between and original semantic features and original semantic features Cosine similarity between ; Step 5.33: Repeat step 5.32 to obtain the query case. and all candidate cases The geometric feature cosine similarity between the geometric feature vectors of various nodes and the semantic feature cosine similarity between the original semantic features; For query cases and candidate cases The average of the geometric feature cosine similarities among the geometric feature vectors of various nodes is used to obtain the query case. and candidate cases Geometric eigenvector mean cosine similarity ; For query cases and candidate cases The average of the cosine similarity of the semantic features among the original semantic features of various nodes is used to obtain the query cases. and candidate cases The average cosine similarity of the original semantic feature vectors ; Step 5.34: Utilize the weights of the geometric graph neural network right and We perform weighted similarity calculations to obtain weighted similarity scores. ; Step 5.35: Review candidate cases According to weighted similarity Sort the candidate cases in descending order to obtain the candidate cases. A ranking list; based on Top-K threshold Extract before permutation The candidate cases are selected as the recommendation results, and the recommendation results are output as the Top-K case recommendation list.

18. The geometric graph neural network case recommendation method according to any one of claims 15-17, characterized in that, It also includes the following steps: Step 6: Construct a hyperparameter grid covering geometric space modeling, feature evolution, recommendation matching modules, and model fusion weights; obtain the optimal parameter combination on the training set through hierarchical grid parameter search; execute the complete forward inference process of geometric space modeling, feature evolution, and case recommendation from Step 3 to Step 5 on the test set, and output a Top-K case recommendation list.

19. The geometric graph neural network case recommendation method according to claim 18, characterized in that, The specific process of step 6 is as follows: Step 6.1: Construct a hyperparameter mesh covering geometric space modeling, feature evolution, recommendation matching modules, and model fusion weights; The parameters for geometric space modeling include the gravitational constant. Distance attenuation coefficient and node coordinate dimension ; The parameters of feature evolution include the evolution step size. Gravity coordinate canonical coefficient Number of layers in a geometric graph neural network ; The parameters for the recommended matching module include query cases. With candidate cases Matching methods and Top-K thresholds between various types of nodes ; The parameters of the model fusion weights include the weights of the geometric graph neural network. ; Step 6.2: The following search strategy is adopted to perform Step 6.2.1: Fix the weight parameters of feature evolution, recommendation matching and model fusion, and use the Calinski-Harabasz index as the objective function on the training set. Perform the geometric space modeling, feature evolution and case recommendation forward inference process of Step 3 to Step 5. The optimal geometric space modeling parameters are selected by maximizing the Calinski-Harabasz index. Parameter optimization: Step 6.2.2: Fix the optimal geometric space modeling parameters. On the training set, with the normalized cumulative gain NDCG@K, a core indicator in the field of case recommendation, as the objective function, execute the geometric space modeling, feature evolution, and case recommendation forward inference process from Step 3 to Step 5. Maximize NDCG@K to select the optimal feature evolution, recommendation matching, and model fusion weight parameters. Step 6.3: Using the optimal parameter combination obtained by the hierarchical grid parameter search, execute the complete forward reasoning process of geometric space modeling, feature evolution and case recommendation from Step 3 to Step 5 on the test set, and output the Top-K case recommendation list.

20. A geometric graph neural network-based case recommendation system, characterized in that, It includes a heterogeneous graph preprocessing module, a heterogeneous graph sparse modeling module, a gravity-guided distribution geometric space modeling module, a geometric graph neural network feature evolution module, a case recommendation module, and a grid parameter search optimization and test recommendation module, which are connected in sequence. The modules are connected in sequence to implement the function of the geometric graph neural network case recommendation method as described in any one of claims 1-19.

21. An electronic device, characterized in that, It includes a memory, one or more processors, and one or more programs stored in the memory, said one or more programs including instructions for performing the geometric graph neural network case recommendation method as described in any one of claims 1-19.

22. A storage medium, characterized in that, Includes one or more programs executable by one or more processors of the device, said one or more programs including instructions for performing the geometric graph neural network case recommendation method as described in any one of claims 1-19.

Citation Information

Patent Citations

  • Class case recommendation method for administrative penalty documents based on graph convolutional neural network

    CN114048305A

  • Diversified recommendation method for news based on graph neural network and its device

    US20240184838A1