Insurance policy information extraction method and device, equipment and storage medium
By using automated policy information extraction methods, the problem of time-consuming and labor-intensive traditional manual review has been solved, achieving efficient and accurate policy information extraction and storage, and supporting the digital management of insurance companies.
Patent Information
- Application Number
- CN202411120572.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
AI Technical Summary
Traditional policy processing relies on manual review, which is time-consuming, labor-intensive, inefficient, and prone to oversights and errors, affecting the management of both insurance companies and policyholders.
By acquiring policy documents, extracting text content, removing noise, selecting an appropriate information extraction model, extracting and storing the target core information, and using a rule engine to store the information in a database.
It enables efficient extraction of policy information without relying on human intervention, reduces errors and omissions in manual review, and improves the digital efficiency of policy management.
Smart Images

Figure CN119027966A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of financial information processing, and in particular to a method, device, equipment and storage medium for extracting insurance policy information. Background Art
[0002] In the insurance industry, insurance policies, as contract documents, record important information such as insurance terms and rights. Traditional insurance policy processing methods usually use manual review methods, which often rely on manpower. Not only is it time-consuming and labor-intensive, but it is also inefficient and prone to omissions and errors. Errors in insurance policy records often cause management chaos, which has a negative impact on both insurance companies and policyholders. Summary of the invention
[0003] The present application aims to propose a method, device, equipment and storage medium for extracting insurance policy information, which can reduce the reliance on manpower in the process of extracting insurance policy information.
[0004] According to the first aspect of the present application, the method for extracting insurance policy information includes:
[0005] Obtain the policy documents to be withdrawn;
[0006] Extracting text content from the insurance policy document to be extracted to obtain a first text;
[0007] Removing noise information from the first text to obtain a second text;
[0008] According to the length of the second text, a target extraction model is selected from a plurality of preset information extraction models, wherein the plurality of preset information extraction models correspond to text lengths in different ranges;
[0009] Inputting the second text into the target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information;
[0010] The target core information is stored in a database.
[0011] According to some embodiments of the present application, removing noise information from the first text to obtain the second text includes:
[0012] Acquire a cutting rule, where the cutting rule is used to perform denoising on the text;
[0013] The first text is cropped according to the cropping rule to obtain the second text.
[0014] According to some embodiments of the present application, after inputting the second text into the target extraction model to obtain the target core information, the insurance policy information extraction method further includes:
[0015] Input the target core information and the first text into a regular generation model, and output an intermediate cutting rule;
[0016] Verify the intermediate cutting rule according to the historical policy document information; the historical policy document includes the historical target core information and the historical first text;
[0017] Under the condition that the intermediate cutting rule is confirmed to pass the verification, the cutting rule is updated according to the intermediate cutting rule.
[0018] According to some embodiments of the present application, the second text is input into the target extraction model to obtain the target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information, including:
[0019] Inputting the second text into the target extraction model to obtain intermediate target core information;
[0020] Verifying the intermediate target core information according to the extraction format;
[0021] Under the condition that the intermediate target core information passes the verification, confirming that the intermediate target core information is the target core information;
[0022] If the intermediate target core information fails to pass the verification, the step of inputting the second text into the target extraction model to obtain the intermediate target core information is returned to the step until the target core information is obtained.
[0023] According to some embodiments of the present application, the target extraction model is selected from a plurality of preset information extraction models according to the length of the second text, and the plurality of preset information extraction models correspond to text lengths in different ranges, including:
[0024] Segmenting the second text to obtain a plurality of paragraphs of the second text;
[0025] Counting the number of characters in each of the paragraphs;
[0026] Obtaining the total number of characters in the second text according to the number of characters in each of the paragraphs;
[0027] Under the condition that the total number of characters is less than a preset total number of characters, selecting a first preset information extraction model as the target extraction model;
[0028] Under the condition that the total number of characters is greater than or equal to the preset total number of characters, a second preset information extraction model is selected as the target extraction model.
[0029] According to some embodiments of the present application, storing the target core information in a database includes:
[0030] Mapping the target core information into information to be stored in a preset data format; the preset data format is a data format recognizable by the database;
[0031] Generate a database insert statement according to the information to be stored and the rule engine;
[0032] According to the database insert statement, the information to be stored is stored in the database.
[0033] According to some embodiments of the present application, extracting text content from the insurance policy document to be extracted to obtain a first text includes:
[0034] In the case where the insurance policy file to be extracted is a PDF file, the PyMuPDF library is used to extract the text content in the PDF file to obtain the first text;
[0035] In the case that the insurance policy document to be extracted is a picture file, OCR technology is used to perform text recognition on the picture file to obtain the first text.
[0036] According to the second aspect of the present application, the insurance policy information extraction device includes:
[0037] The acquisition module is used to obtain the policy document to be extracted;
[0038] A first extraction module, configured to extract text content from the insurance policy document to be extracted to obtain a first text;
[0039] A removal module, used to remove noise information in the first text to obtain a second text;
[0040] A selection module, configured to select a target extraction model from a plurality of preset information extraction models according to the length of the second text, wherein the plurality of preset information extraction models correspond to text lengths in different ranges;
[0041] A second extraction module is used to input the second text into the target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information;
[0042] A storage module is used to store the target core information in a database.
[0043] An electronic device according to an embodiment of the third aspect of the present application includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the insurance policy information extraction method as described in any one of the embodiments of the first aspect are implemented.
[0044] According to the computer-readable storage medium of the fourth aspect embodiment of the present application, computer-executable instructions are stored, and the computer-executable instructions are used to execute the insurance policy information extraction method as described in the first aspect embodiment above.
[0045] In the embodiment of the present application, the first text is obtained by extracting the text content of the insurance policy document, and the extracted content is denoised to obtain the second text, which can remove noise information and shorten the text length, and select a target extraction model of corresponding specifications according to the length of the second text, which can save computing power and reduce costs. Subsequently, the target core information is obtained through the target advance model, and the target core information is stored in the database, and finally the extraction and preservation of the insurance policy information is realized. The insurance policy information extraction method of the embodiment of the present application does not need to rely on manpower to extract the insurance policy information, which is more efficient, can save labor costs, and can also reduce omissions and errors in the manual review process, reduce errors in the insurance policy recording process, and make it easier for insurance companies to digitally manage insurance policies.
[0046] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0048] Figure 1 It is a flowchart of an embodiment of the method for extracting insurance policy information of the present application;
[0049] Figure 2 It is a structural schematic diagram of an embodiment of the insurance policy information extraction device of the present application;
[0050] Figure 3 It is a schematic diagram of the hardware structure of an embodiment of the electronic device of the present application. DETAILED DESCRIPTION
[0051] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0052] In the description of this application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0053] In the description of the present application, it should be understood that the descriptions involving orientation, such as the orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0054] In the description of this application, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution.
[0055] The technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described below are only part of the embodiments of the present application, not all of the embodiments.
[0056] Figure 1 A flowchart of the insurance policy information extraction method of the embodiment provided in this application; Figure 2 It is a structural schematic diagram of an embodiment of the insurance policy information extraction device of the present application; Figure 3 It is a schematic diagram of the hardware structure of an embodiment of the electronic device of the present application.
[0057] See below Figure 1 , the embodiments of the present application are further described.
[0058] The present application embodiment proposes a method for extracting insurance policy information, which includes the following steps:
[0059] Step 101, obtaining the policy document to be retrieved;
[0060] Step 102: extract text content from the insurance policy document to be extracted to obtain a first text;
[0061] Step 103: removing noise information from the first text to obtain a second text;
[0062] Step 104: selecting a target extraction model from a plurality of preset information extraction models according to the length of the second text, wherein the plurality of preset information extraction models correspond to text lengths in different ranges;
[0063] Step 105: input the second text into the target extraction model to obtain the target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information;
[0064] Step 106: Store the target core information in a database.
[0065] In the embodiment of the present application, the first text is obtained by extracting the text content of the insurance policy document, and the extracted content is denoised to obtain the second text, which can remove noise information and shorten the text length, and select a target extraction model of corresponding specifications according to the length of the second text, which can save computing power and reduce costs. Subsequently, the target core information is obtained through the target advance model, and the target core information is stored in the database, and finally the extraction and preservation of the insurance policy information is realized. The insurance policy information extraction method of the embodiment of the present application does not need to rely on manpower to extract the insurance policy information, which is more efficient, can save labor costs, and can also reduce omissions and errors in the manual review process, reduce errors in the insurance policy recording process, and make it easier for insurance companies to digitally manage insurance policies.
[0066] In the above step 101, the policy document to be retrieved is obtained;
[0067] The above-mentioned obtaining of the insurance policy file to be extracted may be directly obtaining the electronic insurance policy in the insurance company system, or obtaining the electronic copy of the paper insurance policy by taking a photo or scanning. The above-mentioned electronic insurance policy and electronic copy may be a text file or an image file, wherein the text file may be a PDF format file.
[0068] In the above step 102, text content is extracted from the insurance policy document to be extracted to obtain a first text;
[0069] The text content extraction process may be to perform text recognition and extraction on the text information in the insurance policy document to be extracted, and obtain a first text including all the text content in the insurance policy document.
[0070] For the above-mentioned first text, when the insurance policy file to be extracted is a picture file, after the text content is extracted, the extracted content may contain a watermark; when the insurance policy file to be extracted is a text file, after the text content is extracted, the extracted content may contain noise information such as headers and footers. Such noise information is irrelevant to the content of the insurance policy file and affects the subsequent analysis and extraction process of the insurance policy information.
[0071] In the above step 103, noise information in the first text is removed to obtain a second text;
[0072] The above-mentioned noise information may be watermarks, headers, footers and other noise information that are irrelevant to the main text of the policy document and must be removed. It may also be part of the template text content of the policy document and does not involve the actual specific content of the policy document. After removal, the length of the text to be processed can be further shortened, which can improve the system processing efficiency.
[0073] In the above step 104, according to the length of the second text, a target extraction model is selected from a plurality of preset information extraction models, wherein the plurality of preset information extraction models correspond to text lengths in different ranges;
[0074] The above-mentioned multiple preset information extraction models are preset information extraction models of multiple different sizes. The larger-scale preset information extraction model is corresponding to processing texts with longer lengths.
[0075] For example, when the length of the second text is relatively short, a preset information extraction model with a larger scale is used as the target extraction model; when the length of the second text is relatively short, a preset information extraction model with a smaller scale is used as the target extraction model.
[0076] In the above step 105, the second text is input into the target extraction model to obtain the target core information; wherein the preset extraction rules of the target extraction model are predetermined, and the preset extraction rules include the extraction format of the target core information;
[0077] The target extraction model is used to extract target core information from the input second text, and the extraction process is performed according to a predetermined preset extraction rule.
[0078] The above-mentioned extraction format of the target core information may include the index field extracted from the target core information and the corresponding position of the index field in the text, and may also include the data format of the extracted data.
[0079] For example, the preset extraction rules of the above-mentioned predetermined target extraction model may be to input a preprocessed text, ie, a text with the specific location of the target core information marked, and the target core information demo with a specific data format as extraction rules into the target extraction model.
[0080] The target extraction model can be a large language model with a SYSTEM side and a USER side. The main function of SYSTEM is to set the background, rules and context of the conversation. It tells the model how to behave, how to answer questions, and what specific rules or constraints need to be followed. USER represents the person who is talking to the model. In the conversation, USER sends questions or instructions, and the model responds based on these inputs.
[0081] For example, the preprocessed text is input into the SYSTEM variable of the target extraction model, and the second text is set as the USER input of the target extraction model to obtain the target core information extracted by the model.
[0082] The specific data format of the above target core information can be in JSON format.
[0083] In the above step 106, the target core information is stored in the database.
[0084] The above-mentioned storage of the target core information in the database can be used to structure the target core information extracted by the target extraction model and map it to a predefined data format, and then automatically store the structured core information in the database. Specifically, a rule engine and a mapping table can be used to convert the extracted information into a format recognizable by the database. The above process can support multiple database types, such as relational databases, NoSQL databases, etc., to ensure reliable storage and fast access to data.
[0085] In some implementations, a user-friendly interactive interface is provided, so that users can conveniently upload the policy PDF file, view the extraction results, and make necessary adjustments and confirmations. Specifically, the user interactive interface includes a file upload area, an information display area, operation buttons, and the like.
[0086] In some implementations, removing noise information from the first text to obtain the second text includes:
[0087] Get the cropping rule, which is used to denoise the text;
[0088] According to the cropping rule, the first text is cropped to obtain the second text.
[0089] In this implementation, by using a clipping rule to denoise the first text, noise information can be removed more accurately.
[0090] The above-mentioned denoising process can remove noise information such as watermarks, headers, footers, etc. that are irrelevant to the main text of the policy document, and can also remove part of the template text content of the policy document that does not involve the actual specific content of the policy document, thereby simplifying the length of the text to be processed.
[0091] The above denoising process can be achieved by performing text cropping according to a cropping formula, and a denoised second text is obtained by cropping the first text.
[0092] The above cutting rules can be set manually.
[0093] The above-mentioned cutting rules can be regular expressions, and the above-mentioned cutting rules can also be a rule library composed of multiple regular expressions, among which some regular expressions can be used to process all policy documents, and other regular expressions are specifically set for different policy documents. This is because the policy documents of different insurance companies use different template contents. When cutting part of the template text content that does not involve the actual specific content of the policy document, corresponding regular expressions can be set for different insurance companies.
[0094] For example, the above cutting rule is set as startReg = "Details List\n", endReg = "Occupation List", and the data between the two regular expressions is cut off, thereby deleting most of the noise information.
[0095] In some implementations, after inputting the second text into the target extraction model to obtain the target core information, the insurance policy information extraction method further includes:
[0096] Input the target core information and the first text into the regular generation model, and output the intermediate cutting rules;
[0097] Verify the intermediate cutting rules based on the historical policy document information; the historical policy document includes the historical target core information and the historical first text;
[0098] Under the condition that the intermediate cutting rule passes the verification, the cutting rule is updated according to the intermediate cutting rule.
[0099] In this implementation, the regular generation model is used to continuously update and optimize the cutting rules, and the newly generated cutting rules need to be verified by the historical policy document information. Only after the verification is passed can they be confirmed for use to obtain the best cutting effect, further shorten the length of the second text, and thereby reduce the computing power required in the subsequent process of extracting the target core information from the second text.
[0100] The above regular generation model can adopt the ERNIE-4 model.
[0101] The above-mentioned updating of the cutting rule according to the intermediate cutting rule may be to replace the cutting rule with the intermediate cutting rule after obtaining the intermediate cutting rule, or to add the intermediate cutting rule into the regular library of the cutting rule.
[0102] In some implementations, after inputting the second text into the target extraction model to obtain the target core information, the insurance policy information extraction method further includes:
[0103] Input the target core information, the first text, and the second text into a regular generation model, and output a first intermediate cutting rule;
[0104] Verifying the first cutting rule according to historical policy document information; the historical policy document includes historical target core information, historical first text and historical second text;
[0105] Under the condition that the first intermediate cutting rule is confirmed to pass the verification, the cutting rule is updated according to the intermediate cutting rule.
[0106] In some implementations, the second text is input into a target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information, including:
[0107] Inputting the second text into the target extraction model to obtain the intermediate target core information;
[0108] Verify the intermediate target core information according to the extraction format;
[0109] Under the condition that the intermediate target core information passes the verification, confirm that the intermediate target core information is the target core information;
[0110] If the intermediate target core information fails to pass the verification, the step of inputting the second text into the target extraction model to obtain the intermediate target core information is returned to the execution until the target core information is obtained.
[0111] In this embodiment, extraction is performed from the input second text through the target extraction model. The extraction process will be carried out according to predetermined preset extraction rules and verified according to the extraction format. Only if it passes the verification will it be confirmed as the target core information. If it fails the verification, the second text will be re-input into the model and subsequent steps will be performed until the model output passes the verification and the target core information is obtained. The verification step further improves the accuracy of Baoding information extraction.
[0112] The above verification of the intermediate target core information according to the extraction format can be used to perform preliminary verification of the extracted core information, such as whether the extraction format of the target core information is correct to ensure its accuracy. If abnormal or incomplete information is found, a corresponding retry is performed.
[0113] The above-mentioned extraction format of the target core information may include the index field extracted from the target core information and the corresponding position of the index field in the text, and may also include the data format of the extracted data.
[0114] For example, the preset extraction rule of the above-mentioned predetermined target extraction model may be to input a text with the target core information position marked and the target core information demo in a specific data format as extraction rules into the target extraction model.
[0115] The specific data format of the above target core information can be in JSON format.
[0116] For example, the above verification of the intermediate target core information according to the extraction format can be used to verify whether the specific data format of the target core information is correct. Specifically, it can be used to verify whether the JSON format is consistent with the preset and whether the required fields have values.
[0117] In some implementations, according to the length of the second text, a target extraction model is selected from a plurality of preset information extraction models, wherein the plurality of preset information extraction models correspond to text lengths in different ranges, including:
[0118] Segmenting the second text to obtain multiple paragraphs of the second text;
[0119] Count the number of characters in each paragraph;
[0120] According to the number of characters in each paragraph, the total number of characters in the second text is obtained;
[0121] Under the condition that the total number of characters is less than the preset total number of characters, selecting the first preset information extraction model as the target extraction model;
[0122] Under the condition that the total number of characters is greater than or equal to the preset total number of characters, the second preset information extraction model is selected as the target extraction model.
[0123] In this implementation, by dividing the text and counting the number of characters in segments to obtain the total number of characters, the length of the text can be simply and accurately counted. Different target extraction models can be selected according to the total number of characters, which can effectively save computing power and cost.
[0124] The above-mentioned segmentation of the second text may be segmentation of the second text content by paragraphs, or segmentation of the second text content by punctuation marks, for example, segmentation by periods.
[0125] The total number of characters in the second text is obtained according to the number of characters in each paragraph. The total number of characters in the entire second text can be obtained by counting the number of characters in each paragraph or sentence.
[0126] The above preset total number of characters can be set according to actual conditions.
[0127] For example, the above preset total number of characters is set to 30,000. When the total number of characters is less than 30,000, the ERNIE-Speed-128K model is selected as the target extraction model; when the total number of characters exceeds 30,000, the GLM4 model is selected as the target extraction model.
[0128] In some embodiments, storing the target core information in a database includes:
[0129] Mapping the target core information to information to be stored in a preset data format; the preset data format is a data format recognizable by the database;
[0130] Generate database insert statements based on the information to be stored and the rule engine;
[0131] According to the database insert statement, the information to be stored is stored in the database.
[0132] In this implementation, a rule engine is used to generate a database insert statement, which can facilitate storing the information to be stored in the database.
[0133] The above-mentioned mapping of the target core information into the information to be stored in a preset data format may be to map the target core information in JSON format extracted by the target extraction model into a specific Java object, and then generate a database insert statement according to the rule engine.
[0134] For example, the target core information extracted by the target extraction model in JSON format is as follows:
[0135] {
[0136] "policy_number":"P2469000185691",
[0137] "insurance_company_code":"JG20231025399",
[0138] "plan_code":"SXCXTTYW23122001",
[0139] "premium":261.9,
[0140] "total_premium":1833.3,
[0141] "agent_business_code":"",
[0142] "agent_name":"HBXT0003",
[0143] "channel_recommender_id":"Wu Mingxia",
[0144] "channel_recommender_name":"zhnx",
[0145] "sales_channel_code":"2024-07-04",
[0146] "underwriting_date":"2024-07-04",
[0147] "effective_date":"2024-07-06",
[0148] "termination_date":"2025-07-05",
[0149] "unit_name":"Xingtai County Zhijiang Machinery Factory",
[0150] "id_type":"Uniform social credit code",
[0151] "id_number":"92130521MA08XNPF90",
[0152] "unit_address":"",
[0153] "contact_phone":"",
[0154] "insured_is_policyholder":"Employed",
[0155] "insured_name":"Yuan Wanqiang",
[0156] "insured_id_type":"ID card",
[0157] "insured_id_number":"13052119791006627X",
[0158] "insured_gender":"",
[0159] "insured_birth_date":"",
[0160] "insured_phone":"",
[0161] "insured_address":"",
[0162] "sales_platform":"",
[0163] "electronic_policy_link":"",
[0164] "remarks":"Agricultural Insurance [Group Insurance Introduction]",
[0165] "template_validation_column":""
[0166] }
[0167] The insert statement converted by the rule engine is as follows:
[0168] INSERT INTO insurance_policy
[0169] (policy_number,insurance_company_code,plan_code,premium,total_premium,agent_business_code,agent_name,channel_recommender_id,channel_recommender_name,sales_channel_code,underwriting_date,effective_date,termination_date,unit_name,id_type,id_n umber,unit_address,contact_phone,insured_is_policyholder,insured_name,insured_id_type,insured_id_number,insured_gender,insured_birth_date,insured_phone,insured_address,sales_platform,electronic_policy_link,remarks,template_validation_column)
[0170] VALUES('P2469000185691','JG20231025399','SXCXTTYW23122001',261.9,1833.3,”,'HBXT0003','Wu Mingxia','zhnx','2024-07-04','2024-07-06','2025-07-05','Xingtai County Zhijiang Machinery Factory','Uniform Social Credit Code','92130521MA08XNPF90',”,”,'Employment','Yuan Wanqiang','ID Card','13052119791006627X',”,”,”,”,”,”,”,”,'Agricultural Insurance [Group Insurance Import]');
[0171] In some implementations, extracting text content from the policy document to be extracted to obtain a first text includes:
[0172] When the policy file to be extracted is a PDF file, the PyMuPDF library is used to extract the text content in the PDF file to obtain the first text;
[0173] When the insurance policy document to be extracted is a picture file, OCR technology is used to perform text recognition on the picture file to obtain the first text.
[0174] In this embodiment, the PyMuPDF library is a Python library for processing PDF files. It provides rich functions to operate, analyze and convert PDF documents. OCR technology, namely optical character recognition, is used to recognize text in images. PyMuPDF library and OCR technology can achieve better text extraction effect.
[0175] In the above case where the policy file to be extracted is a PDF file, the PyMuPDF library can be used to read the text content when the policy file to be processed is an online original PDF policy file.
[0176] In the above case where the insurance policy document to be extracted is an image file, when the insurance policy document to be processed is an offline insurance policy of a photo or screenshot type, OCR technology can be used to recognize the text content in the image.
[0177] The policy information extraction method provided in the embodiment of the present application may be executed by the policy information extraction device 200. In the embodiment of the present application, the policy information extraction device 200 executing the policy information extraction method is taken as an example to illustrate the policy information extraction device 200 provided in the embodiment of the present application.
[0178] See also Figure 2 , is a schematic diagram of the structure of a device 200 for extracting insurance policy information provided in an embodiment of the present application. Figure 2 As shown, the insurance policy information extraction device 200 includes:
[0179] The acquisition module 201 is used to acquire the insurance policy document to be retrieved;
[0180] A first extraction module 202 is used to extract text content from the insurance policy document to be extracted to obtain a first text;
[0181] A removal module 203, used to remove noise information from the first text to obtain a second text;
[0182] A selection module 204, configured to select a target extraction model from a plurality of preset information extraction models according to the length of the second text, wherein the plurality of preset information extraction models correspond to text lengths in different ranges;
[0183] The second extraction module 205 is used to input the second text into the target extraction model to obtain the target core information; wherein the preset extraction rules of the target extraction model are predetermined, and the preset extraction rules include the extraction format of the target core information;
[0184] The storage module 206 is used to store the target core information in a database.
[0185] In some implementations, the removal module 203 may be specifically used to:
[0186] Get the cropping rule, which is used to denoise the text;
[0187] According to the cropping rule, the first text is cropped to obtain the second text.
[0188] In some implementations, the second extraction module 205 may be specifically configured to:
[0189] Input the target core information and the first text into the regular generation model, and output the intermediate cutting rules;
[0190] Verify the intermediate cutting rules based on the historical policy document information; the historical policy document includes the historical target core information and the historical first text;
[0191] Under the condition that the intermediate cutting rule passes the verification, the cutting rule is updated according to the intermediate cutting rule.
[0192] In some implementations, the second extraction module 205 may be specifically configured to:
[0193] Inputting the second text into the target extraction model to obtain the intermediate target core information;
[0194] Verify the intermediate target core information according to the extraction format;
[0195] Under the condition that the intermediate target core information passes the verification, confirm that the intermediate target core information is the target core information;
[0196] If the intermediate target core information fails to pass the verification, the step of inputting the second text into the target extraction model to obtain the intermediate target core information is returned to the execution until the target core information is obtained.
[0197] In some implementations, the root selection module 204 may be specifically configured to:
[0198] Segmenting the second text to obtain multiple paragraphs of the second text;
[0199] Count the number of characters in each paragraph;
[0200] According to the number of characters in each paragraph, the total number of characters in the second text is obtained;
[0201] Under the condition that the total number of characters is less than the preset total number of characters, selecting the first preset information extraction model as the target extraction model;
[0202] Under the condition that the total number of characters is greater than or equal to the preset total number of characters, the second preset information extraction model is selected as the target extraction model.
[0203] In some implementations, the storage module 206 may be specifically configured to:
[0204] Mapping the target core information to information to be stored in a preset data format; the preset data format is a data format recognizable by the database;
[0205] Generate database insert statements based on the information to be stored and the rule engine;
[0206] According to the database insert statement, the information to be stored is stored in the database.
[0207] In some implementations, the first extraction module 202 may be specifically configured to:
[0208] When the policy file to be extracted is a PDF file, the PyMuPDF library is used to extract the text content in the PDF file to obtain the first text;
[0209] When the insurance policy document to be extracted is a picture file, OCR technology is used to perform text recognition on the picture file to obtain the first text.
[0210] Since the insurance policy information extraction device 200 adopts all the technical solutions of the insurance policy information extraction method of the above embodiment, it at least has all the beneficial effects brought by the technical solutions of the above embodiment, which will not be described in detail here.
[0211] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0212] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.
[0213] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0214] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0215] In some embodiments, the memory 302 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0216] The processor 301 implements any one of the insurance policy information extraction methods in the above embodiments by reading and executing computer program instructions stored in the memory 302 .
[0217] In one example, the electronic device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0218] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0219] Bus 310 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0220] The electronic device can execute the insurance policy information extraction method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 2 Described is a method and device for extracting insurance policy information.
[0221] In addition, in combination with the insurance policy information extraction method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the insurance policy information extraction methods in the above embodiment is implemented.
[0222] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0223] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0224] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0225] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0226] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for extracting insurance policy information, characterized in that: include: Obtain the policy documents to be withdrawn; Extracting text content from the insurance policy document to be extracted to obtain a first text; Removing noise information from the first text to obtain a second text; According to the length of the second text, a target extraction model is selected from a plurality of preset information extraction models, wherein the plurality of preset information extraction models correspond to text lengths in different ranges; Inputting the second text into the target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information; The target core information is stored in a database.
2. The method for extracting insurance policy information according to claim 1, characterized in that: The removing noise information from the first text to obtain a second text includes: Acquire a cutting rule, where the cutting rule is used to perform denoising on the text; The first text is cropped according to the cropping rule to obtain the second text.
3. The method for extracting insurance policy information according to claim 2, characterized in that: After inputting the second text into the target extraction model to obtain the target core information, the insurance policy information extraction method further includes: Input the target core information and the first text into a regular generation model, and output an intermediate cutting rule; Verify the intermediate cutting rule according to the historical policy document information; the historical policy document includes the historical target core information and the historical first text; Under the condition that the intermediate cutting rule is confirmed to pass the verification, the cutting rule is updated according to the intermediate cutting rule.
4. The method for extracting insurance policy information according to claim 1, characterized in that: The step of inputting the second text into the target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information, including: Inputting the second text into the target extraction model to obtain intermediate target core information; Verifying the intermediate target core information according to the extraction format; Under the condition that the intermediate target core information passes the verification, confirming that the intermediate target core information is the target core information; If the intermediate target core information fails to pass the verification, the step of inputting the second text into the target extraction model to obtain the intermediate target core information is returned to the step until the target core information is obtained.
5. The method for extracting insurance policy information according to claim 1, characterized in that: The step of selecting a target extraction model from a plurality of preset information extraction models according to the length of the second text, wherein the plurality of preset information extraction models correspond to text lengths in different ranges, including: Segmenting the second text to obtain a plurality of paragraphs of the second text; Counting the number of characters in each of the paragraphs; Obtaining the total number of characters in the second text according to the number of characters in each of the paragraphs; Under the condition that the total number of characters is less than a preset total number of characters, selecting a first preset information extraction model as the target extraction model; Under the condition that the total number of characters is greater than or equal to the preset total number of characters, a second preset information extraction model is selected as the target extraction model.
6. The method for extracting insurance policy information according to claim 1, characterized in that: The storing the target core information in a database includes: Mapping the target core information into information to be stored in a preset data format; the preset data format is a data format recognizable by the database; Generate a database insert statement according to the information to be stored and the rule engine; According to the database insert statement, the information to be stored is stored in the database.
7. The method for extracting insurance policy information according to claim 1, characterized in that: The step of extracting text content from the insurance policy document to be extracted to obtain a first text includes: In the case where the insurance policy file to be extracted is a PDF file, the PyMuPDF library is used to extract the text content in the PDF file to obtain the first text; In the case that the insurance policy document to be extracted is a picture file, OCR technology is used to perform text recognition on the picture file to obtain the first text.
8. A device for extracting insurance policy information, characterized in that: include: The acquisition module is used to obtain the policy document to be extracted; A first extraction module, configured to extract text content from the insurance policy document to be extracted to obtain a first text; A removal module, used to remove noise information in the first text to obtain a second text; A selection module, configured to select a target extraction model from a plurality of preset information extraction models according to the length of the second text, wherein the plurality of preset information extraction models correspond to text lengths in different ranges; A second extraction module is used to input the second text into the target extraction model to obtain target core information; wherein a preset extraction rule of the target extraction model is predetermined, and the preset extraction rule includes an extraction format of the target core information; A storage module is used to store the target core information in a database.
9. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the insurance policy information extraction method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the insurance policy information extraction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Text information extracting method, device, computer equipment and storage medium
CA3148074A1
Text resource classification method and device, storage medium and electronic device
CN110019794A
Short message bill display method and device
CN110267222A
Text extraction method, device and equipment and storage medium
CN110781276A
Method and device for extracting structured information of text, equipment and medium
CN111753717A
