Legal case intelligent retrieval and analysis system

By vectorizing legal case data and building a knowledge graph, and generating response texts with legal case analysis models, the problem of user-defined tag subjectivity and lack of semantic understanding in the existing technology is solved, and the legal case search is improved Accuracy.

CN118606428BActive Publication Date: 2025-01-10NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410651707.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2025-01-10
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

The existing legal case management system has low retrieval accuracy due to the subjective differences in user-defined tags and the lack of semantic understanding of full-text search engines.

Method used

Through the data collection, processing and knowledge graph construction modules, the legal case data is vectorized to represent the legal case data, and a knowledge graph is built, and a legal case analysis model is used to generate response text matching with user questions, reducing the search range and improving accuracy.

Benefits of technology

It effectively reduces the search range, avoids the influence of subjective differences, and improves the generation accuracy of response text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606428B_ABST
    Figure CN118606428B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of knowledge graphs, and discloses a legal case intelligent retrieval and analysis system, comprising: a data collection module, which collects original legal case data; a data processing module, which processes the original legal case data to obtain backup legal case data; a knowledge graph construction module, which constructs a knowledge graph based on the backup legal case data; a knowledge graph retrieval module, which retrieves the knowledge graph according to the user's question to obtain a sub-knowledge graph; a knowledge graph analysis module, which inputs the sub-knowledge graph into a legal case analysis model, and outputs a response text that matches the user's question; the present invention obtains a sub-knowledge graph according to the user's question, which can effectively reduce the retrieval scope, and aggregates the information of the sub-knowledge graph through the legal case analysis model, automatically generates a response text that matches the user's question, avoids the influence of subjective differences, and thus improves the accuracy of the generated response text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and more specifically, to a legal case intelligent retrieval and analysis system. Background Art

[0002] Existing legal case management systems usually require users to customize labels for each legal case, and then store the labels of each legal case in a full-text search engine. The relevant legal cases are then retrieved through the search tools provided by the full-text search engine based on the terms entered by the user. In addition, the source files of the legal cases are stored in a distributed storage system to ensure data security.

[0003] However, the labels of legal cases in existing legal case management systems are customized by users and are subjective. Different users have different background knowledge and understanding angles, which may lead to different labels for similar legal cases. In addition, the search tools provided by the full-text search engine to retrieve relevant legal cases can only perform keyword matching based on the content of the terms entered by the user, lacking semantic understanding, resulting in low retrieval accuracy. Summary of the invention

[0004] The present invention provides a legal case intelligent retrieval and analysis system to solve the technical problems in the above-mentioned background technology.

[0005] The present invention provides a legal case intelligent retrieval and analysis system, including:

[0006] A data collection module, which is used to collect original legal case data;

[0007] The original legal case data includes: case code, case type, case summary, litigation request, evidence materials, legal items, judgment documents and judgment results;

[0008] A data processing module, which is used to process the original legal case data to obtain backup legal case data;

[0009] The backup legal case data has the same content as the original legal case data;

[0010] The case types, keywords and legal entries of the backup legal case data are all represented by vectorization, and the rest of the content is represented by address links;

[0011] A knowledge graph construction module, which is used to construct a knowledge graph based on the backup legal case data;

[0012] The knowledge graph includes: entities, initial attributes of entities, and connection relationships between entities;

[0013] The entities include: a first entity, a second entity and a third entity;

[0014] Establishing data mapping between the first entity and the case code of the backup legal case data;

[0015] The second entity establishes data mapping with the case type of the backup legal case data;

[0016] The third entity establishes data mapping with keywords of the case summary of the backup legal case data;

[0017] The initial attributes of an entity are generated based on the information mapped by the entity data;

[0018] A knowledge graph retrieval module, which is used to retrieve the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities;

[0019] The representation of the sub-knowledge graph is the same as that of the knowledge graph;

[0020] The knowledge graph analysis module is used to input the sub-knowledge graph consisting of T first entities into the legal case analysis model and output the answer text matching the user's question, where T is a custom parameter.

[0021] Furthermore, case types include: criminal cases, civil cases, administrative cases and economic cases.

[0022] Furthermore, the initial attributes of the first entity are represented by an eight-bit binary code of the case code; the initial attributes of the second entity are represented by a vectorization of the case type; and the initial attributes of the third entity are represented by a vectorization of the keywords of the case summary.

[0023] Furthermore, the connection relationship between entities includes: the existence of a connection relationship between the first entity and the second entity indicates that the case code data mapped by the first entity belongs to the case type data mapped by the second entity; the existence of a connection relationship between the second entity and the third entity indicates that the keywords of the case summary data mapped by the third entity belong to the case type data mapped by the second entity.

[0024] Further, the original legal case data is processed to obtain the backup legal case data, including the following steps:

[0025] Step S201, removing sensitive words from the case summary of the original legal case data by regular matching, wherein the sensitive words are manually customized;

[0026] Step S202, performing word segmentation processing on the case summary after removing sensitive words through a Chinese word segmenter;

[0027] Step S203, extracting keywords from the case summary after word segmentation processing by using a keyword extraction model, and manually annotating keywords in the case summary by relevant technical experts as sample labels of training samples for training the keyword extraction model;

[0028] Step S204, vectorizing the keywords of the case summary, the case type and the legal items of the original legal case data through a word embedding model;

[0029] Step S205, storing the litigation request, evidence materials, judgment documents and judgment results in the original legal case data into the distributed storage system, and returning the corresponding address link.

[0030] Furthermore, the entities of the knowledge graph also include a fourth entity, and a mapping relationship is established between the fourth entity and the legal entry. The connection relationship between the fourth entity and the first entity indicates that the legal entry mapped by the fourth entity belongs to the case code mapped by the first entity.

[0031] Further, the knowledge graph is retrieved according to the user's question to obtain a sub-knowledge graph consisting of T first entities, including the following steps:

[0032] Step S301, vectorizing the user's question through a word embedding model;

[0033] Step S302, calculating a first similarity value between the vectorized representation of the user's question and the second entity of the knowledge graph by cosine similarity, and obtaining a first entity corresponding to a first similarity value greater than or equal to a first threshold, wherein the first threshold is a custom parameter;

[0034] Step S303, when it is determined that the number of first entities corresponding to the first similarity value being greater than or equal to the first threshold is less than T, the first threshold is reduced until the number of first entities is equal to T, otherwise, the process proceeds to step S304;

[0035] Step S304, calculating a second similarity value between the vectorized representation of the user's question and the third entity of the knowledge graph by cosine similarity, and obtaining a first entity corresponding to a second similarity value greater than or equal to a second threshold, wherein the second threshold is a custom parameter;

[0036] Step S305 , when it is determined that the number of first entities corresponding to the second similarity value being greater than or equal to the second threshold is less than T, the second threshold is reduced; otherwise, the second threshold is increased until the number of first entities is equal to T.

[0037] Further, the legal case analysis model includes: a first hidden layer, an extraction layer, a concatenation layer, and a second hidden layer;

[0038] The first hidden layer inputs a sub-knowledge graph consisting of T first entities and outputs an update matrix, where a row vector of the update matrix represents an updated attribute of an entity;

[0039] The extraction layer is used to extract the update attribute corresponding to the first entity in the update matrix;

[0040] The concatenation layer is used to concatenate the updated attributes corresponding to the first entity to obtain a response vector;

[0041] The second hidden layer inputs the answer vector and outputs the answer text that matches the user's question. The second hidden layer is built based on the transformer model.

[0042] Furthermore, the calculation formula of the legal case analysis model includes:

[0043] The calculation formula of the update matrix Z is as follows:

[0044] in represents the updated attribute of the b-th entity, and Pile represents the stacking operation;

[0045] Updated properties of the bth entity The calculation formula is as follows:

[0046]

[0047] Where N a represents the set of entities that have a connection relationship with the a-th entity, α ab represents the normalized attention score between the a-th entity and the b-th entity, and B ab Respectively represent the first weight parameter and bias parameter between the a-th entity and the b-th entity, H b represents the initial attribute of the b-th entity, sigmoid represents the sigmoid activation function;

[0048] The normalized attention score α between the a-th entity and the b-th entity ab The calculation formula is as follows:

[0049]

[0050] Where N a represents the set of entities that have a connection relationship with the a-th entity, e ab represents the attention score between the a-th entity and the b-th entity, e ac represents the attention score between the a-th entity and the c-th entity, exp represents the power operation of a natural constant, and LeakyReLU represents the LeakyReLU activation function;

[0051] The attention score e between the a-th entity and the b-th entity ab The calculation formula is as follows:

[0052]

[0053] Among them, H a and H b Represent the initial attributes of the a-th entity and the b-th entity, respectively. and They respectively represent the second weight parameter and the third weight parameter between the a-th entity and the b-th entity, concat represents a concatenation operation, and MLP represents a multi-layer perceptron.

[0054] Furthermore, constructing sample labels for training samples for training the legal case analysis model includes the following steps:

[0055] Step S401, searching the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities;

[0056] Step S402, repeatedly inputting the sub-knowledge graph into the legal case analysis model M times to obtain M answer texts matching the user's question, where M is a custom parameter;

[0057] Step S403: the relevant experts sequentially rate the satisfaction of the M answer texts, and select the answer text with the highest satisfaction score as the sample label of a training sample, where the satisfaction score ranges from 1 to 10;

[0058] Step S404, repeating steps S401 to S403 until N training samples are obtained, where N is a custom parameter.

[0059] The beneficial effects of the present invention are as follows: the present invention can effectively reduce the search scope by obtaining a sub-knowledge graph based on the user's question, and aggregate the information of the sub-knowledge graph through the legal case analysis model, automatically generate a response text that matches the user's question, and avoid the influence of subjective differences. In addition, the legal case analysis model establishes a nonlinear mapping relationship with satisfaction, which can improve the accuracy of the generated response text. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a schematic diagram of the legal case intelligent retrieval and analysis system of the present invention;

[0061] Figure 2 is a flow chart of the present invention for processing original legal case data to obtain backup legal case data;

[0062] Figure 3It is a flowchart of the present invention for retrieving a knowledge graph according to a user's question to obtain a sub-knowledge graph consisting of T first entities;

[0063] Figure 4 It is a flow chart of constructing sample labels of training samples for training a legal case analysis model according to the present invention.

[0064] In the figure: data collection module 101, data processing module 102, knowledge graph construction module 103, knowledge graph retrieval module 104, knowledge graph analysis module 105. DETAILED DESCRIPTION

[0065] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the contents of this specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.

[0066] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0067] like Figure 1-Figure 4 As shown, the legal case intelligent retrieval and analysis system includes:

[0068] A data collection module 101 is used to collect original legal case data;

[0069] The original legal case data includes: case code, case type, case summary, litigation request, evidence materials, legal items, judgment documents and judgment results;

[0070] A data processing module 102, which is used to process the original legal case data to obtain backup legal case data;

[0071] The backup legal case data has the same content as the original legal case data;

[0072] The case types, keywords and legal entries of the backup legal case data are all represented by vectorization, and the rest of the content is represented by address links;

[0073] A knowledge graph construction module 103, which is used to construct a knowledge graph based on the backup legal case data;

[0074] The knowledge graph includes: entities, initial attributes of entities, and connection relationships between entities;

[0075] The entities include: a first entity, a second entity and a third entity;

[0076] Establishing data mapping between the first entity and the case code of the backup legal case data;

[0077] The second entity establishes data mapping with the case type of the backup legal case data;

[0078] The third entity establishes data mapping with keywords of the case summary of the backup legal case data;

[0079] The initial attributes of an entity are generated based on the information mapped by the entity data;

[0080] A knowledge graph retrieval module 104 is used to retrieve the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities;

[0081] The representation of the sub-knowledge graph is the same as that of the knowledge graph;

[0082] The knowledge graph analysis module 105 is used to input the sub-knowledge graph consisting of T first entities into the legal case analysis model and output the answer text matching the user's question.

[0083] In one embodiment of the present invention, case types include: criminal cases, civil cases, administrative cases and economic cases.

[0084] In one embodiment of the present invention, the initial attributes of the first entity are represented by an eight-bit binary code of the case code; the initial attributes of the second entity are represented by a vectorization of the case type; and the initial attributes of the third entity are represented by a vectorization of the keywords of the case summary.

[0085] In one embodiment of the present invention, the connection relationship between entities includes: the existence of a connection relationship between the first entity and the second entity indicates that the case code data mapped by the first entity belongs to the case type data mapped by the second entity; the existence of a connection relationship between the second entity and the third entity indicates that the keywords of the case summary data mapped by the third entity belong to the case type data mapped by the second entity.

[0086] In one embodiment of the present invention, Figure 2 As shown, the original legal case data is processed to obtain the backup legal case data, including the following steps:

[0087] Step S201, removing sensitive words from the case summary of the original legal case data by regular matching, wherein the sensitive words are manually customized;

[0088] Step S202, performing word segmentation processing on the case summary after removing sensitive words through a Chinese word segmenter, and the Chinese word segmenter may be jieba, HanLP, etc.;

[0089] Step S203, extracting keywords from the case summary after word segmentation through a keyword extraction model. The keyword extraction model can be constructed based on Transformer, BERT, etc., and keywords in the case summary are manually annotated by relevant technical experts as sample labels of training samples for training the keyword extraction model;

[0090] Step S204, vectorizing the keywords of the case summary, the case type and the legal items of the original legal case data through a word embedding model, where the word embedding model may be Word2Vec, GloVe, etc.;

[0091] Step S205, store the litigation request, evidence materials, judgment documents and judgment results in the original legal case data into a distributed storage system, and return the corresponding address link. The distributed storage system can be HDFS, MinIO, etc.

[0092] In one embodiment of the present invention, the keyword extraction model can be pre-trained using an existing open source data set. Pre-training can speed up the training of the model. In addition, sample labels of training samples for training the keyword extraction model can be obtained by semi-automatic annotation. The candidate keywords of the case summary are first extracted using TF-IDF (term frequency-inverse document frequency) technology, and then the candidate keywords are manually selected as the final keywords by relevant technical experts, which can greatly reduce the time for constructing training samples.

[0093] In one embodiment of the present invention, T is a custom parameter, and preferably, T is set to 10.

[0094] In one embodiment of the present invention, the entity of the knowledge graph also includes a fourth entity, and the fourth entity establishes a mapping relationship with the legal entry. The fourth entity and the first entity have a connection relationship, indicating that the legal entry mapped by the fourth entity belongs to the case code mapped by the first entity.

[0095] In one embodiment of the present invention, Figure 3 As shown, according to the user's question, the knowledge graph is retrieved to obtain a sub-knowledge graph consisting of T first entities, including the following steps:

[0096] Step S301, vectorizing the user's question through a word embedding model;

[0097] Step S302, calculating a first similarity value between the vectorized representation of the user's question and the second entity of the knowledge graph by cosine similarity, and obtaining a first entity corresponding to a first similarity value greater than or equal to a first threshold, wherein the first threshold is a custom parameter, and preferably, the first threshold is set to 0.95;

[0098] Step S303, when it is determined that the number of first entities corresponding to the first similarity value being greater than or equal to the first threshold is less than T, the first threshold is reduced until the number of first entities is equal to T, otherwise, the process proceeds to step S304;

[0099] Step S304, calculating the second similarity value between the vectorized representation of the user's question and the third entity of the knowledge graph by cosine similarity, and obtaining the first entity corresponding to the second similarity value being greater than or equal to a second threshold, wherein the second threshold is a custom parameter, and preferably, the second threshold is set to 0.9;

[0100] Step S305 , when it is determined that the number of first entities corresponding to the second similarity value being greater than or equal to the second threshold is less than T, the second threshold is reduced; otherwise, the second threshold is increased until the number of first entities is equal to T.

[0101] In one embodiment of the present invention, the legal case analysis model includes: a first hidden layer, an extraction layer, a concatenation layer, and a second hidden layer;

[0102] The first hidden layer inputs a sub-knowledge graph consisting of T first entities and outputs an update matrix, where a row vector of the update matrix represents an updated attribute of an entity;

[0103] The extraction layer is used to extract the update attribute corresponding to the first entity in the update matrix;

[0104] The concatenation layer is used to concatenate the updated attributes corresponding to the first entity to obtain a response vector;

[0105] The second hidden layer inputs the answer vector and outputs the answer text that matches the user's question. The second hidden layer is built based on the Transformer model. The Transformer model is based on a multi-head attention mechanism. It focuses on the key information of the legal case through the multi-head attention mechanism, integrates this information and generates a meaningful text answer that matches the user's query. The Transformer model is a conventional technical means and will not be elaborated here.

[0106] In one embodiment of the present invention, the calculation formula of the legal case analysis model includes:

[0107] The calculation formula of the update matrix Z is as follows:

[0108] in represents the updated attribute of the b-th entity, and Pile represents the stacking operation;

[0109] Updated properties of the bth entity The calculation formula is as follows:

[0110]

[0111] Where N a represents the set of entities that have a connection relationship with the a-th entity, α ab represents the normalized attention score between the a-th entity and the b-th entity, and B ab Respectively represent the first weight parameter and bias parameter between the a-th entity and the b-th entity, H b represents the initial attribute of the b-th entity, sigmoid represents the sigmoid activation function;

[0112] The normalized attention score α between the a-th entity and the b-th entity ab The calculation formula is as follows:

[0113]

[0114] Where N a represents the set of entities that have a connection relationship with the a-th entity, e ab represents the attention score between the a-th entity and the b-th entity, e ac represents the attention score between the a-th entity and the c-th entity, exp represents the power operation of a natural constant, and LeakyReLU represents the LeakyReLU activation function;

[0115] The attention score e between the a-th entity and the b-th entity ab The calculation formula is as follows:

[0116]

[0117] Among them, H a and H b Represent the initial attributes of the a-th entity and the b-th entity, respectively. and They respectively represent the second weight parameter and the third weight parameter between the a-th entity and the b-th entity, concat represents a concatenation operation, and MLP represents a multi-layer perceptron.

[0118] In one embodiment of the present invention, Figure 4 As shown in FIG. 1 , constructing sample labels for training samples for training a legal case analysis model includes the following steps:

[0119] Step S401, searching the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities;

[0120] Step S402, repeatedly inputting the sub-knowledge graph into the legal case analysis model M times to obtain M answer texts matching the user's question, where M is a custom parameter, preferably, M is set to 5;

[0121] Step S403: the relevant experts sequentially rate the satisfaction of the M answer texts, and select the answer text with the highest satisfaction score as the sample label of a training sample, where the satisfaction score ranges from 1 to 10;

[0122] Step S404, repeating steps S401 to S403 until N training samples are obtained, where N is a custom parameter, and preferably, N is set to 5000.

[0123] It should be noted that the difference between the value output by the legal case analysis model and the sample label of the training sample is specified as the loss function, and the gradient information is calculated through the back-propagation algorithm. The weight parameters and bias parameters of the model are updated according to the gradient information with the help of the gradient descent method to iteratively optimize the model until the loss is minimized. The training of the legal case analysis model is a conventional technical means and will not be elaborated here.

[0124] In one embodiment of the present invention, while retrieving the knowledge graph according to the user's question to obtain a sub-knowledge graph composed of T first entities, clicking on the first entity of each sub-knowledge graph can also display the address link of the litigation request, evidence materials, judgment documents and judgment results of the backup legal case data. Clicking on the address link can jump to the page to display the detailed file content.

[0125] The above describes an embodiment of the present embodiment, but the present embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present embodiment, ordinary technicians in this field can also make many forms, all of which are within the protection of the present embodiment.

Claims

1. Legal case intelligent retrieval and analysis system, characterized by: include: A data collection module, which is used to collect original legal case data; The original legal case data includes: case code, case type, case summary, litigation request, evidence materials, legal items, judgment documents and judgment results; A data processing module, which is used to process the original legal case data to obtain backup legal case data; The backup legal case data has the same content as the original legal case data; The case types, keywords and legal entries of the backup legal case data are all represented by vectorization, and the rest of the content is represented by address links; A knowledge graph construction module, which is used to construct a knowledge graph based on the backup legal case data; The knowledge graph includes: entities, initial attributes of entities, and connection relationships between entities; The entities include: a first entity, a second entity and a third entity; Establishing data mapping between the first entity and the case code of the backup legal case data; The second entity establishes data mapping with the case type of the backup legal case data; The third entity establishes data mapping with keywords of the case summary of the backup legal case data; The initial attributes of an entity are generated based on the information mapped by the entity data; A knowledge graph retrieval module, which is used to retrieve the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities; The representation of the sub-knowledge graph is the same as that of the knowledge graph; A knowledge graph analysis module, which is used to input the sub-knowledge graph consisting of T first entities into the legal case analysis model and output a response text matching the user's question, where T is a custom parameter; The initial attributes of the first entity are represented by the eight-bit binary code of the case code; the initial attributes of the second entity are represented by the vectorization of the case type; the initial attributes of the third entity are represented by the vectorization of the keywords of the case summary; The connection relationship between entities includes: the connection relationship between the first entity and the second entity indicates that the case code mapped by the first entity belongs to the case type mapped by the second entity; the connection relationship between the second entity and the third entity indicates that the keywords of the case summary mapped by the third entity belong to the case type mapped by the second entity; Processing the original legal case data to obtain the backup legal case data includes the following steps: Step S201, removing sensitive words from the case summary of the original legal case data by regular matching, wherein the sensitive words are manually customized; Step S202, performing word segmentation processing on the case summary after removing sensitive words through a Chinese word segmenter; Step S203, extracting keywords from the case summary after word segmentation processing by using a keyword extraction model, and manually annotating keywords in the case summary by relevant technical experts as sample labels of training samples for training the keyword extraction model; Step S204, vectorizing the keywords of the case summary, the case type and the legal items of the original legal case data through a word embedding model; Step S205, storing the litigation request, evidence materials, judgment documents and judgment results in the original legal case data into the distributed storage system, and returning the corresponding address link; Retrieving the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities includes the following steps: Step S301, vectorizing the user's question through a word embedding model; Step S302, calculating a first similarity value between the vectorized representation of the user's question and the second entity of the knowledge graph by cosine similarity, and obtaining a first entity corresponding to a first similarity value greater than or equal to a first threshold, wherein the first threshold is a custom parameter; Step S303, when it is determined that the number of first entities corresponding to the first similarity value being greater than or equal to the first threshold is less than T, the first threshold is reduced until the number of first entities is equal to T, otherwise, the process proceeds to step S304; Step S304, calculating a second similarity value between the vectorized representation of the user's question and the third entity in the knowledge graph by using cosine similarity, and obtaining a first entity corresponding to a second similarity value greater than or equal to a second threshold, wherein the second threshold is a custom parameter; Step S305 , when it is determined that the number of first entities corresponding to the second similarity value being greater than or equal to the second threshold is less than T, the second threshold is reduced; otherwise, the second threshold is increased until the number of first entities is equal to T.

2. The legal case intelligent retrieval and analysis system according to claim 1 is characterized in that: Case types include: criminal cases, civil cases, administrative cases and economic cases.

3. The legal case intelligent retrieval and analysis system according to claim 1 is characterized in that: The entities of the knowledge graph also include a fourth entity. The fourth entity establishes a mapping relationship with the legal entry. The fourth entity has a connection relationship with the first entity, indicating that the legal entry mapped by the fourth entity belongs to the case code mapped by the first entity.

4. The legal case intelligent retrieval and analysis system according to claim 1 is characterized in that: The legal case analysis model includes: a first hidden layer, an extraction layer, a splicing layer, and a second hidden layer; The first hidden layer inputs a sub-knowledge graph consisting of T first entities and outputs an update matrix, where a row vector of the update matrix represents an updated attribute of an entity; The extraction layer is used to extract the update attribute corresponding to the first entity in the update matrix; The concatenation layer is used to concatenate the updated attributes corresponding to the first entity to obtain a response vector; The second hidden layer inputs the answer vector and outputs the answer text that matches the user's question. The second hidden layer is built based on the transformer model.

5. The legal case intelligent retrieval and analysis system according to claim 4 is characterized in that: The calculation formula of the legal case analysis model includes: The calculation formula of the update matrix Z is as follows: in represents the updated attribute of the bth entity, and Pile represents the stacking operation; Updated properties of the bth entity The calculation formula is as follows: Where N a represents the set of entities that have a connection relationship with the a-th entity, α ab represents the normalized attention score between the a-th entity and the b-th entity, and B ab Respectively represent the first weight parameter and bias parameter between the a-th entity and the b-th entity, H b represents the initial attribute of the b-th entity, sigmoid represents the sigmoid activation function; The normalized attention score α between the a-th entity and the b-th entity ab The calculation formula is as follows: Where N a represents the set of entities that have a connection relationship with the a-th entity, e ab represents the attention score between the a-th entity and the b-th entity, e ac represents the attention score between the a-th entity and the c-th entity, exp represents the power operation of a natural constant, and LeakyReLU represents the LeakyReLU activation function; The attention score e between the a-th entity and the b-th entity ab The calculation formula is as follows: Among them, H a and H b Represent the initial attributes of the a-th entity and the b-th entity, respectively. and They respectively represent the second weight parameter and the third weight parameter between the a-th entity and the b-th entity, concat represents a concatenation operation, and MLP represents a multi-layer perceptron.

6. The legal case intelligent retrieval and analysis system according to claim 1 is characterized in that: Constructing sample labels for training samples for training the legal case analysis model includes the following steps: Step S401, searching the knowledge graph according to the user's question to obtain a sub-knowledge graph consisting of T first entities; Step S402, repeatedly inputting the sub-knowledge graph into the legal case analysis model M times to obtain M answer texts matching the user's question, where M is a custom parameter; Step S403: the relevant experts sequentially rate the satisfaction of the M answer texts, and select the answer text with the highest satisfaction score as the sample label of a training sample, where the satisfaction score ranges from 1 to 10; Step S404, repeating steps S401 to S403 until N training samples are obtained, where N is a custom parameter.

Citation Information

Patent Citations

  • Knowledge graph driving type law intelligent consultation system

    CN110765257A

  • Semantic understanding method and device, electronic equipment and storage medium

    CN114254656A