Crime analysis method and related device, electronic equipment and storage medium

By obtaining knowledge graphs of multiple cases and extracting information from case descriptions, and forming a reasoning path based on semantic matching, the problem of relying on comprehensive knowledge graphs in case analysis is solved, and the accuracy and effectiveness of case analysis is improved.

CN119128072APending Publication Date: 2024-12-13ANHUI IFLYTEK INTELLIGENT SYST
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411058636.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing case analysis methods rely on the comprehensiveness of the knowledge graph, making it difficult to guarantee the accuracy of analysis in complex case studies.

Method used

By obtaining knowledge graphs of multiple cases, extracting reference information and predicting case causes in case descriptions, forming inference paths based on semantic matching, generating targeted answers, reducing irrelevant case interference, and improving analysis accuracy.

Benefits of technology

Through the combination of semantic matching and knowledge graph, we will reduce the dependence on the comprehensiveness of knowledge graph organization and improve the accuracy and effectiveness of case analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128072A_ABST
    Figure CN119128072A_ABST
Patent Text Reader

Abstract

The invention discloses a case analysis method, a related device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a plurality of cause knowledge maps, and obtaining the case description of a to-be-analyzed case and a target problem of the to-be-analyzed case; wherein different causes of action knowledge maps relate to different causes of action; based on the case description, extracting reference information and a predicted cause of action of the to-be-analyzed case; based on a path formed by a target node in the target knowledge graph, which is in semantic matching with the reference information, obtaining inference content for case analysis; wherein the target knowledge graph is a cause knowledge graph involving the predicted cause; and generating a target answer to the target question based on the reasoning content. According to the scheme, the accuracy of case analysis can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a case analysis method and related devices, electronic equipment and storage media. Background Art

[0002] Thanks to the advantages of knowledge graph technology such as explainability, dependence, traceability, verifiability, and evaluability, knowledge graph technology has been widely used in many industries and scenarios.

[0003] Taking case analysis as an example, most existing case analysis is based on industry knowledge graph solutions. The accuracy of case analysis is overly dependent on the comprehensiveness of knowledge organization in the knowledge graph, which makes it difficult to ensure the accuracy of case analysis, especially when facing complex cases. In view of this, how to improve the accuracy of case analysis has become an urgent problem to be solved. Summary of the invention

[0004] The main technical problem solved by this application is to provide a case analysis method and related devices, electronic equipment and storage media, which can improve the accuracy of case analysis.

[0005] In order to solve the above-mentioned technical problems, the first aspect of the present application provides a case analysis method, including: obtaining a number of case cause knowledge graphs, and obtaining the case description of the case to be analyzed and the target question of the case to be analyzed; wherein different case cause knowledge graphs involve different case causes; based on the case description, extracting reference information and the predicted case cause of the case to be analyzed; based on the path formed by the target node in the target knowledge graph that semantically matches the reference information, obtaining the reasoning content used for case analysis; wherein the target knowledge graph is the case cause knowledge graph involving the predicted case cause; based on the reasoning content, generating a target answer to the target question.

[0006] In order to solve the above-mentioned technical problems, the second aspect of the present application provides a case analysis device, including: an analysis preparation module, a content extraction module, a path reasoning module and an answer generation module, the analysis preparation module is used to obtain a number of case cause knowledge graphs, and obtain the case description of the case to be analyzed and the target question of the case to be analyzed; wherein different case cause knowledge graphs involve different case causes; the content extraction module is used to extract reference information and the predicted case cause of the case to be analyzed based on the case description; the path reasoning module is used to obtain the reasoning content used for case analysis based on the path formed by the target node in the target knowledge graph that semantically matches the reference information; wherein the target knowledge graph is a case cause knowledge graph involving the predicted case cause; the answer generation module is used to generate a target answer to the target question based on the reasoning content.

[0007] In order to solve the above technical problems, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, the memory storing program instructions, and the processor being used to execute the program instructions to implement the case analysis method in the above first aspect.

[0008] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium storing program instructions that can be executed by a processor, and the program instructions are used to implement the case analysis method of the first aspect above.

[0009] The above scheme obtains several case cause knowledge graphs, and obtains the case description of the case to be analyzed and the target question of the case to be analyzed, and different case cause knowledge graphs involve different case causes, and then extracts reference information and predicted case causes of the case to be analyzed based on the case description. On this basis, based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information, the reasoning content used for case analysis is obtained, and the target knowledge graph is the case cause knowledge graph involving the predicted case cause, and then based on the reasoning content, the target answer to the target question is generated. On the one hand, by extracting the predicted case cause of the case to be analyzed from the case description, so as to facilitate semantic matching of the case cause knowledge graph involving the predicted case cause, the interference of the case cause knowledge graph of the case cause that is irrelevant to the case description on the case analysis can be excluded as much as possible. On the other hand, by semantically matching the reference information extracted from the case description with the case cause knowledge graph, the case and its related knowledge can be understood and matched at the semantic level, so that useful knowledge can be mined from the case cause knowledge graph for case analysis at the semantic level, which helps to reduce the dependence on the knowledge graph and its comprehensive knowledge organization as much as possible. Therefore, the accuracy of case analysis can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of an embodiment of the case analysis method of the present application;

[0011] Figure 2a This is a schematic diagram of an embodiment of a case cause knowledge graph;

[0012] Figure 2b is a schematic diagram of an embodiment of performing an extraction task on case description;

[0013] Figure 2c is a schematic diagram of another embodiment of performing an extraction task on a case description;

[0014] Figure 2d is a schematic diagram of an embodiment of semantic matching;

[0015] Figure 3 It is a schematic diagram of the framework of an embodiment of a case analysis device of the present application;

[0016] Figure 4It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0017] Figure 5 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0018] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0019] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0020] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the fragment " / " in this article generally indicates that the related objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0021] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of the case analysis method of the present application.

[0022] Specifically, the following steps may be included:

[0023] Step S11: Obtain several case cause knowledge graphs, and obtain the case description of the case to be analyzed and the target question of the case to be analyzed.

[0024] In the disclosed embodiment, different cause of action knowledge graphs involve different causes of action. It should be noted that the cause of action represents the name of the case formed after summarizing the nature of the legal relationship involved in the litigation case. For example, in a criminal case, it refers to the crime the defendant is accused of (such as theft, etc.), or, in a civil case, it refers to the claims made by the plaintiff in the lawsuit (such as return of property, compensation for damages, etc.). Of course, the above examples are only a few possible examples in practical applications, and do not limit the specific types of causes of action.

[0025] In an implementation scenario, several case file data involving the same case cause can be obtained, and then information extraction can be performed on the several case file data involving the same case cause to extract key information, so that a case cause knowledge graph of the corresponding case cause can be constructed based on the relationship between the key information (such as subordinate relationships, parallel relationships, etc.), thereby constructing a case cause knowledge graph involving different case causes.

[0026] In a specific implementation scenario, a number of case file data may include but are not limited to: transcripts, prosecution documents, judgment documents and other types of data. The specific types of case file data are not limited here.

[0027] In a specific implementation scenario, key information may include but is not limited to: cases, case handling procedures, case status indicators, violation standards, penalty sentencing recommendations, lists of verified facts and evidence, case names, case themes, time, locations, persons involved in the case, case categories, legal provisions, laws and regulations, nature of the case, prevention and control measures, etc. The specific content of the key information is not limited here.

[0028] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, in order to improve the efficiency of obtaining the case cause knowledge graph, after obtaining several case file data involving the same case cause, a prompt construction is performed on the several case file data involving the same case cause based on the first instruction template to obtain a first prompt, and the first prompt is used to instruct the first large model to construct a corresponding case cause knowledge graph for the several case file data involving the same case cause, and then send the first prompt to the first large model, and obtain the output graph of the first large model as the case cause knowledge graph. The above method, by constructing the case cause knowledge graph through the first large model, can make full use of the general understanding ability of the large language model, which not only helps to improve the efficiency of obtaining the case cause knowledge graph, but also can improve the construction accuracy of the case cause knowledge graph.

[0029] In a specific implementation scenario, the specific content of the first instruction template may include but is not limited to the following:

[0030] You are a data collation expert. Please construct a knowledge graph of the case based on the following case files involving the same case. For example, the following key information can be reflected in the knowledge graph: case, case handling process, case status indicators, violation standards, punishment and sentencing recommendations, list of verified facts and evidence, case name, case theme, time, place, person responsible for the case, case category, legal provisions, laws and regulations, case nature, prevention and control measures, etc. [input]: [[Fill in several case files involving the same case here]].

[0031] It should be noted that the above example is only a possible example of the first instruction template in actual application, and does not limit the specific content of the first instruction template. Other possible situations of the first instruction template will not be given one by one here.

[0032] In a specific implementation scenario, the first large model may include but is not limited to open source large models such as LLAMA and Bloom; or, the first large model may be obtained by fine-tuning parameters of an open source large model with specific training data; or, the first large model may be obtained through custom design. The specific source of the first large model is not limited here.

[0033] In a specific implementation scenario, please refer to Figure 2a , Figure 2a Schematic diagram of an embodiment of a case cause knowledge graph. Figure 2a As shown, the case cause knowledge graph may include but is not limited to; key information such as cases, case handling procedures, case status indicators, violation standards, punishment and sentencing recommendations, lists of verified facts and evidence, case names, case themes, time, locations, persons involved in the case, case categories, legal provisions, laws and regulations, nature of the case, prevention and control measures, etc.

[0034] In one implementation scenario, the case description of the case to be analyzed can be obtained by the user through text input, voice input, etc.; or, the case description of the case to be analyzed can also be obtained by text recognition of relevant materials such as transcripts. The specific source of the case description of the case to be analyzed is not limited. For example, the case description of the case to be analyzed may include but is not limited to the following:

[0035] On XX day of XX month of XXXX, X drove a small off-road passenger car with license plate number XXXXXX while drunk on National Highway XXX from north to south to XXXX gas station in XX County. Upon investigation, X was suspected of driving a motor vehicle while drunk. A random blood test showed that the ethanol content in X's blood was 148.86mg / 100ml.

[0036] It should be noted that the above example is only a possible example of case description and does not limit the specific content of the case description.

[0037] In an implementation scenario, the target question of the case to be analyzed can be a personalized question input together with the case description. That is to say, when entering the case description of the case to be analyzed, the target question of the case to be analyzed can be input together. Taking the case description of the aforementioned example as an example, the target question may include but is not limited to: what is the nature of the case involving X, how should X be punished if X violates the law, what is the relevant legal basis for punishing X, etc. Of course, the above examples are only a few possible examples of target questions in actual application, and do not limit the specific content of the target question. In the above method, the target question is a personalized question input together with the case description, which can satisfy the personalized case analysis of the case to be analyzed as much as possible.

[0038] In another implementation scenario, different from the aforementioned possible scenarios, the target questions for the case to be analyzed may also be uniformly preset preset questions. That is to say, no matter what the case description of the case to be analyzed contains, the target questions for the case to be analyzed are the same, and are all preset preset questions. Exemplarily, the preset questions may include but are not limited to: what is the nature of this case, what kind of crime is established in this case, what is the relevant legal basis, how should this case be punished, what is the general handling process for such cases, etc. Of course, the above examples are only a few possible examples of preset questions in actual application, and do not limit the specific content of the preset questions. In the above method, the target questions are uniformly preset preset questions, which can reduce user input as much as possible while realizing case analysis.

[0039] In another implementation scenario, different from the above possible scenarios, the above two scenarios can also be combined. For example, when obtaining the case description of the case to be analyzed, several preset questions of the case to be analyzed can be prompted, and then according to the selection instructions for the preset questions, the selected preset questions are used as the target questions of the case to be analyzed. Of course, the above example is only a possible example of combining the above two scenarios, and no more examples are given here.

[0040] Step S12: Based on the case description, extract reference information and predicted causes of the case to be analyzed.

[0041] In an implementation scenario, network models such as BERT and Transformer can be used to process the case description to predict each character in the case description to obtain a predicted label, and network models such as convolutional neural networks and long short-term memory networks can be used to process the case description to obtain a predicted case cause. Exemplarily, the predicted label can represent whether it belongs to reference information that is helpful for case analysis, and can specifically include but is not limited to starting character labels, middle character labels, ending character labels, and irrelevant character labels. Among them, the starting character label indicates that the character belongs to the starting character of a certain reference information, the middle character label indicates that the character belongs to the middle character of a certain reference information, the ending character label indicates that the character belongs to the ending character of a certain reference information, and the irrelevant character label indicates that the character is irrelevant to the reference information, that is, the character is not helpful for case analysis. On this basis, that is, for any starting character label, the character string starting from its corresponding character and ending at the character corresponding to the first ending character label can be used as a reference information, and so on and so forth, so that some reference information can be extracted from the case description.

[0042] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, the case description and several extraction tasks can also be prompted and constructed based on the second instruction template to obtain a second prompt, and the several extraction tasks at least include a case cause extraction task and an information extraction task. The second prompt is used to instruct the second largest model to perform the aforementioned extraction tasks on the case description, and then send the second prompt to the second largest model, and obtain the output information of the second largest model as reference information, and obtain the output case cause of the second largest model as a predicted case cause. The above scheme, which predicts the case cause and extracts information through the second largest model, can make full use of the general understanding ability of the large language model and improve the accuracy of case cause prediction and information extraction.

[0043] In a specific implementation scenario, the specific content of the second instruction template may include but is not limited to the following:

[0044] You are a case analysis expert. Please extract relevant information based on the following case description and its related extraction tasks. [input]:[CLS]Task[SEP]Prior[SEP]Case description.

[0045] It should be noted that in the above-mentioned second instruction template, Task represents several extraction tasks, Prior represents the specific content under the Task, and the case description is the acquired case description. Among them, as a possible example, Task can be defined as {case cause extraction, entity extraction, relationship extraction, event extraction}, and Prior can be defined as {specific case cause to be identified, entity type to be extracted, "head entity-relationship-tail entity" triple to be extracted, "event-element-type" to be extracted}. In addition, [CLS][SEP] respectively represent the starting identifier and separation identifier of the input string. Of course, the above example is only a possible example of the second instruction template in actual application, and does not limit the specific content of the second instruction template.

[0046] In a specific implementation scenario, still taking the case description of the above example as an example, please refer to Figure 2b and Figure 2c , Figure 2b is a schematic diagram of an embodiment of performing an extraction task on case description, Figure 2c This is a schematic diagram of another embodiment of performing the extraction task on the case description. Figure 2b Figure 2cAs shown, by performing the case extraction task on the case description of the above example, the predicted case "driving a motor vehicle after drinking" can be obtained. By performing the entity extraction task on the case description of the above example, reference information can be obtained: "Name of the person involved - X", "Case name - driving a motor vehicle after drinking", "Detection index - blood ethanol content 148mg / ml" and other entity information, as well as "X-behavior involving case cause - driving a motor vehicle after drinking", "X-involved detection index - blood ethanol content 148mg / ml" and other triple information, as well as "Case - driving a motor vehicle after drinking - X-National Highway XX Line", "Case - driving a motor vehicle after drinking - X-blood ethanol content 148mg / ml" and other event information. Of course, the above example is only a possible example in the actual application process. When the case description or extraction task is other content, it can be deduced by analogy, and no more examples are given here.

[0047] Step S13: Based on the path formed by the target nodes in the target knowledge graph that semantically match the reference information, the reasoning content used for case analysis is obtained.

[0048] In the disclosed embodiment, the target knowledge graph is the case cause knowledge graph involving the predicted case cause. For example, taking the case description in the above example as an example, the predicted case cause is "driving a motor vehicle while drunk", then the case cause knowledge graph involving "driving a motor vehicle while drunk" in the above several case cause knowledge graphs can be selected as the target knowledge graph, and other cases can be deduced by analogy, and no examples are given here one by one.

[0049] In an implementation scenario, based on the semantic matching between the reference information and each graph node in the target knowledge graph, a graph node can be selected as the target node, and then reasoning can be performed based on each target node in the target knowledge graph to obtain a target path formed by connecting each target node in the target knowledge graph, and based on the node content of each graph node on the target path, the reasoning content used for case analysis can be obtained. In the above method, a graph node is selected as the target node by semantic matching, and then reasoning is performed based on the target node to obtain the target path, thereby obtaining the node content of each graph node on the target path, forming the reasoning content used for case analysis, and can mine relevant knowledge for subsequent question answers from a semantic level, which helps to improve the accuracy of subsequent question answers.

[0050] In a specific implementation scenario, the semantic matching degree can be obtained by measuring the semantic features of the reference information and the graph nodes in the target knowledge graph. For example, the semantic matching degree between the two can be obtained by measuring the semantic features of the two using cosine similarity, Euclidean distance, etc.

[0051] In a specific implementation scenario, the target node is a graph node whose semantic matching degree is higher than the matching threshold. In other words, a graph node whose semantic matching degree is higher than the matching threshold can be selected as the target node. It should be noted that the specific value of the matching threshold can be set according to the actual application needs. For example, when the accuracy requirements for the answer to the question are high, the matching threshold can be set appropriately larger, or, when the accuracy requirements for the answer to the question are relatively loose, the matching threshold can be set appropriately smaller. The specific value of the matching threshold is not limited here.

[0052] In a specific implementation scenario, the target path can be the shortest path formed by connecting each target node in the target knowledge graph. That is to say, as a possible example, after obtaining the target node, multi-hop reasoning can be performed based on each target node in the target knowledge graph to infer the shortest path connecting each target node, which can be used as the target path.

[0053] In a specific implementation scenario, the reasoning content may at least include the node content of each graph node on the target path. That is to say, after obtaining the target path, the node content of each graph node on the target path can be obtained and combined into the reasoning content for case analysis. In addition, as another possible example, after obtaining the target path, not only can the node content of each graph node on the target path be obtained, but also the relationship content between adjacent nodes on the target path in the target knowledge graph can be obtained to combine the above-obtained node content and relationship content to obtain the reasoning content for case analysis. Of course, the above examples are only a few possible examples in the actual application process, and the specific content of the reasoning content is not limited thereto.

[0054] In an implementation scenario, as described above, the semantic matching degree between the graph node and the reference information in the target knowledge graph is measured by the semantic features of the two. In order to improve the measurement accuracy of the semantic matching degree, the semantic features can be extracted by a semantic extraction model, and the semantic extraction model can be trained based on the training sample data through the noise contrast estimation loss function and the triple loss function, and the training sample data includes the sample case cause knowledge graph and the sample reference information extracted from the sample case description, and each sample graph node in the sample case cause knowledge graph is marked with a sample tag indicating whether it matches the semantics of the sample reference information. Exemplarily, for the sample graph node that matches the semantics of the sample reference information, its sample tag can be a "positive example graph node", such as being marked with a symbol "+", and for the sample graph node that does not match the semantics of the sample reference information, its sample tag can be a "negative example graph node", such as being marked with a symbol "-". Of course, the above example is only a possible example in the actual application process, and does not limit the specific content of the sample tag, and no one example is given here.

[0055] In a specific implementation scenario, the semantic extraction model may include but is not limited to network models such as BERT and Transformer; or the semantic extraction model may be a large language model. The specific structure of the semantic extraction model is not specifically limited here.

[0056] In a specific implementation scenario, the specific meaning and acquisition source of the sample case cause knowledge graph can refer to the relevant description of the case cause knowledge graph, which will not be repeated here. In addition, the specific meaning and acquisition source of the sample case description can refer to the relevant description of the case description, which will not be repeated here. The specific meaning and acquisition source of the sample reference information can refer to the relevant description of the reference information, which will not be repeated here.

[0057] In a specific implementation scenario, the first sample semantic feature of the sample reference information can be extracted (for the convenience of description, it can be recorded as h), and the second sample semantic feature of each sample graph node can be extracted respectively, so that the second sample semantic feature of the positive example graph node can be obtained (for the convenience of description, it can be recorded as h + ) and the semantic matching degree between the first sample semantic feature is taken as the first matching degree, and the second sample semantic feature of the negative example graph node is obtained (for the convenience of description, it can be recorded as h - ) and the semantic matching degree between the semantic features of the first sample is taken as the second matching degree, and the positive example graph node is the sample graph node whose sample tag represents the semantic matching, and the negative example graph node is the sample graph node whose sample tag represents the semantic mismatch. On this basis, the first matching degree and the second matching degree can be processed based on the noise contrast estimation loss function to obtain the first loss value:

[0058]

[0059] In the above formula (1), represents the first loss value, h i Represents the first sample semantic feature of the sample reference information in the i-th training sample data, Represents the second sample semantic feature of the positive example graph node in the i-th training sample data, Represents the second sample semantic feature of the negative example graph node in the i-th training sample data, represents the second sample semantic feature of the jth positive example graph node, represents the second sample semantic feature of the jth negative example graph node, N represents the total number of sample graph nodes, sim represents the similarity metric function (such as cosine similarity function, etc.), and τ represents the hyperparameter. It should be noted that the specific calculation process of the first loss value can refer to the technical details of the noise contrast estimation loss function, which will not be repeated here. In addition, the first matching degree and the second matching degree can be processed based on the triple loss function to obtain the second loss value:

[0060]

[0061] In the above formula (2), represents the second loss value, h represents the first sample semantic feature of the sample reference information, and h + represents the semantic feature of the second sample of the positive graph node, h -represents the second sample semantic feature of the negative example graph node, d represents the distance metric function (such as the Euclidean distance function, etc.), max represents the maximum value, and margin represents a hyperparameter. It should be noted that the specific calculation process of the second loss value can refer to the technical details of the triplet loss function, which will not be repeated here. In the above method, the first sample semantic feature of the sample reference information is extracted, and the second sample semantic features of each sample map node are extracted respectively, and then the semantic matching degree between the second sample semantic feature of the positive map node and the first sample semantic feature is obtained as the first matching degree, and the semantic matching degree between the second sample semantic feature of the negative map node and the first sample semantic feature is obtained as the second matching degree, and the positive map node is a sample map node whose sample label represents semantic matching, and the negative map node is a sample map node whose sample label represents semantic mismatch, so that the first matching degree and the second matching degree are processed based on the noise contrast estimation loss function to obtain the first loss value, and the first matching degree and the second matching degree are processed based on the triple loss function to obtain the second loss value, and then based on the first loss value and the second loss value, the network parameters of the semantic extraction model are adjusted, so that the first loss value and the second loss value can jointly force the semantic extraction model to be able to distinguish the positive map node and the negative map node as much as possible at the semantic level, and force the semantic extraction model to make the semantic matching degree between the reference information and its positive map node as high as possible at the semantic level.

[0062] In a specific implementation scenario, please refer to Figure 2d , Figure 2d Schematic diagram of an embodiment of semantic matching. Figure 2d As shown in the figure, the sample case description is "X drove a small off-road vehicle with a license plate number of XXXXXXX from north to south on the corridor XXX line to the XXXX gas station in XX County, and was found to be drunk", and the extracted sample reference information includes "driving" and "drunk". In addition, the positive example graph nodes can include "driving a motor vehicle after drinking", and the negative example graph nodes can include "speeding a passenger car", "chasing and racing on the road", etc. On this basis, the corresponding semantic features can be extracted respectively through the semantic extraction model, and then the noise contrast estimation loss function (i.e., infoNCE loss) and the triple loss function (i.e., triple loss) constraints can be used to optimize the training of the semantic extraction network.

[0063] Step S14: Generate a target answer to the target question based on the inference content.

[0064] In one implementation scenario, the answer generation model can be pre-trained, and the answer generation model can include but is not limited to network models such as BERT, and the network structure of the answer generation model is not limited here. Specifically, sample target questions and sample reasoning content for case analysis can be obtained, and the sample target questions are marked with sample target answers. On this basis, the sample target questions and sample reasoning content can be input into the answer generation model to obtain the predicted target answer, and then based on the difference between the sample target answer and the predicted target answer, the network parameters of the answer generation model are adjusted, and the answer generation model can be forced to learn how to generate corresponding answers to questions based on the reasoning content by minimizing the above differences. On this basis, the reasoning content and the target question can be input into the answer generation model to obtain the output answer of the answer generation model as the target answer.

[0065] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, the reasoning content and the target question can also be prompted based on the third instruction template to obtain a third prompt, and the third prompt is used to instruct the third largest model to answer the target question with reference to the reasoning content, and then send the third prompt to the third largest model, and obtain the output answer of the third largest model as the target answer. Exemplarily, the third instruction template may include but is not limited to the following content:

[0066] You are a case analysis expert. Please answer the following questions based on the following reasoning: [Fill in the reasoning obtained through the previous steps]: [Fill in the target question]. Please note that you should answer each question one by one.

[0067] It should be noted that the above example is only a possible example of the third instruction template, and the specific content of the third instruction template is not limited thereto. The third large model may include but is not limited to open source large models such as LLAMA and Bloom, or the third large model may be obtained by fine-tuning the parameters of the open source large model based on specific training data, or the third large model may be a custom-designed large language model, and the specific source of the third large model is not limited here. In addition, in the embodiments of the present disclosure, the first large model, the second large model, and the third large model may be the same large model or different large models, which is not limited here. As a possible example, take the following case description as an example:

[0068] At about X:00 p.m. on X / X / XX / XX, defendant A drove a small ordinary passenger car with license plate number XXXXXXXXX while drunk along XX Road in XX District of this city from east to west. When he reached 100 meters west of the intersection of XX Road, he rear-ended a small car with license plate number XXXXXXXX owned by victim C driven by B in front of him, causing damage to both cars. Upon examination, the ethanol content in A's blood was 186.2 mg / 100 mL.

[0069] In addition, target questions may include the following: "What is the nature of this case?", "Which case is more appropriate for this case?", "Why is this case decided?", "What is the relevant legal basis?", "How should this case be punished?", "What is the general handling procedure for such cases?". Accordingly, after the large language model analyzes the reasoning content and the target question, the following target answers can be output respectively: "The nature of this case is the crime of dangerous driving.", "It is more appropriate to charge this case with the crime of dangerous driving.", "According to the case, A drove a motor vehicle while drunk on the road, and the ethanol content in his blood was 186.2mg / 100mL, which has reached the legal standard of blood alcohol / ethanol content of 80mg / 100ml-200mg / 100ml, and belongs to drunk driving on the road.", "The relevant legal basis is the relevant provisions of Article 133 of the Criminal Law on the crime of dangerous driving.", "According to the case and relevant legal provisions, A can be given detention and a fine. The specific punishment should be comprehensively considered and judged based on the specific circumstances of the case, A's attitude towards confession, compensation situation and other factors.", "The general handling process of such cases includes filing a case for investigation, taking compulsory measures, judicial appraisal, filing a public prosecution, collecting evidence and other steps." Of course, the above example is only a possible example in the actual application process. When the case description is other content or the target question is other problems, it can be deduced by analogy, and no examples are given here one by one.

[0070] The above scheme obtains several case cause knowledge graphs, and obtains the case description of the case to be analyzed and the target question of the case to be analyzed, and different case cause knowledge graphs involve different case causes, and then extracts reference information and predicted case causes of the case to be analyzed based on the case description. On this basis, based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information, the reasoning content used for case analysis is obtained, and the target knowledge graph is the case cause knowledge graph involving the predicted case cause, and then based on the reasoning content, the target answer to the target question is generated. On the one hand, by extracting the predicted case cause of the case to be analyzed from the case description, so as to facilitate semantic matching of the case cause knowledge graph involving the predicted case cause, the interference of the case cause knowledge graph of the case cause that is irrelevant to the case description on the case analysis can be excluded as much as possible. On the other hand, by semantically matching the reference information extracted from the case description with the case cause knowledge graph, the case and its related knowledge can be understood and matched at the semantic level, so that useful knowledge can be mined from the case cause knowledge graph for case analysis at the semantic level, which helps to reduce the dependence on the knowledge graph and its comprehensive knowledge organization as much as possible. Therefore, the accuracy of case analysis can be improved.

[0071] See also Figure 3 , Figure 3It is a schematic diagram of the framework of an embodiment of a case analysis device 30 of the present application. The case analysis device 30 includes: an analysis preparation module 31, a content extraction module 32, a path reasoning module 33 and an answer generation module 34. The analysis preparation module 31 is used to obtain a number of case cause knowledge graphs, and obtain the case description of the case to be analyzed and the target question of the case to be analyzed; wherein different case cause knowledge graphs involve different case causes; the content extraction module 32 is used to extract reference information and the predicted case cause of the case to be analyzed based on the case description; the path reasoning module 33 is used to obtain the reasoning content for case analysis based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information; wherein the target knowledge graph is the case cause knowledge graph involving the predicted case cause; the answer generation module 34 is used to generate a target answer to the target question based on the reasoning content.

[0072] In the above scheme, the case analysis device 30 obtains several case cause knowledge graphs, and obtains the case description of the case to be analyzed and the target problem of the case to be analyzed, and different case cause knowledge graphs involve different case causes. Based on the case description, reference information and the predicted case cause of the case to be analyzed are extracted. On this basis, based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information, the reasoning content used for case analysis is obtained, and the target knowledge graph is the case cause knowledge graph involving the predicted case cause. Then, based on the reasoning content, the target answer to the target question is generated. On the one hand, by extracting the predicted case cause of the case to be analyzed from the case description, so as to facilitate semantic matching of the case cause knowledge graph involving the predicted case cause, the interference of the case cause knowledge graph of the case cause irrelevant to the case description on the case analysis can be excluded as much as possible. On the other hand, by semantically matching the reference information extracted from the case description with the case cause knowledge graph, the case and its related knowledge can be understood and matched at the semantic level, so that useful knowledge can be mined from the case cause knowledge graph for case analysis at the semantic level, which helps to reduce the dependence on the knowledge graph and its comprehensive knowledge organization as much as possible. Therefore, the accuracy of case analysis can be improved.

[0073] In some disclosed embodiments, the path reasoning module 33 includes a node selection submodule, which is used to select a graph node as a target node based on the semantic matching degree between the reference information and each graph node in the target knowledge graph; the path reasoning module 33 includes a multi-hop reasoning submodule, which is used to perform reasoning based on each target node in the target knowledge graph to obtain a target path formed by connecting each target node in the target knowledge graph; the path reasoning module 33 includes a content acquisition submodule, which is used to obtain reasoning content for case analysis based on the node content of each graph node on the target path.

[0074] In some disclosed embodiments, the target node is a graph node whose semantic matching degree is higher than a matching degree threshold; and / or, the target path is the shortest path formed by connecting each target node in the target knowledge graph; and / or, the reasoning content includes at least the node content of each graph node on the target path.

[0075] In some disclosed embodiments, the analysis preparation module 31 includes a data acquisition submodule for acquiring several case file data involving the same case cause; the analysis preparation module 31 includes a first construction submodule for performing prompt construction on several case file data involving the same case cause based on a first instruction template to obtain a first prompt; wherein the first prompt is used to instruct the first large model to construct a corresponding case cause knowledge graph for several case file data involving the same case cause; the analysis preparation module 31 includes a first generation submodule for sending the first prompt to the first large model, and obtaining the output graph of the first large model as the case cause knowledge graph.

[0076] In some disclosed embodiments, the content extraction module 32 includes a second construction submodule, which is used to construct prompts for the case description and several extraction tasks based on the second instruction template to obtain a second prompt; wherein the several extraction tasks include at least a case cause extraction task and an information extraction task, and the second prompt is used to instruct the second large model to perform each extraction task on the case description; the content extraction module 32 includes a second generation submodule, which is used to send the second prompt to the second large model, and obtain the output information of the second large model as reference information, and obtain the output case cause of the second large model as a predicted case cause.

[0077] In some disclosed embodiments, the information extraction task includes at least one of an entity extraction task, a relationship extraction task, and an event extraction task.

[0078] In some disclosed embodiments, the answer generation module 34 includes a third construction submodule, which is used to construct prompts for the reasoning content and the target question based on the third instruction template to obtain a third prompt; wherein the third prompt is used to instruct the third largest model to answer the target question with reference to the reasoning content; the answer generation module 34 includes a third generation submodule, which is used to send the third prompt to the third largest model, and obtain the output answer of the third largest model as the target answer.

[0079] In some disclosed embodiments, the degree of semantic matching between graph nodes and reference information in a target knowledge graph is measured by their respective semantic features, and the semantic features are extracted by a semantic extraction model, which is trained based on training sample data through noise contrast estimation loss function and triple loss function, and the training sample data includes a sample case cause knowledge graph and sample reference information extracted from the sample case description, and each sample graph node in the sample case cause knowledge graph is annotated with a sample tag indicating whether it semantically matches the sample reference information.

[0080] In some disclosed embodiments, the case analysis device 30 also includes a sample extraction module for extracting a first sample semantic feature of sample reference information, and respectively extracting a second sample semantic feature of each sample graph node; the case analysis device 30 also includes a semantic matching module for obtaining a semantic matching degree between the second sample semantic feature of a positive example graph node and the first sample semantic feature as a first matching degree, and obtaining a semantic matching degree between the second sample semantic feature of a negative example graph node and the first sample semantic feature as a second matching degree; wherein the positive example graph node is a sample graph node whose sample label represents a semantic match, and the negative example graph node is a sample graph node whose sample label represents a semantic mismatch; the case analysis device 30 also includes a loss measurement module for processing the first matching degree and the second matching degree based on a noise contrast estimation loss function to obtain a first loss value, and processing the first matching degree and the second matching degree based on a triple loss function to obtain a second loss value; the case analysis device 30 also includes a parameter adjustment module for adjusting the network parameters of the semantic extraction model based on the first loss value and the second loss value.

[0081] In some disclosed embodiments, the target question is a personalized question input together with the case description; or, the target question is a uniformly preset question.

[0082] See also Figure 4 , Figure 4 : is a schematic diagram of the framework of an embodiment of an electronic device 40 of the present application. The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, the memory 41 stores program instructions, and the processor 42 is used to execute the program instructions to implement the steps in any of the above-mentioned case analysis method embodiments. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here. As a possible situation, the electronic device 40 may also include a human-computer interaction circuit (not shown) for realizing human-computer interaction with the user, such as information input, information output, etc. The human-computer interaction circuit may include but is not limited to: a screen, a speaker, a microphone, etc., which are not limited here.

[0083] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps in any of the above-mentioned case analysis method embodiments. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.

[0084] In the above scheme, the electronic device 40 obtains several case cause knowledge graphs, and obtains the case description of the case to be analyzed and the target question of the case to be analyzed, and different case cause knowledge graphs involve different case causes, and then extracts reference information and the predicted case cause of the case to be analyzed based on the case description. On this basis, based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information, the reasoning content for case analysis is obtained, and the target knowledge graph is the case cause knowledge graph involving the predicted case cause, and then based on the reasoning content, the target answer to the target question is generated. On the one hand, by extracting the predicted case cause of the case to be analyzed from the case description, so as to facilitate semantic matching of the case cause knowledge graph involving the predicted case cause, the interference of the case cause knowledge graph of the case cause that is irrelevant to the case description on the case analysis can be excluded as much as possible. On the other hand, by semantically matching the reference information extracted from the case description with the case cause knowledge graph, the case and its related knowledge can be understood and matched at the semantic level, so that useful knowledge can be mined from the case cause knowledge graph for case analysis at the semantic level, which helps to reduce the dependence on the knowledge graph and its comprehensive knowledge organization as much as possible. Therefore, the accuracy of case analysis can be improved.

[0085] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 50 of the present application. The computer-readable storage medium 50 stores program instructions 51 that can be executed by a processor, and the program instructions 51 are used to implement the steps in any of the above-mentioned case analysis method embodiments.

[0086] In the above scheme, the computer-readable storage medium 50 obtains several case cause knowledge graphs, and obtains the case description of the case to be analyzed and the target problem of the case to be analyzed, and different case cause knowledge graphs involve different case causes. Based on the case description, reference information and predicted case causes of the case to be analyzed are extracted. On this basis, based on the path formed by the target node in the target knowledge graph that matches the semantics of the reference information, the reasoning content used for case analysis is obtained, and the target knowledge graph is the case cause knowledge graph involving the predicted case cause. Then, based on the reasoning content, the target answer to the target question is generated. On the one hand, by extracting the predicted case cause of the case to be analyzed from the case description, so as to facilitate semantic matching of the case cause knowledge graph involving the predicted case cause, the interference of the case cause knowledge graph of the case cause irrelevant to the case description on the case analysis can be excluded as much as possible. On the other hand, by semantically matching the reference information extracted from the case description with the case cause knowledge graph, the case and its related knowledge can be understood and matched at the semantic level, so that useful knowledge can be mined from the case cause knowledge graph for case analysis at the semantic level, which helps to reduce the dependence on the knowledge graph and its comprehensive knowledge organization as much as possible. Therefore, the accuracy of case analysis can be improved.

[0087] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0088] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0089] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0091] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0092] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0093] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

Claims

1. A case analysis method, It is characterized in that include: Obtaining several case cause knowledge graphs, and obtaining case descriptions of the cases to be analyzed and target questions for the cases to be analyzed; wherein different case cause knowledge graphs involve different case causes; Based on the case description, extract reference information and predicted causes of the case to be analyzed; Based on the path formed by the target node in the target knowledge graph that semantically matches the reference information, the reasoning content used for case analysis is obtained; wherein the target knowledge graph is a case cause knowledge graph involving the predicted case cause; Based on the inference content, a target answer to the target question is generated.

2. The method according to claim 1, It is characterized in that The path formed by the target node in the target knowledge graph that semantically matches the reference information to obtain the reasoning content used for case analysis includes: Based on the semantic matching degree between the reference information and each graph node in the target knowledge graph, the graph node is selected as the target node; Perform reasoning based on each of the target nodes in the target knowledge graph to obtain a target path formed by connecting each of the target nodes in the target knowledge graph; Based on the node content of each of the graph nodes on the target path, the reasoning content used for case analysis is obtained.

3. The method according to claim 2, It is characterized in that The target node is a graph node whose semantic matching degree is higher than a matching degree threshold; And / or, the target path is the shortest path formed by connecting the target nodes in the target knowledge graph; And / or, the reasoning content at least includes the node content of each of the graph nodes on the target path.

4. The method according to claim 1, It is characterized in that The obtaining of several case cause knowledge graphs includes: Obtain data on several cases involving the same cause of action; Based on the first instruction template, a prompt is constructed for a plurality of case file data involving the same case cause, to obtain a first prompt; wherein the first prompt is used to instruct the first large model to construct a corresponding case cause knowledge graph for the plurality of case file data involving the same case cause; The first prompt is sent to the first large model, and an output graph of the first large model is obtained as the case cause knowledge graph.

5. The method according to claim 1, It is characterized in that The extracting of reference information and predicted causes of the case to be analyzed based on the case description includes: Based on the second instruction template, a prompt is constructed for the case description and a plurality of extraction tasks to obtain a second prompt; wherein the plurality of extraction tasks at least include a case cause extraction task and an information extraction task, and the second prompt is used to instruct the second large model to perform each of the extraction tasks on the case description; The second prompt is sent to the second large model, and the output information of the second large model is obtained as the reference information, and the output case of the second large model is obtained as the prediction case.

6. The method according to claim 5, It is characterized in that The information extraction task includes: at least one of an entity extraction task, a relationship extraction task, and an event extraction task.

7. The method according to claim 1, It is characterized in that The generating a target answer to the target question based on the inference content includes: Based on the third instruction template, a prompt is constructed for the reasoning content and the target question to obtain a third prompt; wherein the third prompt is used to instruct the third model to answer the target question with reference to the reasoning content; The third prompt is sent to the third largest model, and an output answer of the third largest model is obtained as the target answer.

8. The method according to claim 1, It is characterized in that The degree of semantic matching between the graph node in the target knowledge graph and the reference information is obtained by measuring the semantic features of each of them, and the semantic features are extracted by a semantic extraction model, which is trained based on training sample data through noise contrast estimation loss function and triple loss function, and the training sample data includes a sample case knowledge graph and sample reference information extracted from the sample case description, and each sample graph node in the sample case knowledge graph is annotated with a sample tag indicating whether it semantically matches the sample reference information.

9. The method according to claim 8, It is characterized in that The training steps of the semantic extraction model include: Extracting the first sample semantic feature of the sample reference information, and respectively extracting the second sample semantic feature of each of the sample graph nodes; Obtaining the semantic matching degree between the second sample semantic feature of the positive example graph node and the first sample semantic feature as the first matching degree, and obtaining the semantic matching degree between the second sample semantic feature of the negative example graph node and the first sample semantic feature as the second matching degree; wherein the positive example graph node is a sample graph node whose sample label represents a semantic match, and the negative example graph node is a sample graph node whose sample label represents a semantic mismatch; Processing the first matching degree and the second matching degree based on the noise contrast estimation loss function to obtain a first loss value, and processing the first matching degree and the second matching degree based on the triplet loss function to obtain a second loss value; Based on the first loss value and the second loss value, adjust the network parameters of the semantic extraction model.

10. The method according to any one of claims 1 to 9, It is characterized in that The target question is a personalized question input together with the case description; Alternatively, the target question is a preset question that is uniformly preset.

11. A case analysis device, It is characterized in that include: An analysis preparation module is used to obtain a number of case cause knowledge graphs, and obtain a case description of the case to be analyzed and a target question for the case to be analyzed; wherein different case cause knowledge graphs involve different case causes; A content extraction module, used to extract reference information and predicted causes of the case to be analyzed based on the case description; A path reasoning module, used to obtain reasoning content for case analysis based on the path formed by the target node in the target knowledge graph that semantically matches the reference information; wherein the target knowledge graph is a case cause knowledge graph involving the predicted case cause; The answer generation module is used to generate a target answer to the target question based on the reasoning content.

12. An electronic device, It is characterized in that The method comprises at least a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the case analysis method according to any one of claims 1 to 10.

13. A computer-readable storage medium, It is characterized in that Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the case analysis method described in any one of claims 1 to 10.

Citation Information

Cited By

  • Intelligent auditing method and system for digital file and storage medium

    CN120807231A

  • An intelligent auditing method and system for digital files and a storage medium

    CN120807231B