Case keyword extraction method and system based on judgment document

By applying TF-IDF algorithm and key segmentation correction technology in the judgment documents, the problem of insufficient accuracy of traditional algorithms in identifying low-frequency keywords and high-frequency vocabulary of legal terms is solved, and a more efficient and professional keyword extraction effect is achieved.

CN119830908AInactive Publication Date: 2025-04-15GUANGDONG BOWEI CHUANGYUAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510307661.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional TF-IDF algorithm has a problem of low accuracy in the extraction of keywords in judicial documents, and it is impossible to effectively identify low-frequency but key words and high-frequency words in legal terms, resulting in insufficient accuracy and professionalism in keyword extraction.

Method used

By obtaining various types of documents of the judgment document, the TF-IDF algorithm is used to calculate the TF value, IDF value and TF-IDF value of the vocabulary, divide the key segments, correct the TF-IDF value of low-frequency vocabulary and high-frequency vocabulary, and make targeted corrections based on the frequency of occurrence and distribution uniformity of the vocabulary in different segments.

Benefits of technology

It improves the accuracy and professionalism of keyword extraction of judicial documents, can more accurately identify low-frequency but critical information and legal terms, and enhances the efficiency of information retrieval and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830908A_ABST
    Figure CN119830908A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a case keyword extraction method and system based on judgment documents, and the method comprises the steps: obtaining all judgment documents of various case types, obtaining a TF value, an IDF value and a TF-IDF value of each vocabulary of the current judgment document through a TF-IDF algorithm, and determining low-frequency vocabularies and high-frequency vocabularies in the current judgment document; for low-frequency vocabularies, correcting TF-IDF values of the low-frequency vocabularies according to the possibility that the low-frequency vocabularies are located in each key segment; for the high-frequency vocabularies, determining the high-frequency vocabularies belonging to legal terms, and correcting the TF-IDF values of the high-frequency vocabularies according to the distribution uniformity of the high-frequency vocabularies belonging to the legal terms; after correction is completed, the keywords of the current judgment document are determined according to the TF-IDF values of all the vocabularies of the current document, so that case keyword extraction of the current judgment document is completed, and the accuracy and speciality of keyword extraction of the judgment document are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and more particularly to a method and system for extracting case keywords based on judicial documents. Background Art

[0002] As an important information carrier in the legal field, judicial documents contain a wealth of legal knowledge and key case information. With the continuous growth of legal data, efficiently and accurately extracting keywords from judicial documents has become a key link in improving the efficiency of legal information retrieval and analysis.

[0003] The traditional TF-IDF (term frequency-inverse document frequency) algorithm is a commonly used method for text keyword extraction. In general text processing scenarios, it measures the importance of a word in a document by the product (TF-IDF value) of each word's term frequency (TF value) and each word's inverse document frequency (IDF value). It can quickly extract some representative words and meet the needs of information retrieval and text classification to a certain extent. Its core idea is that if a word appears more frequently in the current document and less frequently in other document sets, it means that the word is more critical to the current document and is more likely to be a keyword for the current document; vice versa.

[0004] However, when using the traditional TF-IDF algorithm to analyze the judicial document collection to extract the keywords of the current judicial document, due to the complex characteristics of the judicial document, some key information is easily missed, which in turn affects the accuracy of keyword extraction. Specifically, First, in actual situations, some words do not appear frequently in current judicial documents, but they are the core keywords of the case. They determine the nature and direction of the case. For example, in a contract dispute case involving the "right to perform first", the "right to perform first" may not appear many times in the document due to the specific circumstances of the case, but it is the core point that determines the direction and nature of the case. The traditional TF-IDF algorithm will calculate the TF value of such key low-frequency words very low, resulting in a very low TF-IDF. It is believed that such words are not important and difficult to be identified as keywords, which easily misses these low-frequency and key information.

[0005] Second, judicial documents are highly professional and contain a large number of legal terms. In the legal field, some legal terms may appear frequently in the entire corpus, such as "contract" and "litigation". According to the traditional TF-IDF algorithm, the IDF values ​​of these common legal terms are low. Although they may be in a core position in judicial documents, the final TF-IDF value will be weakened, resulting in their importance being underestimated and unable to accurately reflect their key role. The traditional TF-IDF algorithm cannot distinguish between such words that appear frequently in multiple documents but still have a core position in a specific document, making it impossible for the keyword extraction results to accurately reflect the core points of the case, affecting the accuracy of keyword extraction.

[0006] In summary, the traditional TF-IDF algorithm has the problem of low accuracy when dealing with the task of extracting keywords from judicial documents, and cannot meet the strict requirements of the legal field for the accuracy and professionalism of extracting keywords from judicial documents. Summary of the invention

[0007] In order to solve the problem that the traditional TF-IDF algorithm has low accuracy when processing the task of extracting keywords from judicial documents, the present invention proposes a case keyword extraction method based on judicial documents, including: Obtain all judgment documents of various case types, obtain the TF value, IDF value and TF-IDF value of each word in the current judgment document through the TF-IDF algorithm, and determine the low-frequency and high-frequency words in the current judgment document; For low-frequency words, all judicial documents are first divided into multiple key segments, and then the possibility of low-frequency words being located in each key segment is determined. The TF-IDF value of low-frequency words is modified according to the possibility of low-frequency words being located in each key segment; key segments include: case cause segment, fact finding segment, dispute focus segment and judicial summary segment; For high-frequency words, determine the high-frequency words belonging to legal terms, determine the distribution uniformity of the high-frequency words belonging to legal terms according to the frequency of occurrence of the high-frequency words belonging to legal terms in all judgment documents of each case type, and modify the TF-IDF value of the high-frequency words belonging to legal terms based on the distribution uniformity; After the correction is completed, all the words in the current document are sorted in descending order according to their TF-IDF values, and the keywords of the current judgment document are determined based on the sorting results to complete the case keyword extraction of the current judgment document.

[0008] The above technical solution calculates the relevant value of each word through the TF-IDF algorithm, preliminarily measures the importance of each word in the current judicial document, and provides a data basis for subsequent targeted corrections to different types of words by determining low-frequency words and high-frequency words. And further, in view of the problem that the traditional TF-IDF algorithm is prone to miss low-frequency key information, by using the structural information of the judicial document, the judicial document is divided into key segments, and the TF-IDF value of the low-frequency word is corrected according to the possibility of the low-frequency word appearing in different key segments, so as to achieve a more accurate evaluation of the importance of low-frequency words, make up for the shortcomings of the traditional TF-IDF algorithm in processing low-frequency words, and make low-frequency but key words have a greater chance of being identified as keywords. And further, in view of the problem that the traditional TF-IDF algorithm is prone to underestimate the importance of high-frequency words belonging to legal terms, by analyzing the distribution uniformity of high-frequency words belonging to legal terms, its TF-IDF value is corrected, so that the high-frequency words of legal terms can more accurately reflect their actual importance in keyword extraction. Furthermore, based on the corrected TF-IDF value, the keywords of the current judicial document are accurately extracted, completing the entire keyword extraction task and improving the accuracy and professionalism of keyword extraction for judicial documents.

[0009] Furthermore, the TF-IDF value of low-frequency words is modified according to the probability of the low-frequency words being located in each key segment based on the following formula: ; In the formula, is any low-frequency word, for The corrected TF-IDF value, and They are of value, value, is the total number of key segments, For the The weight of the key segment, for Located in The possibility of a key segment.

[0010] The above technical solution comprehensively considers the structural information of judicial documents by introducing the possibility that low-frequency words are located in different key segments and the weights of key segments, so that the importance of low-frequency words can be evaluated more accurately, which makes up for the shortcomings of traditional algorithms and helps to dig out the truly critical low-frequency information in judicial documents.

[0011] Furthermore, the TF-IDF value of high-frequency words belonging to legal terms is corrected based on the following formula: ; In the formula, is any high frequency word that is a legal term, for The corrected TF-IDF value, and They are of value, value, is the magnification factor, and are the maximum and minimum values ​​of the distribution uniformity of all high-frequency words belonging to legal terms, for uniformity of distribution.

[0012] The above technical solution takes into account the different distribution uniformities of different legal terms in judicial documents of various case types, and uses the distribution uniformity indicator to incorporate the distribution characteristics of legal terms into the calculation of TF-IDF values, so that keyword extraction can better reflect the actual importance of legal terms in different cases.

[0013] Furthermore, the probability of a low-frequency word being located in each key segment is determined based on the following formula: ; In the formula, is any low-frequency word, for Located in The probability of a key segment, is the total amount of key segments, for In all judicial documents The frequency of occurrence in the key segments, is the total number of all judicial documents, is the indicator function, when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0; when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0.

[0014] The above technical solution takes into account the structural information of judicial documents. Words in different positions have different importance. By combining the frequency of occurrence of low-frequency words in each key segment and the indicator function of whether they appear, it can carefully measure the importance of low-frequency words in each key segment, providing a more accurate basis for the subsequent correction of the TF-IDF value of low-frequency words.

[0015] Furthermore, the distribution uniformity of high-frequency words belonging to legal terms is determined based on the following method: Obtain a collection of judgment documents for each case type; According to the frequency of occurrence of high-frequency words belonging to legal terms in the collection of judicial documents of each case type, the information entropy values ​​of high-frequency words belonging to legal terms in different case types are determined based on the frequency through the information entropy formula as the distribution uniformity of the high-frequency words belonging to legal terms.

[0016] The above technical solution introduces the information entropy value, which can intuitively reflect the distribution of high-frequency words belonging to legal terms in different types of cases. Through the size of the information entropy value, it is possible to clearly judge whether the distribution of a word in different case types is uniform or concentrated, which is convenient for subsequent reasonable evaluation and correction of its importance.

[0017] Furthermore, high frequency words belonging to legal terms are determined based on the following method: The high frequency words are matched with all legal terms in a pre-built corpus of legal terms to determine the high frequency words of the legal terms.

[0018] Furthermore, the low-frequency and high-frequency words in current judicial documents are determined based on the following method: The words with TF values ​​below the lower quartile of all the words in the current judicial document are regarded as low-frequency words, and the words with TF values ​​above the upper quartile of all the words are regarded as high-frequency words.

[0019] Furthermore, the method of dividing all judicial documents into multiple key sections is as follows: Build a feature word library for each key segment; Perform feature matching on each segment of each judicial document and the feature word library of each key segment to obtain all the key segments in each judicial document.

[0020] Furthermore, the method for determining the keywords of the current judgment document according to the sorting results is: Based on the elbow rule, the number of keywords in the current judgment document is determined, and corresponding words are selected from the sorted words from the front to the back according to the number as the keywords of the current judgment document.

[0021] On the other hand, the present invention also provides a case keyword extraction system based on judicial documents, the keyword extraction system includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement any step of the keyword extraction method.

[0022] The present invention has the following effects: The present invention targets low-frequency words in current judicial documents, combines the structural information of the judicial documents, and corrects their TF-IDF values ​​through the position information of the low-frequency words, thereby avoiding the problem of traditional algorithms missing low-frequency key information. For high-frequency words belonging to legal terms, the distribution uniformity is analyzed and the TF-IDF values ​​are corrected, thus solving the problem of traditional algorithms underestimating their importance. After the correction is completed, the accuracy and professionalism of keyword extraction in current judicial documents are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0025] Reference Figure 1 The case keyword extraction method based on the judgment document provided by the present invention comprises steps S1 to S5: S1: Obtain all judgment documents of multiple case types.

[0026] When extracting keywords from current judgment documents in order to conduct in-depth case analysis, it is necessary to collect judgment documents of various case types from a large case database in advance. These case types cover all major aspects of the legal field, including criminal cases, civil cases, administrative cases, compensation cases, enforcement cases and other cases, a total of 6 case types, and each case type corresponds to a set of judgment documents. These 6 sets do not exist in isolation, and together they constitute a rich and comprehensive data source, covering the typical characteristics and key information of various cases.

[0027] After obtaining all the judgment documents, they need to be pre-processed, including: Text cleaning: Remove the headers, footers, numbers, formatting marks, and other irrelevant meta-information from each judgment document. For example, remove header information like "[XX Court] No.

[1001] Judgment Document" through regular expressions.

[0028] Word segmentation: Use natural language processing tools such as NLTK (Natural Language Toolkit) for English judgment documents and HanLP (Han Language Processing) for Chinese judgment documents. Utilize these natural language processing tools to split the content of each judgment document into individual words or phrases. For example, for the Chinese judgment document "Zhang San and Li Si sued the court due to a contract dispute", after word segmentation, we get words like "Zhang San", "and", "Li Si", "due to", "contract dispute", "sued", "the court".

[0029] Stop word filtering: Stop words refer to certain words or terms that are automatically filtered out before or after processing natural language data in information retrieval to save storage space and improve search efficiency. Stop words usually include some frequently occurring words in the text that actually contribute little to the text theme. Therefore, build a stop word list, such as common words with no practical meaning like "de" (的), "le" (了), "zai" (在), "shi" (是). Remove these stop words from the word list after word segmentation to reduce noise in subsequent calculations. For example, after stop word filtering, stop words like "and", "due to", "sued" in "Zhang San", "and", "Li Si", "due to", "contract dispute", "sued", "the court" are removed.

[0030] Format unification: Standardize the format of the processed text, remove redundant spaces, line breaks, etc., and convert the text into a plain text format convenient for subsequent processing. This operation can effectively avoid processing errors caused by inconsistent formats and ensure smooth subsequent calculations and analyses.

[0031] Through the above preprocessing steps, all the words with actual analysis value in each judgment document can be clearly and accurately divided, providing a reliable data basis for subsequent keyword extraction, case analysis, etc. based on these words.

[0032] S2: Initially obtain the relevance values of each word in the current judgment document through the TF-IDF algorithm, and determine high-frequency and low-frequency words.

[0033] S21: Calculate the TF value of each word.

[0034] For the current judgment document, count the number of times each word appears in the current judgment document. Let any word The number of times it appears in the current judgment document is , the total number of words in the current judicial documents is , then the vocabulary of for:

[0035] In this formula, For vocabulary of .For example, When the term "contract dispute" appears 5 times in the current judgment document and the total number of words in the current judgment document is 1000, then the number of words in the current judgment document is 1000. for .

[0036] S22: Calculate the IDF value of each word.

[0037] In all judicial documents, statistics contain the word The number of judicial documents. Total appearances There are 100 judicial documents, and the total number of documents in the corpus is N. Then the vocabulary The IDF value of is:

[0038] In this formula, For vocabulary For example, when the word t is "contract dispute", it appears in 100 documents in the corpus, and the total number of documents in the corpus is 1000, then:

[0039] S23: Calculate the TF-IDF value of each vocabulary.

[0040]

[0041] In this formula, For vocabulary The TF-IDF value of the current referee document.

[0042] S24: Identify low-frequency and high-frequency words in the current judicial documents.

[0043] The words with TF values ​​below the lower quartile (25th percentile) of all the words in the current judicial documents are regarded as low-frequency words, and the words with TF values ​​above the upper quartile (75th percentile) of all the words are regarded as high-frequency words.

[0044] Different judgment documents may have very different word frequency distributions due to differences in case type, length, writing style, etc. For example, some complex criminal case judgment documents may contain a large number of professional terms, and the word frequency distribution is relatively scattered; while simple civil dispute judgment documents may have a relatively concentrated word frequency distribution. Using quartiles to divide low-frequency and high-frequency words can automatically adapt to these differences.

[0045] The number and frequency of words in judicial documents are affected by many factors, such as the level of detail in the case description, and the data fluctuates greatly. The quartile method can smooth out such fluctuations to a certain extent because it focuses on the relative position of the data rather than the specific value. Even if the TF value of individual words changes significantly due to special circumstances, as long as the overall data distribution is relatively stable, the division results of low-frequency and high-frequency words will not be significantly affected, ensuring the stability of the division results.

[0046] By accurately dividing low-frequency words and high-frequency words, an accurate data foundation is provided for subsequent targeted processing. For low-frequency words, in the subsequent steps, we focus on exploring their importance in key segments to increase the probability of low-frequency key information being identified as keywords; for high-frequency words, especially high-frequency words belonging to legal terms, we further analyze their distribution uniformity to avoid underestimating the importance of high-frequency words belonging to legal terms, thereby extracting keywords more accurately.

[0047] S3: For low-frequency words, their TF-IDF values ​​are corrected according to the possibility of them being located in different key segments.

[0048] S31: Divide into key segments.

[0049] First, judicial documents have a specific structure, and different parts have different importance. In the legal field, for a judicial document, the key information of a case often includes: cause of action, fact finding, focus of dispute, and summary of the judgment. Therefore, this step sets the structure of all judicial documents to be divided into the cause of action section, fact finding section, focus of dispute section, and summary of the judgment section.

[0050] Specifically: As the starting point of case trial, the cause of action paragraph is mainly used to accurately identify the nature of the case, clearly explain the parties' demands, and define the legal relationship. The information it carries is the basis of the case, and can help relevant personnel quickly identify the type of case and the core demands. It is an indispensable key part of the judgment document. For example, in a contract dispute case, the cause of action paragraph will clearly point out the type of contract, the general cause of the dispute, and the specific demands that the plaintiff hopes to achieve through legal means, providing key guidance for the subsequent trial process.

[0051] The fact-finding section describes in detail and comprehensively the actual circumstances of the case, covering key elements such as the cause, process and result of the incident. These factual information are an important foundation for the subsequent application of law, determination of the focus of the dispute and the conclusion of the judgment. Only on the basis of accurate ascertainment of the facts can correct legal judgments and rulings be made in accordance with relevant laws and regulations. For example, in a tort liability dispute case, the fact-finding section will describe in detail the time, place, specific behavior and damage consequences of the tort, providing a factual basis for the subsequent determination of the attribution and assumption of tort liability.

[0052] The focus of dispute is the core link of case trial. The content of the focus of dispute needs to be summarized through a series of rigorous procedures such as pre-court review and court investigation. According to the judicial interpretation of the Civil Procedure Law, the court has a clear obligation to summarize the focus of dispute and solicit the opinions of the parties. This is not only a requirement of legal procedures, but also the key to improving trial efficiency and enhancing the pertinence of reasoning. The focus of dispute directly affects the evidence, cross-examination and debate of the case. The parties conduct full argumentation and debate around the focus of dispute, which helps the judge to fully understand the key to the dispute in the case and make a fair and reasonable ruling. For example, in intellectual property dispute cases, the focus of dispute may focus on the ownership of intellectual property rights, the identification standards of infringement, etc. Clarifying these focus of dispute can enable the parties to present evidence and debate more specifically, and also enable the judge to hear the case more efficiently.

[0053] The judgment essentials section is a highly refined summary of the core legal issues of the case, and usually reflects the judgment rules or conclusions on the application of law. Unlike the factual findings in the judgment reasons, which are only valid for the current case and do not have res judicata, the judgment essentials focus more on the conclusions on the application of law, have guiding and reference value, and can provide important reference basis for the trial of similar cases, so they can be used as key information. For example, in some innovative legal cases, the legal application rules established by the judgment essentials may become an important reference for the trial of subsequent similar cases, which is of great significance to the practice and development of the law.

[0054] Next, construct the feature vocabulary for each key segment: Case paragraph: usually contains characteristic words such as "plaintiff", "defendant", "prosecution", "cause of action", etc. These words can directly reflect the subject and appeal of the case, and are important markers for identifying the case paragraph. For example, when the document contains "the plaintiff filed a lawsuit against this court due to the defendant's breach of contract, and the cause of action is a sales contract dispute", these characteristic words can quickly determine that the paragraph is the case paragraph.

[0055] Fact-finding paragraph: generally contains characteristic words such as "found out after trial" and "found facts as follows". These words clearly indicate that this paragraph is the part that explains the facts of the case. For example, "found out after trial, the defendant signed a contract with the plaintiff on October 20, 2024, and then failed to perform the obligations as agreed..." Such characteristic words can clearly locate the fact-finding paragraph.

[0056] Dispute focus paragraph: Common characteristic words include "the dispute focus of this case is" and "the focus of the dispute between the two parties is". These words directly point out that the core content of the paragraph is the dispute focus of the case. For example, "the focus of the dispute between the two parties is whether the defendant's behavior constitutes infringement and what kind of liability should be borne". These characteristic words can quickly identify the dispute focus paragraph.

[0057] Judgment summary paragraph: usually contains characteristic words such as "This court believes" and "In summary". "This court believes" is often the starting mark for judges to explain legal opinions and make decisions, while "In summary" is used to summarize and draw conclusions on the judgment results and legal application. For example, "This court believes that according to relevant laws and regulations, the defendant's behavior constitutes infringement and should bear corresponding compensation liability." These characteristic words help to accurately identify the judgment summary paragraph.

[0058] Finally, feature matching is performed between each segment of each judicial document and the feature vocabulary of each key segment to obtain all the key segments in each judicial document.

[0059] A regular expression is constructed through the feature word library of each key segment, and each judgment document is split into paragraphs to obtain multiple text paragraphs. The regular expression corresponding to the feature word library of each key segment constructed previously is used to match each paragraph of each judgment document paragraph by paragraph.

[0060] During the matching process, if the text content of a paragraph matches the regular expression of a key segment, it means that the paragraph meets the characteristics of the key segment. At this time, the paragraph is marked to obtain the key segments in each judicial document.

[0061] For example, when processing a certain judgment document, the regular expression constructed for the cause of action segment will scan each paragraph in the document. When a paragraph contains text such as "the plaintiff [specific name or title] sued the defendant [specific name or title] on the grounds of [specific cause of action]" and contains characteristic words such as "plaintiff", "defendant", "prosecution", "cause of action" and conforms to the relevant sentence pattern, the paragraph will be marked as the cause of action segment.

[0062] Furthermore, by analyzing the importance of different key sections (case cause section, fact finding section, dispute focus section, and judgment summary section) in the judgment documents, a weight is assigned to each key section.

[0063] One method of setting weights is: The weight of the fact-finding paragraph is 0.45. The fact-finding paragraph elaborates on the actual situation of the case and is the basis for the subsequent application of law, determination of dispute focus and conclusion of judgment essence. Therefore, the fact-finding paragraph should account for a larger proportion in the overall weight distribution.

[0064] The weight of the dispute focus segment is 0.3. It is the core of the case trial. It clarifies the key issues of dispute between the two parties in the case, directly affects the evidence, cross-examination and debate, and is related to the efficiency and quality of the entire case trial. Taking its importance into consideration, its weight may be slightly lower than that of the fact-finding segment.

[0065] The weight of the judgment summary is 0.2. It is a summary of the core legal issues of the case, usually reflecting the judgment rules or the conclusion of the application of law. It has guiding and reference value, and has important reference significance for the trial of subsequent similar cases. It focuses more on the results of the application of law and the summary of rules. Considering its importance, its weight can be slightly lower than that of the dispute focus.

[0066] The weight of the case paragraph is 0.05. The case paragraph is mainly used to clarify the nature of the case, the claims of the parties and the legal relationship. It is the starting point of the case trial. It can help quickly locate the type of case and the core claims, but it provides relatively little detailed information and mainly plays a role in guidance and preliminary positioning. Therefore, a lower weight is set.

[0067] S32: Calculate the probability that low-frequency words are located in different key segments.

[0068] First, for low-frequency words , first calculate In the The frequency of occurrence in the key segments ;

[0069] In this formula, Low frequency words In all judgments (all judgments of all case types), The frequency of occurrence in the key segments, for In the The first The number of times it appears in a key segment, for In the The first The number of times it appears in a key segment, is the number of key segments, , is the total number of all judicial documents.

[0070] Then, set the indicator function , indicating that when In the The first When it appears in a key segment, the indicator function The value of is 1, when Not in The first When it appears in a key segment, the indicator function The value of is 0.

[0071] Finally, calculate the probability that the low-frequency words are located in each key segment:

[0072] In the formula, is any low-frequency word, for Located in The probability of a key segment, is the total amount of key segments, for In all judicial documents The frequency of occurrence in the key segments, is the total number of all judicial documents, is the indicator function, when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0; when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0.

[0073] In this formula, reflects the absolute frequency of low-frequency words in a specific key segment. For example, if A higher value indicates a low-frequency word In the The number of occurrences in the key segments is relatively large, which reflects the low-frequency words in absolute numbers. In the The greater the probability of a key segment appearing.

[0074] In this formula, The numerator part represents low-frequency words In all judicial documents The cumulative value of the indicator function when it appears in the key segments, and the denominator represents the low-frequency words The cumulative value of the indicator function when it appears in all key segments of all judicial documents. The larger the score value, the more low-frequency words In all judicial documents The frequency of occurrence of key segments is relative to (low-frequency words ) The greater the frequency of its appearance in all key paragraphs of all judicial documents, that is, the greater the relative frequency.

[0075] Relative frequency is a more accurate measure of low-frequency words In the The relative frequency of the key segments. The greater the relative frequency, the lower the frequency of the words. In the This design takes into account that even if a word appears more frequently in a key segment, if it also appears frequently in other segments, its uniqueness in that specific segment will be weakened, and the relative frequency can reflect the uniqueness of the word to that specific segment.

[0076] In this formula, and Multiplication means taking into account low-frequency words The absolute number of occurrences in each key segment, taking into account low-frequency words The uniqueness of each key segment relative to other segments, so that low-frequency words can be more accurately reflected The probability of appearing in each key segment.

[0077] If low-frequency words In all judicial documents The greater the probability of appearing in a key segment, the lower the frequency of the word. For The more important the key segment is, the more important it is. It is possible to better distinguish which low-frequency words are unique to a key segment.

[0078] S33: Correct the TF-IDF value of low-frequency words.

[0079] If a low-frequency word is more likely to appear in a key segment of all judicial documents, it means that the low-frequency word is more important to the key segment, and the more its TF value needs to be amplified to correct its TF-IDF value in order to increase its criticality in the current judicial documents.

[0080] Specifically, the TF-IDF value of low-frequency words is corrected based on the following formula:

[0081] In this formula, is any low-frequency word, for The corrected TF-IDF value, and They are TF value, IDF value, is the total number of key segments, For the The weight of the key segment, for Located in The formula is mainly to adjust the TF value of low-frequency words to achieve the correction operation of their TF-IDF value.

[0082] The formula weights each key segment and low frequency words The probability of appearing in each key segment Perform weighted summation to comprehensively reflect low-frequency words Regarding the importance of the current judicial document, the structural information of the judicial document is fully utilized, and the TF values ​​of low-frequency words that may be located in the key positions of the current judicial document are amplified to obtain the corrected TF-IDF values ​​of the low-frequency words.

[0083] This formula comprehensively considers the structural information of the judgment document, takes into account the weight of the key segments and the possibility of the words appearing in each key segment, so that the revised TF-IDF value can better reflect the relevance of low-frequency words to the core content of the case, and makes the evaluation of the importance of low-frequency words more in line with the actual situation. It can provide more accurate information when conducting case analysis, information retrieval and other tasks. Compared with the traditional method that only considers word frequency, this can better capture the differences in the importance of words in different positions in the document, and is more in line with the actual structure and content characteristics of the judgment document.

[0084] In summary, this step can accurately identify those words that appear infrequently but are of great significance to the core content of the case by considering the possibility of low-frequency words appearing in the key segments of the judgment documents and the weight of the key segments. For example, in some complex contract dispute cases, certain specific professional terms or specific contract terms related words may only appear a few times, but they are crucial to understanding the focus of the dispute in the case. This formula can effectively enhance the criticality of these words and help quickly locate the key information of the case.

[0085] S4: For high-frequency words, first determine the high-frequency words belonging to legal terms, and then correct their TF-IDF values ​​according to the distribution uniformity of the high-frequency words belonging to legal terms.

[0086] S51: Identify high frequency words that are legal terms.

[0087] The first method is to use legal word segmentation tools, such as LAC (Language AnalysisKit) combined with a legal terminology dictionary, to accurately segment the high-frequency words in the current judicial documents, so as to extract all high-frequency words belonging to legal terms, and regard all words except legal terms as non-legal terminology words.

[0088] The second method is to obtain a corpus in the legal field and a general corpus in advance, which contain legal professional terms. Then, use the word vector model in natural language processing to convert each legal professional term in the corpus into a vector form, convert each high-frequency word into a vector form, and calculate the cosine similarity between the converted vector of each high-frequency word and the converted vector of each legal professional term in the corpus. If the cosine similarity between the converted vector of the high-frequency word and the converted vector of a legal professional term in the corpus is greater than 0.7, it means that the two are semantically similar, and the high-frequency word is used as a legal term. On the contrary, if the cosine similarity is less than or equal to 0.7, it means that the two have a large semantic difference, and the high-frequency word is a non-legal term.

[0089] Through this step, a total of A high frequency word that is a legal term.

[0090] S42: Calculate the distribution uniformity of high-frequency words belonging to legal terms.

[0091] Legal terms are widely applicable and universal. They are based on the legal system and industry practices and frequently appear in various legal affairs and different types of cases. For example, the word "evidence" needs to be mentioned frequently, whether it is the parties presenting evidence in civil cases or the police collecting clues and cross-examination in court in criminal cases. It has a high frequency of occurrence in different types of cases. Therefore, for high-frequency words belonging to legal terms, we can measure whether the distribution of high-frequency words belonging to legal terms in different types of cases is uniform by analyzing their frequency of occurrence in the judgment documents of each type of case.

[0092] Therefore, we first obtain the set of judgment documents for each case type; we know that all judgment documents have There are 6 types of cases, and a total of 6 sets of judgment documents for each type of case are obtained.

[0093] Next, calculate the frequency of high-frequency words belonging to legal terminology in the collection of judgment documents of each case type:

[0094] In this formula, is any high frequency word belonging to legal terminology, for In the The frequency of occurrence of the case type in the judgment document collection, For the The collection of judgment documents of case types contains The number of judicial documents The collection of judgment documents for all case types contains The number of judicial documents.

[0095] Finally, the information entropy formula is used to measure the distribution uniformity of each high-frequency word belonging to legal terminology:

[0096] In this formula, High frequency words belonging to legal terminology The entropy value of all case types as the high frequency words belonging to legal terminology uniformity of distribution (across all case types), is the total number of case types, High frequency words belonging to legal terminology In the The frequency of occurrence of the case type in the judgment document collection, is the total number of case types, .

[0097] The larger the information entropy, the more evenly the high-frequency words are distributed in different case types, which means that the frequency of appearance of the high-frequency words in various case types is relatively similar, and there is no obvious case type specificity. The possibility of using the high-frequency words as keywords in the current judgment documents is relatively low; conversely, the smaller the information entropy, the higher the frequency of appearance of the high-frequency words in certain case types, the more concentrated the distribution, and the more critical they may be to specific case types, and thus they are more likely to be used as keywords in the current judgment documents.

[0098] Through this step, the distribution uniformity of each high-frequency word belonging to legal terminology is obtained.

[0099] S43: Correct the TF-IDF values ​​of high frequency words belonging to legal terms.

[0100] If a high-frequency word belonging to legal terminology is distributed more evenly in different case types, that is, the distribution uniformity is greater, although the word does not have obvious case type specificity, legal terminology also plays a certain role in understanding case information. Therefore, its TF-IDF value should be appropriately enlarged.

[0101] If a high-frequency word belonging to legal terminology is distributed unevenly in different types of cases, that is, the distribution uniformity is smaller, such as "patent infringement" which appears frequently in intellectual property cases but rarely appears in other types of cases, and has a strong directionality to a specific type of case, we should focus on amplifying it and significantly amplify its TF-IDF value to highlight its key role in such cases; Therefore, based on the above logic, targeted corrections are made to the high-frequency words that are legal terms in the current judicial document. No corrections are made to the high-frequency words that are not legal terms in the current judicial document. The high-frequency words that are not legal terms are retained according to the TF-IDF value obtained in step S2.

[0102] In one embodiment, the TF-IDF values ​​of high-frequency words belonging to legal terms in the current judgment document are modified based on the following formula:

[0103] In this formula, is any high frequency word belonging to legal terminology, High frequency words belonging to legal terminology The corrected TF-IDF value, and They are high frequency words belonging to legal terms. TF values ​​and high frequency words belonging to legal terms Value, this formula is mainly for high-frequency words belonging to legal terms The IDF value of the word is adjusted to achieve the correction operation of its TF-IDF value. It is the amplification factor. The value can be adjusted to control the degree of correction. The empirical value is 3. and are the maximum and minimum values ​​of the distribution uniformity of all high-frequency words belonging to legal terms, for uniformity of distribution.

[0104] In this formula, when near When describing high frequency words that are legal terms In some cases, the frequency is higher, the distribution is more concentrated, and the distribution is more uniform. The smaller it is, the stronger the directionality is for a specific case type. Approaching 1, will be greatly increased, thus achieving the high-frequency words belonging to legal terms The value obtained in step S2 The TF-IDF value of high-frequency legal terms with low distribution uniformity is greatly amplified, realizing the correction strategy of greatly amplifying their TF-IDF value. For example, in intellectual property cases, words such as "patent infringement" have low distribution uniformity. After correction, their TF-IDF value will increase significantly. This can highlight the key role of these words in specific case types, which helps to quickly identify important information closely related to specific case types when analyzing judicial documents, facilitate case classification and accurately understand the core issues of the case.

[0105] In this formula, when near When it means a high frequency word belonging to legal terminology The more evenly the distribution of different case types is, The larger the value, the less specific the case type. Approaching 0, will be moderately amplified, thereby achieving high-frequency words belonging to legal terms The moderate amplification of the TF-IDF value obtained in step S2 realizes the correction strategy of moderately amplifying the TF-IDF value of high-frequency legal terms with large distribution uniformity. For example, the TF-IDF values ​​of words such as "contract" and "litigation" are moderately amplified. This confirms the role of some legal terms with common characteristics in understanding case information. Although they cannot directly point to specific case types, they are an indispensable part of the overall case analysis. Moderately amplifying their values ​​can ensure that they receive due attention in information extraction and analysis.

[0106] Through this targeted correction, the TF-IDF value can better reflect the differences in the importance of legal terms in different types of cases. When extracting keywords and key information from judicial documents, it can more accurately identify words related to the core content of the case and exclude some high-frequency words that are not closely related to the substance of the case, thereby improving the accuracy and effectiveness of information extraction.

[0107] S5: Sort the TF-IDF values ​​of all the words in the current judgment document to determine the keywords of the current judgment document and complete keyword extraction.

[0108] The TF-IDF values ​​of all the words in the current judgment document are sorted in descending order, and then the number of keywords in the current judgment document is determined using the elbow rule. The specific method is as follows: Select the first 1, 2, 3 after sorting in turn Each time a word is selected, the ratio of the sum of the TF-IDF values ​​of the remaining words to the sum of the TF-IDF values ​​of all words is calculated as the index value. To select quantity; Construct a trend chart of the index value and the number of selections, with the horizontal axis being the number of selections and the vertical axis being the index value corresponding to the number of selections; when an elbow point appears in the trend chart, the number of selections at the elbow point is recorded as , finally, the sorted front The words are used as keywords of the current judicial document, completing the keyword extraction operation.

[0109] The present invention also provides a case keyword extraction system based on judicial documents, the keyword extraction system includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement any step of the keyword extraction method to complete the case keyword extraction operation of the judicial document.

[0110] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A case keyword extraction method based on judicial documents, characterized in that: include: Obtain all judgment documents of various case types, obtain the TF value, IDF value and TF-IDF value of each word in the current judgment document through the TF-IDF algorithm, and determine the low-frequency and high-frequency words in the current judgment document; For low-frequency words, first divide all judicial documents into multiple key segments, then determine the possibility of low-frequency words being in each key segment, and modify the TF-IDF value of low-frequency words based on the possibility of low-frequency words being in each key segment; The key sections include: the case section, the fact finding section, the dispute focus section and the judgment summary section; For high-frequency words, determine the high-frequency words belonging to legal terms, determine the distribution uniformity of the high-frequency words belonging to legal terms according to the frequency of occurrence of the high-frequency words belonging to legal terms in all judgment documents of each case type, and modify the TF-IDF value of the high-frequency words belonging to legal terms based on the distribution uniformity; After the correction is completed, all the words in the current document are sorted in descending order according to their TF-IDF values, and the keywords of the current judgment document are determined based on the sorting results to complete the case keyword extraction of the current judgment document.

2. The case keyword extraction method based on judicial documents according to claim 1 is characterized in that: The TF-IDF value of low-frequency words is corrected according to the probability of low-frequency words being located in each key segment based on the following formula: ; In the formula, is any low-frequency word, for The corrected TF-IDF value, and They are TF value, IDF value, is the total number of key segments, For the The weight of the key segment, for Located in The possibility of a key segment.

3. The case keyword extraction method based on judicial documents according to claim 1 is characterized in that: The TF-IDF value of high-frequency words belonging to legal terms is corrected based on the following formula: ; In the formula, is any high frequency word that is a legal term, for The corrected TF-IDF value, and They are TF value, value, is the magnification factor, and are the maximum and minimum values ​​of the distribution uniformity of all high-frequency words belonging to legal terms, for uniformity of distribution.

4. The method for extracting case keywords based on judicial documents according to claim 2 is characterized in that: The probability that a low-frequency word is located in each key segment is determined based on the following formula: ; In the formula, is any low-frequency word, for Located in The probability of a key segment, is the total amount of key segments, for In all judicial documents The frequency of occurrence in the key segments, is the total number of all judicial documents, is the indicator function, when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0; when In the The first When it appears in a key segment, the indicator function The value is 1, when Not in The first When it appears in a key segment, the indicator function The value is 0.

5. The case keyword extraction method based on judicial documents according to claim 3 is characterized in that: The distribution uniformity of high frequency words belonging to legal terminology is determined based on the following method: Obtain a collection of judgment documents for each case type; According to the frequency of occurrence of high-frequency words belonging to legal terms in the collection of judicial documents of each case type, the information entropy values ​​of high-frequency words belonging to legal terms in different case types are determined based on the frequency through the information entropy formula as the distribution uniformity of the high-frequency words belonging to legal terms.

6. The method for extracting case keywords based on judicial documents according to claim 3 is characterized in that: High frequency words belonging to legal terminology are determined based on the following method: The high frequency words are matched with all legal terms in a pre-built corpus of legal terms to determine the high frequency words of the legal terms.

7. The method for extracting case keywords based on judicial documents according to claim 1, characterized in that: The low-frequency and high-frequency words in current judicial documents are determined based on the following methods: The words with TF values ​​below the lower quartile of all the words in the current judicial document are regarded as low-frequency words, and the words with TF values ​​above the upper quartile of all the words are regarded as high-frequency words.

8. The method for extracting case keywords based on judicial documents according to claim 1, characterized in that: The method of dividing all judicial documents into several key sections is as follows: Build a feature word library for each key segment; Perform feature matching on each segment of each judicial document and the feature word library of each key segment to obtain all the key segments in each judicial document.

9. The method for extracting case keywords based on judicial documents according to claim 1, characterized in that: The method for determining the keywords of the current judgment document based on the sorting results is: Based on the elbow rule, the number of keywords in the current judgment document is determined, and corresponding words are selected from the sorted words from the front to the back according to the number as the keywords of the current judgment document.

10. A case keyword extraction system based on judicial documents, characterized in that: The keyword extraction system comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the steps of the keyword extraction method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • A text classification method for judgement documents

    CN108984518A

  • News keyword extraction method and system based on TF-IDF method optimization

    CN112256843A

  • Hot word extraction method and system, computer equipment and storage medium

    CN115712700A