A method for extracting knowledge from legal texts

By segmenting the legal text and filtering stop words and filtering keywords, the tag-level knowledge extraction of legal text is achieved, and the problem of lack of tag-level knowledge extraction in the legal field in the existing technology is solved, and personalized automation and manual Interference solutions improve the accuracy and efficiency of extraction.

CN118734846BActive Publication Date: 2025-01-14HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410745744.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2025-01-14
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

The existing technology lacks label-level knowledge extraction methods for the legal field. The main keyword extraction methods are chapter-level and cannot effectively extract label-level knowledge specific to the vertical field in legal texts.

Method used

By segmenting legal texts, aggregating category documents, filtering legal stop words, generating keyword collections, and filtering biased words in unique keywords and common keywords, providing automated solutions based on manual interference and no human intervention. Implement tag-level knowledge extraction.

Benefits of technology

Extend chapter-level keyword extraction from common fields to tag-level knowledge extraction level in vertical fields, and can extract representative keywords, unique keywords and biased words among each tag, providing personalized The solution meets the accuracy and efficiency requirements of different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734846B_ABST
    Figure CN118734846B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for extracting knowledge from legal texts, and belongs to the technical field of knowledge extraction from legal texts. The method comprises: performing word segmentation operations on the text to be extracted, aggregating all documents in each category into a long text, filtering legal stop words, and generating a keyword set for each category; searching for similar categories in each category that share the most keywords with the original category and adding them to the keyword set; screening unique keywords and common keywords in each category and its similar categories and adding them to the keyword set, and screening biased words in unique keywords and common keywords and adding them to the keyword set. In order to solve the problem of lack of knowledge extraction methods in the legal field, the present invention respectively provides a knowledge extraction scheme based on manual intervention and an automated knowledge extraction scheme without manual intervention, and provides personalized solutions for scenarios with different accuracy and efficiency requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for extracting knowledge from a legal text, and belongs to the technical field of extracting knowledge from a legal text. Background Art

[0002] At present, deep learning technology has been widely used in all walks of life. Among them, smart justice is a field that has gradually emerged in recent years. This field uses deep learning technology in the judicial field, which can help judges, lawyers and other legal practitioners to analyze or judge cases to a certain extent, and can also provide intelligent question-and-answer services for areas with fewer legal resources, thereby greatly improving the work efficiency of legal practitioners and the popularization rate of the public. In the field of smart justice, legal knowledge extraction is the basis for important tasks such as similar case retrieval and crime prediction.

[0003] However, most of the existing keyword extraction methods are designed for general fields, and there are almost no related methods designed for vertical fields. At the same time, the existing methods are usually for chapter-level keyword extraction. Summary of the invention

[0004] A brief overview of the present invention is provided below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to a more detailed description discussed later.

[0005] In view of this, in order to solve the technical problem of the lack of label-level knowledge extraction methods in the legal field in the prior art, the present invention provides a legal text knowledge extraction method.

[0006] Solution 1: A method for extracting knowledge from legal texts, comprising:

[0007] Perform word segmentation on the extracted text, aggregate all documents in each category into a long text, filter legal stop words, and generate a keyword set for each category;

[0008] Search for similar categories in each category that share the most keywords with the original category and add them to the keyword set;

[0009] Unique keywords and common keywords in each category and similar categories are filtered and added to the keyword set, and offset words in unique keywords and common keywords are filtered and added to the keyword set.

[0010] Preferably, the method of filtering legal stop words and generating a set of keywords for each category includes manual selection and automatic selection:

[0011] The manual selection method is to extract the top k keywords with the largest weight in each category, select the words with a frequency greater than the frequency threshold in all categories of legal documents as legal stop words, delete the selected legal stop words from the selected keyword set, and then select the top k words with the largest weight in each category as keywords to generate a keyword set, and repeat the above steps until there are no legal stop words in the keyword set

[0012] The automatic selection method is: extract the top l keywords with the largest weight in each category. Assuming there are m categories in total, create a keyword set S′ (S′|=m×l) at this time, use the keywords that have appeared in all categories in the word set S′ as legal stop words, remove the legal stop words, and select the top k words with the largest weight in each category in the word set S′ as keywords to generate a keyword set.

[0013] Preferably, the method of extracting the keyword with the largest weight in each category is: selecting a text x from a set X containing n texts;

[0014] Then the calculation process of the word frequency TF(w) of any word w in x is:

[0015]

[0016] Among them, w_count(w,x) represents the frequency of word w in text x, and size(x) represents the total number of words contained in text x;

[0017] The calculation process of IDF(w) of word w in set X is:

[0018]

[0019] Among them, doc_count(w,X) represents the number of texts in set X that contain word w. If the uncommon word does not appear in any text, the value of doc_count(w,X) is 0, and the value of doc_count(w,X) is increased by 1;

[0020] The weight of word w is: TF-IDF(w)=TF(w)×IDF(w).

[0021] Preferably, the unique keywords are keywords unique to the original category and its similar categories.

[0022] Preferably, the common keywords are keywords shared by the original category and its similar categories.

[0023] Preferably, the bias words in the unique keywords appear in pairs, the bias words in each pair represent the original category and its similar category respectively, and the two bias words have similarity; the bias words in the common keywords are words that are more biased towards a certain category in the keywords shared by two similar categories.

[0024] Preferably, the method for screening biased words in unique keywords is: taking word pairs with an edit distance of 1 in two similar categories of unique keywords as biased words in unique keywords; or filtering out word pairs with an edit distance of 1 from two similar categories of unique keywords respectively, and further filtering out inappropriate word pairs through manual intervention, and the word pairs finally selected are the biased words in the two categories of unique keywords.

[0025] Preferably, the method for screening biased words in common keywords is: introducing a bias coefficient α to measure the bias degree of keywords, with a value range of (1.0, 4.0], for a common keyword w in two similar categories A and B sk , the keyword weights in the two categories are w a and w b , satisfying: w a / w b ≥α, then w sk It is the bias word of category A; or according to expert experience, words that are more biased towards the characteristics of one category are selected from the common keywords of two similar categories. These words are the bias words in the common keywords that are biased towards this category.

[0026] Solution 2: An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a legal text knowledge extraction method described in Solution 1 are implemented.

[0027] Solution three: A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a legal text knowledge extraction method as described in Solution one.

[0028] The beneficial effects of the present invention are as follows: the present invention extends the keyword extraction at the chapter level in the general field to the knowledge extraction level at the tag level in the vertical field; it solves the current problem of the lack of knowledge extraction methods in the legal field, and can not only extract representative keywords for each tag, but also extract unique keywords between tags and bias words in common keywords; at the same time, the present invention respectively provides a knowledge extraction scheme based on manual intervention and an automated knowledge extraction scheme without manual intervention, providing personalized solutions for scenarios with different accuracy and efficiency requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0030] Figure 1 The figure is a flow chart of a legal text knowledge extraction method. DETAILED DESCRIPTION

[0031] In order to make the technical solutions and advantages of the embodiments of the present invention more clearly understood, the exemplary embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0032] Example 1: Reference Figure 1 This embodiment describes a method for extracting knowledge from legal texts, including:

[0033] S1. Perform word segmentation on the extracted text, aggregate all documents in each category into a long text, filter legal stop words, and generate a keyword set for each category;

[0034] Legal stop words refer to words that appear in most legal documents but contain almost no corresponding category information, such as "court" and "occurrence". Since these words appear frequently in all categories of legal documents, they need to be removed to ensure that words that can better describe the category characteristics can be obtained. Two solutions are provided: legal stop word selection based on manual intervention and legal stop word selection without manual intervention, so that a more suitable solution can be selected in scenarios with different requirements for accuracy and efficiency.

[0035] The selection of legal stop words based on manual intervention, that is, the manual selection method is to extract the top k keywords with the largest weight in each category, manually check the extracted keywords, select the words with a frequency greater than the frequency threshold in all categories of legal documents as legal stop words, delete the legal stop words and extract keywords again, and select the top k words with the largest weight in each category as keywords to generate a keyword set;

[0036] In order to improve the selection criteria of keywords, legal stop words can be repeatedly removed until there are no legal stop words in the extracted keywords, and then the top k words with the largest weight in each category are selected as keywords to generate a keyword set;

[0037] The automatic selection method is: extract the first l keywords with the largest weight in each category, and the parameter l must satisfy: l ≥ 2k, where k represents the number of keywords selected in each category; the value range of l is [100, 1000]. Assuming that there are m categories in total, a keyword set S′ (S′|=m×l) is created at this time, and the keywords that appear in all categories in the word set S′ are used as legal stop words, legal stop words are removed, and the first k words with the largest weight in each category in the word set S′ are selected as keywords to generate a keyword set.

[0038] The method of extracting the keyword with the highest weight in each category is: select a text x from a set X containing n texts;

[0039] Then the calculation process of the word frequency TF(w) of any word w in x is:

[0040]

[0041] Among them, w_count(w,x) represents the frequency of word w in text x, and size(x) represents the total number of words contained in text x;

[0042] The calculation process of IDF(w) of word w in set X is:

[0043]

[0044] Among them, doc_count(w,X) represents the number of texts in set X that contain word w. If the uncommon word does not appear in any text, the value of doc_count(w,X) is 0, and the value of doc_count(w,X) is increased by 1;

[0045] The weight of word w is: TF-IDF(w)=TF(w)×IDF(w).

[0046] S2. Search for similar categories in each category that have the most common keywords with the original category and add them to the keyword set;

[0047] S3. Filter the unique keywords and common keywords in each category and its similar categories and add them to the keyword set, and filter the offset words in the unique keywords and common keywords and add them to the keyword set.

[0048] The bias words in legal knowledge are new concepts proposed by the present invention. Legal knowledge includes bias words, and bias words are a kind of legal knowledge. There are two types of bias words, namely, bias words in unique keywords and bias words in common keywords. Unique keywords are unique keywords in the original category and its similar category. The bias words in the unique keywords appear in pairs, and the bias words in each pair represent the original category and its similar category respectively, and the two bias words have similarity. Common keywords are keywords shared by the original category and its similar category, and the bias words in the common keywords are words that are more biased towards a certain category among the keywords shared by two similar categories. For example, although "minor injury" is a common keyword for intentional injury and intentional homicide, its frequency of occurrence in intentional injury is much higher than that in intentional homicide. Therefore, "minor injury" is more representative for intentional injury, so it is a bias word that is more biased towards intentional injury for these two categories. Similar to the selection of legal stop words, the present invention also provides two solutions for the selection of bias words, one based on manual intervention and the other without manual intervention, so as to selectively use them in different scenarios.

[0049] The method for selecting bias words in unique keywords based on manual intervention is: filter out word pairs with an edit distance of 1 from unique keywords of two similar categories respectively, further filter out inappropriate word pairs through manual intervention, and the word pairs finally selected are the bias words in the unique keywords of the two categories.

[0050] The method of using the offset words in the unique keywords without manual intervention is: using the word pairs with an edit distance of 1 in two unique keywords of similar categories as the offset words in the unique keywords.

[0051] The method for selecting bias words in common keywords based on manual intervention is: according to expert experience, words that are more biased towards the characteristics of one category are selected from the common keywords of two similar categories. These words are the bias words in the common keywords that are biased towards the category.

[0052] The method for selecting bias words in common keywords without manual intervention is: The method for selecting bias words in common keywords is: Introduce the bias coefficient α to measure the bias degree of keywords, and the value range is (1.0,4.0], for a common keyword w in two similar categories A and B sk , the keyword weights in the two categories are w a and w b , satisfying: w a / w b ≥α, then w sk is the bias word of category A.

[0053] Embodiment 2: The computer device of the present invention may be a device including a processor and a memory, such as a single chip microcomputer including a central processing unit, etc. Moreover, the processor is used to implement the steps of the above-mentioned legal text knowledge extraction method when executing the computer program stored in the memory.

[0054] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0055] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0056] Embodiment 3: Computer readable storage medium embodiment.

[0057] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. A computer program is stored on the computer-readable storage medium. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned legal text knowledge extraction method can be implemented.

[0058] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.

[0059] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.

Claims

1. A method for extracting knowledge from legal texts, characterized in that: include: Perform word segmentation on the extracted text, aggregate all documents in each category into a long text, filter legal stop words, and generate a keyword set for each category; Search for similar categories in each category that share the most keywords with the original category and add them to the keyword set; Filter unique keywords and common keywords in each category and similar categories and add them to the keyword set, and filter bias words in unique keywords and common keywords and add them to the keyword set; Biased words are a type of legal knowledge. There are two types of biased words, namely, biased words in unique keywords and biased words in common keywords. Unique keywords are keywords that are unique to the original category and its similar categories; biased words in unique keywords appear in pairs, and the biased words in each pair represent the original category and its similar categories, and the two biased words have similarities; common keywords are keywords shared by the original category and its similar categories, and biased words in common keywords are words that are more biased towards a certain category among the keywords shared by two similar categories.

2. A method for extracting knowledge from legal texts according to claim 1, characterized in that: The method of filtering legal stop words and generating a set of keywords for each category is: including manual selection and automatic selection: The manual selection method is to extract the top most weighted Keywords, select words with a frequency greater than the frequency threshold in all categories of legal documents as legal stop words, delete the selected legal stop words from the selected keyword set, and then select the top words with the largest weight in each category. The words are used as keywords to generate a keyword set, and the manual selection is repeated until there are no legal stop words in the keyword set; The automatic selection method is: extract the top keywords, assuming there are categories, create a keyword set , the word set Keywords that appear in all categories are used as legal stop words, legal stop words are removed, and the word set is selected The top most weighted The words are used as keywords to generate a keyword set.

3. A method for extracting knowledge from legal texts according to claim 1, characterized in that: The method to extract the most important keywords in each category is to select a A collection of texts Select a text ; but Any word in Frequency of words The calculation process is: ; in, Represents text Chinese words The frequency of occurrence, Represents text The total number of words contained in Words In the collection Inverse document frequency in The calculation process is: ; in, Representing a collection Contains words If the uncommon words do not appear in any text, then The value of is 0, The value of is increased by 1; Words The weight is: .

4. A method for extracting knowledge from legal texts according to claim 1, characterized in that: Unique keywords are keywords that are unique to the original category and its similar categories.

5. A method for extracting knowledge from legal texts according to claim 1, characterized in that: Common keywords are keywords shared by the original category and its similar categories.

6. A method for extracting knowledge from legal texts according to claim 1, characterized in that: The method for screening biased words in unique keywords is: taking word pairs with an edit distance of 1 in unique keywords of two similar categories as biased words in unique keywords; or filtering out word pairs with an edit distance of 1 from unique keywords of two similar categories respectively, further filtering out inappropriate word pairs through manual intervention, and finally selecting word pairs as biased words in unique keywords of the two categories.

7. A method for extracting knowledge from legal texts according to claim 1, characterized in that: The method of filtering out biased words in common keywords is: introducing bias coefficient Measures the bias of keywords, with a value range of , for two similar categories and A common keyword in , the keyword weights in the two categories are and ,satisfy: ,but For Category or select words that are more biased towards the characteristics of one category from the common keywords of two similar categories based on expert experience. These words are the biased words in the common keywords that are biased towards that category.

8. An electronic device, characterized in that: It comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of a legal text knowledge extraction method as described in any one of claims 1-7 when executing the computer program.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, a method for extracting knowledge from legal text as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Hidden keyword extraction method, terminal equipment and storage medium

    CN114372461A

  • Automatic keyword extraction method and device based on rules and TF-IDF

    CN115455139A