Event extraction method and device for farmland illegal case text
By employing a model training method that combines entity argument annotation and domain logic rule optimization, the accuracy and adaptability issues of information extraction from texts related to illegal farmland use cases were addressed, achieving efficient extraction of structured information and identification of new illegal behaviors.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT GEOMATICS CENT OF CHINA
- Filing Date
- 2025-07-25
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies struggle to efficiently and accurately extract key structured information such as time, location, perpetrator, and illegal act from texts of illegal farmland use cases, leading to difficulties in subsequent analysis and decision support.
We employ a model training method based on entity argument annotation, bidirectional long short-term memory network, and conditional random field module. We combine domain logic rules and target loss function optimization, and utilize domain knowledge constraints and exception handling mechanisms to ensure the accuracy and adaptability of the extraction results.
It enables efficient and accurate extraction of structured information from texts of illegal farmland use cases, enhancing the model's generalization ability and adaptability, and enabling it to identify newly emerging illegal behaviors.
Smart Images

Figure CN120929587B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer science and artificial intelligence, specifically to an event extraction method and device for text of illegal farmland cases. Background Technology
[0002] In many professional fields, such as natural resource management, financial supervision, and judicial decisions, there is a large amount of case or event information recorded in unstructured text form. Taking farmland protection as an example, relevant departments will release texts of cases involving illegal occupation of farmland, i.e., farmland violation case texts. However, this textual data has low value density, inconsistent formats, and is difficult to use directly for subsequent analysis and utilization.
[0003] Therefore, how to efficiently and accurately extract key structured information such as time, location, violator, illegal behavior, and area involved to support subsequent intelligent analysis, trend prediction, and decision support has become an urgent technical problem to be solved. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an event extraction method and device for texts of illegal farmland cases, so as to overcome the current problem that event information cannot be extracted efficiently and accurately from texts of illegal farmland cases, and thus cannot be used efficiently.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] Firstly, this application provides an event extraction method for texts related to illegal farmland use cases, including:
[0007] Identify the entity arguments to be extracted from the texts of illegal farmland use cases;
[0008] The text samples of illegal farmland cases are labeled based on the entity arguments to generate a dataset for training the information target model. The target model is then trained using the dataset and a preset base model. The target model is used to label the content in the text of illegal farmland cases that corresponds to the entity arguments to generate a label sequence.
[0009] Establish domain logic rules specifically for illegal farmland use;
[0010] Construct a target loss function that includes domain knowledge constraints based on the aforementioned domain logic rules;
[0011] Optimize the target model based on the target loss function;
[0012] Calculate the rule satisfaction degree of the prediction result of the optimized target model with respect to the domain logic rule, and use the satisfaction degree as the confidence degree of the prediction result of the optimized target model;
[0013] When the confidence level is lower than a preset threshold, an exception handling mechanism is triggered to confirm the prediction results of the optimized target model.
[0014] Furthermore, in some embodiments of this application, the entity arguments include: location, time, event type, illegal act, type of cultivated land occupied, actual land use type, total land area occupied, and cultivated land occupied area;
[0015] The event types include non-agricultural and non-grain production;
[0016] The illegal acts include illegally occupying cultivated land, changing or damaging the use of cultivated land, illegally occupying land for construction, and digging lakes for landscaping.
[0017] Furthermore, in some embodiments of this application, the annotation of text samples of illegal farmland cases based on the entity arguments includes:
[0018] Based on the BMES text annotation method, generate tags corresponding to the entity arguments;
[0019] The YEDDA annotation tool was used to annotate the text samples of illegal farmland cases with the aforementioned tags.
[0020] Furthermore, in some embodiments of this application, the basic model includes a bidirectional long short-term memory network module and a conditional random field module;
[0021] The bidirectional long short-term memory network module is used to determine the predicted score of each position corresponding to a different label in the input content determined by the text of the illegal farmland case based on contextual semantic features.
[0022] The Conditional Random Field module is used to determine the optimal label sequence based on the predicted scores of different labels corresponding to each position in the input content and the preset label transfer rules, using the Viterbi algorithm.
[0023] Furthermore, in some embodiments of this application, the domain logic rules are composed of corresponding indicator functions, and the indicator functions include constraint judgment conditions; the indicator functions are used to confirm the output of 1 when the prediction result of the target model meets the corresponding constraint judgment conditions, so as to indicate that the result is correct, and to confirm the output of 0 when the extraction result of the target model does not meet the corresponding constraint judgment conditions, so as to indicate that the result is illegal;
[0024] The constraint judgment conditions include: logical constraints on event type and illegal behavior, area numerical constraints, time format constraints, and time location mapping constraints; the logical constraints on event type and illegal behavior are used to specify the illegal behaviors corresponding to the non-agricultural and non-grain event types; the area numerical constraints are used to specify that the total land area occupied must be greater than or equal to the cultivated land area occupied; the time format constraints are used to specify the format of the time; and the time location mapping constraints are used to specify that the number of times the time occurs must be less than or equal to the number of times the location occurs.
[0025] Furthermore, in some embodiments of this application, the construction of the target loss function including domain knowledge constraints based on the domain logic rules includes:
[0026] The weights corresponding to the logical rules of each domain are determined, and the weighted sum of the judgment results of the logical rules of each domain is used as the rule satisfaction degree; wherein, the judgment result of the logical rule of each domain is the judgment result of the corresponding indicator function;
[0027] The difference between the standard CRF loss and the logical regularization term is used as the target loss function; wherein the logical regularization term is the product of the rule satisfaction degree and the preset balance factor.
[0028] Furthermore, in some embodiments of this application, it also includes:
[0029] Replace the prediction results of the target model with probability distribution data;
[0030] By sampling the probability distribution data through Gumbel-Softmax to approximate a discrete distribution, continuous approximate values of discrete labels in the prediction results of the target model are obtained, so that the logical regularization term is differentiable.
[0031] Furthermore, in some embodiments of this application, the calculation of the rule satisfaction degree of the optimized target model's prediction result with respect to the domain logic rules, and the use of the mean of the rule satisfaction degree as the confidence level of the optimized target model's prediction result, includes:
[0032] For a tag sequence segment corresponding to a target event, the quotient of the rule satisfaction degree of the domain logic rule corresponding to the tag sequence segment and the number of domain logic rules is used as the confidence degree of the tag sequence segment and the target event.
[0033] Furthermore, in some embodiments of this application, the exception handling mechanism includes:
[0034] Receive manual instructions, determine whether the tag sequence segment corresponding to the target event should be retained, and update the domain logic rules based on the retained tag sequence segment or the target event.
[0035] Secondly, this application provides an event extraction device for text of illegal farmland cases, including a processor and a memory, wherein the processor is connected to the memory:
[0036] The processor is used to call and execute the program stored in the memory;
[0037] The memory is used to store the program, which is at least used to execute the above-described event extraction method for text of illegal farmland cases.
[0038] This invention relates to the fields of computer science and artificial intelligence, specifically to a method and apparatus for event extraction from texts related to illegal farmland use cases. The method includes: determining entity arguments to be extracted from the texts of illegal farmland use cases; labeling text samples of illegal farmland use cases based on the entity arguments to generate a dataset for training a target information model, and generating a target model using the dataset and a preset base model; the target model is used to label the content corresponding to the entity arguments in the texts of illegal farmland use cases to generate a label sequence, which is used to obtain event information; determining domain logic rules for the illegal farmland use domain; constructing a target loss function including domain knowledge constraints based on the domain logic rules; optimizing the target model based on the target loss function; calculating the rule satisfaction degree of the prediction results of the optimized target model with respect to the domain logic rules, and using the mean of the rule satisfaction degree as the confidence level of the prediction results of the optimized target model; and triggering an exception handling mechanism to confirm the prediction results of the optimized target model when the confidence level is lower than a preset threshold. Thus, by integrating domain knowledge into model training, efficient and accurate information extraction is achieved using the model, while the exception handling mechanism enhances the model's generalization and adaptability. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating the event extraction method for text of illegal farmland cases provided in an embodiment of the present invention.
[0041] Figure 2 This is a flowchart illustrating the event extraction device for text of illegal farmland cases provided in an embodiment of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0043] Figure 1 This is a flowchart illustrating the event extraction method for text analysis of illegal farmland cases provided in this embodiment of the invention. Please refer to [link / reference]. Figure 1 This embodiment may include the following steps:
[0044] S101. Determine the entity arguments to be extracted from the text of illegal farmland cases.
[0045] Specifically, in this application, the entity arguments identified in the text of the illegal farmland case include: location, time, event type, illegal act, type of farmland occupied, actual land use type, total land area occupied, and farmland area occupied.
[0046] Among these, time and location are essential elements for the occurrence of an event. In practical applications, the location of the event can be represented by "Location" and the time by "Time" (i.e., for efficient annotation, "Location" and "Time" are used as specific labels. It is understood that when facing different annotation needs and methods, the entity arguments mentioned above, as a broad category of entity arguments, can be expanded with specific labels according to the actual situation, the same applies below), thereby obtaining the time and location information of the event. The event type, represented by "Type," is used to reveal what changes have occurred in the use of cultivated land in cases of illegal cultivation land use. Specifically, it includes non-agriculturalization and non-grain conversion, i.e., whether cultivated land has become non-agricultural or non-grain land. The illegal act represents the occurrence of illegal acts on the cultivated land area. The types of illegal land use are represented by "Offence," which specifically include illegal occupation of arable land, alteration or destruction of arable land use, illegal construction on occupied land, and excavation for landscaping. The type of arable land used is represented by "SpecifiedUse," and the type of actual land use is represented by "ActualUse." These two represent the land use situation before and after the illegal occupation of arable land, respectively. They can reflect whether the illegally occupied arable land continues to be used for agricultural purposes and whether it has completely deviated from its agricultural purpose. They can be used to assess the loss of land resources and provide guidance for land reclamation and restoration of arable land. The total area and cultivated area represent the total area of the corresponding project or event and the area of arable land occupied, respectively. They can be used to determine the proportion and specific value of illegal occupation of arable land.
[0047] S102. Annotate text samples of illegal farmland cases based on entity arguments to train the target model.
[0048] Specifically, the above-mentioned major categories of entity arguments are first mapped to the fine-grained categories of farmland violation case texts, and corresponding examples are found to jointly construct a framework for identifying major and fine-grained categories of farmland violation incident entity arguments, as shown in Table 1 below:
[0049] Table 1. Framework for Identifying Entity Arguments and Fine-Grained Categories in Farmland Violation Incidents
[0050] Location Province, city, district, county, township Hebei Province Time Year, Month, Day 2024 Type Non-agricultural and non-grain types Non-agriculturalization and non-grain production Offence Types of illegal acts Damaging farmland and illegally occupying farmland SpecifiedUse Types of arable land occupied land for facility agriculture Actual Use Actual land use type Scenic Road TotalArea Total land area Area: 137.91 mu Cultivated Area Size of arable land occupied Occupying 51.6 mu of cultivated land
[0051] Based on this, text samples of illegal farmland use cases are identified (in practical applications, texts of illegal farmland use cases released by relevant departments such as the Ministry of Natural Resources can also be preprocessed to obtain the core information of illegal farmland use events, and subsequent processing can be directly based on the preprocessed data). According to the "Begin-Middle-End-Single" (BMES) annotation method, specific labels corresponding to entity arguments are generated. The YEDDA annotation tool is then used to annotate the text samples of illegal farmland use cases with these labels to obtain a dataset for training the target information model. The target model is then generated using the dataset and a pre-set base model. The target model is used to label the content corresponding to entity arguments in the text of illegal farmland use cases to generate a label sequence. This label sequence includes each label and the corresponding content in the text of the illegal farmland use case, such as the label "Time" and its corresponding specific time information. It can be understood that the label sequence is structured data, containing information corresponding to at least one illegal farmland use event.
[0052] It's important to note that the BMES annotation method explicitly distinguishes between start, middle, and end words in an entity. B (Begin) represents the first word of the entity, M (Middle) represents the middle part of the entity, E (End) represents the last word of the entity, S (Single) represents an entity consisting of only one word, and O (Other) represents non-entity parts. In actual annotation, tags such as B-Location and E-Location are generated for Location.
[0053] Furthermore, in this application, the pre-defined basic model is a Bidirectional Long Short-Term Memory-Conditional Random Field (BiLSTM-CRF) model. Specifically, it includes a Bidirectional Long Short-Term Memory network module and a Conditional Random Field module. The Bidirectional Long Short-Term Memory network module is used to determine the predicted score for each position in the input content, determined from the text of the farmland violation case, based on contextual semantic features. Building upon this, the Conditional Random Field module is used to determine the optimal label sequence based on the predicted scores for each position in the input content and a pre-defined label transition rule, using the Viterbi algorithm.
[0054] In practical applications, the above-mentioned basic model is trained using the dataset composed of the labeled sequence (the label sequence specifically includes the labeled labels and the specific content of the labeled text in the case of illegal farmland use). This allows the trained target model to label and extract its input data (the sequence obtained after preprocessing the text of the case of illegal farmland use).
[0055] S103. Determine the domain logic rules for illegal activities related to cultivated land.
[0056] S104. Construct a target loss function that includes domain knowledge constraints based on domain logic rules.
[0057] S105. Optimize the target model based on the target loss function.
[0058] In practical applications, there are strong logical constraints between the information on illegal farmland incidents extracted based on the above methods and the entity arguments of illegal farmland incidents (such as the "non-agriculturalization" type must include "illegal land occupation for construction and lake excavation for landscaping" and other argument arguments), which affects the accuracy of extraction. At the same time, the number of farmland illegal incident text samples used to train the model is generally small and the data is relatively sparse, which cannot generalize to a large number of illegal farmland incidents and is prone to overfitting.
[0059] Therefore, this application constructs a domain logic rule base by determining domain logic rules for the field of illegal farmland use, and then uses the domain logic rules in the domain logic rule base to construct a target loss function including domain knowledge constraints. The target model is then optimized using this target loss function, thereby avoiding the problems caused by strong logical constraints and small sample size mentioned above.
[0060] S106. Calculate the rule satisfaction degree of the prediction results of the optimized target model with respect to the domain logic rules, and use the mean of the rule satisfaction degree as the confidence degree of the prediction results of the optimized target model.
[0061] S107. When the confidence level is lower than the preset threshold, trigger the exception handling mechanism to confirm the prediction results of the optimized target model.
[0062] Furthermore, since new illegal activities in the field of farmland violations emerge over time, it is difficult to extract information on newly occurring or sudden farmland violation events by processing them based on past farmland knowledge. Therefore, in this application, the confidence level of the model's prediction results is calculated using the rule satisfaction degree of domain logic rules. New illegal activities lower the confidence level of the model's prediction results, thereby triggering an exception handling mechanism, such as manual review to confirm prediction results with low confidence levels, to avoid missing information on farmland violation events containing new illegal activities.
[0063] The event extraction method for illegal farmland cases provided by this invention integrates domain knowledge into model training, thereby enabling efficient and accurate information extraction. At the same time, the exception handling mechanism enhances the generalization and adaptability of the model.
[0064] Furthermore, in some embodiments of this application, the domain logic rules are composed of indicator functions, which contain constraint judgment conditions. The indicator functions are used to confirm an output of 1 when the prediction result of the target model meets the corresponding constraint judgment conditions, indicating that the prediction result is correct, and to confirm an output of 0 when the extraction result of the target model does not meet the corresponding constraint judgment conditions, indicating that the prediction result is illegal. The constraint judgment conditions include: logical constraints on event type and illegal behavior, area value constraints, time format constraints, and time-location mapping constraints.
[0065] Specifically, the logical constraints on event types and illegal behaviors are used to specify the illegal behaviors corresponding to non-agricultural and non-grain-producing event types. For example, if the event type in the prediction results or partial prediction results of the judgment model is non-agricultural, then it is determined whether the corresponding illegal behavior type is illegal land occupation for construction or lake excavation for landscaping. If so, the rule is satisfied, and the indicator function outputs 1; otherwise, it is not satisfied, and the exponential function outputs 0 (the following rules are similar). The area numerical constraint is used to specify that the total land area must be greater than or equal to the cultivated land area. The time format constraint is used to specify the time format. The time location mapping constraint is used to specify that the number of times the time occurs must be less than or equal to the number of times the location occurs.
[0066] Based on this, the objective loss function constructed based on domain logic rules, including domain knowledge constraints, includes: determining the weights corresponding to each domain logic rule, and using the weighted sum of the judgment results of each domain logic rule as the rule satisfaction; wherein, the judgment result of the domain logic rule is the judgment result of the corresponding indicator function; and using the difference between the standard CRF loss and the logical regularization term as the objective loss function; wherein, the logical regularization term is the product of the rule satisfaction and the preset balance factor.
[0067] Specifically, the rule satisfaction degree is the weighted sum of the judgment results of the logical rules in each domain, i.e., the judgment results of the corresponding indicator functions, and is expressed as follows:
[0068]
[0069] Where R(y) represents the rule satisfaction degree of the label sequence (or a partial label sequence segment corresponding to a certain event) y; k is the label of the domain logic rule; K is the total number of domain logic rules; λ k The weights of the logical rules for each domain; φ k (y) is the result of the indicator function of the domain logic rule with label k judging the label sequence (or a partial label sequence segment corresponding to a certain event) y (the value is 1 or 0).
[0070] Based on this, a logical regularization term is added to the loss function of the standard CRF. Specifically, the difference between the standard CRF loss and the logical regularization term is used as the target loss function. The logical regularization term is the product of the above R(y) and the balance factor (e.g., 0.5 by default).
[0071] In practical applications, when backpropagating to optimize a model using the target loss function, the indicator function is often non-differentiable, which affects the final model performance. Therefore, this application utilizes Gumbel-Softmax to address the non-differentiability of the indicator function, mapping its output to the 0-1 interval to achieve differentiable optimization and thus enabling backpropagation. The specific process is as follows:
[0072] Specifically, firstly, the label sequence is replaced with probability distribution data (which can be directly replaced using the output of BiLSTM); then, Gumbel-Softmax is used to approximate discrete distribution sampling of the probability distribution data, achieving a relaxation operation on the data. Based on this, the rule satisfaction of the relaxed data is calculated. At this point, through the above processing, the above logical regularization term becomes differentiable, and the corresponding objective loss function also becomes a differentiable loss function.
[0073] Furthermore, in some embodiments of this application, the rule satisfaction degree of the prediction result of the optimized target model with respect to the domain logic rules is calculated, and the mean of the rule satisfaction degree is used as the confidence degree of the prediction result of the optimized target model. Specifically, this includes: for the label sequence segment corresponding to the target event (it can be understood that the prediction result of the target model is a label sequence, which may correspond to multiple farmland violation events), the ratio of the rule satisfaction degree of the domain logic rules corresponding to the label sequence segment to the number of domain logic rules is used as the confidence degree of the label sequence segment and the corresponding target event.
[0074] As mentioned above, new illegal activities in the field of farmland violations emerge over time. If these new violations are handled using existing farmland knowledge, it becomes difficult to extract the text of newly occurring or sudden farmland violation events. Therefore, this application introduces an exception handling mechanism to address newly emerging farmland domain knowledge. The core idea of this exception handling mechanism is to further transform the rule-based judgment (0 for fulfilling a rule and 1 for not fulfilling it) into a probabilistic expression, thereby calculating the domain logic confidence of different farmland violation event information. This quantifies the confidence level of the event's conformity to prior domain knowledge. A threshold is set to distinguish between high and low confidence events, with low-confidence events triggering a manual review process.
[0075] Understandably, after the above processing, events conforming to the domain logic rules will be considered high-confidence events, while newly emerging illegal behaviors will lower the overall confidence of the event. Based on this, events with lower confidence are added to a manual processing mechanism. When the confidence is low, the operator manually determines whether the event is a newly emerging illegal farmland event. Using a pre-designed judgment module, the operator inputs "y" on the terminal to indicate that it is judged as an illegal farmland event and continues processing, encoding the corresponding new text rule into the model for rule expansion to assist subsequent judgments; otherwise, the operator inputs "n" to ignore the identified event.
[0076] Specifically, the formula for calculating the confidence level of a model's prediction for a given event is as follows:
[0077]
[0078] Where e represents an event, and its corresponding part of the label sequence predicted by the model is the segment y of the label sequence predicted by the model. e ;Conf(e) represents the confidence level of event e; φ k (y e ) indicates that the k-th rule applies to the label sequence segment y. e The judgment result is given by the formula section above, and the other parameters have been introduced. They will not be repeated here.
[0079] In practical applications, after obtaining the data corresponding to an event e, its confidence level is first calculated. Then, the confidence level is compared with a preset threshold (e.g., the preset threshold is 0.9). If the confidence level is greater than the threshold, the event is judged as a high-confidence event and the model's result is accepted. Otherwise, it is considered a low-confidence event and triggers manual review. At this time, the manual input of the confirmation command "y" is used to encode a new rule to supplement the existing rule; or "n" is input to reject the event.
[0080] The event extraction method for farmland violation cases provided in this application firstly improves the model's prediction results by incorporating domain knowledge and adding a loss control mechanism, making the model's predictions more consistent with domain logic. Simultaneously, domain logic rules compensate for the sparse sample problem caused by a small number of samples, and the introduction of domain logic rules reduces the need for training data, enabling good recognition results even with small amounts of text. Furthermore, for newly emerging farmland violation events, confidence calculation and exception handling, combined with manual judgment, allow new farmland violation knowledge to be incorporated into the model to meet various practical scenarios.
[0081] Based on the same inventive concept, this invention also provides an event extraction device for text analysis of illegal farmland cases, used to implement the above-described method embodiments. Figure 2 This is a flowchart illustrating an event extraction device for text analysis of illegal farmland cases provided in an embodiment of the present invention. Figure 2 As shown, the event extraction device for farmland violation case texts in this embodiment includes a processor 1 and a memory 22, with the processor 21 connected to the memory 22. The processor 21 is used to call and execute a program stored in the memory 22; the memory 22 is used to store the program, which is at least used to execute the event extraction method for farmland violation case texts in the above embodiments.
[0082] The specific implementation scheme of the event extraction device for illegal farmland case text provided in this application embodiment can refer to the implementation scheme of the event extraction method for illegal farmland case text in any of the above embodiments, and will not be repeated here.
[0083] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0084] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0085] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0086] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0087] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0088] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0089] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0090] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0091] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for event extraction of a text of a case of illegal cultivation of farmland, characterized by, include: Identify the entity arguments to be extracted from the texts of illegal farmland use cases; The text samples of illegal farmland cases are labeled based on the entity arguments to generate a dataset for training the information target model, and the target model is trained using the dataset and a preset base model. The target model is used to label the content corresponding to the entity arguments in the text of illegal farmland cases to generate a tag sequence; Establish domain logic rules specifically for illegal farmland use; Construct a target loss function that includes domain knowledge constraints based on the aforementioned domain logic rules; Optimize the target model based on the target loss function; Calculate the rule satisfaction degree of the prediction result of the optimized target model with respect to the domain logic rule, and use the mean of the rule satisfaction degree as the confidence degree of the prediction result of the optimized target model; When the confidence level is lower than a preset threshold, an exception handling mechanism is triggered to confirm the prediction result of the optimized target model; The construction of the target loss function based on the domain logic rules, including domain knowledge constraints, includes: determining the weights corresponding to each domain logic rule, and using the weighted sum of the judgment results of each domain logic rule as the rule satisfaction; wherein, the judgment result of the domain logic rule is the judgment result of the corresponding indicator function; and using the difference between the standard CRF loss and the logical regularization term as the target loss function; wherein, the logical regularization term is the product of the rule satisfaction and the preset balance factor. It also includes: replacing the prediction results of the target model with probability distribution data; and performing approximate discrete distribution sampling on the probability distribution data using Gumbel-Softmax to obtain continuous approximate values of discrete labels in the prediction results of the target model, so that the logical regularization term is differentiable. The calculation of the prediction result of the optimized target model with respect to the rule satisfaction of the domain logic rules, and the mean of the rule satisfaction as the confidence level of the prediction result of the optimized target model, includes: for the label sequence segment corresponding to the target event, the quotient of the rule satisfaction of the domain logic rules corresponding to the label sequence segment and the number of domain logic rules is used as the confidence level of the label sequence segment and the target event; The exception handling mechanism includes: receiving manual instructions, determining whether the tag sequence segment corresponding to the target event should be retained, and updating the domain logic rules based on the retained tag sequence segment or the target event; The domain logic rules are composed of corresponding indicator functions, and the indicator functions contain constraint judgment conditions. The indicator functions are used to confirm the output of 1 when the prediction result of the target model meets the corresponding constraint judgment conditions, so as to indicate that the result is correct, and to confirm the output of 0 when the extraction result of the target model does not meet the corresponding constraint judgment conditions, so as to indicate that the result is illegal. The constraint judgment conditions include: logical constraints on event type and illegal behavior, area numerical constraints, time format constraints, and time-location mapping constraints; the logical constraints on event type and illegal behavior are used to specify the illegal behavior corresponding to non-agricultural and non-grain event types; the area numerical constraints are used to specify that the total occupied area must be greater than or equal to the cultivated land occupied area; the time format constraints are used to specify the time format; and the time-location mapping constraints are used to specify that the number of times the time occurs must be less than or equal to the number of times the location occurs.
2. The method of claim 1, wherein the method comprises: The entity arguments include: location, time, event type, illegal act, type of cultivated land occupied, actual land use type, total land area occupied, and cultivated land occupied area; The event types include non-agricultural and non-grain production; The illegal acts include illegally occupying cultivated land, changing or damaging the use of cultivated land, illegally occupying land for construction, and digging lakes for landscaping.
3. The method of claim 2, wherein the method comprises: The annotation of text samples of illegal farmland cases based on the entity arguments includes: Based on the BMES text annotation method, generate tags corresponding to the entity arguments; The YEDDA annotation tool was used to annotate the text samples of illegal farmland cases with the aforementioned tags.
4. The method according to claim 3, wherein, The basic model includes a bidirectional long short-term memory network module and a conditional random field module; The bidirectional long short-term memory network module is used to determine the predicted score of each position corresponding to a different label in the input content determined by the text of the illegal farmland case based on contextual semantic features. The Conditional Random Field module is used to determine the optimal label sequence based on the predicted scores of different labels corresponding to each position in the input content and the preset label transfer rules, using the Viterbi algorithm.
5. An event extraction device for a text of a case of violation of a law of cultivation, characterized by, It includes a processor and a memory, wherein the processor is connected to the memory: The processor is used to call and execute the program stored in the memory; The memory is used to store the program, which is at least used to execute the event extraction method for text of illegal farmland cases as described in any one of claims 1-4.