Information extraction method and device, equipment, storage medium and computer program product
By determining the information extraction rules and using the information extraction model to extract key information, combined with the operation of the structured model, the problems of low efficiency and poor adaptability of traditional methods are solved, and more efficient and accurate information extraction is achieved.
Patent Information
- Application Number
- CN202411645413.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-07
AI Technical Summary
Traditional information extraction methods rely on fixed rules and are difficult to adapt to the dynamic data of the Internet, resulting in low efficiency. The large model is regarded as a black box, and users cannot intervene in the adjustment, affecting accuracy and adaptability.
By determining the information extraction rules, key information is extracted based on these rules through the information extraction model, and key information is structured through the structured model to obtain the target extraction information.
It improves the accuracy and efficiency of information extraction, enhances the adaptability and interpretability of the model, and reduces users' dependence on the black box model.
Smart Images

Figure CN119578423A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information mining technology, and in particular to information extraction methods, devices, equipment, storage media and computer program products. Background Art
[0002] The field of information extraction is advancing rapidly, but traditional methods rely on fixed rules and are difficult to adapt to the dynamic data of the Internet. Complex data, diverse needs, and timely accuracy requirements pose challenges to existing technologies. In the current field of information extraction, large models are often regarded as black boxes that are difficult to see through, and users cannot intervene to adjust or set the extraction logic internally, which may affect the accuracy and adaptability of extraction when dealing with professional fields, unique formats, or complex data structures. Although pre-training large models improves processing efficiency, there is still potential to be explored in the customization of information extraction. At present, the lack of intuitive user customization tools limits the widespread use and efficiency of models. Therefore, it is urgent to propose a method that can improve the accuracy and efficiency of information extraction.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present application is to provide an information extraction method, apparatus, device, storage medium and computer program product, aiming to solve the technical problem of low efficiency in extracting information from text.
[0005] To achieve the above objectives, the present application proposes an information extraction method, which comprises:
[0006] Determine the information extraction rules for the data to be extracted;
[0007] Based on the information extraction rules, extracting key information of the data to be extracted through an information extraction model;
[0008] The key information is subjected to a structural operation through a structured model to obtain target extraction information of the data to be extracted.
[0009] In one embodiment, the step of determining the information extraction rules of the data to be extracted includes:
[0010] Determine the extraction method for information extraction of the data to be extracted;
[0011] When the extraction method is keyword extraction, extracting keywords of the data to be extracted, and generating information extraction rules for the data to be extracted based on the keywords;
[0012] When the extraction method is pattern extraction, an extraction structure is determined according to the data to be extracted, and information extraction rules for the data to be extracted are generated based on the extraction structure.
[0013] In one embodiment, before the step of extracting the key information of the data to be extracted through the information extraction model based on the information extraction rule, the step further includes:
[0014] Initialize the information extraction model;
[0015] Performing rule parsing on the information extraction rule through the information extraction model to extract rule features of the information extraction rule;
[0016] Dynamic adaptive learning is performed based on the rule features to update parameters of the information extraction model.
[0017] In one embodiment, the step of extracting key information of the data to be extracted through an information extraction model based on the information extraction rule includes:
[0018] Performing word segmentation on the data to be extracted, and performing part-of-speech tagging on the data to be extracted after word segmentation to obtain a word segmentation tag sequence;
[0019] Performing entity recognition extraction on the word segmentation annotation sequence to obtain an entity sequence of the data to be extracted;
[0020] Relation extraction is performed on the word segmentation tag sequence based on the entity sequence to obtain a relationship sequence of the data to be extracted.
[0021] In one embodiment, the step of performing a structural operation on the key information through a structured model to obtain target extraction information of the data to be extracted includes:
[0022] Determining a target format of target extraction information when outputting according to the data to be extracted;
[0023] Performing a structural operation on the key information through a structured model, outputting the key information in the target format, and obtaining initial extracted information;
[0024] The initial extraction information is verified and corrected to obtain target extraction information of the data to be extracted.
[0025] In one embodiment, after the step of determining the information extraction rule of the data to be extracted, the step further includes:
[0026] Based on the information extraction rule, a task instruction corresponding to the information extraction rule is determined, and the task instruction is input into the information extraction model.
[0027] In addition, to achieve the above purpose, the present application also proposes an information extraction device, the information extraction device comprising:
[0028] A rule determination module, used to determine information extraction rules for data to be extracted;
[0029] An information extraction module, used to extract key information of the data to be extracted through an information extraction model based on the information extraction rules;
[0030] The format output module is used to perform structured operations on the key information through a structured model to obtain target extraction information of the data to be extracted.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes an information extraction device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the information extraction method described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the information extraction method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the information extraction method described above are implemented.
[0034] One or more technical solutions proposed in this application have at least the following technical effects:
[0035] The embodiments of the present application propose an information extraction method, apparatus, device, storage medium and computer program product, which determine information extraction rules for data to be extracted; based on the information extraction rules, extract key information of the data to be extracted through an information extraction model; perform structured operations on the key information through a structured model to obtain target extracted information of the data to be extracted. The present application can improve the accuracy of information extraction by determining information extraction rules; and can improve the efficiency of information extraction by extracting key information through an information extraction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 A flowchart of the first embodiment of the information extraction method of this application is provided;
[0039] Figure 2 This is a schematic diagram of the module structure of the information extraction device according to an embodiment of the present application;
[0040] Figure 3 Schematic diagram of the device structure of the hardware operating environment involved in the information extraction method in the embodiment of the present application.
[0041] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0043] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0044] The main solution of the embodiment of the present application is: determine the information extraction rules of the data to be extracted; based on the information extraction rules, extract the key information of the data to be extracted through the information extraction model; perform structured operations on the key information through the structured model to obtain the target extraction information of the data to be extracted.
[0045] In this embodiment, for the convenience of description, the following description is made by taking the identification information extraction device as the execution subject.
[0046] The field of information extraction is advancing rapidly, but traditional methods rely on fixed rules and are difficult to adapt to the dynamic data of the Internet. Complex data, diverse needs, and timely accuracy requirements pose challenges to existing technologies. In the current field of information extraction, large models are often regarded as black boxes that are difficult to see through, and users cannot intervene to adjust or set the extraction logic internally, which may affect the accuracy and adaptability of extraction when dealing with professional fields, unique formats, or complex data structures. Although pre-training large models improves processing efficiency, there is still potential to be explored in the customization of information extraction. At present, the lack of intuitive user customization tools limits the widespread use and efficiency of models. Therefore, it is urgent to propose a method that can improve the accuracy and efficiency of information extraction.
[0047] The present application provides a solution, which can improve the accuracy of information extraction by determining information extraction rules; and can improve the efficiency of information extraction by extracting key information through an information extraction model.
[0048] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an information extraction device, etc. The following takes the information extraction device as an example to illustrate this embodiment and the following embodiments.
[0049] Based on this, the present application embodiment provides an information extraction method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the information extraction method of this application.
[0050] In this embodiment, the information extraction method includes steps S10 to S30:
[0051] Step S10, determining information extraction rules for the data to be extracted.
[0052] It should be noted that the data to be extracted refers to the original text data that needs to be subjected to information extraction operations. These data may come from various channels, such as text files, database records, web page content, etc.
[0053] In addition, it should be noted that information extraction rules refer to the rules and strategies used to guide the information extraction model on how to extract key information from the data to be extracted. They are guiding principles or methods set by users to locate and extract specific information from a large amount of data. The generation of information extraction rules can be keyword-based or pattern-based.
[0054] Specifically, an extraction method for information extraction of the data to be extracted is determined; when the extraction method is keyword extraction, keywords of the data to be extracted are extracted, and information extraction rules for the data to be extracted are generated based on the keywords; when the extraction method is pattern extraction, an extraction structure is determined according to the data to be extracted, and information extraction rules for the data to be extracted are generated based on the extraction structure.
[0055] Step S20: extracting key information of the data to be extracted through an information extraction model based on the information extraction rule.
[0056] It should be noted that the information extraction model refers to a machine learning model that can automatically extract key information from text or data. These models are usually based on deep learning techniques, such as neural networks, to identify and extract useful information from texts through training and learning. Based on the determined information extraction rules, the information extraction model can identify and extract key information from the data to be extracted. This information can be named entities (such as names of people, places, names of institutions, etc.), relationships (such as relationships between entities), events (such as specific events and their related elements), etc. The information extraction model can be implemented in a variety of ways, including rule-based methods, machine learning-based methods (such as support vector machines, naive Bayes, etc.) and deep learning-based methods (such as convolutional neural networks, recurrent neural networks, Transformer, etc.).
[0057] In addition, it should be noted that the key information of the data to be extracted refers to the information that meets the requirements of the rules that the information extraction model will filter out from the data to be extracted according to the preset information extraction rules during the information extraction process. The specific content of the key information may vary depending on the business scenario, data characteristics and analysis objectives.
[0058] Specifically, the data to be extracted are segmented, and the part-of-speech tagging is performed on the segmented data to obtain a segmentation tagging sequence; entity recognition extraction is performed on the segmentation tagging sequence to obtain an entity sequence of the data to be extracted; and relationship extraction is performed on the segmentation tagging sequence based on the entity sequence to obtain a relationship sequence of the data to be extracted.
[0059] Step S30, performing a structural operation on the key information through a structured model to obtain target extraction information of the data to be extracted.
[0060] It should be noted that a structured model is a model that can convert unstructured or semi-structured data into structured data. Structured data usually has a fixed format and structure, such as database tables, XML files, etc., which is convenient for subsequent analysis and processing. The structured model performs structured operations on the key information extracted by the information extraction model and converts it into target extracted information. This process includes but is not limited to steps such as data cleaning, conversion, and formatting to ensure that the output data conforms to the expected structure and format. The structured model can be implemented through a variety of technologies, including data mapping, pattern matching, data cleaning, etc., combined with the information extraction model to form a complete information extraction and structuring process.
[0061] Specifically, according to the data to be extracted, the target format of the target extraction information during output is determined; the key information is structured by a structured model, and the key information is output in the target format to obtain initial extraction information; the initial extraction information is verified and corrected to obtain the target extraction information of the data to be extracted.
[0062] This embodiment uses the above scheme to determine the information extraction rules of the data to be extracted; based on the information extraction rules, extract the key information of the data to be extracted through the information extraction model; perform structured operations on the key information through the structured model to obtain the target extracted information of the data to be extracted. Extracting key information through the information extraction model can improve the efficiency and accuracy of information extraction; performing structured operations on the key information through the structured model can ensure the accuracy and stability of the data structured output.
[0063] Based on the above implementation scheme, in a feasible implementation scheme, the information extraction rule of the data to be extracted includes steps S11 to S13:
[0064] Step S11, determining an extraction method for information extraction of the data to be extracted.
[0065] It should be noted that the extraction method is a method that dynamically selects keyword extraction or pattern extraction as the information extraction method according to the specific content and format of the data to be extracted during data preprocessing and information extraction. The extraction method includes keyword extraction and pattern extraction.
[0066] Specifically, whether to use keyword extraction or pattern extraction as the information extraction method is determined based on the type, structure, format, content of the data to be extracted and the specific requirements of the information extraction.
[0067] Step S12: when the extraction method is keyword extraction, extract keywords of the data to be extracted, and generate information extraction rules for the data to be extracted based on the keywords.
[0068] Specifically, when the selected extraction method is keyword extraction, natural language processing (NLP) technology or keyword extraction algorithm is used to identify and extract key words or phrases from the data to be extracted. These keywords can accurately reflect the core information and themes in the data and meet the specific needs of information extraction; based on the extracted keywords, information extraction rules are formulated; the rules clearly specify how to extract keyword-related information from the data, including the format, location, and relationship with other information of the information.
[0069] More specifically, when the selected extraction method is keyword extraction, the keywords that the user needs to extract are obtained. The keywords can be one or more. Then, through the keyword extraction algorithm, data segments containing keywords are identified and extracted from the data to be extracted. The keywords can be product names, names, dates, etc., depending on the actual business scenario.
[0070] Step S13: when the extraction method is pattern extraction, determining an extraction structure according to the data to be extracted, and generating information extraction rules for the data to be extracted based on the extraction structure.
[0071] Specifically, when the selected extraction method is pattern extraction, the structure and format of the data to be extracted are analyzed to determine the data extraction structure. The extraction structure includes the hierarchical relationship of the data, field definitions, and the relationship between the data. Based on the determined extraction structure, information extraction rules are formulated. The rules should clearly specify how to extract the required information from the data, including the fields of the information, the format, and the relationship with other fields.
[0072] More specifically, when the selected extraction method is pattern extraction, the data extraction structure is determined according to the structure and format of the data to be extracted. The extraction structure can be predefined by the user or automatically extracted and generated by the model, such as the date format (such as "YYYY-MM-DD") or the structure of the telephone number, IP address format, etc. The system will search and extract data that meets the format according to this preset extraction structure.
[0073] Through the above scheme, this embodiment can adapt to the information extraction needs in different scenarios through keyword extraction or pattern extraction. This flexibility enables the system to process various types of data and meet the diverse information extraction requirements of users; according to the characteristics of the data to be extracted and its own needs, the appropriate extraction method is selected to optimize the information extraction process. This not only reduces unnecessary processing steps, but also improves the speed and efficiency of information extraction.
[0074] Based on the above implementation scheme, in a feasible implementation manner, before the step of extracting the key information of the data to be extracted through the information extraction model based on the information extraction rule, steps S41 to S43 are also included:
[0075] Step S41, initializing the information extraction model.
[0076] Specifically, first determine the appropriate information extraction model. This can be selected according to the specific application scenario and data characteristics, such as models based on deep learning (such as convolutional neural network CNN, recurrent neural network RNN, long short-term memory network LSTM, Transformer, etc.) or traditional machine learning models (such as support vector machine SVM, naive Bayes NB, etc.). Then the initial parameters of the model. These parameters may include weights, bias terms, learning rates, batch sizes, etc. The settings of these parameters usually need to be determined based on experience or experiments. Finally, if there is a pre-trained model, load the pre-trained model to use the model pre-trained on a large amount of data as a starting point, which helps to speed up training and improve model performance.
[0077] Step S42: parsing the information extraction rule through the information extraction model to extract the rule features of the information extraction rule.
[0078] It should be noted that rule features refer to specific attributes extracted from information extraction rules during the information extraction process to guide the behavior of the information extraction model. Rule features may include entity types, relationship patterns, context information, pattern matching and other features. Among them, entity types define the types of entities that need to be identified and extracted in the text, such as names, place names, dates, etc.; relationship patterns define possible associations or relationships between entities, such as "author-work" or "company-CEO"; context information provides words or phrases that may appear around entities, which helps the model identify entities more accurately; pattern matching refers to specific patterns or templates, such as date formats, phone number formats, etc. These patterns help to identify and extract standardized information.
[0079] Specifically, the information extraction rules are preprocessed and converted into a data format suitable for the information extraction model, such as representing the rules as vectors or tensors; then the information extraction rules are input into the information extraction model, and the model parses the rules. This includes understanding the structure, logic, and semantics of the rules, as well as identifying key elements in the rules (such as keywords, patterns, etc.); in the process of parsing the rules, the model extracts features related to the rules, which may include the weights of keywords in the rules, the structural features of the patterns, etc.
[0080] Step S43: Perform dynamic adaptive learning based on the rule features to update parameters of the information extraction model.
[0081] Specifically, calculate the loss function; the loss function is used to measure the difference between the current output of the model and the expected output. In the information extraction task, the loss function may be defined based on indicators such as the accuracy of rule matching and the completeness of information extraction. Perform back propagation; according to the gradient of the loss function, update the parameters of the model through the back propagation algorithm, which includes adjusting the weights and bias terms to reduce the value of the loss function. Dynamic adaptive learning; during the training process, the model will continuously adjust its parameters based on the newly extracted rule features and learned knowledge, which includes learning new rule features, optimizing the weights of existing features, etc. Iterate and update parameters; through multiple iterative training, the model will gradually converge to a stable state, at which time the parameters of the model will be able to adapt well to the needs of the information extraction task.
[0082] Through the above scheme, this embodiment allows the model to adjust its parameters according to the newly extracted rule features through dynamic adaptive learning, further improving the accuracy and efficiency of information extraction, while also enhancing the flexibility and scalability of the model; the rule parsing and feature extraction steps enable the model to process different information extraction rules, thereby adapting to different application scenarios.
[0083] Based on the above implementation scheme, in a feasible implementation manner, extracting the key information of the data to be extracted through the information extraction model based on the information extraction rule includes steps S21 to S23:
[0084] Step S21, segmenting the data to be extracted, and performing part-of-speech tagging on the segmented data to be extracted to obtain a segmentation tag sequence.
[0085] It should be noted that the word segmentation tag sequence refers to a sequence containing each word and its part-of-speech tag, formed by combining the results of word segmentation and part-of-speech tagging. Word segmentation refers to the process of dividing a continuous text into independent words or phrases; tagging is to give each word a tag indicating its part of speech, such as noun (n), verb (v), adjective (adj), etc., based on word segmentation. For example, "I / r love / v natural language / n processing / v".
[0086] In addition, it should be noted that word segmentation is the process of dividing continuous text into independent words or symbols. In Chinese text processing, word segmentation is an important preprocessing step because there is no obvious space between Chinese words. There are many methods for word segmentation, including rule-based methods, statistical methods, and deep learning-based methods. For example, the sentence "I love natural language processing" can be segmented into "I / love / natural language / processing".
[0087] Additionally, it should be noted that part-of-speech tagging is a fundamental task in natural language processing, which aims to identify the grammatical function or part-of-speech of each word in a sentence. For example, "I (pronoun r) / love (verb v) / natural language (noun n) / processing (verb v)".
[0088] Specifically, perform text preprocessing such as data cleaning and stop word removal on the data to be extracted, remove irrelevant information such as special characters, punctuation marks, and HTML tags in the text, as well as handle noise and redundant data in the text, and remove common words (such as "de", "shi", "zai", etc.) to reduce noise and improve processing efficiency. Then select a suitable word segmentation tool, such as jieba segmentation, HanLP, etc., and use the selected word segmentation tool to perform word segmentation on the data to be extracted to obtain the segmented text. Select a suitable part-of-speech tagging tool, such as HanLP, LTP, etc., and use the selected part-of-speech tagging tool to perform part-of-speech tagging on the segmented data to obtain the part-of-speech tagging sequence.
[0089] Step S22: Perform entity recognition and extraction on the part-of-speech tagging sequence to obtain the entity sequence of the data to be extracted.
[0090] It should be noted that an entity is an entity with a specific meaning identified in the text, such as a person's name, a place name, an organization name, a time, a date, etc. For example, in the sentence "Zhang San went to Beijing on January 1, 2023", entities such as "Zhang San" (person's name), "January 1, 2023" (date), and "Beijing" (place name) can be identified. The entity sequence is a sequence formed by arranging all the identified entities in the text in the order they appear in the text. For example, for the above sentence, the entity sequence may be "Zhang San / Date (January 1, 2023) / Beijing".
[0091] Specifically, the part-of-speech tagging sequence contains the text and its corresponding annotation information (entity boundaries and categories), and a sequence annotation model is used for entity recognition, such as the Hidden Markov Model (HMM), Conditional Random Field (CRF), etc. These models can take the text sequence as input and output an annotation sequence, thereby realizing the recognition of entities. Use the labeled training data to train the model so that it can learn the characteristics and rules of entities in the text; apply the trained model to perform entity recognition on new text and extract entities with specific meanings to obtain the entity sequence.
[0092] Step S23: Perform relation extraction on the part-of-speech tagging sequence based on the entity sequence to obtain the relation sequence of the data to be extracted.
[0093] It should be noted that the relationship sequence refers to a sequence formed by arranging all the identified relationships in the text in the order in which they appear in the text (or a certain logical order). Relationships are usually expressed in the form of triples (entity 1, relationship type, entity 2). For example, for the sentence "Zhang San's father is Li Si", the relationship sequence may be "(Zhang San, father and son, Li Si)".
[0094] Specifically, classification models are used for relation extraction, such as support vector machines (SVMs) and logistic regression. These models can take entity pairs with labeled information as input and output prediction results representing the relationship category; the model is trained using labeled training data, and the trained model is applied to new text for relation extraction. By extracting entity pairs that conform to the predefined relationship pattern in the text, the relationship information between entities can be obtained.
[0095] Based on the above implementation scheme, in a feasible implementation manner, the step of performing a structured operation on the key information through a structured model to obtain the target extraction information of the data to be extracted includes steps S31 to S33:
[0096] Step S31, determining the target format of the target extraction information when outputting according to the data to be extracted.
[0097] It should be noted that the target format in this application refers to a data representation with a clear structure and organization. These formats are usually used to store, transmit and process data to ensure the accuracy and consistency of the data. Common structured formats include but are not limited to extensible markup language XML, comma separated values CSV, JavaScript object notation JSON, database table structure, etc.
[0098] Specifically, according to the structured formats that can be converted in the structured model and the structured formats that need to be converted, the target format of the target extracted information during output is determined.
[0099] Step S32, performing a structural operation on the key information through a structured model, outputting the key information in the target format, and obtaining initial extracted information.
[0100] Specifically, obtain the generated key information from the information extraction model. This information may exist in the form of JSON objects, key-value pairs, or other intermediate representations. Ensure the accuracy and completeness of this information, verify the format and content of the input data, and ensure that they meet the input requirements of the small structured model. According to the target format (such as conversion to XML, CSV, etc.), set predefined structuring rules in the structured model. Input the key information into the structured model and perform formatting operations based on the target format. Output the key information in the target format to obtain the initial extracted information.
[0101] Step S33, verifying and correcting the initial extraction information to obtain target extraction information of the data to be extracted.
[0102] Specifically, after the conversion is completed, the initial extracted information is checked to ensure that they meet the requirements of the expected target format. If any inconsistencies or errors are found, they are corrected and then verified. The verified information is output to obtain the target extracted information.
[0103] Through the above scheme, this embodiment determines the target format and performs structured operations to organize and output key information in a preset format, which helps to ensure the accuracy and consistency of the information and reduce errors caused by different formats or missing information. At the same time, the structured information format also facilitates the storage and management of information, and improves the flexibility and scalability of information processing.
[0104] Based on the above implementation scheme, in a feasible implementation manner, the step of determining the information extraction rule of the data to be extracted further includes step S40:
[0105] Step S40: determining a task instruction corresponding to the information extraction rule based on the information extraction rule, and inputting the task instruction into the information extraction model.
[0106] It should be noted that the task instruction is a phrase, sentence or paragraph used to guide the information extraction model to understand and respond to specific needs or questions. In one embodiment of the present application, prompt words are used as task instructions to provide the necessary context and guidance for the information extraction model so that it can accurately understand the information extraction rules and generate corresponding responses accordingly.
[0107] Specifically, task instructions are generated based on the information extraction rules and the expected model responses corresponding to the rules; the task instructions are passed as input to the information extraction model; after receiving the task instructions, the information extraction model will use the model's internal knowledge structure and learned rules for reasoning and processing. The model will analyze the user's intentions based on the information in the task instructions and its own stored knowledge, and determine how to respond; finally, the model will generate a response that meets expectations.
[0108] Through the above scheme, this embodiment determines the task instructions corresponding to the information extraction rules based on the information extraction rules, thereby improving the model's ability to accurately identify and extract key information when extracting information, reducing misjudgments and missed judgments, and at the same time speeding up the information extraction process and improving the overall processing efficiency; clear information extraction rules and expected model responses make the model's behavior more predictable and explainable, which helps developers and users understand the model's decision-making process.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the information extraction method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0110] This application also provides an information extraction device, please refer to Figure 2 , the information extraction device comprises:
[0111] A rule determination module 201 is used to determine information extraction rules for data to be extracted;
[0112] An information extraction module 202 is used to extract key information of the data to be extracted through an information extraction model based on the information extraction rules;
[0113] The format output module 203 is used to perform a structural operation on the key information through a structured model to obtain the target extraction information of the data to be extracted.
[0114] The information extraction device provided by the present application adopts the information extraction method in the above embodiment, which can solve the technical problem of low efficiency when extracting information from text. Compared with the prior art, the beneficial effects of the information extraction device provided by the present application are the same as the beneficial effects of the information extraction method provided by the above embodiment, and other technical features in the information extraction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0115] The present application provides an information extraction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information extraction method in the above-mentioned embodiment one.
[0116] Reference below Figure 3 , which shows a schematic diagram of the structure of an information extraction device suitable for implementing the embodiment of the present application. The information extraction device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The information extraction device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0117] like Figure 3 As shown, the information extraction device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the information extraction device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the information extraction device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an information extraction device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0119] The information extraction device provided by the present application adopts the information extraction method in the above embodiment, which can solve the technical problem of low efficiency when extracting information from text. Compared with the prior art, the beneficial effects of the information extraction device provided by the present application are the same as the beneficial effects of the information extraction method provided by the above embodiment, and other technical features in the information extraction device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0120] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the information extraction method in the above-mentioned embodiment.
[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0124] The computer-readable storage medium may be included in the information extraction device; or may exist independently without being assembled into the information extraction device.
[0125] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the information extraction device, the information extraction device: determines the information extraction rules of the data to be extracted; based on the information extraction rules, extracts the key information of the data to be extracted through the information extraction model; performs structured operations on the key information through the structured model to obtain the target extraction information of the data to be extracted.
[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0129] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned information extraction method, and can solve the technical problem of low efficiency when extracting information from text. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the information extraction method provided by the above-mentioned embodiment, and will not be repeated here.
[0130] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned information extraction method when executed by a processor.
[0131] The computer program product provided by the present application can solve the technical problem of low efficiency in extracting information from text. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the information extraction method provided by the above embodiment, which will not be described in detail here.
[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An information extraction method, characterized in that: The method comprises: Determine the information extraction rules for the data to be extracted; Based on the information extraction rules, extracting key information of the data to be extracted through an information extraction model; The key information is subjected to a structural operation through a structured model to obtain target extraction information of the data to be extracted.
2. The method according to claim 1, characterized in that The step of determining the information extraction rules of the data to be extracted comprises: Determine the extraction method for information extraction of the data to be extracted; When the extraction method is keyword extraction, extracting keywords of the data to be extracted, and generating information extraction rules for the data to be extracted based on the keywords; When the extraction method is pattern extraction, an extraction structure is determined according to the data to be extracted, and information extraction rules for the data to be extracted are generated based on the extraction structure.
3. The method according to claim 1, characterized in that Before the step of extracting the key information of the data to be extracted through the information extraction model based on the information extraction rule, the step further includes: Initialize the information extraction model; Performing rule parsing on the information extraction rule through the information extraction model to extract rule features of the information extraction rule; Dynamic adaptive learning is performed based on the rule features to update parameters of the information extraction model.
4. The method according to claim 1, characterized in that The step of extracting key information of the data to be extracted through the information extraction model based on the information extraction rule comprises: Performing word segmentation on the data to be extracted, and performing part-of-speech tagging on the data to be extracted after word segmentation to obtain a word segmentation tag sequence; Performing entity recognition extraction on the word segmentation annotation sequence to obtain an entity sequence of the data to be extracted; Relation extraction is performed on the word segmentation tag sequence based on the entity sequence to obtain a relationship sequence of the data to be extracted.
5. The method according to claim 1, characterized in that The step of performing a structural operation on the key information through a structured model to obtain target extraction information of the data to be extracted comprises: Determining a target format of target extraction information when outputting according to the data to be extracted; Performing a structural operation on the key information through a structured model, outputting the key information in the target format, and obtaining initial extracted information; The initial extraction information is verified and corrected to obtain target extraction information of the data to be extracted.
6. The method according to claim 1, characterized in that The step of determining the information extraction rules of the data to be extracted also includes: Based on the information extraction rule, a task instruction corresponding to the information extraction rule is determined, and the task instruction is input into the information extraction model.
7. An information extraction device, characterized in that: The device comprises: A rule determination module, used to determine information extraction rules for data to be extracted; An information extraction module, used to extract key information of the data to be extracted through an information extraction model based on the information extraction rules; The format output module is used to perform structured operations on the key information through a structured model to obtain target extraction information of the data to be extracted.
8. An information extraction device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the information extraction method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the information extraction method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the information extraction method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Bulletin information extraction method and system and storage medium
CN115455936A
Information extraction method, and method and device for training information extraction model
CN116468038A
Medical information extraction method and device, electronic equipment and storage medium
CN118230971A
Information extraction method and device, storage medium and intelligent equipment
CN118364102A