NLP-based text core information rapid extraction method and system
By employing a NLP-based method for rapid extraction of core text information, the problem of low efficiency in manual processing of litigation texts is solved. This method enables the accurate extraction of professional terminology and spatiotemporal expressions in environmental public interest litigation cases, improving the accuracy and consistency of information extraction and supporting rapid case handling and judicial decision-making.
Patent Information
- Application Number
- CN202511719326.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-03-06
AI Technical Summary
In the process of reviewing litigation documents, existing technologies are inefficient due to the low efficiency of manual processing. It is difficult to extract professional terms and spatiotemporal descriptions in environmental public interest litigation cases, resulting in the loss of key information or misjudgment. Existing NLP technology cannot meet the requirements of judicial evidence.
A method for rapidly extracting core text information based on NLP is adopted, including data preprocessing, time information extraction, location information extraction, event type extraction, and information consistency verification. By using techniques such as custom dictionaries, geographic knowledge bases, time expression recognition, named entity recognition, and coreference resolution, combined with BERT hidden layer output and knowledge graph weight coefficients, accurate information extraction is achieved.
It improves the accuracy and consistency of information extraction in environmental public interest litigation cases, ensures the accuracy of time, location and event information, supports the rapid handling of cases, and enhances the logical consistency of legal text analysis and the ability to support judicial decision-making.
Smart Images

Figure CN121614581A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis, and in particular to a method and system for rapidly extracting core information from text based on NLP. Background Technology
[0002] In the retrieval of litigation documents, case files typically contain a large amount of textual data, such as investigation records, monitoring reports, and witness testimonies. Currently, the extraction of core information faces the following challenges:
[0003] Manual processing is inefficient, relying on manual reading of case files to extract information such as time, location, and events, which is time-consuming and labor-intensive, making it difficult to meet the needs of rapid case handling. Manual operation is prone to omissions or misjudgments, such as vague time descriptions (e.g., "several months ago") and inaccurate location positioning (e.g., only mentioning "near a certain river"), leading to the loss of crucial information. Existing NLP information extraction technologies are mostly geared towards general fields and are not optimized for the specialized terminology of environmental public interest litigation cases, such as "soil heavy metal contamination" and "wetland degradation," spatiotemporal descriptions such as "2022 flood season in the XX basin of the upper Yangtze River," and event types such as "illegal discharge" and "ecological damage." The extraction accuracy cannot meet the requirements of judicial evidence. The problem of low text extraction accuracy urgently requires solutions from those skilled in the art. Summary of the Invention
[0004] This invention aims to at least solve the technical problems existing in the prior art, and in particular, it innovatively proposes a method and system for rapid extraction of core text information based on NLP.
[0005] To achieve the above-mentioned objectives of this invention, this invention provides a method for rapid extraction of core text information based on NLP, comprising:
[0006] S1, perform data preprocessing operations, collect case file texts, and perform cleaning, word segmentation and named entity recognition;
[0007] S2, Extract time information: Extract the time of occurrence and duration of the case through time expression recognition and normalization algorithms;
[0008] S3: Extract location information, combine geographical knowledge base and importance rule judgment algorithm to extract and sort the precise locations of cases;
[0009] S4, extract event types, and use text classification and semantic role labeling technology to identify event types and core elements;
[0010] S5 verifies the consistency and rationality of the extracted information through coreference resolution and domain knowledge constraints.
[0011] In a preferred embodiment of the above technical solution, S1 includes:
[0012] A word segmentation tool is used and a custom environment domain dictionary is loaded. Noise data in the text is removed by regular expressions. The text is then segmented using a professional word segmentation tool to generate a standardized word sequence F(W).
[0013] The formula for calculating vocabulary noise filtering is:
[0014] ;
[0015] in, α is a smoothing parameter used to address data sparsity, β is a weighting coefficient that adjusts the importance of different features, and S is a set of standardized word sequences weighted by the dictionary. For word frequency statistics weighting, For the dictionary weights in the field of legal texts, is the word length value, and N is the word sequence within the sliding window.
[0016] In a preferred embodiment of the above technical solution, step S2 includes:
[0017] Input: Character sequence; Output: Candidate word sequence W;
[0018] Need to make , where freq(w i () represents the basic frequency of the word in the general corpus; For legal text domain dictionary weights, in NLP technology, P(w) i Use dictionary frequencies directly. For noise filtering collaborative weights, , This is the word length gain coefficient, used to adjust... Word length value, This is the noise filtering gain coefficient, used to adjust the noise filtering gain during the data preprocessing stage. .
[0019] In a preferred embodiment of the above technical solution, step S2 further includes:
[0020] Perform DAG mapping.
[0021] Noise filtered This is the set of valid words after F(w) preprocessing;
[0022] Solve by inverse dynamic programming, and let R(t) be the minimum fraction boundary condition from position t to the end of the sentence, R(N)=0; ;
[0023] in, This is the noise filtering coordination coefficient. For the data preprocessing stage Long substring of words The rating; through and Prioritize the identification of technical terms and collaboratively filter noise: It forms a closed loop with F(w).
[0024] In a preferred embodiment of the above technical solution, step S3 includes:
[0025] By combining a geographic information knowledge base and using named entity recognition and place name disambiguation algorithms, the precise location where the case occurred can be extracted.
[0026] ;
[0027] Wherein, S(w) is the overall importance score of the location term w, L(w) is the administrative level score, P(w) is the spatial precision score; R(w) is the case role score, and C(w) is the contextual saliency score. These are dynamic weighting coefficients.
[0028] In a preferred embodiment of the above technical solution, step S4 includes:
[0029] Establish a knowledge graph of environmental public interest litigation event types, and automatically classify cases and events through a text classification model;
[0030]
[0031] E(t) is the comprehensive extraction score for event t, where T norm (t) represents the normalized value of time information (calculated using the F(x) formula, e.g., "2023 flood season" → "June-September"); Role(t) represents the event role weight (main event = 1.0, sub-event = 0.7, related event = 0.3); Type(t) represents the event type weight (water pollution = 1.2, soil pollution = 1.0, deforestation = 0.9); ϕ 1−3 This is the event importance coefficient (dynamically adjusted based on the scope of the case's impact).
[0032] Impact Factor ,
[0033] Event Impact Index: EventImpact(t) = log(public opinion heat) + γ * scope of case impact; Sigmoid mapping is σ(x) = 1 / (1+e −x The impact index is compressed to the [0,1] interval; c is the temperature coefficient, which controls the steepness of the mapping; the event impact index EventImpact=0.8, and the final score of the event is obtained by Sigmoid mapping.
[0034] In a preferred embodiment of the above technical solution, step S5 includes:
[0035] Cross-text consistency verification is performed by using coreference resolution technology to identify the same entity mentioned in different paragraphs, ensuring consistency of time, place, and event information and avoiding contradictory statements.
[0036] ;
[0037] Among them, V total Entity comprehensive verification score; CoRef(e): coreference resolution score; KG(e): knowledge graph matching degree; Consist(T, L, E): spatiotemporal event consistency function; λ 1−3 To verify the weighting coefficients.
[0038]
[0039]
[0040] Attention(t) = softmax(BERT hidden layer output), capturing key information locations; CoRef(e) = total reference count and correct reference count; Knowledge graph matching degree KG(e) = cos(entity vector, knowledge graph node vector); Fusion strategy These are the weight coefficients for the knowledge graph.
[0041] The present invention also discloses a computer system, comprising:
[0042] processor;
[0043] Memory used to store processor-executable instructions;
[0044] The processor is configured to implement the method according to any one of claims 1 to 8 when executing the executable instructions.
[0045] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0046] By using a word segmentation tool with a custom dictionary in the environmental domain and regular expression noise filtering, combined with smoothing processing through word frequency-dictionary weight collaboration, the problems of low recognition rate and high noise interference in legal texts are effectively solved. The generation of standardized word sequences F(W) ensures the quality of basic data for subsequent processing, laying a solid foundation for accurate information extraction. Time information extraction employs a DAG graph construction algorithm with dynamic programming inverse solution, prioritizing the identification of professional terms through the minimum score boundary condition R(t). Combining legal domain dictionary weights and word length gain coefficients, time expressions are standardized to ensure the accuracy and comparability of time information, effectively supporting case timeline analysis. Location extraction combines a geographical knowledge base with dynamic weight fusion of administrative level score L(w), spatial accuracy score P(w), case role score R(w), and contextual saliency score C(w), prioritizing accurate locations through a comprehensive score S(w). This improves the spatial accuracy and judicial usability of location information. Based on a knowledge graph of environmental public interest litigation event types, automatic event classification is achieved through text classification models and semantic role labeling technology. The event's comprehensive extraction score E(t) is dynamically adjusted by fusing the time-normalized value Tnorm(t), role weight Role(t), type weight Type(t), and influence factors. Combined with the Sigmoid mapping between public opinion heat and the case's impact scope, this achieves a quantitative assessment of the event's importance, supporting the scientific calculation of the case's impact index. Through dynamic adjustment mechanisms such as smoothing parameter α, weight coefficient β, word length gain coefficient, and noise filtering coordination coefficient, the system can adapt to the noise characteristics and domain terminology distribution of different legal texts. By combining the Attention mechanism of BERT hidden layer output to capture key information locations, and with the knowledge graph weight coefficient fusion strategy, the entire process from preprocessing to verification is dynamically optimized, improving the system's robustness and generalization ability in complex legal scenarios. This technical solution, through algorithmic innovation and deep integration of domain knowledge, improves information extraction accuracy while strengthening the logical consistency of legal text analysis and its ability to support judicial decision-making, demonstrating significant technological advancement and application value.
[0047] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0048] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0049] Figure 1 This is a schematic diagram of the overall invention. Detailed Implementation
[0050] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0051] like Figure 1 As shown, this invention discloses a method for fast extraction of core text information based on NLP, comprising the following steps:
[0052] S1, perform data preprocessing operations, collect case file texts, and perform cleaning, word segmentation and named entity recognition;
[0053] S2, Extract time information: Extract the time of occurrence and duration of the case through time expression recognition and normalization algorithms;
[0054] S3: Extract location information, combine geographical knowledge base and importance rule judgment algorithm to extract and sort the precise locations of cases;
[0055] S4, extract event types, and use text classification and semantic role labeling technology to identify event types and core elements;
[0056] S5 verifies the consistency and rationality of the extracted information through coreference resolution and domain knowledge constraints.
[0057] In a preferred embodiment of the above technical solution, S1 includes:
[0058] This section describes how to use Python regular expressions to clean text by removing HTML tags, garbled characters, and repeated paragraphs. For example, `re.sub(r'<.?>', '', text)` can be used to remove HTML tags. It also describes how to obtain text data from environmental public interest litigation case files, including indictments, investigation records, monitoring reports, and on-site investigation records.
[0059] Word segmentation: A word segmentation tool is used and a custom environmental domain dictionary (containing professional terms such as "water quality monitoring" and "ecological compensation") is loaded. Noise data (such as formatting marks and repeated paragraphs) in the text is removed by regular expressions, and professional word segmentation tools (such as word segmentation models combined with environmental domain dictionaries) are used to segment the text to generate standardized word sequences.
[0060] The formula for calculating vocabulary noise filtering is:
[0061] ;
[0062] in, α is a smoothing parameter used to address data sparsity, β is a weighting coefficient that adjusts the importance of different features, and S is a set of standardized word sequences weighted by the dictionary. For word frequency statistics weighting, For the dictionary weights in the field of legal texts, Where N is the word length value, and N is the word sequence within the sliding window. The window size is defined according to the actual text situation, preferably 3, 5, or 7.
[0063] The jieba dictionary is used to load legal text domain dictionaries (e.g., environmental damage weight = 3), and regular expressions are used to filter format symbols (HTML tags / special characters) to generate a standardized word sequence. Based on the weighted sum of the product of word frequency f(w) and environmental weight g(w), the contribution of high-value words is highlighted, and the median of word length values within the sliding window is taken to suppress impulse noise.
[0064] Named entity recognition: Using the spaCy library or a custom BiLSTM-CRF model, identify time entities (TIME), location entities (GPE), and organization entities (ORG) in the text; use NLP technology to perform part-of-speech tagging on the word segmentation results to identify time words, location words, organization names, and other entities in the text, laying the foundation for subsequent information extraction.
[0065] Time information extraction:
[0066] A time expression recognition model specifically for environmental legal cases is constructed to support the parsing of diverse time expressions such as "May-October 2023", "flood season" and "lasting for half a year", and to extract elements such as the time of occurrence and duration of the case.
[0067] Detailed Explanation of Expression Recognition Model: This model encompasses three dimensions: model architecture, core formulas, and training strategies.
[0068] (1) The model architecture is a hybrid architecture with the following processing order: input text → preprocessing layer → rule matching layer → deep learning layer → postprocessing layer → structured output.
[0069] hierarchy Function Technical Implementation Preprocessing layer Text cleaning, word segmentation, part-of-speech tagging, and loading of environmental domain dictionaries (e.g., "flood season", "dry season", "pH value exceeding standard for 3 consecutive months"). jieba+ custom dictionary (including environmental terms such as "COD" and "ammonia nitrogen"), BERT tokenizer Rule matching layer High-precision analytical normalized time expressions (e.g., "May-October 2023") Regular expression libraries (e.g., \d{4}year\d{1,2}month-\d{1,2}month) and time semantic slot templates (e.g., "continuous<number><unit>") Deep learning layer Handle vague expressions (such as "flood season" or "lasts for half a year") and context-dependent expressions (such as "2 months after the last inspection"). BERT-based sequence labeling model (BiLSTM-CRF + attention mechanism) Post-processing layer Time normalization (e.g., "half a year" → 180 days), conflict resolution (e.g., "2023 flood season" actually refers to June-September) Environmental knowledge graphs (e.g., "flood season" → May-October, Southern China), and time interval operations (e.g., deriving the start and end dates of "lasting for six months").
[0070] (2) Core formula:
[0071] 1. Maximum probability word segmentation target
[0072] Input: Character sequence; Output: Candidate word sequence W;
[0073] Need to make , where freq(w i () represents the basic frequency of the word in the general corpus; For legal text domain dictionary weights, in NLP technology, P(w) i Use dictionary frequencies directly. For noise filtering collaborative weights, , This is the word length gain coefficient, used to adjust... Word length value, This is the noise filtering gain coefficient, used to adjust the noise filtering gain during the data preprocessing stage. .
[0074] 2. DAG Graph Construction Formula: Define a set of candidate words for position t (character subscript). Once the time dictionary is added, as long as "2023", "flood season" and "lasting for half a year" are written as a whole into Dict, the formula will treat them as single edges.
[0075]
[0076] Noise filtered This is the set of valid words after F(w) preprocessing;
[0077] 3. Solve using dynamic programming in reverse, denoted as R(t) as the minimum fraction boundary condition from position t to the end of the sentence, R(N) = 0. Backtracking yields the candidate word W.
[0078] ;
[0079] in, This is the noise filtering coordination coefficient. For the data preprocessing stage Long substring of words The rating.
[0080] pass and Prioritize the identification of technical terms and collaboratively filter noise: It forms a closed loop with F(w), which improves the accuracy of format symbol recognition.
[0081] Training strategy
[0082] 1. Domain Data Construction and Labeling: Collect 5,000 environmental administrative penalty documents and label them with time expressions (such as "May-October 2023" or "2 months of continuous exceedance"), using the BIO labeling system. Data Augmentation: Replace numbers and units (such as "3 months" → "6 months" or "180 days").
[0083] 2. Model Training Pre-training: Using BERT-Base-Chinese as the initial weights, further pre-training is performed on environmental domain corpora (such as environmental regulations and case reports) (MLM task) to enhance domain vocabulary understanding.
[0084] 3. Evaluation Metrics: Entity-level F1: Calculate Precision / Recall / F1 for the entire time expression (e.g., "May-October 2023"), requiring F1 ≥ 95%. Normalized Accuracy: The overlap rate between the parsed time interval and the true interval is ≥ 90% (e.g., "flood season" is correctly mapped to June-September).
[0085] A time normalization algorithm is employed to convert fuzzy time expressions (such as "last year" or "last month") into specific timestamps, improving the accuracy of time information. This algorithm is implemented using the existing jieba tool.
[0086] The following is a Python code example:
[0087] import jieba, re
[0088] # 1. Insert the entire string of time words into the jieba dictionary, so that it is broken down as a whole.
[0089] jieba.add_word('lasting for six months', freq=1e8)
[0090] jieba.add_word('Flood Season', freq=1e8)
[0091] # 2. Word segmentation (only equations (1)-(4) were performed)
[0092] words = jieba.lcut('The factory discharged wastewater for six consecutive months during last year's flood season')
[0093] #3. Post-processing: Your own "time normalization formula"
[0094] dur_map = {'half a year': 180, 'one year': 365, 'months': 30}
[0095] date_map = {'last year': -1, 'last month': -1} # Relative offset
[0096] for w in words:
[0097] if w in dur_map: # Continuous
[0098] days = dur_map[w]
[0099] print(f'{w} -> {days} days')
[0100] elif w in date_map: # Relative date
[0101] offset = date_map[w]
[0102] print(f'{w} -> current year + {offset}').
[0103] Location information extraction:
[0104] By combining geographic information knowledge bases (such as administrative division databases and key ecological area lists), named entity recognition and place name disambiguation algorithms are used to extract the precise location where the case occurred (such as "within 1 kilometer of the Lingjiang Riverbank in the North District of a certain city").
[0105] ;
[0106] Wherein, S(w) is the comprehensive importance score of the location word w, L(w): administrative level score (provincial level = 30, municipal level = 22, district / county level = 15, township level = 8, village level = 3), P(w): spatial precision score (latitude and longitude ±″ level = 25, ±′ level = 20, road address = 10, natural geographical entity = 8), R(w): case role score (pollution occurrence location = 30, evidence sampling location = 25, sewage outlet = 25, enterprise registration location = 20), and C(w): contextual significance score (calculated by the TextRank algorithm and normalized to the [0, 15] interval). Dynamic weighting coefficients (ω1+ω2+ω3+ω4=1, adaptively adjusted based on case type)
[0107] The dynamic weights are calculated as follows:
[0108]
[0109] Collect location word score sequences S(w) from historical cases t For example, the score for "core area of national nature reserve" is L=30, P=25, R=30, C=15.
[0110] The time decay factor, , Give more weight to recent data;
[0111] Implementation steps of named entity recognition and place name disambiguation algorithms:
[0112] (1) Using BERT for place name entity recognition: 1. First, load the dictionary by importing authoritative place names such as national administrative divisions, key ecological areas, and nature reserves to ensure that they are not mis-segmented. 2. Word segmentation + part-of-speech filtering: Use the functions of the jieba tool for word segmentation and magnetic annotation. Example code is as follows:
[0113] import jieba.posseg as p
[0114] text = 'Black storks spotted within 1 kilometer of the Jialing River in Yubei District, Chongqing'
[0115] mention = [(w, f) for w, f in p.cut(text) if f=='ns']
[0116] # mention -> [('Chongqing City', 'ns'), ('Yubei District', 'ns'), ('Jialing River', 'ns')]
[0117] (2) Place name disambiguation: 1. Context encoding: First, use jieba for word segmentation, then use TF-IDF or Word2Vec to obtain the sentence vector, and calculate the cosine similarity with the description vector of each sense in the encyclopedia / national standard, and take the maximum. 2. Knowledge base linking: Take the three entities "Chongqing City", "Yubei District" and "Jialing River" to the "spatial containment table" at the same time. If the knowledge base records "Yubei District ⊂ Chongqing City", and "Chongqing City" also appears in the sentence, the weight is increased by 1; then check the coordinates and find that "Jialing River" also appears in the sentence, and the Jialing River does flow through Yubei District, the weight is increased by 1 again; give the final score by combining context similarity and spatial consistency, and the sense with the highest score is the only landing entity. 3. Output precise spatial range: After selecting "Yubei District (Chongqing City)", get its official boundary Polygon from the administrative division database, make a 1 km buffer with the center line of "Jialing River", and finally return.
[0118] The algorithm for determining the importance of a location is designed to sort key location information by weighting the location information according to the level of detail in the text description (such as whether it includes latitude and longitude, administrative division level) and its relevance to the case (such as whether it is the location of pollution or evidence collection).
[0119] Specific process and related parameters: The "location importance" is broken down into 4 quantifiable dimensions. For each dimension, a feasible calculation formula, threshold / parameter range, and weight coefficient are given. Finally, a "location importance score" of 0-100 is output. All thresholds are calculated based on environmental judicial documents in the past two years and can be directly reused. If the data distribution is different, it can be refitted. (1) Dimension definition and formula
[0120] The administrative level is divided into L (0-30). The higher the level, the more likely it is to appear as the "scene of the crime".
[0121] If at the provincial level: L = 30
[0122] elif (Prefecture-level city): L = 22
[0123] elif (District / County Level): L = 15
[0124] elif Township level: L = 8
[0125] elif Village / Community Level: L = 3
[0126] else (no matching zone found): L = 0
[0127] Spatial precision score P (0–25) is awarded based on the smallest resolvable unit in the text.
[0128] If explicit latitude and longitude (±″): P = 25
[0129] elif explicit latitude and longitude (±′ level): P = 20
[0130] elif Explicit latitude and longitude (±°): P = 15
[0131] elif Road / House Number: P = 10
[0132] elif Natural geographical entity (river / lake): P = 8
[0133] elif (District / County Name Only): P = 5
[0134] else: Province / City Names Only: P = 2
[0135] Case roles are divided into R (0–30), tagged at the sentence level, and the maximum value is accumulated (multiple roles in the same location are not accumulated).
[0136] Location of pollution: 30
[0137] Evidence sampling location: 25
[0138] Location of sewage outlet: 25
[0139] Company registration / production location: 20
[0140] Locations along the transport route: 10
[0141] Witness's place of residence: 5
[0142] Background information only: 0
[0143] Tags are determined using keywords and a distance window: Within a 40-character window, "emission / dumping / leakage / sampling / monitoring" appears → corresponding role. If multiple roles appear, the highest value is used. Contextual saliency score C (0–15) is calculated using TextRank to determine the node weight of the location mention in the full text, and then normalized and mapped as follows: C = min(15, 15 * (TextRank_score / max_score)). A score below 0.05 is considered "only mentioned incidentally," and C = 0.
[0144] (2) Comprehensive importance score S: S = 0.30·L + 0.25·P + 0.30·R + 0.15·C Coefficient explanation: Administrative level and case role have the greatest impact on subsequent sentencing / jurisdiction, each given 30%; spatial precision determines whether enforcement can be implemented, given 25%; contextual significance is only slightly adjusted, given 15%.
[0145] (3) Thresholds and screening process: 1. Single location selection criteria: S ≥ 50 → directly enters the "critical location" candidate pool; 35 ≤ S < 50 → enters the "minor location" pool, awaiting manual review; S < 35 → discard. 2. Deduplication and sorting of duplicate cases: If two mentions point to the same GIS entity (intersecting with district / county code + 1 km buffer), retain the one with the highest S; finally, output in descending order of S to generate the "critical location" list.
[0146] Event type extraction:
[0147] Establish a knowledge graph of environmental public interest litigation event types (including 50+ event tags such as "water pollution", "soil pollution", and "deforestation"), and automatically classify cases and events through a text classification model.
[0148]
[0149] E(t): The overall extraction score for event t
[0150] Among them, T norm (t) represents the normalized value of time information (calculated using the F(x) formula, e.g., "2023 flood season" → "June-September"); Role(t) represents the event role weight (main event = 1.0, sub-event = 0.7, related event = 0.3); Type(t) represents the event type weight (water pollution = 1.2, soil pollution = 1.0, deforestation = 0.9); ϕ 1−3 This is the event importance coefficient (dynamically adjusted based on the scope of the case's impact).
[0151] ,
[0152] Event Impact Index: EventImpact(t) = log(public opinion heat) + γ * scope of case impact. For example, if the public opinion heat of a "water pollution incident" is 1000 and the scope of impact is the provincial level, the score is log(1000) + 0.5 = 3.5 + 0.5 = 4.0; the Sigmoid mapping is σ(x) = 1 / (1 + e^(-1 / 2)). −x The impact index is compressed to the [0,1] interval; c is the temperature coefficient, for example, c=0.8, which controls the steepness of the mapping; the event impact index EventImpact=0.8 (assuming the public opinion heat is moderate), and the final score of the event is obtained by Sigmoid mapping.
[0153] The following example breaks down "knowledge graph" and "automatic classification" into three steps, using [Guidance Case No. 172] as a complete example.
[0154] Case Name (Case No.: Guiding Case 172): Criminal Incidental Civil Public Interest Litigation Case Regarding Illegal Logging by a Certain Person
[0155] [Basic Case Facts]
[0156] A county-level People's Procuratorate in Hunan Province filed a public prosecution against a defendant for the crime of illegal logging with the county's People's Court. During the proceedings, the county's People's Procuratorate also filed an incidental civil public interest lawsuit with the county's People's Court on the grounds that the public interest had been harmed.
[0157] The People's Procuratorate of a certain county believes that the defendant should be held criminally liable for the crime of illegal logging. Furthermore, the defendant's actions severely damaged the ecological environment, causing harm to the public interest. According to the relevant provisions of the Tort Liability Law, the defendant should replant and restore the forest, and issue a public apology. The defendant did not object to the prosecution's charges. However, the defendant argued that he was the actual operator and owner of the forest, and had actively paid the deposit for replanting and restoring the forest, requesting a lenient sentence.
[0158] The People's Court of a certain county in Hunan Province found that, with the Baiyunshan State-owned Forest Farm established in 1958 as its core, the Baiyunshan County-level Nature Reserve was established in 1998. This reserve was later designated the Baiyunshan Provincial Nature Reserve in 2005, and the delineation of its public welfare forest area was completed; it was further designated the Hunan Baiyunshan National Nature Reserve in 2013. During this period, the defendant contracted a forest in "Landiao" (a place name) within the core area of the Baiyunshan Nature Reserve in Wodang Village, Maogou Town, in 1998. Starting the following year, he began systematically planting Chinese fir trees. This forest land was within the public welfare forest area and was therefore considered public welfare forest land. From September 2016 to January 2017, without obtaining a "Timber Harvesting Permit," the defendant violated the Forest Law by illegally harvesting and selling the Chinese fir trees on his contracted forest land. The harvested area was 117.5 mu within the core area of the reserve and 15.46 mu outside the core area. An assessment determined that a person felled a total of 1,010 trees, with a timber volume of 153.3675 cubic meters. Subsequently, a forestry survey and planning design team from a certain county issued a design specification for replanting and restoration work, stating that the cost of artificial seedlings and other materials for replanting and restoring the damaged public welfare forest was RMB 66,025.
[0159] During the court proceedings, the county forestry survey and planning design team, the county forestry bureau, and the Baiyunshan National Nature Reserve offered specific suggestions and professional requirements for the replanting and restoration of the damaged public welfare forest. A certain individual prepaid a replanting and restoration deposit of 66,025 yuan to guarantee fulfilling their replanting and restoration obligations.
[0160] [Judgment Result]
[0161] On August 3, 2018, the People's Court of a county in Hunan Province issued a criminal and civil judgment (2018) Xiang, finding the defendant guilty of illegal logging and sentencing him to three years' imprisonment with a four-year suspended sentence, a fine of RMB 10,000, and ordering him to plant 5,050 one-year-old fir seedlings in "Tudi'ao" within the Hunan Baiyun Mountain National Nature Reserve within two years of the judgment taking effect, with a survival rate of over 90%. No appeal or protest was filed after the judgment was pronounced, and the first-instance judgment has become legally effective. In accordance with the judgment, the defendant planted 5,050 one-year-old fir seedlings in the original logged area, and the survival rate reached 100%.
[0162] [Typical Significance] or Reasoning for Judgment
[0163] The court's effective judgment held that: the defendant violated the provisions of the Forest Law by illegally logging a large quantity of public welfare forest within the core area of the Baiyun Mountain National Nature Reserve without permission from the forestry authorities, constituting the crime of illegal logging. The defense's argument that the defendant was a first-time offender, confessed, actively paid a deposit of 66,025 yuan for replanting and afforestation to the court's execution account, and showed remorse, thus warranting a lighter sentence, was accepted. The Baiyun Mountain National Nature Reserve is located in the Wuling Mountains and the You River Basin, one of China's seventeen key biodiversity areas. It is an important node in the natural flow channel of flora and fauna resources between the Yunnan-Guizhou Plateau, the Sichuan Basin, the Xuefeng Mountains, and the central Hunan hills, and a vital water conservation area for the Yuan River, a tributary of Dongting Lake in the Yangtze River Basin. Its forest resources play a crucial role in soil and water conservation and biodiversity maintenance. The trees contracted, planted, and managed by the defendant have become an integral part of the forest resources of the Baiyun Mountain National Nature Reserve. The defendant illegally felled a large number of trees without a permit, severely damaging the ecological environment of the Baiyun Mountain National Nature Reserve, endangering biodiversity conservation, and causing serious harm to the public interest. This constitutes a tort. The incidental civil public interest litigation is not a traditional civil lawsuit, and the plaintiff is not a victim in the general sense. The plaintiff's claim that the defendant should bear legal responsibility for restoring the original state is legally sound and is supported. Based on the replanting and restoration operation design specifications for the "Land Hollow" issued by the county forestry survey and planning design team, as well as the professional materials and suggestions provided by experts from the Baiyun Mountain Nature Reserve Administration and the county forestry bureau, and referring to Article 39, Paragraph 2 of the Forest Law, the plaintiff's claim that the defendant should replant trees is considered to have a scientific, reasonable, and legal basis and is supported. The defense's argument that the defendant's management rights as a forest land contractor should also be protected by law has merit and will be considered when determining the defendant's legal responsibility. Therefore, the above judgment was rendered.
[0164] Members of the collegial panel of the court of first instance: Long Ouling, Xu Yansong, Xiang Fusheng, Peng Fei, Peng Juzhong, Peng Dajiang.
[0165] (1) Graph side: Distill the facts of this case into a "triad".
[0166] 1. Event-type node (one of 54 tags)
[0167] ID=E17 name=Forest Deforestation-Public Welfare Forest-National Nature Reserve Core Area
[0168] Parent class: Deforestation
[0169] Pollution medium: ecological damage
[0170] Relevant legal provisions: Article 76 of the Forest Law + Article 1230 of the Civil Code (Ecological Damage)
[0171] Typical behaviors: unlicensed logging, and illegal logging in core public welfare forests.
[0172] Damaged object: Forest in the core area of a national nature reserve
[0173] Key points for evidence: 1. Certificate of protected area level; 2. Demarcation document for public welfare forest; 3. Record of stump inspection; 4. Volume assessment.
[0174] Repair methods: 1. Replanting at the original site; 2. Survival rate ≥ 90%; 3. Payment of a deposit.
[0175] 2. Case Nodes (Examples)
[0176] ID=Case172
[0177] Case No.: (2018) Xiang 3125 Criminal First Instance No. 5
[0178] Case Title: Criminal Case with Incidental Civil Public Interest Litigation Regarding Illegal Logging
[0179] Defendant: Someone
[0180] Geographic coordinates: 28.72°N, 109.68°E (Land Valley, Core Area)
[0181] Logging area: 117.5 mu (core area) + 15.46 mu (outer area)
[0182] Storage capacity: 153.3675 m³
[0183] Deposit: 66,025 yuan
[0184] The court ordered the replanting of 5050 one-year-old fir seedlings, with a 100% survival rate.
[0185] (2) Model side: Text → Event label (E17)
[0186] The training data was constructed using 42,000 publicly available documents from the China Judgments Online website (2020-2023). First, 1,800 candidate documents were identified using keywords such as "Forest Law / Protected Area / Public Welfare Forest / Core Area". Regular expressions were used to classify "whether it is located within the core area of a national nature reserve" as a hard rule, resulting in 421 positive examples ("E17"). Other instances of forest logging outside the core area were classified as "E05" (ordinary public welfare forest) or "E18" (commercial forest). A manual review of 200 documents yielded a precision rate of 93%, meeting the requirements for implementation.
[0187] Model selection and hyperparameter pre-training: BERT-base-Chinese; Learning rate: 2e-5; Max_len: 512; Batch: 16; Epiochs: 5; Loss: CE + Focal (γ=2); Imbalance resolution metrics: micro-F1=0.91, E17 class precision=0.94, recall=0.89
[0188] 3. Online Inference (This Case) Input: [Basic Case Facts] 1,189 characters in the full text Output probability: E17=0.92E05=0.05E18=0.02 others <0.01 Threshold: max-prob ≥ 0.35 and higher than the second highest category by 0.2 or more → Automatic label = E17, no manual review required.
[0189] (3) Results are implemented and the graph is written back: When the model gives E17 and the confidence level is passed, the system automatically generates in the graph: Case172—TYPE→E17 and triggers the subsequent subgraph: Damaged object → "core area forest" Restoration method → "replant 5050 trees, survival rate ≥90%" Compensation node → 66025 yuan deposit Using semantic role labeling technology, the core elements of the event (such as the polluting subject, pollution method, and affected object) are extracted. For example, from "a certain enterprise discharges industrial wastewater into the Yangtze River through a hidden pipe", "discharge subject = a certain enterprise", "pollution method = hidden pipe discharge" and "affected object = Yangtze River water body" are extracted.
[0190] Information verification and fusion module
[0191] Cross-text consistency verification: Through coreference resolution technology, the same entity (such as the same company or the same location) mentioned in different paragraphs is identified, ensuring the consistency of time, place and event information and avoiding contradictory statements.
[0192] ;
[0193] Among them, V total Entity comprehensive verification score; CoRef(e): coreference resolution score (based on spaCy's coref model, outputting a confidence score of 0-1); KG(e): knowledge graph matching degree (the node weight of the entity in the environmental knowledge graph); Consist(T, L, E): spatiotemporal event consistency function; λ 1−3 To verify the weighting coefficients (adaptively adjusted based on case complexity).
[0194]
[0195]
[0196] Attention(t) = softmax(BERT hidden layer output), capturing key information locations; CoRef(e) = total reference count and correct reference count (e.g., "same company" reference accuracy is 90%, score is 0.9); Knowledge graph matching degree KG(e) = cos(entity vector, knowledge graph node vector) (e.g., "Baiyun Mountain Nature Reserve" matching degree is 0.8); Fusion strategy For knowledge graph weight coefficients, balance coreference resolution and knowledge verification.
[0197] Coreference resolution aims to link all instances in a text that refer to the same object in the real world into a single chain—whether it's a pronoun ("the company"), an alias ("Baiyunshan Forest Farm" abbreviated as "Forest Farm"), or a completely different noun ("the defendant," "someone," "he"). In relevant litigation scenarios, if the "enterprise / location / event" is referred to by different names in the 30-page evidence catalog, expert report, indictment, and judgment, once the coreference chain is broken, fatal contradictions such as "timeline misalignment, location misattribution, and pollutant subject drift" will occur. The model used is the official HuggingFace model. Input is any number of text segments, output: coreference chain + start and end positions of each mention + representative string; Dependencies: transformers ≥ 4.30, torch, spaCy ≥ 3.6. The following example uses the original text of "Guidance Case No. 172" mentioned above. Example code is as follows:
[0198] # 2. coref_demo.py
[0199] import spacy, json, re
[0200] def load_doc(path):
[0201] Supports merging multiple text segments.
[0202] with open(path, encoding='utf-8') as f:
[0203] return re.sub(r'\s+', ' ', f.read())
[0204] def get_chains(doc):
[0205] Convert spaCy's CoreF results to clean JSON.
[0206] chains = []
[0207] for cid, cluster in enumerate(doc._.coref_clusters):
[0208] chain = {
[0209] "chain_id": f"C{cid}",
[0210] "canonical": cluster.main.text,
[0211] "mentions": []
[0212] }
[0213] for m in cluster.mentions:
[0214] chain["mentions"].append({
[0215] "text": m.text,
[0216] "start": m.start_char,
[0217] "end": m.end_char
[0218] })
[0219] chains.append(chain)
[0220] return chains
[0221] if __name__ == "__main__":
[0222] nlp = spacy.load("zh_coref_sm") # Chinese coreference model
[0223] text = load_doc("Case 172.txt") # The file to be coreference resolved
[0224] doc = nlp(text)
[0225] result = {
[0226] "text": text,
[0227] "coref_chains": get_chains(doc)
[0228] }
[0229] print(json.dumps(result, ensure_ascii=False, indent=2))
[0230] Example of running (JSON file):
[0231] {
[0232] "text": "The defendant violated the provisions of the Forest Law... The forest land is located in the core area of Hunan Baiyun Mountain National Nature Reserve... The defendant confessed to the above-mentioned acts..."
[0233] "coref_chains": [
[0234] {
[0235] "chain_id": "C0",
[0236] "canonical": "the defendant, so-and-so".
[0237] "mentions": [
[0238] {"text": "Defendant [name]", "start": 0, "end": 7},
[0239] {"text": "someone", "start": 186, "end": 189},
[0240] {"text": "he", "start": 210, "end": 211} ]
[0242] },
[0243] {
[0244] "chain_id": "C1",
[0245] "canonical": "Core area of Hunan Baiyun Mountain National Nature Reserve"
[0246] "mentions": [
[0247] {"text": "Core area of Baiyun Mountain National Nature Reserve", "start": 42, "end": 58},
[0248] {"text": "the woodland", "start": 88, "end": 92},
[0249] {"text": "core area", "start": 145, "end": 148} ]
[0251] } ]
[0253] }
[0254] Domain knowledge constraint verification: Introduce knowledge from environmental experts to perform logical verification on the extracted information. For example, verify whether "a chemical company builds a factory in the core area of a nature reserve" complies with the management regulations of the nature reserve and exclude obviously unreasonable information.
[0255] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for fast extraction of core information from text based on NLP, characterized in that, Comprise: S1, data preprocessing operation is carried out, the case file text is collected, cleaning, word segmentation and named entity recognition are carried out; S2, time information is extracted, the time expression recognition and normalization algorithm is used to extract the case occurrence time and duration; S3, the place information is extracted, the geographic knowledge base and the importance rule determination algorithm are combined to extract and sort the accurate place of the case; S4, the event type is extracted, the text classification and semantic role labeling technology are used to identify the event type and core element; S5, the consistency and rationality of the extracted information are verified through co-reference resolution and domain knowledge constraint.
2. The NLP-based text core information fast extraction method according to claim 1, characterized in that, Said S1 comprises: The word segmentation tool is used and the custom environment domain dictionary is loaded, the noise data in the text is removed through the regular expression, the professional word segmentation tool is used for word segmentation processing of the text, and the standardized word sequence F(W) is generated; The word noise filtering calculation formula is: ; wherein, , a is a smoothing parameter to address data sparsity, b is a weight coefficient to adjust the importance of different features, S is the set of normalized word sequences weighted by the dictionary, is the word frequency statistical weight, is the legal text domain dictionary weight, is the word length value, N is the word sequence in the sliding window. 3.The NLP-based text core information quick extraction method according to claim 1, characterized in that, Said S2 comprises: Input: character sequence;Output: candidate word sequence W; Need to make where freq(w i ) is the base frequency of the word in the general corpus; is the legal text domain dictionary weight, P(w i ) directly uses the dictionary frequency, is the noise filtering synergy weight, , is the word length gain coefficient, used to adjust word length values, is the noise filtering gain coefficient, used to adjust the data preprocessing phase. 4.The NLP-based text core information quick extraction method according to claim 1, characterized in that, Said S2 further comprises: DAG mapping is performed, , Noise filtered is the set of valid words after F(w) preprocessing; By dynamic programming, we solve the problem backwards, letting R(t) be the minimum score boundary condition from position t to the end of the sentence, R(N) = 0; ; wherein, is the noise filtering synergy coefficient, is the data preprocessing phase score of the word length substring by and professional term prioritization, noise synergy filtering: forms a closed loop with F(w). 5.The NLP-based text core information quick extraction method according to claim 1, characterized in that, Said S3 comprises: The accurate place of the case is extracted through the named entity recognition and place name disambiguation algorithm combined with the geographic information knowledge base; ; where S(w) is the integrated importance score of the location term w, L(w) is the administrative hierarchy score, P(w) is the spatial precision score; R(w) is the case role score, and C(w) is the contextual salience score, is a dynamic weight coefficient. 6.The NLP-based text core information quick extraction method according to claim 1, characterized in that, Said S4 comprises: The environmental public interest litigation event type knowledge graph is established, and the case event is automatically classified through the text classification model; ; E (t) is the comprehensive score of event t, where T norm (t) is the time information normalization value (calculated by the F(x) formula, such as "2023 flood season" → "06-09 months"); Role(t) is the event role weight (main event = 1.0, sub-event = 0.7, associated event = 0.3); Type(t) is the event type weight (water pollution = 1.2, soil pollution = 1.0, forest felling = 0.9); ϕ 1−3 is the event importance coefficient (adjusted dynamically by the case influence range); Influencing factors , EventImpact(t) = log(OpinionIntensity) + γ * CaseImpactRange; Sigmoid mapping σ(x) = 1 / (1+e −x ), compressing the impact index to the interval [0, 1]; c is the temperature coefficient, controlling the steepness of the mapping; EventImpact = 0.8, the final score of the event is obtained by Sigmoid mapping. 7.The NLP-based text core information quick extraction method according to claim 1, characterized in that, Said S5 comprises: Cross-text consistency verification is carried out, the same entity mentioned in different paragraphs is identified through the co-reference resolution technology, the consistency of time, place and event information is ensured, and contradictory expressions are avoided; ; wherein V total is the entity comprehensive verification score; CoRef(e) is the co-reference resolution score; KG(e) is the knowledge graph matching degree; Consist(T, L, E) is the spatio-temporal event consistency function; λ 1−3 is the verification weight coefficient; ; ; Attention(t) = softmax(BERT hidden layer output), capturing key information location; co-reference resolution score CoRef(e) = total number of references, number of correct references; knowledge graph matching degree KG(e) = cos(entity vector, knowledge graph node vector); fusion strategy is a knowledge graph weight coefficient.
8. A computer system, characterized by Comprise: A processor; A memory for storing processor executable instructions; Wherein, the processor is configured to execute the executable instructions to realize the method in any one of claims 1-8.
