Text-based confidence acquisition method and apparatus, and electronic device
By introducing confidence evaluation into the output results of the information extraction model, the problem of difficulty in determining the accuracy of the output results of the information extraction model is solved, the efficiency of manual verification is improved, and accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202410806817.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The accuracy of the output results of the information extraction model cannot be effectively determined in the existing technology, which requires a large amount of manual verification and consumes human resources.
By obtaining the files to be processed and inputting them into the pre-trained information extraction model, the results to be processed are obtained, and then input into the pre-trained confidence model. The confidence model is obtained to evaluate the accuracy of the output results of the information extraction model, thereby reducing manual verification. workload.
It improves the efficiency of manual verification, reduces the workload of manual verification, and ensures the accuracy of the output results of the information extraction model.
Smart Images

Figure CN118780273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text-based confidence acquisition method, device and electronic equipment. Background Art
[0002] In the scenario of extracting information from text, the text information extraction model extracts corresponding information based on expert rules to obtain extraction results. Specifically, text information such as the title, author, core ideas, tables, etc. of the article can be extracted.
[0003] However, currently, after obtaining the extraction results, it is impossible to determine the accuracy of the extraction results, resulting in an unclear understanding of whether the extraction results output by the text information extraction model are accurate. All extraction results need to be manually verified, which consumes a lot of manpower. Summary of the invention
[0004] The present invention provides a text-based confidence acquisition method, device and electronic device to solve the defect in the prior art that it is impossible to determine whether the results of the model output are accurate. The accuracy of the output results of the information extraction model can be obtained, thereby reducing the workload of manual verification and improving the work efficiency of manual verification.
[0005] The present invention provides a text-based confidence acquisition method, the method comprising: Obtaining a file to be processed, and inputting the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model trained based on a sample file; The result to be processed and the file to be processed are input into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
[0006] According to a text-based confidence acquisition method provided by the present invention, before the step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain the confidence, the method further includes: Acquire a file to be determined, and input the file to be determined into the information extraction model to obtain a result to be determined; Based on the result to be determined, the pre-acquired calibration result and the file to be determined, the pre-acquired initial model is trained to obtain the confidence model.
[0007] According to a text-based confidence acquisition method provided by the present invention, the step of training a pre-acquired initial model based on the result to be determined, the pre-acquired calibration result and the file to be determined to obtain the confidence model includes: Determine positive samples and negative samples based on the to-be-determined results and the pre-acquired calibration results; Based on the to-be-determined file, the positive sample, and the negative sample, a pre-acquired initial model is trained to obtain the confidence model.
[0008] According to a text-based confidence acquisition method provided by the present invention, the result to be determined includes a plurality of first results, and the calibration result includes a plurality of second results; The step of determining positive samples and negative samples based on the result to be determined and the pre-acquired calibration result includes: when the first result is consistent with the second result, taking the first result as a positive sample; When the first result is inconsistent with the second result, the first result is taken as a negative sample.
[0009] According to a text-based confidence acquisition method provided by the present invention, the step of training a pre-acquired initial model based on the to-be-determined file, the positive sample and the negative sample to obtain the confidence model includes: Inputting the to-be-determined file into the initial model, performing feature extraction on the to-be-determined file based on a preset feature extraction algorithm, and obtaining an extraction result; Based on the relationship between the extraction result and the positive sample and the negative sample, the parameters of the initial model are adjusted until the initial model converges to obtain the confidence model.
[0010] According to a text-based confidence acquisition method provided by the present invention, the step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain the confidence includes: The result to be processed and the file to be processed are input into a pre-trained confidence model, and feature extraction is performed on the file to be processed based on a preset feature extraction algorithm to obtain a current extraction result corresponding to the result to be processed, and obtain a confidence level corresponding to the current extraction result.
[0011] The present invention also provides a text-based confidence acquisition device, the device comprising: A first acquisition module is used to acquire a file to be processed, and input the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model trained based on a sample file; An input module is used to input the result to be processed and the file to be processed into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
[0012] According to a text-based confidence acquisition device provided by the present invention, the device also includes: A second acquisition module is used to obtain the file to be determined before inputting the result to be processed and the file to be processed into a pre-trained confidence model to obtain the confidence, and input the file to be determined into the information extraction model to obtain the result to be determined; A training module is used to train a pre-acquired initial model based on the to-be-determined result, the pre-acquired calibration result and the to-be-determined file to obtain the confidence model.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned text-based confidence acquisition methods are implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of a text-based confidence acquisition method as described in any one of the above are implemented.
[0015] The present invention provides a text-based confidence acquisition method, device and electronic device, which obtains a file to be processed and inputs the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model trained based on a sample file, and the result to be processed and the file to be processed are input into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model. In this way, the confidence of the result to be processed output by the information extraction model can be obtained, that is, the accuracy of the result to be processed output by the information extraction model can be obtained, which facilitates the subsequent verification of the result to be processed based on the confidence, reduces the workload of manual verification, and can improve the work efficiency of manual verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is one of the flow charts of a text-based confidence acquisition method provided by the present invention; Figure 2 This is the second flow chart of a text-based confidence acquisition method provided by the present invention; Figure 3 It is a structural schematic diagram of a text-based confidence acquisition device provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] In order to obtain the accuracy of the output results of the information extraction model, the present invention discloses a text-based confidence acquisition method, device, electronic device, non-transitory computer-readable storage medium and computer program product. The following first introduces a text-based confidence acquisition method disclosed in the present invention: like Figure 1 As shown, the present invention discloses a text-based confidence acquisition method, the method comprising: S101, obtaining a file to be processed, and inputting the file to be processed into a pre-trained information extraction model to obtain a result to be processed.
[0020] When information extraction is performed using a pre-trained information extraction model, a file to be processed can be obtained and input into the pre-trained information extraction model, so that an extraction result output by the information extraction model, i.e., a result to be processed, can be obtained. The information extraction model is a model trained based on a sample file.
[0021] The file to be processed may be a file from which the user wants to extract information. The file to be processed may be a PDF file, a Word document, a PPT file, etc., which are all reasonable and are not specifically limited here.
[0022] In one implementation, the file to be processed can be input into the information extraction model, and the information extraction model extracts information from the file to be processed based on a pattern matching algorithm, thereby obtaining a result to be processed, wherein the result to be processed can be the position information of the text information to be processed in the file to be processed, can also be the font size information of the text information to be processed, can also be a processed file with key information annotated, and can also be a first word embedding vector. All of these are reasonable and are not specifically limited here.
[0023] As an implementation method, the to-be-processed file may include multiple to-be-processed pages, and the current to-be-processed page may be selected from the multiple to-be-processed pages, and then the current to-be-processed page may be input into the information extraction model, thereby obtaining the to-be-processed result corresponding to the current to-be-processed page. Among them, the current to-be-processed page may include only one to-be-processed page, or may include multiple to-be-processed pages, which is reasonable.
[0024] S102, inputting the result to be processed and the file to be processed into a pre-trained confidence model to obtain confidence.
[0025] After obtaining the results to be processed, the results to be processed and the files to be processed can be input into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the results to be determined and the files to be determined, and the results to be determined are the results obtained based on the files to be determined and the information extraction model.
[0026] Confidence is an indicator that can measure the gap between the unprocessed result output by the information extraction model and the actual result that the user actually wants to obtain. The higher the confidence, the closer the unprocessed result is to the actual result, that is, the higher the accuracy of the unprocessed result output by the information extraction model. Correspondingly, the lower the confidence, the greater the gap between the unprocessed result and the actual result, that is, the lower the accuracy of the unprocessed result output by the information extraction model.
[0027] In one embodiment, the confidence levels include multiple ones. After obtaining the confidence levels, each confidence level can be screened, and the data corresponding to the confidence levels lower than the preset confidence threshold can be screened out for subsequent manual verification. In this way, there is no need to manually verify all the results to be processed, but only the data corresponding to the confidence levels lower than the preset confidence threshold need to be locked for verification, which reduces the workload of manual verification, can improve the work efficiency of manual verification, and can achieve the purpose of reducing labor costs and improving efficiency.
[0028] It can be seen that the text-based confidence acquisition method provided by the present invention can obtain the to-be-processed file and input the to-be-processed file into a pre-trained information extraction model to obtain the to-be-processed result, wherein the information extraction model is a model trained based on the sample file, and the to-be-processed result and the to-be-processed file are input into the pre-trained confidence model to obtain the confidence, wherein the confidence model is a model trained based on the to-be-determined result and the to-be-determined file, and the to-be-determined result is a result obtained based on the to-be-determined file and the information extraction model. In this way, the confidence of the to-be-processed result output by the information extraction model can be obtained, that is, the accuracy of the to-be-processed result output by the information extraction model can be obtained, which is convenient for the subsequent verification of the to-be-processed result based on the confidence, reduces the workload of manual verification, and can improve the work efficiency of manual verification.
[0029] As an embodiment of the present invention, the training process of the above-mentioned information extraction model can be as follows: obtain the model to be trained and the sample file, obtain the sample label corresponding to the sample file, input the sample file into the model to be trained, obtain the training result, and adjust the model parameters of the model to be trained based on the difference between the training result and the sample label until the model to be trained converges to obtain the information extraction model.
[0030] The sample label may be the position information of the sample information in the sample file, the font size information of the sample information, a processed sample file with key information annotated, or a second word embedding vector. All of these are reasonable and are not specifically limited here.
[0031] In one implementation, the parameters of the model to be trained may be adjusted using a gradient descent algorithm, a stochastic gradient descent algorithm, etc., which are all reasonable and are not specifically limited here.
[0032] As an implementation mode of the present invention, before the step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain the confidence, the method may further include: Obtain a file to be determined, and input the file to be determined into the information extraction model to obtain a result to be determined.
[0033] In order to obtain a confidence model, the confidence model can be trained based on the extraction results output by the information extraction model so as to obtain the confidence later. The to-be-determined file can be obtained and input into the information extraction model to obtain the to-be-determined result.
[0034] The file to be determined may be a PDF file, a Word document, a PPT file, etc. The result to be determined may be the position information of the text information to be determined in the file to be determined, the font size information of the text information to be determined, a determined file with key information marked, or a third word embedding vector. All of these are reasonable and are not specifically limited here.
[0035] In one implementation, the file to be determined may be input into an information extraction model, and the information extraction model extracts information from the file to be determined based on a pattern matching algorithm, thereby obtaining a result to be determined.
[0036] As an implementation method, the to-be-determined file may include multiple to-be-determined pages, and the current to-be-determined page may be selected from the multiple to-be-determined pages, and then the current to-be-determined page may be input into the information extraction model, thereby obtaining the to-be-determined result corresponding to the current to-be-determined page. Among them, the current to-be-determined page may include only one to-be-determined page, or may include multiple to-be-determined pages, which is reasonable.
[0037] Based on the result to be determined, the pre-acquired calibration result and the file to be determined, the pre-acquired initial model is trained to obtain the confidence model.
[0038] After the result to be determined is obtained, the pre-acquired initial model may be trained based on the result to be determined, the pre-acquired calibration result and the file to be determined to obtain a confidence model.
[0039] The pre-acquired calibration result is the result that the user actually wants to obtain, and there is a corresponding relationship between the pre-acquired calibration result and the result to be determined. In one embodiment, the user can calibrate the file to be determined, so as to obtain the calibration result.
[0040] The calibration result may include the actual position information of the text information that the user actually wants to obtain in the to-be-determined file, the actual font size information of the text information that the user actually wants to obtain, the file that has been annotated with the key information that the user actually wants to obtain, and the fourth word embedding vector. All of these are reasonable and are not specifically limited here.
[0041] As an implementation method, the confidence model can be a binary classification model obtained through supervised training, specifically a support vector machine, logistic regression, ensemble tree model or deep neural network, which are all reasonable and are not specifically limited here.
[0042] It can be seen that the present invention can train a confidence model so as to subsequently obtain the confidence of the results to be processed output by the information extraction model, and the confidence model is trained based on the results to be determined output by the information extraction model, the calibration results obtained in advance, and the files to be determined. The confidence output by the confidence model can characterize the accuracy of the results to be processed output by the information extraction model.
[0043] As an embodiment of the present invention, the above-mentioned step of training the pre-acquired initial model based on the to-be-determined result, the pre-acquired calibration result and the to-be-determined file to obtain the confidence model may include: determining positive samples and negative samples based on the to-be-determined result and the pre-acquired calibration result.
[0044] In order to obtain a more accurate confidence model, and thus improve the reliability of the confidence output by the confidence model, positive samples and negative samples can be determined based on the results to be determined and the calibration results obtained in advance. Among them, positive samples are samples that can represent the information that the user actually wants to obtain. Negative samples are samples that are not the information that the user actually wants to obtain.
[0045] In one embodiment, the above-mentioned to-be-determined result may include multiple first results, and the above-mentioned calibration result may include multiple second results. The first results are compared with the second results in turn to see if they are consistent. If it is determined that the first result is consistent with the second result, it means that the first result is the information that the user actually wants to obtain, and therefore, the first result can be used as a positive sample.
[0046] When it is determined that the first result is inconsistent with the second result, it means that the first result is not the information that the user actually wants to obtain, so the first result can be used as a negative sample. In this way, positive samples and negative samples can be obtained.
[0047] As an implementation, the result to be determined can be represented by Y, the calibration result can be represented by Y', and then the positive sample can be represented by Y+, Y+=Y∩Y', that is, the positive sample is the intersection of the result to be determined and the calibration result.
[0048] Negative samples can be represented by Y-, Y-=Y'-Y∩Y', that is, the negative sample is the second result remaining in the calibration result after removing the positive sample, that is, the information that the information extraction model fails to recognize.
[0049] Based on the to-be-determined file, the positive sample, and the negative sample, a pre-acquired initial model is trained to obtain the confidence model.
[0050] After the positive samples and the negative samples are obtained, the pre-acquired initial model can be trained based on the to-be-determined file, the positive samples and the negative samples to obtain a confidence model.
[0051] In one embodiment, the file to be determined can be input into a pre-acquired initial model, and feature extraction is performed on the file to be determined based on a preset feature extraction algorithm to obtain an extraction result. Based on the relationship between the extraction result and the positive sample and the negative sample, the parameters of the initial model are adjusted until the initial model converges to obtain a confidence model.
[0052] The extraction result may include the position information of the text information to be determined in the file to be determined, the font size information of the text information to be determined, the determined extracted file with key information marked, or the fifth word embedding vector. All of these are reasonable and are not specifically limited here.
[0053] As an implementation mode of the present invention, the step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain the confidence may include: The result to be processed and the file to be processed are input into the pre-trained confidence model, and feature extraction is performed on the file to be processed based on a preset feature extraction algorithm to obtain the current extraction result corresponding to the result to be processed and the confidence corresponding to the current extraction result.
[0054] This is equivalent to the confidence model being able to calculate the probability that each first result in the results to be processed belongs to a positive sample, thereby obtaining the confidence corresponding to each first result, so that subsequent users can quickly locate information that may be erroneous based on the confidence, and perform subsequent processing on the information that may be erroneous. For example, the range of confidence z is 0<=z<=1. The smaller z is, the greater the probability of an error. Therefore, a threshold (for example, 0.5) can be set for locating errors. If the confidence of a sample is less than the threshold, the sample is judged to be erroneous. Erroneous samples can be manually processed according to business needs, and different thresholds can be set for different problems. This embodiment does not impose any special restrictions on the setting of thresholds.
[0055] In one embodiment, the result to be processed is the position information of the text information to be processed in the file to be processed. After the result to be processed and the file to be processed are input into a pre-trained confidence model, the feature information of the text information to be processed corresponding to the result to be processed can be extracted from the file to be processed based on a preset feature extraction algorithm and position information as the current extraction result, so that the confidence corresponding to the current extraction result can be obtained.
[0056] For example, the result to be processed 1 is the position information 1 of table 1 in the file to be processed 1. After the result to be processed 1 and the file to be processed 1 are input into the pre-trained confidence model, the feature information corresponding to the position information 1 can be extracted from the file to be processed 1 based on the preset feature extraction algorithm and the position information 1 as the current extraction result. In this way, the confidence corresponding to the current extraction result can be obtained, that is, the accuracy of the feature information corresponding to the position information 1 in the file to be processed 1 as table 1.
[0057] In another embodiment, the result to be processed is the font size information of the text information to be processed. After the result to be processed and the file to be processed are input into a pre-trained confidence model, the feature information of the text information to be processed corresponding to the result to be processed can be extracted from the file to be processed based on a preset feature extraction algorithm as the current extraction result, so that the confidence corresponding to the current extraction result can be obtained.
[0058] For example, the result to be processed 2 is the font size information 2 of the title 2 in the file to be processed 2. After the result to be processed 2 and the file to be processed 2 are input into the pre-trained confidence model, the feature information corresponding to the font size information 2 can be extracted from the file to be processed 2 based on the preset feature extraction algorithm and the font size information 2 as the current extraction result. In this way, the confidence corresponding to the current extraction result can be obtained, that is, the accuracy of the feature information corresponding to the font size information 2 in the file to be processed 2 as the title 2.
[0059] As an implementation method, the result to be processed is a processed file with marked key information. After the result to be processed and the file to be processed are input into a pre-trained confidence model, the feature information of the text information to be processed corresponding to the result to be processed can be extracted from the file to be processed based on a preset feature extraction algorithm as the current extraction result, so that the confidence corresponding to the current extraction result can be obtained.
[0060] For example, the result to be processed 3 is a processed file 3 with labeled key information 3. After the result to be processed 3 and the file to be processed 3 are input into the pre-trained confidence model, the feature information corresponding to the labeled key information 3 can be extracted from the file to be processed 3 based on the preset feature extraction algorithm and the processed file 3 with labeled key information 3 as the current extraction result. In this way, the confidence corresponding to the current extraction result can be obtained.
[0061] It can be seen that the text-based confidence acquisition method provided by the present invention can obtain the confidence of the to-be-processed result output by the information extraction model, that is, the accuracy of the to-be-processed result output by the information extraction model can be obtained.
[0062] Combine the following Figure 2 Introduce the steps of training the confidence model: S201, obtaining a file to be determined; S202, inputting the file to be determined into a pre-trained information extraction model to obtain a result to be determined; S203, obtaining a calibration result; S204, determining positive samples and negative samples based on the result to be determined and the calibration result; S205, inputting the file to be determined into the pre-acquired initial model, performing feature extraction on the file to be determined based on a preset feature extraction algorithm, and obtaining an extraction result; S206, based on the relationship between the extraction result and the positive sample and the negative sample, adjust the parameters of the initial model until the initial model converges to obtain a confidence model.
[0063] The text-based confidence acquisition method provided by the present invention is introduced below by way of example in conjunction with a specific embodiment, wherein the information extraction model is an industrial chain information extraction model A: Obtain N documents A to be determined, where the document A to be determined contains the industry: monocrystalline silicon, and the attribute corresponding to the industry: production capacity. Input the N documents A to be determined into the industrial chain information extraction model A in sequence, and obtain the sentences containing monocrystalline silicon and performance output by the industrial chain information extraction model A, and take the sentences containing monocrystalline silicon and performance as information set 1.
[0064] By manually annotating N sentences containing single crystal silicon and performance in the document A to be determined, an information set 2 is formed. The sentences that are consistent in information set 1 and information set 2 are used as positive samples, and the sentences in information set 2 except the sentences corresponding to the positive samples are used as negative samples.
[0065] Input N copies of documents A to be determined into the initial model A in sequence to obtain extraction results. Based on the relationship between the extraction results and positive samples and negative samples, adjust the parameters of the initial model A until the initial model A converges to obtain the confidence model A.
[0066] Obtain a document A to be processed, wherein the document A to be processed contains the industry: monocrystalline silicon, and the attribute corresponding to the industry: production capacity. Input the document A to be processed into the industrial chain information extraction model A to obtain the result A to be processed, and input the result A to be processed and the document A to be processed into the confidence model A. The confidence model A can calculate the probability that the first result A belongs to a positive sample for each first result A in the result A to be processed, thereby obtaining the confidence.
[0067] It can be seen that the text-based confidence acquisition method provided by the present invention can locate errors in the unprocessed results output by the text information extraction model, and can effectively guide subsequent data quality verification based on the confidence level, adjust the quality control priority according to the confidence level, and spend time on the places where the real errors occur, greatly improving the quality control efficiency.
[0068] A text-based confidence acquisition device provided by the present invention is described below. The text-based confidence acquisition device described below and the text-based confidence acquisition method described above can refer to each other.
[0069] like Figure 3 As shown, the present invention discloses a text-based confidence acquisition device, the device comprising: The first acquisition module 310 is used to acquire a file to be processed, and input the file to be processed into a pre-trained information extraction model to obtain a result to be processed.
[0070] The information extraction model is a model trained based on sample files.
[0071] The input module 320 is used to input the result to be processed and the file to be processed into a pre-trained confidence model to obtain confidence.
[0072] The confidence model is a model obtained by training based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
[0073] It can be seen that the text-based confidence acquisition device provided by the present invention obtains the file to be processed and inputs the file to be processed into a pre-trained information extraction model to obtain the result to be processed, wherein the information extraction model is a model obtained by training based on the sample file, and the result to be processed and the file to be processed are input into the pre-trained confidence model to obtain the confidence, wherein the confidence model is a model obtained by training based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model. In this way, the confidence of the result to be processed output by the information extraction model can be obtained, that is, the accuracy of the result to be processed output by the information extraction model can be obtained, which is convenient for the subsequent verification of the result to be processed based on the confidence, reduces the workload of manual verification, and can improve the work efficiency of manual verification.
[0074] As an embodiment of the present invention, the above device may further include: The second acquisition module is used to obtain the file to be determined before inputting the result to be processed and the file to be processed into the pre-trained confidence model to obtain the confidence, and input the file to be determined into the information extraction model to obtain the result to be determined.
[0075] A training module is used to train a pre-acquired initial model based on the to-be-determined result, the pre-acquired calibration result and the to-be-determined file to obtain the confidence model.
[0076] As an implementation mode of the present invention, the above training module may include: A determination unit is used to determine positive samples and negative samples based on the to-be-determined result and the pre-acquired calibration result.
[0077] A training unit is used to train a pre-acquired initial model based on the to-be-determined file, the positive sample and the negative sample to obtain the confidence model.
[0078] As an embodiment of the present invention, the above-mentioned result to be determined includes a plurality of first results, and the above-mentioned calibration result includes a plurality of second results.
[0079] The above-mentioned determination unit may include: When the first result is consistent with the second result, the first result is taken as a positive sample.
[0080] When the first result is inconsistent with the second result, the first result is taken as a negative sample.
[0081] As an implementation manner of the present invention, the training unit may include: The input subunit is used to input the to-be-determined file into the initial model, perform feature extraction on the to-be-determined file based on a preset feature extraction algorithm, and obtain an extraction result.
[0082] The adjustment subunit is used to adjust the parameters of the initial model based on the relationship between the extraction result and the positive sample and the negative sample until the initial model converges to obtain the confidence model.
[0083] As an implementation of the present invention, the input module 320 may include: An input unit is used to input the result to be processed and the file to be processed into a pre-trained confidence model, perform feature extraction on the file to be processed based on a preset feature extraction algorithm, obtain a current extraction result corresponding to the result to be processed, and obtain a confidence level corresponding to the current extraction result.
[0084] Figure 4An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a text-based confidence acquisition method, the method comprising: obtaining a file to be processed, and inputting the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model obtained by training based on a sample file, and inputting the result to be processed and the file to be processed into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model obtained by training based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
[0085] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a text-based confidence acquisition method provided by the above-mentioned methods.
[0087] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute a text-based confidence acquisition method provided by the above methods.
[0088] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A text-based confidence acquisition method, It is characterized in that The method comprises: Obtaining a file to be processed, and inputting the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model trained based on a sample file; The result to be processed and the file to be processed are input into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
2. According to the text-based confidence acquisition method of claim 1, It is characterized in that Before the step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain confidence, the method further includes: Acquire a file to be determined, and input the file to be determined into the information extraction model to obtain a result to be determined; Based on the result to be determined, the pre-acquired calibration result and the file to be determined, the pre-acquired initial model is trained to obtain the confidence model.
3. A text-based confidence acquisition method according to claim 2, It is characterized in that The step of training the pre-acquired initial model based on the result to be determined, the pre-acquired calibration result and the file to be determined to obtain the confidence model comprises: Determine positive samples and negative samples based on the to-be-determined results and the pre-acquired calibration results; Based on the to-be-determined file, the positive sample, and the negative sample, a pre-acquired initial model is trained to obtain the confidence model.
4. A text-based confidence acquisition method according to claim 3, It is characterized in that The to-be-determined result includes a plurality of first results, and the calibration result includes a plurality of second results; The step of determining positive samples and negative samples based on the result to be determined and the pre-acquired calibration result includes: when the first result is consistent with the second result, taking the first result as a positive sample; When the first result is inconsistent with the second result, the first result is taken as a negative sample.
5. A text-based confidence acquisition method according to claim 3 or 4, It is characterized in that The step of training the pre-acquired initial model based on the to-be-determined file, the positive sample, and the negative sample to obtain the confidence model comprises: Inputting the to-be-determined file into the initial model, performing feature extraction on the to-be-determined file based on a preset feature extraction algorithm, and obtaining an extraction result; Based on the relationship between the extraction result and the positive sample and the negative sample, the parameters of the initial model are adjusted until the initial model converges to obtain the confidence model.
6. A text-based confidence acquisition method according to any one of claims 1 to 4, It is characterized in that The step of inputting the to-be-processed result and the to-be-processed file into a pre-trained confidence model to obtain the confidence includes: The result to be processed and the file to be processed are input into a pre-trained confidence model, and feature extraction is performed on the file to be processed based on a preset feature extraction algorithm to obtain a current extraction result corresponding to the result to be processed, and obtain a confidence level corresponding to the current extraction result.
7. A text-based confidence acquisition device, It is characterized in that The device comprises: A first acquisition module is used to acquire a file to be processed, and input the file to be processed into a pre-trained information extraction model to obtain a result to be processed, wherein the information extraction model is a model trained based on a sample file; An input module is used to input the result to be processed and the file to be processed into a pre-trained confidence model to obtain confidence, wherein the confidence model is a model trained based on the result to be determined and the file to be determined, and the result to be determined is a result obtained based on the file to be determined and the information extraction model.
8. A text-based confidence acquisition device according to claim 7, It is characterized in that The device further comprises: a second acquisition module, which is used to acquire the file to be determined before inputting the result to be processed and the file to be processed into a pre-trained confidence model to obtain the confidence, and input the file to be determined into the information extraction model to obtain the result to be determined; A training module is used to train a pre-acquired initial model based on the to-be-determined result, the pre-acquired calibration result and the to-be-determined file to obtain the confidence model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the processor implements the steps of the text-based confidence acquisition method as described in any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of a text-based confidence acquisition method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Model training method and device, storage medium and electronic equipment
CN115618237A
Information extraction model acquisition method and system
CN116542250A
