Language model-based information verification method, apparatus and device, and storage medium
Through the information verification method based on the language model, the problem of low inspection accuracy of traditional text insurance policy verification methods is solved, and the accurate verification and false alarm rate of insurance policy information of different formats is achieved, ensuring the accuracy of insurance policy information verification Sex and compatibility.
Patent Information
- Application Number
- CN202411259134.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional text policy verification methods have low inspection accuracy, which is prone to false alarms, and is difficult to be compatible with different policy formats and matching field values.
The information verification method based on the language model is adopted to obtain the strings in the insurance policy, layout and restore, and use the large language model to extract and compare fields to ensure verification accuracy and compatibility.
It improves the accuracy of policy information verification and reduces the false alarm rate, so that the system can effectively verify policy information in different formats and adapt to various layouts.
Smart Images

Figure CN119128226A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of data processing and financial technology, and in particular to a language model-based information verification method, device, computer equipment and computer-readable storage medium. Background Art
[0002] After the user purchases insurance, the insurance agent will upload the text policy and the corresponding information of the policyholder / insured, premium, total insured amount, insurance start and end dates, and applicable insurance terms in the insurance system. If a claim is made, the system will perform subsequent operations based on the information entered by the agent. If the information entered by the agent into the system is inconsistent with the information recorded in the policy, it may lead to problems such as non-payment or overpayment. Therefore, it is necessary to use the policy text verification method to verify the consistency of the key fields in the policy (name of the policyholder / insured, premium and total insured amount, etc.) with the corresponding field values uploaded by the agent to the system.
[0003] The traditional text policy verification method is to use optical character recognition (OCR) to extract the text position and text content in the text policy, then extract the key fields in the text policy based on the rule engine, and then compare the extracted key fields with the corresponding fields recorded in the system. However, the above traditional text policy verification method has a low accuracy rate and is prone to false positives.
[0004] Therefore, how to solve the low accuracy of traditional text insurance policy verification methods has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of the present invention is to provide an information verification method, device, equipment and computer-readable storage medium based on a language model, aiming to solve the technical problem of low verification accuracy of traditional text insurance policy verification methods.
[0006] To achieve the above object, the present invention provides an information verification method based on a language model, the information verification method comprising the following steps:
[0007] Acquire a character string in a target insurance policy, and restore the layout of the character string based on layout information of the character string in the target insurance policy;
[0008] Based on the target language model, extract the fields from the restored string to obtain the target fields;
[0009] Based on the target language module, the target field is compared with the system value to complete the key field verification of the target insurance policy.
[0010] In addition, to achieve the above-mentioned purpose, the present invention further provides an information verification device based on a language model, the information verification device based on a language model comprising:
[0011] A character layout restoration module, used for acquiring a character string in a target insurance policy, and restoring the layout of the character string based on layout information of the character string in the target insurance policy;
[0012] The target field extraction module is used to extract fields from the restored string based on the target language model to obtain the target field;
[0013] The target field verification module is used to compare the target field with the system value based on the target language module to complete the key field verification of the target insurance policy.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes a processor, a memory, and a language model-based information verification program stored in the memory and executable by the processor, wherein when the language model-based information verification program is executed by the processor, the steps of the language model-based information verification method as described above are implemented.
[0015] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a language model-based information verification program is stored, wherein when the language model-based information verification program is executed by a processor, the steps of the language model-based information verification method as described above are implemented.
[0016] The present application provides an information verification method based on a language model, the method obtains a string in a target policy, and based on the layout information of the string in the target policy, restores the layout of the string; based on the target language model, extracts fields from the restored string to obtain the target field; based on the target language module, compares the target field with the system value to complete the key field verification of the target policy. Through the above method, the present application first restores the layout information of the string in the target policy to input the string that conforms to the target policy format layout into the target language model, so that the target language model can verify the policy information of different formats, avoid the recognition abnormality of the verification information caused by the format problem, so that the target language model can effectively verify the policy information of any format. And through the semantic understanding ability of the target language model, the policy information is extracted and compared, which improves the verification accuracy of the policy information and reduces the verification false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1It is a flow chart of the first embodiment of the information verification method based on the language model of the present invention;
[0018] Figure 2 It is a flow chart of the second embodiment of the information verification method based on the language model of the present invention;
[0019] Figure 3 It is a flow chart of a third embodiment of the information verification method based on a language model of the present invention;
[0020] Figure 4 It is a schematic diagram of the information verification device based on the language model of the present invention;
[0021] Figure 5 The figure is a schematic diagram of the hardware structure of a computer device involved in an embodiment of the present invention.
[0022] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0025] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] The language model-based information verification method involved in the embodiment of the present invention is mainly applied to computer equipment. The language model-based information verification generation device can be a PC, a portable computer, a mobile terminal, or other device with display and processing functions.
[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0029] Reference Figure 1 , Figure 1 It is a flowchart of the first embodiment of the information verification method based on the language model of the present invention.
[0030] like Figure 1 As shown, an embodiment of the present invention provides an information verification method based on a language model, and the information verification method based on a language model includes steps S10 to S30.
[0031] In this embodiment, the information verification method based on the language model includes the following steps:
[0032] Step S10, obtaining a character string in a target insurance policy, and restoring the layout of the character string based on layout information of the character string in the target insurance policy;
[0033] The traditional text policy verification method is to use optical character recognition (OCR) to extract the text position and text content in the text policy, then extract the key fields in the text policy based on the rule engine, and then compare the extracted key fields with the corresponding fields recorded in the system. However, the above traditional text policy verification method has a low accuracy rate and is prone to false positives.
[0034] Specifically, the defects of traditional text policy verification methods are divided into two points: extraction defects and matching defects.
[0035] 1. Extraction defects: There are many formats of text policies (the formats of text policies for different types of insurance are different, and the formats of text policies for the same type of insurance from different institutions are also different). The traditional text policy verification method is based on the rule engine to extract policy information, so it is difficult to be compatible with all policy formats.
[0036] 2. Matching defects: The traditional text insurance policy verification method matches the values of the extracted key fields with the values of the key fields entered in the system based on the edit distance and other methods. This matching method can easily cause the system to generate false alarms.
[0037] In order to solve the above problems, the information verification method based on the language model provided in this embodiment uses the semantic understanding ability and generalization of the large language model to solve the extraction defects and matching defects of existing products. First, the layout information of the string in the target policy is restored to input the string that conforms to the target policy format layout into the target language model, so that the target language model can verify the policy information of different formats, avoid the recognition abnormality of the verification information caused by format problems, and enable the target language model to effectively verify the policy information of any format. And through the semantic understanding ability of the target language model, the policy information is extracted and compared, which improves the verification accuracy of the policy information and reduces the verification false alarm rate.
[0038] Specifically, any insurance policy is obtained as the target insurance policy. All Chinese characters, numbers, English letters and other texts in the target insurance policy are obtained as a string. The language model-based information verification method provided in this embodiment independently processes each different key field. For a certain key field, a multi-page text insurance policy PDF (PDF is used as an example in this embodiment, and the text insurance policy can also be in other formats such as doc format) is first divided into multiple single-page PDFs, and then each page of PDF is processed one by one. For each page of PDF, the text in the page of PDF is first converted into a string, and the layout information in the PDF is restored as much as possible using spaces and line breaks. Then, the large language model is used to determine whether the string contains the key field. If it contains the key field, the large language model is used to extract the field, and the field is compared to see if it is consistent with the system value.
[0039] Step S20: Based on the target language model, extract the field of the restored character string to obtain the target field;
[0040] The target language model in this embodiment is a large language model, which is an artificial intelligence technology used to understand and generate human language. The large language model is used to understand and generate various types of texts, including articles, dialogues, poems, stories, etc. by learning a large amount of text data. The generalization of the large language model is one of its most important features. Since the large language model learns a large amount of text data during the training process, it has a strong generalization ability and can be used to handle various tasks and problems. The large language model can answer questions in the question-and-answer system and can also have a dialogue with a chat robot, and can flexibly respond to various scenarios and tasks. In addition to generalization, the semantic understanding ability of the large language model is also one of its important features. The large language model can understand the deep meaning and contextual relationship of the text by learning the inherent laws and structure of the language. Therefore, the large language model can not only understand simple facts and information, but also complex concepts and semantic relationships. The large language model consumes more computing resources. During the dialogue process, the speed of each word output by the large language model is usually 10 words / s. Therefore, the number of words output is closely related to the timeliness of the large language model. In this embodiment, the open source Qwen72B is used as the basic large model. When the large model is used, the input of the large model is called Prompt.
[0041] Specifically, after restoring the string based on its layout information in the target policy PDF, the restored string is input into the target language model, and the target language model is used to determine whether the string contains the target field to be verified. If the string contains the target field, the target language model is used to extract the field, and the target field is compared with the system value to see if it is consistent. If the target field is not contained, the next policy is obtained as the target policy, and the process returns to step S10.
[0042] Step S30: Based on the target language module, the target field is compared with the system value to complete the key field verification of the target insurance policy.
[0043] In this embodiment, if the target field is included in the string, the target field is extracted using the target language model, and the target field is compared with the system value to see if it is consistent. If the target field is not included, the next insurance policy is obtained as the target insurance policy, and the process returns to step S10. Thus, by using a large language model to extract and match fields, the semantic understanding ability and generalization of the large language model are utilized to enable the insurance policy information verification method to adapt to various different formats, thereby reducing the model false alarm rate.
[0044] This embodiment provides an information verification method based on a language model, which obtains a string in a target policy, and restores the layout of the string based on the layout information of the string in the target policy; based on the target language model, extracts fields from the restored string to obtain the target field; based on the target language module, compares the target field with the system value to complete the key field verification of the target policy. In the above manner, the present application first restores the layout information of the string in the target policy to input the string that conforms to the target policy format layout into the target language model, so that the target language model can verify the policy information of different formats, avoiding the recognition abnormality of the verification information caused by the format problem, so that the target language model can effectively verify the policy information of any format. And through the semantic understanding ability of the target language model, the policy information is extracted and compared, which improves the verification accuracy of the policy information and reduces the verification false alarm rate.
[0045] Reference Figure 2 , Figure 2 It is a flow chart of the second embodiment of the information verification method based on language model of the present invention.
[0046] Based on the above Figure 1 In the embodiment shown, in this embodiment, the step S10 specifically includes:
[0047] Step S11, obtaining the target insurance policy, and splitting the target insurance policy according to the number of pages to obtain individual single-page insurance policies;
[0048] Step S12, performing character recognition and extraction on the single-page insurance policy respectively to obtain character strings corresponding to each single-page insurance policy;
[0049] Step S13, based on the layout information of the character string in the corresponding single-page insurance policy, restore the layout of the character string of each single-page insurance policy.
[0050] Furthermore, the character string is each character in each single-page insurance policy, and the step S13 specifically includes:
[0051] Obtain each character in each single-page insurance policy, and obtain the character position, average character height, and average character width of each character in the corresponding single-page insurance policy;
[0052] Determine the number of lines of each character in the corresponding single-page insurance policy based on the character position and the average character height;
[0053] Based on the character positions and the average width of the characters, the layout of the characters in the same row in the same single-page policy is restored until the layout restoration of the characters in all rows in all single-page policies is completed.
[0054] The step of restoring the layout of characters in the same row of the same single-page insurance policy based on the character positions and the average character width specifically includes:
[0055] Based on the character positions and the average width of the characters, space characters and / or line break characters are added to the characters in the same row in the same single-page policy to restore the layout of the characters in the same row in the same single-page policy.
[0056] In this embodiment, since the font format of the text insurance policy PDF is relatively uniform, this embodiment converts the single-page PDF into a string through the following four steps, and restores the PDF layout information using spaces and line breaks in the string.
[0057] 1. Use PDF parsing technology to obtain the text content and text position of the PDF page, and obtain the average height and average width of the PDF text on the page;
[0058] Second, using the average height of the text combined with the text position, a greedy algorithm is used to determine which characters belong to the same line;
[0059] 3. For the characters in the same line, based on the average width and position of the characters, use spaces to restore the content and layout of the characters in the line;
[0060] 4. Use spaces and line breaks to connect each line of text parsed so that the restored string is consistent with its layout format in the target policy.
[0061] Through the above method, the language model-based information verification method provided in this embodiment uses spaces and line breaks to restore the layout information of a single-page PDF file, so that the large model can effectively read the PDF file, and input the character string that conforms to the target policy format layout into the target language model, so that the target language model can verify the policy information in different formats, and can better adapt to rich and diverse text policy formats, thereby improving the compatibility of the information verification method and avoiding abnormal recognition of the verification information due to format problems, so that the target language model can effectively verify the policy information in any format.
[0062] Reference Figure 3 , Figure 3 It is a flowchart diagram of the third embodiment of the information verification method based on the language model of the present invention.
[0063] Based on the above Figure 1 In the embodiment shown, in this embodiment, the step S20 specifically includes:
[0064] Step S21, based on the target language model, according to the relevant information corresponding to the target field, performing the target field query on the restored character string;
[0065] Step S22: when the target field exists in the restored character string, extract the target field from the restored character string based on context semantics and the target language model.
[0066] In this embodiment, based on the target language model, the relevant information corresponding to the target field is queried, wherein the relevant information includes but is not limited to the meaning of the target field, the common format of the key field in the document policy, or the alias of the key field. After the corresponding structure of the string in the target policy is restored through spaces and line breaks. In order to avoid problems such as long sentences being cut off, unreasonable word segmentation, incorrect merging of text, and disordered text order when performing OCR recognition on the target policy, the target language model is used to comprehensively judge the characters according to the contextual semantics of each character in the target policy to extract accurate field information.
[0067] Furthermore, before comparing the target field with the system value based on the target language module, the method further includes:
[0068] Acquire historical samples whose comparison frequency exceeds a preset frequency threshold and / or whose comparison result false alarm rate exceeds a preset false alarm threshold as training samples;
[0069] A prompt training template is generated based on the training sample, and the target language model is generated based on the prompt training template, so as to perform enhanced training on high-frequency scenarios and model-prone error data based on the prompt training template.
[0070] Specifically, the model is trained in advance using the Prompt template, which is as follows:
[0071] You are a robot that can read articles. Your task is to determine whether the document contains {key field}
[0072]
Notes
[0073] * Further explanation of key fields 1
[0074] * Further explanation of key fields 2
[0075] * Further explanation of key fields 3
[0076] *If it contains {key field}, then output "Y"; otherwise, output "N"
[0077] [Example Start]
[0078] Example 1
[0079] Example 2
[0080] Example 3
[0081] [End of example]
[0082]
Document Content
[0083] {The string obtained by converting a single-page PDF to a string}
[0084]
Answer
[0085] Among them, the precautions are used to explain the target fields and standardize the output of the target language model. The explanation of the target fields includes but is not limited to the meaning of the target fields, the common format of the key fields in the document policy or the alias of the key fields.
[0086] Examples are mainly in the form of examples to enhance high-frequency scenarios (i.e., obtaining historical samples with a comparison frequency exceeding a preset frequency threshold to train the model) and places where the model is prone to errors (i.e., obtaining historical samples with a comparison result false alarm rate exceeding a preset false alarm threshold to train the model), thereby improving the judgment accuracy of the target language model. If the answer returned by the target language model contains Y, it means that the PDF page contains the target field, otherwise it is considered that it does not contain the target field.
[0087] Furthermore, before comparing the target field with the system value based on the target language module, the method further includes:
[0088] The target language model is iteratively trained based on preset training samples until the judgment accuracy of the target language model reaches a preset judgment accuracy and / or the judgment logic of the target language model complies with preset judgment rules.
[0089] In this embodiment, the model training is performed in advance through the Prompt template, and the Prompt template is as follows:
[0090] You are a robot that can read articles. Your task is to determine whether the document contains {key field}
[0091]
Notes
[0092] * Further explanation of key fields 1
[0093] * Further explanation of key fields 2
[0094] * Further explanation of key fields 3
[0095] *This document is a form image obtained by OCR, and the characters are sorted from top to bottom and from left to right.
[0096] The document structure is restored as much as possible using spaces and line breaks. Please note that the OCR recognition results may have problems such as long sentences being cut off, unreasonable word segmentation, incorrect merging of words, and disordered word order. You need to make a comprehensive judgment based on the context semantics to extract accurate information.
[0097] *If there are multiple {key fields}, please concatenate them together for output.
[0098] *Please only input the answer and do not input any extra content.
[0099] *If there is no {key field} in the document, please output "None"
[0100] [Example Start]
[0101] Example 1
[0102] Example 2
[0103] Example 3
[0104] [End of example]
[0105]
Document Content
[0106] {The string obtained by converting a single-page PDF to a string}
[0107]
Answer
[0108] Among them, the notes are used to explain the target fields and standardize the output of the target language model, as well as to explain the document content. Examples are mainly in the form of examples to enhance high-frequency scenarios and places where the model is prone to errors, so as to improve the judgment accuracy. If the answer returned by the target language model does not contain "none", it means that the model answer is the extraction result, and the extraction result is compared with the system value in the next step.
[0109] It is understandable that during extraction, it is still determined whether the document content contains the target field to avoid hallucinations in the model, thereby further improving the extraction accuracy of the model.
[0110] Furthermore, before using the target language model to extract the target field in the PDF, the target language model is trained through the Prompt template. The Prompt template is as follows:
[0111] You are a robot that can read articles. Your task is to determine whether the following two strings are consistent in content. Inconsistent formats do not affect the judgment of the content.
[0112]
Notes
[0113] * Requirement for judgment 1
[0114] * Requirement for judgment 2
[0115] * Requirement for judgment 3
[0116] *If the content is consistent, output "Y", otherwise output "N"
[0117] [Example Start]
[0118] Example 1
[0119] Example 2
[0120] Example 3
[0121] [End of example]
[0122] [String A]
[0123] {Key field system value}
[0124] [String B]
[0125] {Key field extraction value}
[0126]
Answer
[0127] Among them, the notes are used to give further explanations of the judgment accuracy (for example, the date field is accurate to the day or hour, and the address field only needs to be compared with the district and county, etc.) and judgment rules (for example, whether the field order affects the content consistency judgment result). In addition to standardizing the output of the target language model, the document content is also explained. Examples are mainly in the form of examples to enhance high-frequency scenarios and places where the model is prone to errors to improve the judgment accuracy. If the model outputs Y, it means that the system value is the same as the text policy. If the model outputs N, it means that the system value is different from the text policy.
[0128] Through the above method, this embodiment provides an information verification method based on a language model, which uses spaces and line breaks to restore the layout information of a single-page PDF file, so that the large model can effectively read the PDF file; and use the large model to extract and match fields, and use the semantic understanding ability and generalization of the large model to enable the algorithm to adapt to various different layouts and reduce the model false alarm rate; using process design, first use the large model to determine whether the target field is included (only need to output Y / N), if the target field is included, then extract and compare, improve the timeliness of the large model. Thus, the verification method of the insurance policy information has the following features:
[0129] 1. It has strong generalization and can adapt to a variety of text policy formats;
[0130] 2. Fewer false positives, used for semantic consistency comparison to reduce false positive rates;
[0131] 3. The development cycle is short. If a new policy type that needs to be verified is added in production, it can be quickly supported and launched online by adding examples in the prompt, further improving the verification efficiency.
[0132] See also Figure 4 , Figure 4 The present invention provides a functional module diagram of an information verification device based on a language model according to an embodiment of the present application.
[0133] like Figure 4 As shown, the information verification device 400 based on the language model includes:
[0134] A character layout restoration module 10 is used to obtain a character string in a target insurance policy, and restore the layout of the character string based on layout information of the character string in the target insurance policy;
[0135] A target field extraction module 20 is used to extract fields from the restored character string based on a target language model to obtain a target field;
[0136] The target field verification module 30 is used to compare the target field with the system value based on the target language module to complete the key field verification of the target insurance policy.
[0137] Furthermore, the character layout restoration module specifically includes:
[0138] An insurance policy splitting unit, used for acquiring the target insurance policy and splitting the target insurance policy according to the number of pages to obtain individual single-page insurance policies;
[0139] A character extraction unit, used to perform character recognition and extraction on the single-page insurance policy respectively, to obtain character strings corresponding to each single-page insurance policy;
[0140] The layout restoration unit is used to restore the layout of the character strings of each single-page insurance policy based on the layout information of the character strings in the corresponding single-page insurance policy.
[0141] Furthermore, the character string is each character in each single-page insurance policy, and the layout restoration unit specifically includes:
[0142] The layout parameter acquisition subunit is used to acquire each character in each single-page insurance policy, and acquire the character position, average character height and average character width of each character in the corresponding single-page insurance policy;
[0143] A character line number calculation subunit, used to determine the number of lines of each character in the corresponding single-page insurance policy based on the character position and the average character height;
[0144] The character layout restoration subunit is used to restore the layout of the characters in the same row in the same single-page policy based on the character positions and the average width of the characters, until the character layout restoration of all rows in all single-page policies is completed.
[0145] Furthermore, the character layout restoration subunit is also used for:
[0146] Based on the character positions and the average width of the characters, space characters and / or line break characters are added to the characters in the same row in the same single-page policy to restore the layout of the characters in the same row in the same single-page policy.
[0147] Furthermore, the target field extraction module specifically includes:
[0148] A target field query unit, configured to perform a target field query on the restored character string based on the target language model and according to relevant information corresponding to the target field;
[0149] The target field extraction unit is used to extract the target field from the restored character string based on context semantics and the target language model when the target field exists in the restored character string.
[0150] Furthermore, the language model-based information verification device 400 further includes:
[0151] A training sample generation module is used to obtain historical samples whose comparison frequency exceeds a preset frequency threshold and / or whose comparison result false alarm rate exceeds a preset false alarm threshold as training samples;
[0152] A language model generation module is used to generate a prompt training template based on the training sample, and to generate the target language model based on the prompt training template, so as to perform enhanced training on high-frequency scenarios and model-prone error data based on the prompt training template.
[0153] Furthermore, the language model-based information verification device 400 further includes:
[0154] The model iteration training module is used to iteratively train the target language model based on preset training samples until the judgment accuracy of the target language model reaches the preset judgment accuracy and / or the judgment logic of the target language model conforms to the preset judgment rules.
[0155] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0156] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0157] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0158] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0159] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any information verification method based on a language model.
[0160] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0161] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any information verification method based on the language model.
[0162] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0163] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0164] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0165] Acquire a character string in a target insurance policy, and restore the layout of the character string based on layout information of the character string in the target insurance policy;
[0166] Based on the target language model, extract the fields from the restored string to obtain the target fields;
[0167] Based on the target language module, the target field is compared with the system value to complete the key field verification of the target insurance policy.
[0168] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0169] Obtain the target insurance policy, and split the target insurance policy according to the number of pages to obtain individual single-page insurance policies;
[0170] Recognize and extract characters on the single-page insurance policies respectively to obtain character strings corresponding to each single-page insurance policy;
[0171] Based on the layout information of the character string in the corresponding single-page insurance policy, the layout of the character string of each single-page insurance policy is restored respectively.
[0172] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0173] Obtain each character in each single-page insurance policy, and obtain the character position, average character height, and average character width of each character in the corresponding single-page insurance policy;
[0174] Determine the number of lines of each character in the corresponding single-page insurance policy based on the character position and the average character height;
[0175] Based on the character positions and the average width of the characters, the layout of the characters in the same row in the same single-page policy is restored until the layout restoration of the characters in all rows in all single-page policies is completed.
[0176] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0177] Based on the character positions and the average width of the characters, space characters and / or line break characters are added to the characters in the same row in the same single-page policy to restore the layout of the characters in the same row in the same single-page policy.
[0178] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0179] Based on the target language model, according to the relevant information corresponding to the target field, query the target field on the restored character string;
[0180] When the target field exists in the restored character string, the target field is extracted from the restored character string based on context semantics and the target language model.
[0181] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0182] Acquire historical samples whose comparison frequency exceeds a preset frequency threshold and / or whose comparison result false alarm rate exceeds a preset false alarm threshold as training samples;
[0183] A prompt training template is generated based on the training sample, and the target language model is generated based on the prompt training template, so as to perform enhanced training on high-frequency scenarios and model-prone error data based on the prompt training template.
[0184] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0185] The target language model is iteratively trained based on preset training samples until the judgment accuracy of the target language model reaches a preset judgment accuracy and / or the judgment logic of the target language model complies with preset judgment rules.
[0186] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the language model-based information verification methods provided in the embodiments of the present application.
[0187] The computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.
[0188] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for verifying information based on a language model. It is characterized in that The information verification method comprises the following steps: Acquire a character string in a target insurance policy, and restore the layout of the character string based on layout information of the character string in the target insurance policy; Based on the target language model, extract the fields from the restored string to obtain the target fields; Based on the target language module, the target field is compared with the system value to complete the key field verification of the target insurance policy.
2. The information verification method based on the language model as claimed in claim 1, It is characterized in that The step of obtaining the character string in the target insurance policy and restoring the layout of the character string based on the layout information of the character string in the target insurance policy specifically includes: Obtain the target insurance policy, and split the target insurance policy according to the number of pages to obtain individual single-page insurance policies; Recognize and extract characters on the single-page insurance policies respectively to obtain character strings corresponding to each single-page insurance policy; Based on the layout information of the character string in the corresponding single-page insurance policy, the layout of the character string of each single-page insurance policy is restored respectively.
3. The information verification method based on language model as claimed in claim 2, It is characterized in that The character string is each character in each single-page insurance policy, and the layout restoration of the character string of each single-page insurance policy based on the layout information of the character string in the corresponding single-page insurance policy specifically includes: Obtain each character in each single-page insurance policy, and obtain the character position, average character height, and average character width of each character in the corresponding single-page insurance policy; Determine the number of lines of each character in the corresponding single-page insurance policy based on the character position and the average character height; Based on the character positions and the average width of the characters, the layout of the characters in the same row in the same single-page policy is restored until the layout restoration of the characters in all rows in all single-page policies is completed.
4. The information verification method based on the language model as claimed in claim 3, It is characterized in that The restoring the layout of the characters in the same row of the same single-page insurance policy based on the character positions and the average width of the characters specifically includes: Based on the character positions and the average width of the characters, space characters and / or line break characters are added to the characters in the same row in the same single-page policy to restore the layout of the characters in the same row in the same single-page policy.
5. The information verification method based on language model according to claim 1, It is characterized in that Based on the target language model, field extraction is performed on the restored string to obtain the target field, which specifically includes: Based on the target language model, according to the relevant information corresponding to the target field, query the target field on the restored character string; When the target field exists in the restored character string, the target field is extracted from the restored character string based on context semantics and the target language model.
6. The information verification method based on language model according to claim 1, It is characterized in that Before comparing the target field with the system value based on the target language module, the method further includes: Acquire historical samples whose comparison frequency exceeds a preset frequency threshold and / or whose comparison result false alarm rate exceeds a preset false alarm threshold as training samples; A prompt training template is generated based on the training sample, and the target language model is generated based on the prompt training template, so as to perform enhanced training on high-frequency scenarios and model-prone error data based on the prompt training template.
7. The information verification method based on a language model according to any one of claims 1 to 6, It is characterized in that Before comparing the target field with the system value based on the target language module, the method further includes: The target language model is iteratively trained based on preset training samples until the judgment accuracy of the target language model reaches a preset judgment accuracy and / or the judgment logic of the target language model complies with preset judgment rules.
8. An information verification device based on a language model, It is characterized in that The information verification device based on the language model comprises: A character layout restoration module, used for acquiring a character string in a target insurance policy, and restoring the layout of the character string based on layout information of the character string in the target insurance policy; The target field extraction module is used to extract fields from the restored string based on the target language model to obtain the target field; The target field verification module is used to compare the target field with the system value based on the target language module to complete the key field verification of the target insurance policy.
9. A computer device, It is characterized in that The computer device includes a processor, a memory, and a language model-based information verification program stored in the memory and executable by the processor, wherein when the language model-based information verification program is executed by the processor, the steps of the language model-based information verification method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a language model-based information verification program, wherein when the language model-based information verification program is executed by a processor, the steps of the language model-based information verification method according to any one of claims 1 to 7 are implemented.
