Class case text pushing method and device based on artificial intelligence
Through artificial intelligence-based methods, the feature features of legal texts are extracted and feature vectors are calculated, which solves the problem of low accuracy in pushing legal text cases in the existing technology, and accurately match and push legal texts are achieved.
Patent Information
- Application Number
- CN202411857348.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The existing legal text case push method cannot effectively analyze legal relationships when processing legal texts, resulting in low accuracy of case push.
Using an artificial intelligence-based method, we obtain the target legal text, determine its legal classification, build a feature extraction model, extract feature features, calculate feature vectors, and then push texts of similar cases.
It improves the accuracy of legal text case push, realizes effective extraction and precise matching of diverse features in legal text, and reduces the poor learning ability of single modeling and corpus training.
Smart Images

Figure CN119807521A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and in particular to a method and device for pushing similar case texts based on artificial intelligence. Background Art
[0002] With the rapid development of text processing technology, providing text recommendations for users has become a key research and development direction of text processing. For example, the retrieval or recommendation of similar legal documents usually uses a combination of natural language processing and machine learning technology.
[0003] At present, the existing recommendation of similar case texts for legal documents usually adopts the method of combining text similarity calculation with machine learning and natural language processing. However, the combination of text similarity calculation with machine learning and natural language processing mostly directly processes all case information, and cannot parse the content with legal attributes such as legal relationships in the case according to legal business logic. If separate modeling and corpus training are carried out for legal attribute elements, a large amount of text processing resources are required, resulting in low accuracy of feature extraction of legal texts and inability to accurately push similar case texts. Summary of the invention
[0004] In view of this, the present application provides a method and device for pushing similar case texts based on artificial intelligence, the main purpose of which is to solve the problem of poor accuracy in the existing push of similar case texts of legal texts.
[0005] According to one aspect of the present application, a method for pushing similar case texts based on artificial intelligence is provided, comprising:
[0006] Obtain the target legal text;
[0007] Determine a feature extraction model based on the legal classification of the target legal text, and extract features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set;
[0008] Determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
[0009] Furthermore, the legal classification includes criminal classification, and before determining the feature extraction model based on the legal classification of the target legal text, the method further includes:
[0010] Obtain criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set;
[0011] Constructing a case cause prediction model and a criminal feature extraction model that match the legal attributes;
[0012] The case cause prediction model is trained based on the criminal case cause sample to obtain a case cause prediction model that has completed model training, and the criminal feature extraction model is trained based on the criminal element feature sample and the criminal case cause sample to obtain a criminal feature extraction model that has completed model training.
[0013] Furthermore, the criminal feature extraction model includes a natural language processing network, a conditional random field algorithm, and a bidirectional long short-term memory network, and the model training of the criminal feature extraction model based on the criminal element feature samples and the criminal case cause samples includes:
[0014] Performing semantic division on the input sample in the criminal element feature sample based on the natural language processing network, and obtaining a semantic sample;
[0015] The semantic samples are labeled by the conditional random field algorithm to obtain labeled samples, wherein the labeled samples include labeled word samples, part-of-speech samples, syntactic samples, word and sentence samples, and knowledge element position samples;
[0016] The bidirectional long short-term memory network is trained based on the labeled samples and the output samples in the criminal element feature samples to complete the training of the criminal feature extraction model. The output samples include case cause features, attribute features, knowledge element features, knowledge element category features, element role features, and paragraph features.
[0017] Furthermore, the step of labeling the semantic samples by using the conditional random field algorithm to obtain the labeled samples includes:
[0018] Extracting expected knowledge meta-features from the semantic sample and determining the text position of the expected knowledge meta-features;
[0019] A prompt word is determined based on the text position and a preset word distance, and is integrated into a position mark of the knowledge element position sample based on the position identifier of the prompt word.
[0020] Furthermore, the first feature vector for determining the element feature and the second feature vectors of different case texts in the case database include:
[0021] Determining a weight value of the element feature, and constructing a first feature vector of the element feature based on the weight value;
[0022] The case database is matched based on the extracted case cause features, and second feature vectors of different case texts in the case database are obtained.
[0023] Furthermore, the legal classification includes civil classification, and before determining the feature extraction model based on the legal classification of the target legal text, the method further includes:
[0024] Acquire a civil element feature sample from the element feature sample set;
[0025] Constructing a civil feature extraction model, wherein the civil feature extraction model includes a combination of a natural language processing network and a conditional random field algorithm, a bidirectional long short-term memory network, a text transfer network, or an unsupervised model;
[0026] The civil feature extraction model is trained based on the civil element feature samples to obtain a civil feature extraction model that has completed model training.
[0027] Furthermore, the determining a target similar case text based on the similarity between the first feature vector and the second feature vector and pushing the target similar case text includes:
[0028] Calculating the similarity between the first feature vector and the second feature vector, and sorting the similarities;
[0029] A target similar case text is determined based on the ranking result of the similarity, and the target similar case text is pushed.
[0030] According to another aspect of the present application, a device for pushing similar case texts based on artificial intelligence is provided, comprising:
[0031] An acquisition module, used to acquire the target legal text;
[0032] An extraction module, used to determine a feature extraction model based on the legal classification of the target legal text, and perform feature extraction on the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set;
[0033] The push module is used to determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
[0034] Furthermore, the device also includes: a construction module, a training module,
[0035] The acquisition module is used to acquire criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set;
[0036] The construction module is used to construct a case cause prediction model and a criminal feature extraction model that match the legal attributes;
[0037] The training module is used to perform model training on the case cause prediction model based on the criminal case cause sample to obtain a case cause prediction model that has completed model training, and to perform model training on the criminal feature extraction model based on the criminal element feature sample and the criminal case cause sample to obtain a criminal feature extraction model that has completed model training.
[0038] Furthermore, the training module is specifically used to perform semantic division on the input samples in the criminal element feature samples based on the natural language processing network and obtain semantic samples; mark the semantic samples through the conditional random field algorithm to obtain marked samples, and the marked samples include marked word samples, part of speech samples, syntax samples, sentence samples and knowledge element position samples; perform model training on the bidirectional long short-term memory network based on the marked samples and the output samples in the criminal element feature samples to complete the training of the criminal feature extraction model, and the output samples include case cause features, attribute features, knowledge element features, knowledge element category features, element role features, and paragraph features.
[0039] Furthermore, the training module is specifically used to extract expected knowledge element features from the semantic sample and determine the text position of the expected knowledge element features; determine the prompt word based on the text position and the preset word distance, and integrate the position mark of the knowledge element position sample based on the position identifier of the prompt word.
[0040] Furthermore, the push module is specifically used to determine the weight value of the element feature and construct a first feature vector of the element feature based on the weight value; match the case database based on the extracted case cause feature and obtain the second feature vector of different case texts in the case database.
[0041] Further,
[0042] The acquisition module is further used to acquire civil element feature samples from the element feature sample set;
[0043] The construction module is further used to construct a civil feature extraction model, which includes a combination of a natural language processing network and a conditional random field algorithm, a bidirectional long short-term memory network, a text migration network, or an unsupervised model;
[0044] The training module is also used to perform model training on the civil feature extraction model based on the civil element feature samples to obtain a civil feature extraction model that has completed model training.
[0045] Furthermore, the push module is specifically used to calculate the similarity between the first feature vector and the second feature vector, and sort the similarity; determine the target similar case text based on the sorting result of the similarity, and push the target similar case text.
[0046] According to another aspect of the present application, a storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned artificial intelligence-based similar case text push method.
[0047] According to another aspect of the present application, a terminal is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;
[0048] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned artificial intelligence-based similar case text pushing method.
[0049] By means of the above technical solution, the technical solution provided by the embodiment of the present application has at least the following advantages:
[0050] The present application provides a method and device for pushing similar case texts based on artificial intelligence. Compared with the prior art, the embodiments of the present application obtain a target legal text; determine a feature extraction model based on the legal classification of the target legal text, and extract features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set; determine a first feature vector of the element feature and a second feature vector of different case texts in a case database, and determine a target similar case text based on the similarity between the first feature vector and the second feature vector, and push the target similar case text, thereby effectively extracting diversified features from the legal text, meeting the demand for accurate matching of the characteristic content of the legal text, and reducing the problem of poor learning ability for single modeling and corpus training, thereby improving the accurate recommendation of similar cases of legal texts.
[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0053] Figure 1 A flowchart of a method for pushing similar case texts based on artificial intelligence provided in an embodiment of the present application is shown;
[0054] Figure 2 A schematic diagram of knowledge element feature extraction provided by an embodiment of the present application is shown;
[0055] Figure 3 The following is a block diagram showing a similar case text push device based on artificial intelligence provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of the structure of a terminal provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0057] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0058] The present application embodiment provides a method for pushing similar case texts based on artificial intelligence, such as Figure 1 As shown, the method includes:
[0059] 101. Obtain the target legal text.
[0060] In the embodiment of the present application, the target legal text is a normative or non-normative legal or ordinary text to be pushed for similar case files, including but not limited to judgments, rulings, indictments, prosecution opinions, or case summaries, case descriptions, etc., which are not specifically limited in the embodiment of the present application. In addition, the acquisition of the target legal text can be entered by the user through the client, or it can be cached by the system, which is not specifically limited in the embodiment of the present application.
[0061] It should be noted that the current execution end, which is used as the execution end for pushing similar case texts, can be a cloud server or a client device, and this embodiment of the present application does not make any specific limitation.
[0062] 102. Determine a feature extraction model based on the legal classification of the target legal text, and perform feature extraction on the target legal text based on the feature extraction model to obtain element features that match the legal classification.
[0063] In the embodiment of the present application, after obtaining the target legal text, the current execution end determines the feature extraction model based on the legal classification of the target legal text. At this time, the legal classification includes criminal classification and civil classification, and different legal classifications are pre-trained with matching feature extraction models. Among them, the feature extraction model is obtained by training the feature extraction model matching the legal classification according to the element feature sample set. The feature extraction model is constructed based on an artificial intelligence algorithm. The element feature sample set includes feature samples of different element extraction requirements, including but not limited to the cause of the case, the charge, the criminal behavior, etc., which are not specifically limited in the embodiment of the present application.
[0064] It should be noted that the legal classification can be determined based on semantic recognition in the target legal text, or based on extraction from a specific position. For example, if the word intentional injury is identified from a specific position in the target legal text, the legal classification can be determined as criminal. This embodiment of the present application does not make specific limitations.
[0065] 103. Determine a first feature vector of the element feature and a second feature vector of different case texts in a case database, and determine a target similar case text based on the similarity between the first feature vector and the second feature vector for push.
[0066] In the embodiment of the present application, after extracting the element features, the current execution end performs vector conversion on the element features to obtain the first feature vector, and calls the case database. The case database stores case texts as similar cases to be matched, and feature vectors corresponding to different case texts, so as to calculate the similarity between the first feature vector and the second feature vector, and then select the target similar case text from the case text based on the ranking result of the similarity, and push it to the user.
[0067] It should be noted that when performing vector conversion, specifically, the weight value of each element feature can be obtained, and each weight value can be converted into a vector representation to obtain a feature vector. Different element features are pre-configured with different weight values, which can be configured based on different case types and case push requirements. The embodiments of this application do not make specific limitations.
[0068] In another embodiment of the present application, for further definition and explanation, before the step of determining the feature extraction model based on the legal classification of the target legal text, the method further includes:
[0069] Obtain criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set;
[0070] Constructing a case cause prediction model and a criminal feature extraction model that match the legal attributes;
[0071] The case cause prediction model is trained based on the criminal case cause sample to obtain a case cause prediction model that has completed model training, and the criminal feature extraction model is trained based on the criminal element feature sample and the criminal case cause sample to obtain a criminal feature extraction model that has completed model training.
[0072] In order to improve the accuracy of feature extraction and meet the push efficiency of case texts of different legal classifications, for the implementation scenario where the legal classification is criminal classification, first obtain criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set. Among them, the legal attribute is used to characterize the specific circumstances of the entire criminal crime, including but not limited to the subject of the crime, the object of the crime, the motive and purpose of the crime, the time of the crime, the place of the crime, the means of crime, the amount of the crime, the consequences of the damage, the tools of the crime, the sentencing circumstances, etc. For example, the time of the crime, the place of the crime, the amount of the crime, etc. of the facts of the case, and also include the sentencing circumstances of the case, such as: surrender, compensation for the victim's loss, etc. The criminal case cause is used to characterize the reasons for the occurrence of criminal cases, including but not limited to crimes against the person, crimes against property, such as intentional injury and theft. The criminal element feature is the specific content extracted according to the legal attribute, which is used as a knowledge element to construct the element feature, and the embodiment of this application does not make specific restrictions. At the same time, in the embodiment of the present application, the specific feature information extracted can be classified and processed to directly define the knowledge element, for example, causing the victim Wang Moumou to die of craniocerebral injury and lung rupture (knowledge element) - death (knowledge element category), entering the victim's home to steal three times (knowledge element) - multiple crimes (knowledge element category). At this time, the classification of knowledge elements helps to quickly locate the core knowledge element, that is, as the extracted specific element feature content, simplifying the key information of the case. In addition, the element features in the embodiment of the present application can be classified based on different attributes. In addition to the above, they can also include: element roles, extraction paragraphs, etc., where the element role is the defendant, such as a natural person and an institution, and the extraction paragraph is the location information extracted by the identification knowledge element, for example: causing the victim Wang Moumou to die of craniocerebral injury and lung rupture (knowledge element) - traffic accident crime (cause of the case) - Wang (element role) - evidence (location information). At this time, the same element feature as a knowledge element may correspond to different attribute types, such as a minor. At this time, the attribute type can be a criminal subject or a criminal object, and the embodiment of the present application does not make specific limitations.
[0073] Specifically, a case prediction model and a criminal feature extraction model that match the legal attributes are constructed. For the case prediction model, the criminal case samples can be matched based on the criminal means and criminal behavior in the legal attributes, and the RoformerV2 model can be used as the model to be trained. At the same time, for the criminal feature extraction model, the criminal element feature samples can be matched based on the criminal motive and purpose, crime time, crime location, crime means, etc. in the legal attributes, and the criminal feature extraction model is constructed by combining the natural language processing network, the conditional random field algorithm, and the bidirectional long short-term memory network. Furthermore, the case prediction model is trained based on the criminal case samples to obtain the case prediction model that has completed the model training, and the criminal feature extraction model is trained based on the criminal element feature samples and the criminal case samples to obtain the criminal feature extraction model that has completed the model training.
[0074] When the case prediction model is trained based on the criminal case sample to obtain the case prediction model that has completed the model training, the current execution end specifically includes the case sample and the recommendation sample in the criminal case sample. During training, the case sample is used as the model input and the recommendation sample is used as the model output to train the RoformerV2 model, so as to obtain the prediction result represented as case 1-recommendation degree; case 2-recommendation degree; case 3-recommendation degree, etc. At this time, the recommendation degree can be calibrated based on human intervention, or the confidence of each case can be calculated for configuration, which is not specifically limited in the embodiments of the present application.
[0075] In another embodiment of the present application, for further definition and explanation, the step of training the criminal feature extraction model based on the criminal element feature sample and the criminal case sample includes:
[0076] Performing semantic division on the input sample in the criminal element feature sample based on the natural language processing network, and obtaining a semantic sample;
[0077] The semantic samples are labeled by the conditional random field algorithm to obtain labeled samples, wherein the labeled samples include labeled word samples, part-of-speech samples, syntactic samples, word and sentence samples, and knowledge element position samples;
[0078] The bidirectional long short-term memory network is trained based on the labeled samples and the output samples in the criminal element feature samples to complete the training of the criminal feature extraction model.
[0079] In order to achieve accurate matching of legal cases using artificial intelligence, thereby improving the efficient recommendation of legal cases, the current execution end, when training the criminal feature extraction model based on the criminal element feature samples and the criminal case cause samples, targets the constructed criminal feature extraction model, including a natural language processing network, a conditional random field algorithm, and a bidirectional long short-term memory network, so as to achieve different learning purposes when training the model. Among them, the natural language processing network is preferably a Bert model, which is used to semantically divide the input samples in the criminal element feature samples to obtain semantic samples as outputs of the natural language processing network. At this time, the input samples in the criminal element feature samples can be texts containing the element features to be extracted, so as to obtain output semantic samples after semantic division through the natural language processing network to complete the division of text paragraphs. For example, after the model is trained, the first-instance judgment of the criminal case is used as the target legal text. After input into the natural language processing network, the output divided paragraphs are the defendant's profile, the litigation process, the prosecution's accusation, the facts of the case, the court's opinion, the evidence paragraph, the judgment result, etc., which are not specifically limited in the embodiments of this application. After the semantic segmentation is completed, the semantic samples after the segmentation are obtained, and the semantic samples are labeled by the conditional random field algorithm CRF (conditional random field) to obtain labeled samples. Among them, the labeled samples include the labeled word samples, part of speech samples, syntax samples, sentence samples and knowledge element position samples, that is, the labeling samples are learned by the conditional random field algorithm model to learn the words, parts of speech and other labels in the semantic samples to complete the model training. Finally, the bidirectional long short-term memory network BilSTM is trained based on the output samples in the labeled samples and the criminal element feature samples to complete the training of the criminal feature extraction model, wherein the output samples include case cause features, attribute features, knowledge element features, knowledge element category features, element role features, and paragraph features. The case cause features are used to characterize the case causes of criminal cases, the attribute features are used to characterize the elements that constitute a crime, such as damaging behavior, damaging results, etc., the knowledge element features are used to characterize the specific content of the features, the knowledge element category features are used to characterize the category to which the features belong, for example, if the knowledge element feature is death due to lung rupture, the corresponding knowledge element category is death, the element role features are used to characterize the characteristics of the victim or the defendant, such as a minor, etc., and the paragraph features are used to characterize the text paragraphs in which the above-mentioned element features are identified, which are not specifically limited in the embodiments of the present application.
[0080] It should be noted that if Figure 2As shown, in order to improve the effectiveness and accuracy of feature extraction and meet the extraction requirements of different feature elements, the current execution end can also extract and mark each output sample as a knowledge element feature based on auxiliary rules. For example, the purpose of crime is for the purpose of illegal possession, the location of the crime is in the courtyard of No. 265, Pingchuan Road, Shayibake District, Urumqi. The rule method is mainly used to mark the sentencing information and the judgment results when extracting, so as to describe such attributes. Usually, the expression is relatively standardized. At this time, a fixed language expression is used. For example For example: the regular expression library in the Boost algorithm: Boost.Regex; applied to the crime time expressed as: (\d{4} year\d{1,2} month\d{1,2} day (?: early morning|early morning|morning|late night|morning|morning|noon|afternoon|evening|late)?(?:(?:\d{1,2} hour)?(?: around)?(?:\d{1,2} minute)?)?), fixed-term imprisonment - the defendant is sentenced to xx years in prison, and the rule method extraction can improve the accuracy of feature extraction.
[0081] In addition, when extracting features and corresponding annotations for a specific implementation scenario, such as extracting element features from judicial documents, the current execution end can also extract and annotate knowledge elements for the same attribute based on the knowledge element extraction paragraph, forming knowledge element features at the case fact level and knowledge element features at the court recognition level, so as to provide more comprehensive similar case comparison features. For example, in a robbery case, corresponding to the case facts, the main feature of the attribute crime location is home robbery, but at the level of the court's final recognition, it may or may not constitute home robbery. At this time, the current execution end can extract the crime location as the knowledge element feature of the attribute feature from both the case fact paragraph and the court opinion paragraph, so as to ensure that the target case is matched to a greater extent and improve the accuracy of similar case matching.
[0082] In another embodiment of the present application, for further definition and explanation, the step of marking the semantic sample by the conditional random field algorithm to obtain the marked sample includes:
[0083] Extracting expected knowledge meta-features from the semantic sample and determining the text position of the expected knowledge meta-features;
[0084] A prompt word is determined based on the text position and a preset word distance, and is integrated into a position mark of the knowledge element position sample based on the position identifier of the prompt word.
[0085] In order to improve the effectiveness of the conditional random field algorithm in extracting feature features, the current execution end adds a tag of the knowledge element position information when marking semantic samples based on the conditional random field algorithm. That is, when the knowledge element may be composed of multiple words, the named entity recognition model BME (B-begin, M-middle, E-end) method is first used to mark the expected knowledge element features as the expected feature content, that is, the starting word of the expected extracted knowledge element is marked as tag_b, the end word of the knowledge element is marked as tag_e, and the remaining middle words are marked as tag_m. Secondly, the sentence where the knowledge element is located is preprocessed, including word segmentation, part-of-speech tagging, syntactic analysis, sentence component analysis, adding position prompt word tags, etc. At the same time, the conditional random field algorithm CRF algorithm is used to mark out the possible knowledge elements in the sentence and integrate the BME tags (tag_b, tag_m, tag_e:). Specifically, the complete knowledge element is obtained, the knowledge element is compared with the original sentence, the starting position and length of the knowledge element in the original text are obtained, and normalization is performed. For example, the attribute crime location. The original case is: On the evening of May 25, 2014, the defendant Wang took advantage of the fact that no one was in the yard of No. 265 Pingchuan Road, Shayibake District, Urumqi City, and stole a blue Baolai bicycle parked in the yard of the victim Wu with pliers. After marking, it is shown in Table 1 below.
[0086] Table 1
[0087]
[0088] It should be noted that when determining the expected knowledge element feature in the text position, specifically, the current execution end marks the content word closest to the expected knowledge element head word within the range of n (preferably 4) words in front of the expected knowledge element as the left prompt word of this type of attribute, and assigns it a mark (for example, the left prompt word of the crime time knowledge element is marked as: time_l), and marks the content word closest to the knowledge element tail word within the range of 4 words behind the knowledge element as the right prompt word of this type of attribute, and assigns it a mark (for example, the right prompt word of the crime time knowledge element is marked as: time_r), so as to achieve the purpose of determining the prompt word based on the text position and the preset word distance. Further, the position mark based on the prompt word is integrated into the position mark of the knowledge element position sample. At this time, all the position marks marked by each position prompt word are integrated, and these marks are expressed as one mark, and all the position prompt word marks in the text are replaced with the integrated position prompt mark to form the position information feature of the knowledge element. At the same time, a position information prompt word list is formed, and the content of the word list is the statistical position word and its position mark, so as to use this position mark as one of the semantic samples for model training.
[0089] In another embodiment of the present application, for further definition and explanation, the step of determining the first feature vector of the element feature and the second feature vector of different case texts in the case database includes:
[0090] Determining a weight value of the element feature, and constructing a first feature vector of the element feature based on the weight value;
[0091] The case database is matched based on the extracted case cause features, and second feature vectors of different case texts in the case database are obtained.
[0092] In order to improve the retrieval effect of similar cases and meet the high similarity recommendation requirements of different legal documents, the current execution end, when determining the first feature vector and the second feature vector, specifically first vectorizes the element features. Among them, first determine the case database containing different case texts for the case cause, and different case causes can pre-build a case database matching it. At this time, each case text can be pre-vectorized based on the extracted features. The feature extraction method is the same as the element feature method of the target legal text, which will not be repeated here. Specifically, when vectorizing the element features, a weight value can be assigned to each element feature in advance. For example, for the amount element feature, such as the amount of theft, the type and weight of the item, etc., it is of great significance to recommend similar cases. Therefore, the weight value of such element features can be configured to be very large, and then, the weight values corresponding to all element features are constructed as a vector to obtain the feature vector of this target legal text. At this time, when configuring the weight value, in order to ensure the validity of the vector and reduce the system operation pressure, the product of the vector is less than the preset value, such as the square of 10,000, etc., and the embodiment of the present application is not specifically limited.
[0093] In addition, in the process of vectorizing the feature of the amount-type element, different vectorization methods can be used for the target legal text and the case text in the case database. For example, the case database configures weights according to the amount interval, and the target legal text can generate a vector containing all interval sentencing weights according to the interval weight to achieve the relevance sorting of the amount vector and avoid the drawbacks of unequal and irrelevant data. For example: the target case extracts the knowledge element fraud amount of 90,000 yuan, and the corresponding vector is generated. The weight values included are: "Fraud amount 5W-10W: 2269, fraud amount 10W-15W: 1664, fraud amount 15W-20W: 1512, fraud amount 20W-25W: 907, fraud amount 25W-30W: 453, 30W-35W: 453, fraud amount 35W-40W: 151, fraud amount 40W-50W: 151", which is not specifically limited in the embodiment of this application.
[0094] In another embodiment of the present application, for further definition and explanation, before the step of determining the feature extraction model based on the legal classification of the target legal text, the method further includes:
[0095] Acquire a civil element feature sample from the element feature sample set;
[0096] Build a civil feature extraction model;
[0097] The civil feature extraction model is trained based on the civil element feature samples to obtain a civil feature extraction model that has completed model training.
[0098] In order to improve the accuracy of feature extraction and meet the push efficiency of case texts of different legal classifications, for the implementation scenario where the legal classification is civil classification, the current execution end first obtains civil element feature samples corresponding to different legal attributes from the element feature sample set. Among them, the legal attribute is used to characterize the specific plot type of the entire civil dispute, including but not limited to contract disputes, ownership disputes, etc., and can also include types for role attributes, including but not limited to plaintiffs, defendants, appellants, the above-mentioned persons, applicants, etc., which are not specifically limited in the embodiments of this application. At the same time, a civil feature extraction model can also be constructed. At this time, the construction of the civil feature extraction model includes a combination of a natural language processing network and a conditional random field algorithm, a bidirectional long short-term memory network, a text migration network or an unsupervised model, wherein the natural language processing network is preferably a Bert model, which is used to semantically divide the input samples in the civil element feature samples to obtain semantic samples as the output of the natural language processing network, and then, the combined training method of the conditional random field algorithm and the bidirectional long short-term memory network is the same as the method of the criminal feature extraction model, so as to eliminate the limitations of the word segmentation for the indexing model, and can ensure a higher feature entity extraction result, which will not be repeated here. In addition, the embodiments of the present application can also combine the natural language processing network with the text transfer network Transformer model, such as the T5 (Text-to-Text Transfer Transformer) model, to extract the feature words or phrases that are not directly expressed in the original text, that is, to generate some summarized or simplified abbreviations of feature words or phrases, which can make up for the shortcomings of feature word extraction and improve the recall rate of feature extraction. For example: "W asked Company A to compensate for the loss of work time caused during this period" can be marked as "request for compensation for loss of work time". Moreover, when combining unsupervised models, 7 extraction methods can be used: KeyBert, LDA, TF-IDF, TextRank, rake, yake, lda, etc. are extracted in turn, and the embodiments of the present application do not make specific limitations.
[0099] In another embodiment of the present application, for further definition and explanation, the step of determining the target similar case text based on the similarity between the first feature vector and the second feature vector and pushing the target similar case text includes:
[0100] Calculating the similarity between the first feature vector and the second feature vector, and sorting the similarities;
[0101] A target similar case text is determined based on the ranking result of the similarity, and the target similar case text is pushed.
[0102] In order to improve the push of similar cases as target legal texts, so as to achieve accurate push of similar cases, the current execution end can specifically calculate the similarity between the first feature vector and the second feature vector when determining the target similar case text, so as to sort the similarity. Among them, when calculating the similarity, similarity calculation can be performed based on the VSM vector calculation method of kbase to complete the similarity sorting of similar cases in the similar case library, and the most similar text is extracted from the sorting result as the target similar case text to push this target similar case text.
[0103] The embodiment of the present application provides a method for pushing similar case texts based on artificial intelligence. Compared with the prior art, the embodiment of the present application obtains a target legal text; determines a feature extraction model based on the legal classification of the target legal text, and extracts features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set; determines a first feature vector of the element feature and a second feature vector of different case texts in a case database, and determines a target similar case text based on the similarity between the first feature vector and the second feature vector, and pushes the target similar case text, thereby effectively extracting diversified features from the legal text, meeting the demand for accurate matching of the characteristic content of the legal text, and reducing the problem of poor learning ability for single modeling and corpus training, thereby improving the accurate recommendation of similar cases of legal texts.
[0104] Furthermore, as a response to the above Figure 1 The implementation of the method shown in the embodiment of the present application provides a similar case text push device based on artificial intelligence, such as Figure 3 As shown, the device comprises:
[0105] An acquisition module 21, used for acquiring a target legal text;
[0106] An extraction module 22 is used to determine a feature extraction model based on the legal classification of the target legal text, and to extract features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set;
[0107] The push module 23 is used to determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
[0108] Furthermore, the device also includes: a construction module, a training module,
[0109] The acquisition module is used to acquire criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set;
[0110] The construction module is used to construct a case cause prediction model and a criminal feature extraction model that match the legal attributes;
[0111] The training module is used to perform model training on the case cause prediction model based on the criminal case cause sample to obtain a case cause prediction model that has completed model training, and to perform model training on the criminal feature extraction model based on the criminal element feature sample and the criminal case cause sample to obtain a criminal feature extraction model that has completed model training.
[0112] Furthermore, the training module is specifically used to perform semantic division on the input samples in the criminal element feature samples based on the natural language processing network and obtain semantic samples; mark the semantic samples through the conditional random field algorithm to obtain marked samples, and the marked samples include marked word samples, part of speech samples, syntax samples, sentence samples and knowledge element position samples; perform model training on the bidirectional long short-term memory network based on the marked samples and the output samples in the criminal element feature samples to complete the training of the criminal feature extraction model, and the output samples include case cause features, attribute features, knowledge element features, knowledge element category features, element role features, and paragraph features.
[0113] Furthermore, the training module is specifically used to extract expected knowledge element features from the semantic sample and determine the text position of the expected knowledge element features; determine the prompt word based on the text position and the preset word distance, and integrate the position mark of the knowledge element position sample based on the position identifier of the prompt word.
[0114] Furthermore, the push module is specifically used to determine the weight value of the element feature and construct a first feature vector of the element feature based on the weight value; match the case database based on the extracted case cause feature and obtain the second feature vector of different case texts in the case database.
[0115] Further,
[0116] The acquisition module is further used to acquire civil element feature samples from the element feature sample set;
[0117] The construction module is further used to construct a civil feature extraction model, which includes a combination of a natural language processing network and a conditional random field algorithm, a bidirectional long short-term memory network, a text migration network, or an unsupervised model;
[0118] The training module is also used to perform model training on the civil feature extraction model based on the civil element feature samples to obtain a civil feature extraction model that has completed model training.
[0119] Furthermore, the push module is specifically used to calculate the similarity between the first feature vector and the second feature vector, and sort the similarity; determine the target similar case text based on the sorting result of the similarity, and push the target similar case text.
[0120] The embodiment of the present application provides an artificial intelligence-based device for pushing similar case texts. Compared with the prior art, the embodiment of the present application obtains a target legal text; determines a feature extraction model based on the legal classification of the target legal text, and extracts features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set; determines a first feature vector of the element feature and a second feature vector of different case texts in a case database, and determines a target similar case text based on the similarity between the first feature vector and the second feature vector, and pushes the target similar case text, thereby effectively extracting diversified features from the legal text, meeting the demand for accurate matching of the characteristic content of the legal text, and reducing the problem of poor learning ability for single modeling and corpus training, thereby improving the accurate recommendation of similar cases of legal texts.
[0121] According to one embodiment of the present application, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the artificial intelligence-based similar case text push method in any of the above method embodiments.
[0122] Figure 4A schematic diagram of the structure of a terminal provided according to an embodiment of the present application is shown, and the specific embodiment of the present application does not limit the specific implementation of the terminal.
[0123] like Figure 4 As shown, the terminal may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
[0124] The processor 302 , the communication interface 304 , and the memory 306 communicate with each other via the communication bus 308 .
[0125] The communication interface 304 is used to communicate with other devices such as clients or other servers.
[0126] The processor 302 is used to execute the program 310, and specifically can execute the relevant steps in the above-mentioned embodiment of the method for pushing similar case texts based on artificial intelligence.
[0127] Specifically, the program 310 may include program codes, which include computer operation instructions.
[0128] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0129] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0130] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:
[0131] Obtain the target legal text;
[0132] Determine a feature extraction model based on the legal classification of the target legal text, and extract features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set;
[0133] Determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
[0134] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0135] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for pushing similar case texts based on artificial intelligence, characterized in that: include: Obtain the target legal text; Determine a feature extraction model based on the legal classification of the target legal text, and extract features of the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set; Determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
2. The method according to claim 1, characterized in that The legal classification includes criminal classification. Before determining the feature extraction model based on the legal classification of the target legal text, the method further includes: Obtain criminal element feature samples and criminal case cause samples corresponding to different legal attributes from the element feature sample set; Constructing a case cause prediction model and a criminal feature extraction model that match the legal attributes; The case cause prediction model is trained based on the criminal case cause sample to obtain a case cause prediction model that has completed model training, and the criminal feature extraction model is trained based on the criminal element feature sample and the criminal case cause sample to obtain a criminal feature extraction model that has completed model training.
3. The method according to claim 2, characterized in that The criminal feature extraction model includes a natural language processing network, a conditional random field algorithm, and a bidirectional long short-term memory network. The model training of the criminal feature extraction model based on the criminal element feature samples and the criminal case cause samples includes: Performing semantic division on the input sample in the criminal element feature sample based on the natural language processing network, and obtaining a semantic sample; The semantic samples are labeled by the conditional random field algorithm to obtain labeled samples, wherein the labeled samples include labeled word samples, part-of-speech samples, syntactic samples, word and sentence samples, and knowledge element position samples; The bidirectional long short-term memory network is trained based on the labeled samples and the output samples in the criminal element feature samples to complete the training of the criminal feature extraction model. The output samples include case cause features, attribute features, knowledge element features, knowledge element category features, element role features, and paragraph features.
4. The method according to claim 3, characterized in that The labeling of the semantic samples by the conditional random field algorithm to obtain the labeled samples comprises: Extracting expected knowledge meta-features from the semantic sample and determining the text position of the expected knowledge meta-features; A prompt word is determined based on the text position and a preset word distance, and is integrated into a position mark of the knowledge element position sample based on the position identifier of the prompt word.
5. The method according to claim 2, characterized in that: The first feature vector for determining the element feature and the second feature vectors of different case texts in the case database include: Determining a weight value of the element feature, and constructing a first feature vector of the element feature based on the weight value; The case database is matched based on the extracted case cause features, and second feature vectors of different case texts in the case database are obtained.
6. The method according to claim 2, characterized in that The legal classification includes civil classification. Before determining the feature extraction model based on the legal classification of the target legal text, the method further includes: Acquire a civil element feature sample from the element feature sample set; Constructing a civil feature extraction model, wherein the civil feature extraction model includes a combination of a natural language processing network and a conditional random field algorithm, a bidirectional long short-term memory network, a text transfer network, or an unsupervised model; The civil feature extraction model is trained based on the civil element feature samples to obtain a civil feature extraction model that has completed model training.
7. The method according to any one of claims 1 to 6, characterized in that: The determining the target similar case text based on the similarity between the first feature vector and the second feature vector and pushing the target similar case text includes: Calculating the similarity between the first feature vector and the second feature vector, and sorting the similarities; A target similar case text is determined based on the ranking result of the similarity, and the target similar case text is pushed.
8. An artificial intelligence-based similar case text push device, characterized in that: include: An acquisition module, used to acquire the target legal text; An extraction module, used to determine a feature extraction model based on the legal classification of the target legal text, and perform feature extraction on the target legal text based on the feature extraction model to obtain element features matching the legal classification, wherein the feature extraction model is obtained by training a feature extraction model matching the legal classification according to an element feature sample set; The push module is used to determine the first feature vector of the element feature and the second feature vector of different case texts in the case database, and determine the target similar case text based on the similarity between the first feature vector and the second feature vector for push.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to claim 1 are implemented.
10. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method of claim 1.
Citation Information
Cited By
Class case recommendation method based on deep understanding
CN120492612A