An efficient text information extraction method and device
Patent Information
- Application Number
- CN202310355574.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-04-04
AI Technical Summary
[0004]有鉴于此,本申请提供了一种有效文本信息提取方法和装置,用于解决现有信息提取方式中,信息提取准确率低的问题
[0062] As can be seen from the above technical solutions, the effective text information extraction method and apparatus provided in this application, after obtaining the information to be extracted, determines whether there is only one target entity relationship in the text data to be identified that corresponds to the first entity in the information to be extracted. If there is only one target entity relationship corresponding to the first entity, then the text data to be identified is subjected to entity relationship information extraction processing to obtain a target entity object that has the target entity relationship with the first entity; then the text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified. The target entity object and the target digital combination information are matched and combined to obtain an effective information set corresponding to the information to be extracted.
Smart Images

Figure CN116402054B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and more specifically, to an effective method and apparatus for extracting text information. Background Technology
[0002] With the development of computer technology, more and more data information can be flexibly entered and queried online. However, the format of the entered data information is not uniform and the content is complex. The required key information cannot be obtained and stored in a timely manner. Therefore, it is necessary to extract some specific key information from the data information and store it so that when this key information is needed next time, it is not necessary to search for it from a large amount of data information.
[0003] However, in existing technologies, after acquiring a large amount of data, key information, such as entity objects, entity relationships, and numerical information, is typically extracted manually by operators. During this process, due to the operator's subjectivity, the extraction of key information may be influenced by personal factors, resulting in low accuracy. Furthermore, due to the limited number of operators and the large workload, the error rate in information extraction is even higher. Summary of the Invention
[0004] In view of this, this application provides an effective text information extraction method and apparatus to solve the problem of low information extraction accuracy in existing information extraction methods.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] An effective method for extracting text information includes:
[0007] Obtain information to be extracted, wherein the information to be extracted includes at least one first entity, one second entity, and one text data to be identified, and there is a debt transfer relationship between the first entity and the second entity;
[0008] Determine whether there is only one target entity relationship corresponding to the first entity in the text data to be identified;
[0009] If there is only one target entity relationship in the text data to be identified that corresponds to the first entity, then the text data to be identified is subjected to entity relationship information extraction processing to obtain a target entity object that has the target entity relationship with the first entity;
[0010] The text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified.
[0011] The target entity object is matched and combined with the target number combination information to obtain a set of valid information corresponding to the information to be extracted.
[0012] Preferably, the method further includes:
[0013] If there are multiple target entity relationships corresponding to the first entity in the text data to be identified, and there are multiple first entities in the text data to be identified, then based on the character position of each first entity in the text data to be identified, the text data to be identified is divided into multiple text data blocks, and the first entity includes at least one entity;
[0014] Entity relationship information extraction processing is performed on each of the text data blocks to obtain target entity objects in each of the text data blocks that have the target entity relationship with the first entity, and the target entity objects include at least one entity;
[0015] Perform digital information matching and detection processing on each of the text data blocks to obtain target digital combination information corresponding to each text data block;
[0016] Based on the correspondence between the target entity object, the target number combination information and the text data block, a matching and combination process is performed to obtain a set of valid information corresponding to the information to be extracted. The set of valid information includes multiple subsets of valid information based on the text data block. Each subset of valid information includes the target entity object and the target number combination information corresponding to the text data block.
[0017] Preferably, the method further includes:
[0018] If there are multiple target entity relationships corresponding to the first entity in the text data to be identified, and there is only one character of the first entity in the text data to be identified, and it is impossible to divide the text data to be identified into multiple text data blocks, then the text data to be identified will be processed by entity relationship information extraction to obtain target entity objects that have the target entity relationship with the first entity in the text data to be identified, and the target entity objects include at least two.
[0019] The text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified.
[0020] The target entity object and the target number combination information are matched and combined to obtain a set of valid information corresponding to the information to be extracted.
[0021] Preferably, the step of extracting entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity includes:
[0022] The text data to be identified is input into the entity relationship extraction model for processing to obtain entity object number one that has the target entity relationship with the first entity.
[0023] The text data to be identified is input into the entity object matching model for entity object matching processing to obtain the second entity object, which includes at least one entity.
[0024] Delete entities that are identical to the first entity and the second entity from the second entity to obtain candidate entity objects;
[0025] The target entity object is determined based on the similarity between the first entity object and the candidate entity objects;
[0026] The entity relationship extraction model and the entity object matching model are trained based on different model structures, using the first entity, the second entity, and the text data of the sample information as feature values, and the entity objects in the text data that have the target entity relationship with the first entity as target values.
[0027] Preferably, the method further includes:
[0028] Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data;
[0029] The sample dataset is randomly divided into a training dataset and a test dataset;
[0030] By statistically analyzing all sample information in the training dataset, at least one question expression reflecting the relationship of the target entity is obtained;
[0031] The problem statement is written into a preset extraction model structure to obtain the extraction model structure to be trained;
[0032] Based on the extraction model structure to be trained and the training dataset, the model is trained to obtain an initial entity relationship extraction model that matches the extraction model structure to be trained. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train the initial entity relationship extraction model.
[0033] The problem statement of the initial entity relationship extraction model is tested and adjusted based on the test dataset to obtain the entity relationship extraction model.
[0034] Preferably, the method further includes:
[0035] Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data;
[0036] The sample dataset is randomly divided into a training dataset and a test dataset;
[0037] By statistically analyzing the textual forms of entity objects in the text data corresponding to all sample information in the training dataset, at least one matching expression reflecting the entity object is obtained.
[0038] The matching expression is written into a preset matching model structure to obtain an initial matching model structure;
[0039] The initial entity object matching model is trained based on the training dataset and the initial matching model structure. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train the initial entity object matching model.
[0040] The matching formula of the initial entity object matching model is tested and adjusted based on the test dataset to obtain the entity object matching model.
[0041] Preferably, the step of performing digital information matching and detection processing on the text data to be identified to obtain target digital combination information corresponding to the text data to be identified includes:
[0042] At least one candidate number combination is obtained from the text data to be identified based on a specific number matching formula, wherein the specific number matching formula includes at least a matching formula that identifies two specific number combination forms;
[0043] Examine the position of the numeric character in each candidate numeric combination to determine whether the position of the character is within a preset position range of the position of the preset keyword.
[0044] Delete the candidate number combination information corresponding to the position of the number character within the preset position range to obtain the target candidate number combination information;
[0045] Detect the commonalities of the target candidate number combination information, and determine the abnormal number combination information in the target candidate number combination information that does not contain the commonalities;
[0046] Delete abnormal number combinations from the target candidate number combination information to obtain the target number combination information.
[0047] Preferably, the method further includes:
[0048] Create a local database;
[0049] Store the set of valid information in the local database;
[0050] Create a query interface in the local database, which is used to query combination information of numbers or entity objects.
[0051] An effective text information extraction device includes:
[0052] The information to be extracted unit is used to acquire information to be extracted, wherein the information to be extracted includes at least one first entity, one second entity, and one text data to be identified, and there is a debt transfer relationship between the first entity and the second entity;
[0053] An entity relationship determination unit is used to determine whether there is only one target entity relationship corresponding to the first entity in the text data to be identified;
[0054] The target entity extraction unit is used to perform entity relationship information extraction processing on the text data to be identified if there is only one target entity relationship corresponding to the first entity in the text data to be identified, so as to obtain a target entity object that has the target entity relationship with the first entity.
[0055] The target digit extraction unit is used to perform digit information matching and detection processing on the text data to be identified, and to obtain target digit combination information corresponding to the text data to be identified.
[0056] An information set unit is used to match and combine the target entity object with the target digital combination information to obtain a valid information set corresponding to the information to be extracted.
[0057] Preferably, the device further includes:
[0058] A text data partitioning unit is used to divide the text data to be identified into multiple text data blocks based on the character position of the first entity in the text data to be identified if there are multiple target entity relationships corresponding to the first entity in the text data to be identified. The first entity includes at least one entity.
[0059] The second target entity extraction unit is used to perform entity relationship information extraction processing on each of the text data blocks to obtain target entity objects in each of the text data blocks that have the target entity relationship with the first entity, and the target entity object includes at least one entity.
[0060] The second target number extraction unit is used to perform digital information matching and detection processing on each text data block to obtain target number combination information corresponding to each text data block.
[0061] An information combination unit is used to perform matching and combination processing based on the correspondence between the target entity object, the target number combination information and the text data block to obtain a valid information set corresponding to the information to be extracted. The valid information set includes multiple valid information subsets based on the text data block. The valid information subsets include the target entity object and the target number combination information corresponding to the text data block.
[0062] As can be seen from the above technical solutions, the effective text information extraction method and apparatus provided in this application, after obtaining the information to be extracted, determines whether there is only one target entity relationship in the text data to be identified that corresponds to the first entity in the information to be extracted. If there is only one target entity relationship corresponding to the first entity, then the text data to be identified is subjected to entity relationship information extraction processing to obtain a target entity object that has the target entity relationship with the first entity; then the text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified. The target entity object and the target digital combination information are matched and combined to obtain an effective information set corresponding to the information to be extracted.
[0063] This application embodiment obtains effective information by performing entity relationship information extraction processing and digital information matching and detection processing on the information to be extracted. Compared with the prior art, it is more automated and can objectively and timely process a large amount of information to be extracted. By performing entity relationship information extraction processing on the text data to be identified, target entity objects that have target entity relationships with the first entity can be accurately extracted from the text data to be identified. Furthermore, in the process of obtaining target digital information, not only is digital combination information matched in the text data to be identified, but the digital combination information can also be detected to exclude abnormal numbers, ensuring the accuracy of the extracted target digital combination information. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0065] Figure 1 A flowchart illustrating a method for extracting effective text information provided in an embodiment of this application;
[0066] Figure 2 This is a schematic diagram illustrating the relationship between the target entities of the first entity provided in the embodiments of this application;
[0067] Figure 3 This is another flowchart illustrating the effective text information extraction method provided in the embodiments of this application;
[0068] Figure 4 This is another flowchart illustrating the effective text information extraction method provided in the embodiments of this application;
[0069] Figure 5 This application provides an schematic diagram illustrating the segmentation of text information to be identified, as shown in the embodiments of this application.
[0070] Figure 6 This is a schematic diagram of a structure of an effective text information extraction device provided in an embodiment of this application. Detailed Implementation
[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0072] Reference Figure 1 This document illustrates a flowchart of a method for extracting valid text information provided in an embodiment of this application. This method can be used on servers, mobile devices, etc., to extract valid information from input or logged-in information based on certain preset conditions or rules. Specifically, the flowchart of the valid text information extraction method may include:
[0073] Step S110: Obtain the information to be extracted, which includes at least a first entity, a second entity, and text data to be identified.
[0074] Information to be extracted can be obtained through various means. For example, it can be obtained directly from the information registration interface. After the user enters specific information in the form of a registration information form and uploads it, the registration information can be obtained directly from the upload port as the information to be extracted, and then effective information can be extracted. Alternatively, the registration information of each user stored on the second platform can be obtained from the second platform, and the registration information can be used as the information to be extracted, and then effective information can be extracted from each piece of information to be extracted.
[0075] Typically, when users fill in registration information, they follow the registration format (form) corresponding to the registration type to complete the registration. The information to be extracted is included in the registered content. Information in a specific format can be obtained for extraction. Based on this format, the information content can be roughly categorized into a first entity, a second entity, and text data to be identified. The first entity and the second entity represent two different entity objects, and a specific relationship may exist between them, such as a debt relationship or a debt transfer relationship. This application embodiment specifically uses a debt transfer relationship as an example. The text data to be identified in the extracted information can specifically describe the debt transfer relationship between the first entity and the second entity, as well as information such as accounts payable, transfer amount, and target transaction party. This can include specific text forms such as text and numbers.
[0076] Step S120: Does the text data to be identified have only one target entity relationship corresponding to the first entity?
[0077] The target entity relationship is distinct from the relationship between the first entity and the second entity; it is the target entity relationship between the first or second entity described in the text data to be identified and another entity object. However, the target entity relationship may not be explicitly expressed in the text data to be identified. In such cases, a preliminary judgment needs to be made on the target entity relationship existing in the text data to determine the subsequent strategy for extracting effective information from the text data to be identified.
[0078] In this embodiment of the application, entity objects that have a target entity relationship with the first entity and other valid information can be extracted, referring to... Figure 2 The schematic diagram illustrating the target entity relationships of the first entity provided in this embodiment of the application can include the following four cases. Among them, Figure 2 In this context, S, S1, S2, and S3 all represent the first entity, and A, B, C, and D represent entity objects that have a relationship with the first entity as described in the target entity. The first case is as follows: Figure 2 of Figure 2-1As shown, the first entity has only one entity S, and the text data to be identified only discloses one target entity relationship corresponding to the first entity; the second case is as follows. Figure 2 of Figure 2-2 As shown, the text data to be identified contains multiple first entities. Figure 2-2 Taking three first entities as an example, where the first entities are S1, S2, and S3 respectively, and each first entity has only one corresponding target entity relationship; the third case is as follows. Figure 2 of Figure 2-3 As shown, the text data to be identified contains only one first entity S, but the first entity S has the target entity relationship with entity objects A, B, C, and D respectively; the fourth case is as follows. Figure 2 of Figure 2-4 As shown, there are multiple first entities in the text data to be identified, namely S1, S2, and S3. However, unlike the second case where each first entity has only one corresponding target entity relationship, the fourth case combines the second and third cases. As shown in the figure, S1 has two corresponding target entity relationships and entity objects, while the first entities S2 and S3 each have one corresponding target entity relationship and entity object.
[0079] Based on the analysis of the target entity relationships corresponding to the first entity object, the first case is the most basic relationship situation, in which there is only one first entity in the text data to be identified, and the first entity has only one corresponding target entity relationship. In other cases, there are multiple target entity relationships. Based on this consideration, effective information can be extracted from the most basic relationship situation, and for more complex cases, additional conditions can be added to the basic situation for further processing.
[0080] When initially determining whether there is only one target entity relationship with the first entity object in the text data to be identified, Natural Language Processing (NLP) technology can be used to identify the number of first entities and the number of corresponding relationships in the text data. Specifically, a QA structure can be used to construct specific questions to determine the number of target entity relationships in the text data. Alternatively, the number of characters in the text data can be used to determine whether there is only one target entity relationship corresponding to the first entity. In this step, the method for determining the number of target entity relationships for the first entity in the text data is not specifically limited.
[0081] Step S130: Extract entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity.
[0082] This step is performed after step S120 above determines that there is only one target entity relationship with the first entity object in the text data to be identified. The target entity relationship is extracted from the text data to be identified, and the entity object corresponding to the target entity relationship is extracted to obtain the first entity and the entity object, wherein the entity object is valid information. The first entity is deleted, and the entity object is determined to be the target entity object.
[0083] The target entity object can be extracted from the text data to be identified using a specific model. For example, a pre-defined model structure can be used for modeling, and a large amount of sample information can be obtained for model training and testing to obtain a specific model capable of extracting entity objects corresponding to the target entity relationships. Based on the specific model, the text data to be identified is processed to obtain the target entity object. Alternatively, all entity objects can be extracted from the text data to be identified, and entity objects identical to the first and second entities can be deleted. The remaining entity objects can be identified as the target entity objects. Another option is to combine the above two extraction methods: process the text data to be identified based on the specific model to obtain the first entity object, and then use a name matching method to extract the second entity object from the text data to be identified. By comparing the first and second entity objects, entity objects with repeated names or high name similarity are identified as the target entity objects.
[0084] The effective information extracted in this embodiment is based on the target entity relationship location. Therefore, the processing idea for extracting effective information in this embodiment is to first determine the number of target entity relationships from the text data to be identified, and then extract the effective information corresponding to each target entity relationship for each target entity relationship.
[0085] Therefore, when the text data to be identified contains more than one target entity relationship, the text data can be divided into multiple text data blocks based on a certain rule. Each text data block may contain one or more target entity relationships, but the number of target entity relationships in each resulting text data block is less than the number of target entity relationships in the original text data. Then, effective information extraction processing is performed on each text data block to obtain the effective information corresponding to each text data block. The above method can process complex text data with intricate relationship descriptions in a more organized manner, obtaining more accurate effective information. Specific processing steps are described below.
[0086] Step S140: Perform digital information matching and detection processing on the text data to be identified to obtain target digital combination information corresponding to the text data to be identified.
[0087] Step S130 is to extract text information from the text data to be identified, namely the text name representing the entity object. The text data to be identified also includes numerical combination information corresponding to each text name, such as order number, invoice number, etc. The numerical combination information is also part of the valid information to be extracted.
[0088] Numerical information can be identified directly from the text data to be identified by matching all the numerical information. Then, all the obtained numbers are sorted according to their character coordinates in the text to obtain a long numerical sequence. This long numerical sequence is then divided according to a preset number of digits to obtain one or more combinations of numerical information. However, the numerical combinations obtained by the above method may have misaligned digits. In this embodiment, the number of digits can be fixed. A fixed number of digit combinations is matched from the text data to be identified, and anomaly detection is performed on each obtained numerical combination to eliminate anomalies and obtain the target numerical combination.
[0089] For example, if the text data to be identified is "Transfer amount: 125000, Invoice number 12345678, Date 20000222, Party B transfers the debt owed to Party A to Party C", the matched numerical information is "12500012345678". The valid information to be extracted is the invoice number, which is a fixed combination of 8 consecutive digits. Therefore, the obtained numerical information can be divided into 8-digit sequences, resulting in the invoice number "12500012". However, this method is prone to errors in the extracted valid numerical information. Further, a fixed 8-digit sequence can be extracted as a numerical combination. Matching only the 8-digit combination from the text data to be identified yields the numerical combinations "12345678" and "20000222". Further testing of these numerical combinations reveals that "20000222" corresponds to the keyword "date", which is time information and can be deleted. The final target number combination information, i.e., the invoice information, is "12345678".
[0090] Furthermore, the number of digits in the matching numerical combination information of the text data to be identified can be set. It can be adjusted according to the number of digits in the valid numerical information, and can be 8 digits, or numerical information with special symbols, etc., allowing for flexible adjustment. The detection of numerical combination information can be based on the explicitly stated type of numbers in the text data to be identified. For example, "20000222" is explicitly stated as a date in the text data to be identified, so it can be excluded; or anomaly detection models can be used for further exclusion.
[0091] Step S150: Match and combine the target entity object with the target number combination information to obtain a set of valid information corresponding to the information to be extracted.
[0092] Since the above extraction steps are all for the case where there is only one target entity relationship in the text data to be extracted that corresponds to the first entity, i.e. the first case described in step 120, the extracted target entity object and target number combination information are in one-to-one correspondence, and based on this combination, a set of effective information corresponding to the information to be extracted is obtained.
[0093] However, when there is more than one first entity and more than one entity object that has a target entity relationship with the first entity, it is necessary to clearly define the correspondence between the obtained target entity object and the target number combination information, and combine them according to the correspondence to ensure the orderliness and accuracy of the effective information.
[0094] This application embodiment obtains effective information by performing entity relationship information extraction and digital information matching and detection processing on the information to be extracted. Compared with the prior art, it is more automated and can objectively and timely process a large amount of information to be extracted. By performing entity relationship information extraction processing on the text data to be identified, target entity objects that have target entity relationships with the first entity can be accurately extracted from the text data to be identified. Furthermore, in the process of obtaining target digital combination information, not only is digital combination information matched in the text data to be identified, but the digital combination information can also be detected to exclude abnormal numbers, ensuring the accuracy of the extracted target digital combination information.
[0095] Next, this application embodiment will further introduce the method for extracting effective text information.
[0096] The previous section introduced how to extract effective information when there is only one target entity relationship corresponding to the first entity in the text data to be identified. The following section will discuss how to extract effective information when there are multiple target entity relationships corresponding to the first entity in the text data to be identified, i.e., when the text data to be identified describes a similar... Figure 2 middle Figure 2-2 , Figure 2-3 as well as Figure 2-4 In the case of such a situation, the processing flow for the text data to be identified will be further described below.
[0097] Reference Figure 3 It illustrates another flowchart of the effective text information extraction method implemented in this application, specifically including:
[0098] Step S210: Obtain information to be extracted, wherein the information to be extracted includes at least a first entity, a second entity, and text data to be identified.
[0099] Step S220: Does the text data to be identified have only one target entity relationship corresponding to the first entity?
[0100] The steps S210 and S220 are respectively with Figure 1 The steps S110 and S120 shown correspond to each other, and similarly, their descriptions in the preceding text are identical. After determining in step S210 that multiple target entity relationships corresponding to the first entity exist in the text data to be identified, the following steps are performed:
[0101] Step S230: If there are multiple first entities in the text data to be identified, and the judgment result is "yes", that is, if there are multiple first entities in the text data to be identified, then proceed to step S240.
[0102] Step S240: Based on the character position of each of the first entities in the text data to be identified, divide the text data to be identified into multiple text data blocks.
[0103] The first entity includes at least one entity. It is understood that each first entity character in the text data to be identified can represent a different entity object.
[0104] Step S250: Extract entity relationship information from each of the text data blocks to obtain the target entity object in each of the text data blocks.
[0105] Refer to the second scenario described in step S120, namely... Figure 2 In Figure 2-2 The text data to be identified can be divided into three text data blocks, which correspond to entities S1, S2, and S3 respectively. Thus, there are three target entity objects extracted, namely entity objects A, B, and C.
[0106] However, there is another situation. Figure 2-2If entity objects A, B, and C in the text are the same entity object M, that is, entity S1, entity S2, and entity S3 all have the target entity relationship with the entity object M only, then the target entity object extracted from the three text data blocks is M. Therefore, the target entity object extracted in step S250 includes at least one entity.
[0107] Step S260: Perform digital information matching and detection processing on each of the text data blocks to obtain target digital combination information corresponding to each text data block.
[0108] Step S270: Match and combine the target entity object, the target number combination information, and the text data block to obtain a valid information set corresponding to the information to be extracted.
[0109] Specifically, a matching and combination process is performed based on the correspondence between the target entity object, the target number combination information, and the text data block to obtain a set of valid information corresponding to the information to be extracted. The set of valid information includes multiple subsets of valid information based on the text data block. Each subset of valid information includes the target entity object and the target number combination information corresponding to the text data block.
[0110] The above description can be used as a reference. Figure 2 of Figure 2-2 and Figure 2-4 The diagram illustrates relationships where multiple first entities exist, or a single first entity divides the text data to be identified according to the text portion corresponding to that first entity, specifically through character division. (Refer to...) Figure 5 , Figure 5 This is an application illustration of segmenting text information to be identified according to an embodiment of this application. A single horizontal line in the figure represents the entire text data to be identified. The name of each first entity is found from the text data, and the character coordinates corresponding to the first character of the name are recorded, as shown in s1, s2, and s3. Each first entity includes at least one entity. The text between the character coordinates of two adjacent first entities is extracted as a text data block. This text data block corresponds to the first entity whose character coordinates are relatively earlier among the two adjacent first entities. Figure 5 In the text data block, there is a correspondence between the text data blocks s1 and s2 and the first entity at character coordinate s1. Similarly, there is a correspondence between the text data blocks s2 and s3 and the first entity at character coordinate s2. Based on this correspondence, the corresponding target entity object and target number combination information can be extracted from the text data blocks.
[0111] In addition, there is another situation, such as Figure 2 of Figure 2-3 As shown, in this situation, the text to be identified may only have one character of the first entity, making segmentation impossible. Therefore, the embodiments of this application propose the following... Figure 4 The diagram shown illustrates another process for extracting effective text information in this situation, which may include:
[0112] Step S310: Obtain the information to be extracted, which includes at least a first entity, a second entity, and text data to be identified.
[0113] Step S320: Does the text data to be identified have only one target entity relationship corresponding to the first entity?
[0114] The steps S310 and S320 are respectively with Figure 1 The steps S110 and S120 shown correspond to each other, and similarly, their descriptions in the preceding text are identical. After determining in step S310 that multiple target entity relationships corresponding to the first entity exist in the text data to be identified, the following steps are performed:
[0115] Step S330: If there are multiple first entities in the text data to be identified, and the result is "no", that is, if there is only one first entity in the text data to be identified, then proceed to step S340.
[0116] Step S340: Extract entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity.
[0117] Step S350: Perform digital information matching and detection processing on the text data to be identified to obtain target digital combination information corresponding to the text data to be identified.
[0118] Step S360: Match the target entity object with the target number combination to obtain a set of valid information corresponding to the information to be extracted.
[0119] Steps S340, S350, and S360 correspond to steps S130, S140, and S150 as described above, respectively. Please refer to the description above for details.
[0120] It is understood that the above description of the text data to be identified can be used as a reference. Figure 2 of Figure 2-3The diagram illustrates a relationship where there is a first entity, but multiple entity objects have the target entity relationship with the first entity. If only one character of the first entity exists in the text data to be identified, it's impossible to divide the text data with multiple target entity relationships into multiple text data blocks based on character coordinates and extract valid information from each block individually. Instead, the entire text data to be identified can be directly processed for valid information extraction to obtain a corresponding set of valid information. This set of valid information includes at least two sets of target entity objects and target number combinations corresponding to each target entity object.
[0121] However, because the text descriptions in the text data to be identified vary, the same relationship may require different processing methods. For example, if the first text data to be identified is "Party A has transaction relationships with Party B, Party C, and Party D respectively.", this text data contains multiple target entity relationships and target entity objects corresponding to the first entity, Party A, but only one character for the first entity "Party A" exists. Since it cannot be divided according to character coordinates, the effective information in the text data corresponding to "Party A has transaction relationships with Party B, Party C, and Party D respectively" is directly extracted. However, the second text data to be identified, "Party A has a transaction relationship with Party B; Party A has a transaction relationship with Party C; Party A has a transaction relationship with Party D," has the same correspondence as the above "Party A has transaction relationships with Party B, Party C, and Party D respectively." However, since there are multiple characters for the first entity "Party A," the second text data to be identified can be divided into three text data blocks based on the character coordinates: "Party A has a transaction relationship with Party B," "Party A has a transaction relationship with Party C," and "Party A has a transaction relationship with Party D." Effective information can then be extracted from each of the three text data blocks to obtain the target entity object and target number combination information corresponding to each text data block.
[0122] Furthermore, the process of extracting entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity can specifically include:
[0123] The text data to be identified is input into an entity relationship extraction model for processing to obtain a first entity object that has the target entity relationship with the first entity; the text data to be identified is input into an entity object matching model for entity object matching processing to obtain a second entity object, the second entity object including at least one entity; entities identical to the first entity and the second entity are deleted from the second entity object to obtain candidate entity objects; the target entity object is determined based on the similarity between the first entity object and the candidate entity objects.
[0124] The entity relationship extraction model and the entity object matching model are trained based on different model structures, using the first entity, the second entity, and the text data of the sample information as feature values, and the entity objects in the text data that have the target entity relationship with the first entity as target values.
[0125] Specifically, after the text data to be identified is input into the entity relation extraction model, the entity relation extraction model processes the text data according to a specific format to obtain the final input expression for information extraction. For example, the entity relation extraction model in this embodiment is trained on the basis of the BERT (Bidirectional Encoder Representation from Transformers) model and the QA structure. Therefore, the input text data to be identified into the entity relation extraction model needs to be processed according to the model structure and requirements. That is, the final input expression corresponding to the text data to be identified is "[CLS]+Question_token+[SEP]+Paragraph_token+[SEP]", where "Paragraph" is the text content of the text data to be identified, and the token is obtained using the BasicTokenizer built into the BERT model.
[0126] For example, Paragraph: Accounts receivable under commercial contract number ABCD-2020-06-22, with an amount of RMB (in words) Four Million Yuan and a payment date of May 31, 2021, have been transferred to China ** Limited Company. China ** Limited Company holds all rights to the above accounts receivable, and the promised payer for this accounts receivable is ** Construction Group Co., Ltd. The above Paragraph represents the specific content of the text data to be identified for extraction. After inputting this text data into the entity relationship extraction model, the model will perform preliminary processing on the text information corresponding to the above Paragraph, obtaining the model input formula: "[CLS]+Question_token+[SEP]+Paragraph_token+[SEP]".
[0127] After obtaining the model input, the entity relationship extraction model extracts entity objects from the Paragraph based on the Question in the input. The Question is related to the target entity relationship and is applied to the entity relationship extraction model. Specifically, the creation process of the entity relationship extraction model is described in detail below. The specific process of creating the entity relationship extraction model is as follows:
[0128] Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with a target entity relationship with the first entity in the text data; randomly divide the sample dataset into a training dataset and a test dataset; statistically analyze all sample information in the training dataset to obtain at least one question expression reflecting the target entity relationship; write the question expression into a preset extraction model structure to obtain an extraction model structure to be trained; train the model based on the extraction model structure to be trained and the training dataset to obtain an initial entity relationship extraction model that matches the extraction model structure to be trained, wherein the training process uses the text data corresponding to each sample information in the training dataset as feature values and the entity object as the target value to train the initial entity relationship extraction model; test and adjust the question expression of the initial entity relationship extraction model based on the test dataset to obtain the entity relationship extraction model.
[0129] In the sample dataset, each sample information text data has only one first entity and one entity object that has a target entity relationship with the first entity. Only information with the most basic relationship is identified as sample information.
[0130] The model's preset extraction structure is trained based on the BERT model structure, employing a QA task to identify entity objects in the text data to be identified. Specifically, a question is constructed that contains references to the target entity relationships, and then the question is used to find answers from the text data to be identified, i.e., the "paragraph" of the model input. The answers are the extracted entity objects. The QA task is a common task in NLP machine reading comprehension, capable of extracting text fragments as answer outputs. Based on this, entity objects can be extracted from the text data to be identified.
[0131] If the model predicts the start_logit (the confidence level of the starting position as the answer) and end_logit (the confidence level of the ending position as the answer) of the token at each position in the Paragraph, then the overall values are obtained as start_logits and end_logits. If the position with the highest probability of start_logits is A, and the position with the highest probability of end_logits is B, and a single answer is output for a selected value, then the string between positions A and B is extracted as the desired answer.
[0132] Question refers to the question format mentioned in the embodiments of this application. The question format requires statistical analysis of a large amount of sample information to obtain a large number of keywords or key sentences that can characterize the relationship of the target entity. The keywords and key sentences are then arranged and combined to obtain multiple question formats.
[0133] Specifically, this application embodiment requires extracting target entity objects from the text data to be identified that have a specific transaction transfer relationship with a first entity. The transaction transfer relationship is that a second entity transfers its debt to the first entity to the target entity object. Therefore, the target entity relationship is determined as a transaction transfer relationship, with the first entity as the transferor and the second entity as the transferee. The target entity object can be defined as a transaction object. By statistically analyzing the descriptions of the transaction transfer relationship in the text data of the training dataset and mining the characteristics of these descriptions, it can be concluded that in scenarios where certain keywords appear in the text data, multiple question formulas can be constructed. Based on these question formulas, it is possible to determine that a transaction transfer relationship exists between two entities and to extract the transaction object.
[0134] Based on the keywords obtained above, a problem-based approach can be constructed as follows:
[0135] 1. If the term "counterpartner" appears in the text, and the transferor's name also appears in the text, then the question can be formatted as: Question = Transferor's name + "Which company is the counterparty?", or Question = "Which company is the transferor's counterparty?";
[0136] 2. If the word "debtor" appears in the text, the question can be formatted as: Question = "Which company is the debtor?".
[0137] 3. If the phrase "promised payment" appears in the text, the question format can be: Question = "Which company is making the promised payment?".
[0138] 4. If the term "accounts receivable" appears in the text, and the transferor's name also appears in the text, then the question format can be: Question = "The account receivable to be transferred is" + transferor's name + "With which company are the accounts receivable generated?", or Question = "The account receivable to be transferred is the account receivable generated by the transferor with which company?";
[0139] 5. If none of the above conditions 1 to 4 are met, the default Question is "Which company is the payer of the accounts receivable?".
[0140] The above-mentioned question expressions are all written into the preset extraction model structure to obtain the extraction model structure to be trained. The training dataset is input into the extraction model structure to be trained for training to obtain the initial entity relationship extraction model. During testing, the text data in the test dataset is input into the initial entity relationship extraction model for processing, and the target entity object is output. The target entity object is compared with the entity objects in the test training set. Based on the differences between the two, the question expressions are adjusted by adding, deleting, or modifying them. The test is repeated, and this process is repeated until the optimal question expression and the final entity relationship extraction model are obtained. Entity objects are extracted from the text data to be identified based on the entity relationship extraction model.
[0141] When extracting valid information, the entity relationship extraction model only extracts entity object number one. To avoid incomplete names and extraction errors in entity object number one, this embodiment of the application, after processing the text data to be identified by the entity relationship extraction model, further inputs the text data to be identified into an entity object matching model. The entity object matching model performs name matching from the identified text data to obtain the specific entity object name, i.e., entity object number two. Subsequently, the entity object number one and entity object number two extracted by the two methods are compared and detected to obtain a more accurate target entity object.
[0142] The specific process of creating the entity object matching model may include:
[0143] Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data; randomly divide the sample dataset into a training dataset and a test dataset; statistically analyze the text forms of entity objects in the text data corresponding to all sample information in the training dataset to obtain at least one matching expression reflecting the entity object; write the matching expression into a preset matching model structure to obtain an initial matching model structure; train based on the training dataset and the initial matching model structure to obtain an initial entity object matching model, wherein the training process uses the text data corresponding to each sample information in the training dataset as feature values and the entity object as the target value to train the initial entity object matching model; test and adjust the matching expression of the initial entity object matching model based on the test dataset to obtain the entity object matching model.
[0144] The sample dataset obtained is the same as the sample dataset obtained when creating the entity relationship model. When obtaining the sample dataset, a large amount of sample information can be collected first. This sample information is information with a specific format targeting a particular aspect. Further, the number of entity objects in the text data of each sample information that have a target entity relationship with the first entity is counted. Sample information with more than one entity object is filtered out, and only sample information with one entity object is included in the sample dataset for subsequent training of the entity object matching model and entity relationship extraction model.
[0145] By analyzing the textual forms of the entity names of various entities in the text data of the statistical sample information, multiple keywords can be obtained. In this embodiment, it can be set that most of the entity objects to be extracted from the effective information are companies. Therefore, after analyzing the sample data, the keywords obtained are mostly suffixes of company names or names of relevant departments within the company, such as "Limited Company," "Finance Department," and "Research Institute." These keywords are then arranged and combined, and adjusted according to the textual form and model structure in the text data to obtain a matching expression that can match entity objects in the text data. The following example uses regular expression matching, and the matching expression is written using regular expression syntax as follows:
[0146] Matching formula 1: "(counterpartie|payer|payer|debtor|buyer|buyer)(is|is|:|:)?([\u4e00-\u9fa5A-Za-z]{2,40}(business unit|research institute|company|hospital|factory|center))";
[0147] Matching formula 2: "(Guaranteed by)(.{2,40}(Business Unit|Research Institute|Company|Hospital|Factory|Center))(";
[0148] Matching formula 3: "(to|for)(.{2,40}(business unit|research institute|company|hospital|factory|center))(.)*(provide)".
[0149] Based on the syntax standard of regular expression matching and the keywords obtained from the statistical sample dataset, at least one matching expression is obtained. The above matching expression is written into the preset matching model structure for training, so that multiple second entity objects can be matched from the text data to be identified in the input model according to the matching expression in the model. Not all of the obtained second entity objects are the target entity objects. They need to be compared and fused with the first entity objects to obtain the target entity objects of the information to be extracted.
[0150] Specifically, entity object #1 and entity object #2 are compared to check if there are any entity objects with high similarity. High similarity can be defined as the overlap of the names of the two entity objects exceeding a certain set value, in which case the names of the two entity objects can be merged. For example, if entity object #1 has an entity object named "Hunan ** Construction Labor Services" and entity object #2 has an entity object named "Hunan ** Construction Labor Services Co., Ltd.", the two names have high overlap, and it is obvious that the entity object's name was not fully extracted by the entity relationship extraction model. Therefore, the two names can be merged to obtain "Hunan ** Construction Labor Services Co., Ltd." as the target entity object.
[0151] After obtaining valid information in text form, it is necessary to perform digital information matching and detection processing on the text data to be identified to obtain target digital combination information corresponding to the text data to be identified. The specific matching and detection process is as follows:
[0152] At least one candidate number combination is obtained from the text data to be identified based on a specific number matching formula, wherein the specific number matching formula includes at least a matching formula that identifies two specific number combination forms;
[0153] Examine the position of the numeric character in each candidate numeric combination to determine whether the position of the character is within a preset position range of the position of the preset keyword.
[0154] Delete the candidate number combination information corresponding to the position of the number character within the preset position range to obtain the target candidate number combination information;
[0155] Detect the commonalities of the target candidate number combination information, and determine the abnormal number combination information in the target candidate number combination information that does not contain the commonalities;
[0156] Delete abnormal number combinations from the target candidate number combination information to obtain the target number combination information.
[0157] The specific number matching formula can be adjusted according to the specific form of the numerical information to be extracted. In this embodiment, the invoice number in the text data to be extracted is set to be an 8-digit consecutive number. The matching formula can be set to "\d{8}". Based on this matching formula, the consecutive 8-digit number combination information can be matched and extracted from the text data to be recognized. In addition, by statistically analyzing a large amount of sample information or invoice numbers, a matching formula can be set for special forms of invoice numbers to prevent missing invoice numbers that appear in a specific form in the text data to be recognized. For example, "Invoice number: 12345678-12345679" contains a connector, or not only connectors but also other special symbols. One or more matching formulas written in regular expression syntax can be set to match the special symbols, such as "\d{8}\-+\d{8}|\d{8}\-+\d{8}|d{8}\~+\d{8}". Based on this matching formula, the start and end two invoice numbers connected by the connector can be obtained, and then they can be further divided and combined according to a specific number of digits.
[0158] The matched candidate number combinations need further detection to prevent abnormal values from being mixed in, which could lead to incorrect valid information. In this embodiment, two methods are used to detect abnormal numbers. One is character detection, which requires first determining the character coordinates (positions) of each candidate number combination. Abnormal numbers are usually number combinations that conform to a specific number matching pattern, so it is necessary to determine whether they are abnormal numbers based on the information type. Typically, there are keywords indicating the type of number combination information near the character coordinates, such as date, amount, or order number. For example, if "signing date 20220222" is matched using a consecutive 8-digit number matching pattern, the resulting number combination is "20220222". Based on the character coordinates, the keyword "date" is found near this number combination, clearly indicating its type. It does not belong to the invoice number category and can be deleted from the candidate number combination information to obtain the target candidate number combination information.
[0159] Another approach is to determine the presence of anomalies in candidate number combinations by detecting their similarity. This involves detecting commonalities among the candidate number combinations, such as consecutive numbers or identical prefixes. Number combinations with outliers typically lack these commonalities. Based on this, anomaly-prone number combinations are identified and removed, yielding the target number combination. Additionally, outlier detection can be performed using an "isolated forest model." This model identifies anomalies based on the distance between number combinations, allowing for their removal and the acquisition of the target number combination.
[0160] In summary, by combining the target entity object and target digital information of the information to be extracted, a set of valid information corresponding to the information to be extracted is obtained, thus completing the extraction of valid information from the information to be extracted.
[0161] After obtaining valid information, it can be archived for faster querying and retrieval later, saving time. This requires creating one or more local databases to store the obtained valid information, as well as the corresponding information to be extracted. This allows for self-checking of any erroneous valid information not detected during the extraction process. To facilitate user queries, a query interface can be created in the local databases. Users can simply input any information from the valid information into the query interface to automatically retrieve and display the results.
[0162] Below is a common practical application of the effective text information extraction method provided in this application. Typically, after a platform collects user information, it needs to archive it. However, although the information filled in by the user follows a fixed table format, the effective information is mixed in with a large amount of text description and needs to be extracted. An example of registration information on a financing registration platform is as follows:
[0163] Transferor (Name): Shaanxi **** Manufacturing Co., Ltd.
[0164] Transferee (Name): Shenzhen **** Co., Ltd.
[0165] Registration date: 2020 / 03 / 19
[0166] Registration expiration date: 2021 / 03 / 18
[0167] Property Description: Transfer Amount: RMB 1,000; Buyer Confirmation Letter No. JD987654321; Contract No. XA-XB-XFL01-CG-19 between Shaanxi *** Co., Ltd. and Shaanxi **** Manufacturing Co., Ltd.; Contract Name: **Comprehensive Renovation Project DK-1** Procurement Contract; Invoice No.: 12345678, 23456789.
[0168] The above registration information is based on a fixed registration format and includes simple information categorization. However, some valid information remains mixed in with the aforementioned property description text, requiring extraction. The property description text indicates that Shaanxi **** Manufacturing Co., Ltd. transferred accounts receivable between itself and Shaanxi *** Co., Ltd. to the transferee (Shenzhen **** Co., Ltd.). The valid information to be extracted includes the transaction counterparty (Shaanxi *** Co., Ltd.) and the invoice number. This involves extracting information from both physical entities and numerical combinations, which can be achieved using the aforementioned method for extracting valid text information.
[0169] In this model, the transferor (name) is equivalent to the first entity, the transferee (name) is equivalent to the second entity, and the property text description can be considered as the text data to be identified. A debt transfer relationship exists between the transferor (name) and the transferee (name), and the target entity relationship refers to the debt relationship with the transferor (name). The above information is the main reference information for extracting valid information. Further, it is preliminarily determined whether there is only one debt relationship corresponding to the transferor's name in the property text description. It is determined that there is only one debt relationship in the property text description, so there is no need to segment the property text description. It can be directly input into the entity relationship extraction model and the entity object matching model for processing to obtain the transaction object, namely, Shaanxi *** Co., Ltd. Then, numerical matching and detection processing is performed on the property text description to obtain the invoice numbers corresponding to the transaction described in the property text description, namely 12345678 and 23456789.
[0170] The transaction objects and invoice numbers obtained above are combined to obtain a set of valid information, which is then paired with the original registration information and stored in the local database for easy verification and retrieval.
[0171] The effective text information extraction device provided in the embodiments of this application is described below. The effective text information extraction device described below can be referred to in correspondence with the effective text information extraction method described above.
[0172] like Figure 6 The diagram shown is a structural schematic of the information extraction device provided in this embodiment. This effective text information extraction device may include:
[0173] The information to be extracted acquisition unit 100 is used to acquire information to be extracted, wherein the information to be extracted includes at least one first entity, one second entity, and one text data to be identified, and there is a debt relationship between the first entity and the second entity;
[0174] The entity relationship determination unit 200 is used to determine whether there is only one target entity relationship corresponding to the first entity in the text data to be identified;
[0175] The target entity extraction unit 300 is used to perform entity relationship information extraction processing on the text data to be identified if there is only one target entity relationship corresponding to the first entity in the text data to be identified, so as to obtain a target entity object that has the target entity relationship with the first entity.
[0176] The target digit extraction unit 400 is used to perform digit information matching and detection processing on the text data to be identified, and obtain target digit combination information corresponding to the text data to be identified.
[0177] Information set unit 500; used to match and combine the target entity object with the target digital combination information to obtain a valid information set corresponding to the information to be extracted.
[0178] This application embodiment obtains effective information by performing entity relationship information extraction processing and digital information matching and detection processing on the information to be extracted. Compared with the prior art, it is more automated and can objectively and timely process a large amount of information to be extracted. By performing entity relationship information extraction processing on the text data to be identified, target entity objects that have target entity relationships with the first entity can be accurately extracted from the text data to be identified. Furthermore, in the process of obtaining target digital information, not only is digital information matched in the text data to be identified, but the digital information can also be detected to exclude abnormal numbers, ensuring the accuracy of the extracted target digital information.
[0179] Preferably, the device further includes:
[0180] A text data partitioning unit is used to divide the text data to be identified into multiple text data blocks based on the character position of the first entity in the text data to be identified if there are multiple target entity relationships corresponding to the first entity in the text data to be identified. The first entity includes at least one entity.
[0181] The second target entity extraction unit is used to perform entity relationship information extraction processing on each of the text data blocks to obtain target entity objects in each of the text data blocks that have the target entity relationship with the first entity, and the target entity object includes at least one entity.
[0182] The second target number extraction unit is used to perform digital information matching and detection processing on each text data block to obtain target number combination information corresponding to each text data block.
[0183] An information combination unit is used to perform matching and combination processing based on the correspondence between the target entity object, the target number combination information and the text data block to obtain a valid information set corresponding to the information to be extracted. The valid information set includes multiple valid information subsets based on the text data block. The valid information subsets include the target entity object and the target number combination information corresponding to the text data block.
[0184] Preferably, the device further includes:
[0185] The third target entity extraction unit is used to perform entity relationship information extraction processing on the text data to be identified if there are multiple target entity relationships corresponding to the first entity in the text data to be identified, and there is only one character of the first entity in the text data to be identified, and it is impossible to divide the text data to be identified into multiple text data blocks. This process yields target entity objects that have the target entity relationship with the first entity in the text data to be identified, and the target entity objects include at least two.
[0186] The third target digit extraction unit is used to perform digit information matching and detection processing on the text data to be identified, and obtain target digit combination information corresponding to the text data to be identified.
[0187] The third unit of the information set is used to match and combine the target entity object and the target number combination information to obtain a valid information set corresponding to the information to be extracted.
[0188] Preferably, the target entity extraction unit 300 includes:
[0189] The entity model processing subunit is used to input the text data to be identified into the entity relationship extraction model for processing, and obtain an entity object No. 1 that has the target entity relationship with the first entity.
[0190] The matching model processing subunit is used to input the text data to be identified into the entity object matching model for entity object matching processing to obtain a second entity object, wherein the second entity object includes at least one entity;
[0191] The entity filtering subunit is used to delete entities that are the same as the first entity and the second entity from the second entity to obtain candidate entity objects;
[0192] The target entity determination subunit is used to determine the target entity object based on the similarity between the first entity object and the candidate entity object;
[0193] The entity relationship extraction model and the entity object matching model are trained based on different model structures, using the first entity, the second entity, and the text data of the sample information as feature values, and the entity objects in the text data that have the target entity relationship with the first entity as target values.
[0194] Preferably, it further includes:
[0195] The sample acquisition subunit is used to acquire a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data;
[0196] The sample data partitioning subunit is used to randomly divide the sample dataset into a training dataset and a test dataset.
[0197] The question-based acquisition subunit is used to statistically analyze all sample information in the training dataset to obtain at least one question reflecting the relationship of the target entity.
[0198] The model structure setting subunit is used to write the problem into the preset extraction model structure to obtain the extraction model structure to be trained.
[0199] The model training subunit is used to train the model based on the extraction model structure to be trained and the training dataset to obtain an initial entity relationship extraction model that matches the extraction model structure to be trained. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train the initial entity relationship extraction model.
[0200] The initial model testing subunit is used to test and adjust the problem expression of the initial entity relationship extraction model based on the test dataset, so as to obtain the entity relationship extraction model.
[0201] Preferably, it further includes:
[0202] The sample information acquisition second subunit is used to acquire a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data;
[0203] The sample data is divided into a second sub-unit, which is used to randomly divide the sample dataset into a training dataset and a test dataset.
[0204] The matching sub-unit is used to statistically analyze the text form of entity objects in the text data corresponding to all sample information in the training dataset, and obtain at least one matching expression that reflects the entity object.
[0205] The matching model structure setting subunit is used to write the matching formula into the preset matching model structure to obtain the initial matching model structure.
[0206] The matching model training subunit is used to train based on the training dataset and the initial matching model structure to obtain an initial entity object matching model. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train and obtain the initial entity object matching model.
[0207] The matching model testing subunit is used to test and adjust the matching formula of the initial entity object matching model based on the test dataset to obtain the entity object matching model.
[0208] Preferably, the target digit extraction unit 400 includes:
[0209] A number matching subunit is used to match at least one candidate number combination information from the text data to be identified based on a specific number matching formula, wherein the specific number matching formula includes at least a matching formula that identifies two specific number combination forms.
[0210] The numeric character detection subunit is used to examine the numeric character position of each candidate numeric combination information and determine whether the character position is within a preset position range of the character position of the preset keyword;
[0211] The digital information deletion subunit is used to delete the candidate digital combination information corresponding to the position of the digital character within the preset position range, so as to obtain the target candidate digital combination information;
[0212] A digital co-construction detection subunit is used to detect the commonalities of the target candidate digital combination information and determine abnormal digital combination information in the target candidate digital combination information that does not contain the commonalities.
[0213] The abnormal number deletion subunit is used to delete abnormal number combination information from the target candidate number combination information to obtain the target number combination information.
[0214] Preferably, the device further includes:
[0215] The database creation unit is used to create local databases;
[0216] An information storage unit is used to store the set of valid information into the local database;
[0217] The query interface creation unit is used to create a query interface in the local database, which is used to query combination information of numbers or entity objects.
[0218] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0219] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0220] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An effective method for extracting text information, characterized in that, include: Obtain information to be extracted, wherein the information to be extracted includes at least one first entity, one second entity, and one text data to be identified, and there is a debt transfer relationship between the first entity and the second entity; Determine whether there is only one target entity relationship corresponding to the first entity in the text data to be identified; If there is only one target entity relationship in the text data to be identified that corresponds to the first entity, then the text data to be identified is subjected to entity relationship information extraction processing to obtain a target entity object that has the target entity relationship with the first entity; The text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified. The target entity object is matched and combined with the target number combination information to obtain a set of valid information corresponding to the information to be extracted; The step of extracting entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity includes: The text data to be identified is input into the entity relationship extraction model for processing to obtain entity object number one that has the target entity relationship with the first entity. The text data to be identified is input into the entity object matching model for entity object matching processing to obtain the second entity object, which includes at least one entity. Delete entities that are identical to the first entity and the second entity from the second entity to obtain candidate entity objects; The target entity object is determined based on the similarity between the first entity object and the candidate entity objects; The entity relationship extraction model and the entity object matching model are trained based on different model structures, using the first entity, the second entity, and the text data of the sample information as feature values, and the entity objects in the text data that have the target entity relationship with the first entity as target values.
2. The method according to claim 1, characterized in that, Also includes: If there are multiple target entity relationships corresponding to the first entity in the text data to be identified, and there are multiple first entities in the text data to be identified, then based on the character position of each first entity in the text data to be identified, the text data to be identified is divided into multiple text data blocks, and the first entity includes at least one entity; Entity relationship information extraction processing is performed on each of the text data blocks to obtain target entity objects in each of the text data blocks that have the target entity relationship with the first entity, and the target entity objects include at least one entity; Perform digital information matching and detection processing on each of the text data blocks to obtain target digital combination information corresponding to each text data block; Based on the correspondence between the target entity object, the target number combination information and the text data block, a matching and combination process is performed to obtain a set of valid information corresponding to the information to be extracted. The set of valid information includes multiple subsets of valid information based on the text data block. Each subset of valid information includes the target entity object and the target number combination information corresponding to the text data block.
3. The method according to claim 2, characterized in that, Also includes: If there are multiple target entity relationships corresponding to the first entity in the text data to be identified, and there is only one character of the first entity in the text data to be identified, and it is impossible to divide the text data to be identified into multiple text data blocks, then entity relationship information extraction processing is performed on the text data to be identified to obtain target entity objects that have the target entity relationship with the first entity in the text data to be identified, and the target entity objects include at least two. The text data to be identified is subjected to digital information matching and detection processing to obtain target digital combination information corresponding to the text data to be identified. The target entity object and the target number combination information are matched and combined to obtain a set of valid information corresponding to the information to be extracted.
4. The method according to claim 1, characterized in that, Also includes: Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data; The sample dataset is randomly divided into a training dataset and a test dataset; By statistically analyzing all sample information in the training dataset, at least one question formula reflecting the relationship of the target entity is obtained; The problem statement is written into a preset extraction model structure to obtain the extraction model structure to be trained; Based on the extraction model structure to be trained and the training dataset, the model is trained to obtain an initial entity relationship extraction model that matches the extraction model structure to be trained. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train the initial entity relationship extraction model. The problem statement of the initial entity relationship extraction model is tested and adjusted based on the test dataset to obtain the entity relationship extraction model.
5. The method according to claim 1, characterized in that, Also includes: Obtain a sample dataset, wherein the sample dataset includes a first entity, a second entity, and text data features corresponding to each sample information, as well as entity objects labeled with target entity relationships with the first entity in the text data; The sample dataset is randomly divided into a training dataset and a test dataset; By statistically analyzing the textual forms of entity objects in the text data corresponding to all sample information in the training dataset, at least one matching expression reflecting the entity object is obtained. The matching expression is written into a preset matching model structure to obtain an initial matching model structure; The initial entity object matching model is trained based on the training dataset and the initial matching model structure. The training process uses the text data corresponding to each sample information in the training dataset as the feature value and the entity object as the target value to train the initial entity object matching model. The matching formula of the initial entity object matching model is tested and adjusted based on the test dataset to obtain the entity object matching model.
6. The method according to claim 1, characterized in that, The step of performing digital information matching and detection processing on the text data to be identified to obtain target digital combination information corresponding to the text data to be identified includes: At least one candidate number combination is obtained from the text data to be identified based on a specific number matching formula, wherein the specific number matching formula includes at least a matching formula that identifies two specific number combination forms; Examine the position of the numeric character in each candidate numeric combination to determine whether the position of the character is within a preset position range of the position of the preset keyword. Delete the candidate number combination information corresponding to the position of the number character within the preset position range to obtain the target candidate number combination information; Detect the commonalities of the target candidate number combination information, and determine the abnormal number combination information in the target candidate number combination information that does not contain the commonalities; Delete abnormal number combinations from the target candidate number combination information to obtain the target number combination information.
7. The method according to any one of claims 1-3, characterized in that, Also includes: Create a local database; Store the set of valid information in the local database; Create a query interface in the local database, which is used to query combination information of numbers or entity objects.
8. An effective text information extraction device, characterized in that, include: The information to be extracted unit is used to acquire information to be extracted, wherein the information to be extracted includes at least one first entity, one second entity, and one text data to be identified, and there is a debt transfer relationship between the first entity and the second entity; An entity relationship determination unit is used to determine whether there is only one target entity relationship corresponding to the first entity in the text data to be identified; The target entity extraction unit is used to perform entity relationship information extraction processing on the text data to be identified if there is only one target entity relationship corresponding to the first entity in the text data to be identified, so as to obtain a target entity object that has the target entity relationship with the first entity. The target digit extraction unit is used to perform digit information matching and detection processing on the text data to be identified, and to obtain target digit combination information corresponding to the text data to be identified. An information set unit is used to match and combine the target entity object with the target digital combination information to obtain a valid information set corresponding to the information to be extracted. The step of extracting entity relationship information from the text data to be identified to obtain a target entity object that has the target entity relationship with the first entity includes: The text data to be identified is input into the entity relationship extraction model for processing to obtain entity object number one that has the target entity relationship with the first entity. The text data to be identified is input into the entity object matching model for entity object matching processing to obtain the second entity object, which includes at least one entity. Delete entities that are identical to the first entity and the second entity from the second entity to obtain candidate entity objects; The target entity object is determined based on the similarity between the first entity object and the candidate entity objects; The entity relationship extraction model and the entity object matching model are trained based on different model structures, using the first entity, the second entity, and the text data of the sample information as feature values, and the entity objects in the text data that have the target entity relationship with the first entity as target values.
9. The apparatus according to claim 8, characterized in that, Also includes: A text data partitioning unit is used to divide the text data to be identified into multiple text data blocks based on the character position of the first entity in the text data to be identified if there are multiple target entity relationships corresponding to the first entity in the text data to be identified. The first entity includes at least one entity. The second target entity extraction unit is used to perform entity relationship information extraction processing on each of the text data blocks to obtain target entity objects in each of the text data blocks that have the target entity relationship with the first entity, and the target entity object includes at least one entity. The second target number extraction unit is used to perform digital information matching and detection processing on each text data block to obtain target number combination information corresponding to each text data block. The second information set unit is used to perform matching and combination processing based on the correspondence between the target entity object, the target number combination information and the text data block to obtain a valid information set corresponding to the information to be extracted. The valid information set includes multiple valid information subsets based on the text data block. The valid information subsets include the target entity object and the target number combination information corresponding to the text data block.
Citation Information
Patent Citations
Artificial intelligence-based entity extraction method, apparatus and device, and medium
CN113158675A
Information flow extraction method, device and equipment
CN113761214A