Sample generation method, model training method, and text extraction method and device

By automatically generating training samples using target word slot values ​​and combining them with a deep learning model, the problem of low efficiency in manually annotating training samples is solved, achieving efficient and accurate text extraction.

CN114692628BActive Publication Date: 2026-02-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210387281.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-13
Publication Date
2026-02-10
Estimated Expiration
2042-04-13

AI Technical Summary

Technical Problem

Existing technologies require a large number of manually labeled training samples when extracting target text from the text to be processed, resulting in low efficiency and high cost.

Method used

By identifying the target slots to be filled in the target scene corpus samples, determining the slot values ​​according to the filling conditions, and combining them to generate training samples, a deep learning model is used to train and process the text to extract the target text.

Benefits of technology

It reduces the number of manually labeled training samples, improves the efficiency of training sample generation and deep learning model training, and enhances the accuracy and efficiency of text extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692628B_ABST
    Figure CN114692628B_ABST
Patent Text Reader

Abstract

The present disclosure provides a sample generation method, a model training method, a text extraction method and device, relates to the field of data processing, and particularly to the fields of artificial intelligence, natural language processing and knowledge graph. The specific implementation scheme is: determining a target scene corpus sample, the target scene corpus sample including a target slot to be filled; determining a target slot value according to a filling condition of the target slot; and generating a training sample by combining the target slot value and the target scene corpus sample. By adopting the technical scheme provided by the present disclosure, the number of training samples manually labeled can be reduced in the process of training the model, thereby improving the efficiency of generating training samples and reducing the labor cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more particularly to the fields of artificial intelligence, natural language processing, and knowledge graphs. More specifically, this disclosure provides a method for generating training samples, a method for training deep learning models, a method for extracting text, an apparatus, an electronic device, a storage medium, and a computer program product. Background Technology

[0002] Knowledge extraction plays a crucial role in data processing. One of its objectives is to extract target text from the text to be processed. For example, extracting information such as compensation details, plaintiffs, defendants, and compensation amounts from court documents; or extracting information such as announcement numbers, increased holdings, and company names from fund announcements. Summary of the Invention

[0003] This disclosure provides a method for generating training samples, a method for training deep learning models, a method for text extraction, an apparatus, an electronic device, a storage medium, and a computer program product.

[0004] According to one aspect of this disclosure, a method for generating training samples is provided, comprising: determining a target scene corpus sample, the target scene corpus sample including target word slots to be filled; determining target word slot values ​​according to the filling conditions of the target word slots; and generating training samples by combining the target word slot values ​​and the target scene corpus sample.

[0005] According to another aspect of this disclosure, a method for training a deep learning model is provided, comprising: acquiring training samples; and training a deep learning model using the training samples; wherein the training samples are generated by the training sample generation method described above.

[0006] According to another aspect of this disclosure, a text extraction method is provided, comprising: determining multiple candidate paragraphs in a text to be processed based on target trigger words; processing the multiple candidate paragraphs using a first deep learning model to obtain multiple target paragraphs; and processing the multiple target paragraphs using a second deep learning model to obtain multiple target texts in the multiple target paragraphs; wherein at least one of the first deep learning model and the second deep learning model is trained using the training method of the aforementioned deep learning model.

[0007] According to another aspect of this disclosure, an apparatus for generating training samples is provided, comprising a first determining module, a second determining module, and a combining module. The first determining module is used to determine a target scene corpus sample, the target scene corpus sample including target slots to be filled. The second determining module is used to determine target slot values ​​based on the filling conditions of the target slots. The combining module is used to generate training samples by combining the target slot values ​​and the target scene corpus sample.

[0008] According to another aspect of this disclosure, a training apparatus for a deep learning model is provided, including a second acquisition module and a training module. The second acquisition module is used to acquire training samples. The training module is used to train a deep learning model using the training samples. The training samples are generated by the aforementioned training sample generation apparatus.

[0009] According to another aspect of this disclosure, a text extraction apparatus is provided, including a candidate paragraph determination module, a first processing module, and a second processing module. The candidate paragraph determination module is used to determine multiple candidate paragraphs in the text to be processed based on target trigger words. The first processing module is used to process the multiple candidate paragraphs using a first deep learning model to obtain multiple target paragraphs. The second processing module is used to process the multiple target paragraphs using a second deep learning model to obtain multiple target texts from the multiple target paragraphs. At least one of the first deep learning model and the second deep learning model is trained using a training device for the aforementioned deep learning models.

[0010] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods provided in this disclosure.

[0011] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods provided in this disclosure.

[0012] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods provided in this disclosure.

[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0014] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0015] Figure 1 This is a schematic diagram illustrating application scenarios of the training sample generation method, deep learning model training method, text extraction method, and apparatus according to embodiments of this disclosure.

[0016] Figure 2 This is a schematic flowchart of a method for generating training samples according to an embodiment of the present disclosure;

[0017] Figure 3 This is a schematic diagram illustrating the principle of a training sample generation method according to an embodiment of the present disclosure;

[0018] Figure 4 This is a schematic flowchart of a method for generating training samples according to another embodiment of the present disclosure;

[0019] Figure 5 This is a schematic flowchart of a training method for a deep learning model according to an embodiment of the present disclosure;

[0020] Figure 6 This is a schematic diagram illustrating the principle of a training method for a deep learning model according to an embodiment of the present disclosure;

[0021] Figure 7 This is a schematic flowchart of a text extraction method according to an embodiment of the present disclosure;

[0022] Figure 8 This is a schematic diagram illustrating the principle of a text extraction method according to an embodiment of the present disclosure;

[0023] Figure 9 This is a schematic structural block diagram of a training sample generation apparatus according to an embodiment of the present disclosure;

[0024] Figure 10 This is a schematic structural block diagram of a training apparatus for a deep learning model according to an embodiment of the present disclosure;

[0025] Figure 11 This is a schematic structural block diagram of a text extraction device according to embodiments of the present disclosure; and

[0026] Figure 12 This is a structural block diagram of an electronic device used to implement the training sample generation method, deep learning model training method, and text extraction method of the embodiments of this disclosure. Detailed Implementation

[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0028] Knowledge extraction plays a crucial role in data processing. One of the purposes of knowledge extraction is to extract target text from the text to be processed. The text to be processed can include paragraphs of plain text or tabular information. The extracted target text can include at least one of the following: entity of a feature, attribute of a feature, or attribute value of a feature.

[0029] For example, in the legal field, information such as compensation details, plaintiffs, defendants, and compensation amounts can be extracted from court judgments. The entity element can be "compensation information," and its attributes can include "plaintiff," "defendant," and "compensation amount." The attribute values ​​can include "the plaintiff's specific name (e.g., Zhang San)," "the defendant's specific name," and "the specific value of the compensation amount (e.g., 1000)." Extracting this information from court judgments can reduce labor costs and improve operational efficiency.

[0030] For example, in the financial sector, key information such as announcement number, quantity of increased holdings, and company name can be extracted from fund announcements. This extracted information can assist in financial statement verification and provide a reference for assessing corporate risk.

[0031] For example, in the medical field, information such as patient name, age, cause of illness, and symptoms can be extracted from medical records. This extracted information can be used to quickly locate the patient and, combined with knowledge graphs, provide diagnostic and treatment plans.

[0032] Figure 1 This is a schematic diagram illustrating application scenarios of the training sample generation method, deep learning model training method, text extraction method, and apparatus according to embodiments of the present disclosure.

[0033] It is important to note that Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0034] like Figure 1As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0035] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0036] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as target text extracted from the text to be processed) to the terminal devices.

[0037] It should be noted that the training sample generation method, deep learning model training method, and text extraction method provided in the embodiments of this disclosure can generally be executed by server 105. Correspondingly, the training sample generation device, deep learning model training device, and text extraction device provided in the embodiments of this disclosure can generally be located in server 105. The training sample generation method, deep learning model training method, and text extraction method provided in the embodiments of this disclosure can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103, and / or server 105. Correspondingly, the training sample generation device, deep learning model training device, and text extraction device provided in the embodiments of this disclosure can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103, and / or server 105.

[0038] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0039] Figure 2 This is a schematic flowchart of a method for generating training samples according to an embodiment of the present disclosure.

[0040] like Figure 2 As shown, the training sample generation method 200 may include operations S210 to S230.

[0041] In operation S210, the target scene corpus sample is determined, which includes the target word slots to be filled.

[0042] In operation S220, the target slot value is determined based on the target slot filling conditions.

[0043] In operation S230, training samples are generated by combining target word slot values ​​and target scene corpus samples.

[0044] The target scenario can include industry sectors such as law, finance, healthcare, and the internet. The industry sector represented by the target scenario can be the same as or similar to the industry sector of the text to be processed. For example, if the text to be processed is a court judgment in the legal field, and it is necessary to extract information such as the defendant, plaintiff, and the amount of the judgment from the judgment, then the industry sector represented by the target scenario can be the legal field, especially a branch of the legal field related to court judgments.

[0045] The target scenario corpus sample can represent some texts appearing in the industry field of the text to be processed. Some texts can be a sentence or a paragraph. The target scenario corpus sample includes fixed text, as well as a portion of words that are in a missing state. The words in a missing state are the target slots to be filled.

[0046] For example, in the internet domain, a target scenario corpus sample could be “{ORG} is located in {LOC} and is a Fortune 500 company,” where “located in” and “is a Fortune 500 company” are fixed texts in the target scenario corpus sample, and “{ORG}” and “{LOC}” represent the target slots to be filled. “{ORG}” and “{LOC}” will be explained in detail below and will not be repeated here.

[0047] For example, in the legal field, a target scenario corpus sample could be “{ORG}compensate Zhang Mou {EXP}”, where “compensate Zhang Mou” is a fixed text in the target scenario corpus sample, and “{ORG}” and “{EXP}” represent the target slots to be filled. “{ORG}” and “{EXP}” will be explained in detail below and will not be repeated here.

[0048] In one example, textual information from various industry sectors can be manually summarized to obtain candidate scenario corpus samples, which are then stored in a first knowledge base. When a target scenario corpus sample is needed, a candidate scenario corpus sample can be selected from the first knowledge base based on the desired target scenario.

[0049] For example, if a company introduction in the internet sector contains the following: "XX Internet Co., Ltd. is headquartered in XX Building, XX City," then the corresponding target scenario corpus sample could be "{ORG} is located in {LOC}". Similarly, if a court judgment in the legal field contains the following: "XX Internet Co., Ltd. compensated Mr. Zhang for medical expenses of 3,000 yuan," then the corresponding target scenario corpus sample could be "{ORG} compensated Mr. Zhang {EXP}".

[0050] A target slot is an abstract concept. Each target slot corresponds to a filling condition, which defines the common attribute information of multiple target slot values ​​corresponding to that target slot. The attribute information may include at least one of the following: part of speech, type, and character length. Part of speech may include names, verbs, adjectives, quantifiers, etc., and type may include person type, organization type, address type, amount type, etc.

[0051] The target slot value is a specific content, which can be the attribute value of the attribute information related to the slot to be filled.

[0052] Since the filling conditions limit the common attribute information of multiple target slot values ​​corresponding to the target slot, the target slot value can be determined based on the attribute information.

[0053] In one example, the target slot value can be determined based on the part-of-speech and type in the attribute information. For instance, candidate words can be identified, and then, if the part-of-speech of the candidate word is the same as the predetermined part-of-speech corresponding to the target slot, and the type of the candidate word is the same as the predetermined type corresponding to the target slot, the candidate word can be determined as the target slot value.

[0054] In some embodiments, multiple candidate words can be pre-stored in a second knowledge base, and the attribute information of each candidate word is known, such as its part-of-speech and type. When it is necessary to determine the target slot value, a candidate word is selected from the second knowledge base as the target slot value based on the attribute information of the target slot, either through random selection or other methods. The second knowledge base and the first knowledge base can be two independent knowledge bases or the same knowledge base.

[0055] For example, in one example, the target slot is {ORG}, and the filling conditions for the target slot include: the part of speech of the target slot value to be filled is a noun and the type is an organization type. Among multiple candidate words, the target slot values ​​that meet this attribute information can include "First Company", "Second Company", "Internet Company Limited", "Intellectual Property Agency Company Limited", etc.

[0056] For example, in another example, the target slot is {LOC}, and the filling conditions for the target slot include: the part of speech of the target slot value to be filled is a noun and the type is address type. Among multiple candidate words, the target slot values ​​that meet this attribute information can include "a street in the first city", "a district in the second city", "a building in a district of the third city", etc.

[0057] For example, if the target slot is {EXP}, the filling conditions for the target slot include: the part of speech of the target slot value to be filled is name and the type includes amount type. Among multiple candidate words, the target slot values ​​that meet this attribute information can include "medical expenses 10,000 yuan", "compensation for mental distress 5,000 yuan", "lost wages 1,000 yuan", etc.

[0058] This embodiment determines the target word slot value by part-of-speech and type, which can improve the accuracy of the target word slot value and thus avoid the generated training samples from differing too much from the required training samples.

[0059] It should be understood that in other examples, the target slot value may be determined based on other information in the attribute information, rather than on the part-of-speech and type in the attribute information. For example, the target slot value may be determined based solely on the part-of-speech in the attribute information, or based on the part-of-speech and character length in the attribute information. This disclosure does not limit the method of determining the target slot value.

[0060] For example, the target slot value can be added at the location of the target slot to be filled in the target scene corpus sample.

[0061] For example, a target scenario corpus sample could be "{ORG} is located in {LOC} and is a Fortune 500 company." Target slot values ​​matching "{ORG}" include "the first company" and "a certain internet company," while target slot values ​​matching "{LOC}" include "a certain street in the first city." A generated training sample could then include "The first company is located on a certain street in the first city and is a Fortune 500 company" and "A certain internet company is located on a certain street in the first city and is a Fortune 500 company."

[0062] The technical solution provided in this disclosure automatically generates training samples by using target scene corpus samples and target word slot values. Therefore, it can reduce the number of manually labeled training samples during the training process, thereby improving the efficiency of generating training samples and reducing labor costs.

[0063] According to another embodiment of this disclosure, the operation of determining the target scene corpus sample may include the following operations: determining the similarity between the dependency parsing result of the predetermined sample and the dependency parsing result of the candidate scene corpus sample, and then determining the candidate scene corpus sample as the target scene corpus sample if the similarity is greater than or equal to the similarity threshold.

[0064] The dependency parsing result can be a directed graph G = (V, A), where V represents a node, and each word in a sentence (in this embodiment, the sentence can be a predefined sample or a candidate scene corpus sample) corresponds to a node. A represents a directed edge (Arc), indicating a dependency relationship between words. A directed edge can have a label to represent the specific dependency relationship. Among the two words connected by a directed edge, one word is the core word (also called the dominant word), and the other word is the modifier (also called the dependent word). The direction of the directed edge can be from the core word to the modifier.

[0065] In one example, the predefined samples can be manually labeled samples used to train deep learning models. The predefined samples can be labeled with tags and also with slot values. For instance, a company introduction in the internet sector might include the following: "XX Internet Co., Ltd. is headquartered in XX Building, XX City, and is a Fortune 500 company." "XX Internet Co., Ltd. Headquarters" could be labeled as a slot value.

[0066] In another example, the slots corresponding to the slot values ​​contained in the predefined sample can be labeled, and then the slot values ​​can be replaced with the slots to obtain the predefined sample. For example, the slot corresponding to the slot value "XX Internet Co., Ltd. Headquarters" could be "{ORG}". After replacing the slot value with the slot, the predefined sample is "{ORG} is located in the XX Building in XX City, and is a Fortune 500 company".

[0067] In one example, candidate scene corpus samples can be selected from a first knowledge base. For instance, a candidate scene corpus sample can be retrieved from the first knowledge base using an ANN (Approximate Nearest Neighbor) retrieval method to obtain a candidate list.

[0068] Then, the similarity between the dependency parsing results of the predetermined sample and the dependency parsing results of the candidate scene corpus sample can be calculated. If the similarity is less than the similarity threshold, the candidate scene corpus sample can be deleted from the candidate list; if the similarity is greater than or equal to the similarity threshold, the candidate scene corpus sample can be determined as the target scene corpus sample.

[0069] This embodiment of the disclosure determines whether to identify a candidate scene corpus sample as a target scene corpus sample by measuring the similarity between the dependency parsing results of the predetermined sample and the dependency parsing results of the candidate scene corpus sample. This avoids excessive differences in sentence structure between the predetermined sample and the target scene predetermined sample, thereby ensuring the accuracy of the training samples generated from the target scene predetermined sample.

[0070] According to another embodiment of this disclosure, the method for generating training samples may further include the following operations: constructing a syntax tree for at least one of the following samples: a predetermined sample, a target scene corpus sample, and training samples, and then displaying the syntax tree. Using the above technical solution, users can intuitively understand the sentence structure of the training samples.

[0071] According to another embodiment of this disclosure, in a plurality of training samples, the ratio between the number of manually labeled training samples and the number of training samples generated using the above-described training sample generation method can be 1:5. Of course, this ratio can be adjusted according to actual needs. For example, 100 training samples can be manually labeled, and 500 training samples can be generated using the above-described training sample generation method. Using the above-described ratio of training samples can improve the accuracy of the deep learning model.

[0072] Figure 3 This is a schematic diagram illustrating the principle of a training sample generation method according to an embodiment of the present disclosure.

[0073] like Figure 3 As shown, in this embodiment, candidate scene corpus samples 320 can be selected from the first knowledge base 310, and then the similarity 340 between the dependency parsing results of the candidate scene corpus samples 320 and the dependency parsing results of the predetermined samples 330 is calculated. Then, it is determined whether the similarity 340 is greater than or equal to a similarity threshold. If not, the process can end, for example, by deleting the candidate scene corpus samples 320. If yes, the candidate scene corpus samples 320 can be determined as the target scene corpus samples 350. Alternatively, based on the part of speech and type of the slots to be filled in the target scene corpus samples 350, target slot values ​​370 can be selected from the second knowledge base 360, and then the target slot values ​​370 and the target scene corpus samples 350 are combined to obtain training samples 380.

[0074] Figure 4 This is a schematic flowchart of a method for generating training samples according to another embodiment of the present disclosure.

[0075] According to another embodiment of this disclosure, the training sample generation method 400 may further include operations S440 to S470.

[0076] The following example, using fund announcements from the financial sector as both training samples and text to be processed, illustrates the technical solution provided in this disclosure. It should be understood that the training samples and text to be processed can also be applied to other industries.

[0077] In operation S440, obtain paragraph positive samples, which include paragraphs and first annotation information that satisfies the association relationship with the paragraphs.

[0078] In operation S450, the annotation information other than the first annotation information in the predetermined annotation information set is determined as the second annotation information.

[0079] In operation S460, negative samples of the paragraph are determined based on the paragraph and second annotation information.

[0080] In operation S470, the negative samples of the paragraph are identified as training samples.

[0081] For example, if the text to be processed includes multiple paragraphs, the first annotation information can be added to each paragraph in the fund announcement through manual annotation or other methods to obtain positive samples of the paragraphs.

[0082] For example, the set of labeled information is {announcement number, quantity of shares increased, company name}. If the text in a certain paragraph M includes "announcement number is 2021-001" or "2021-001", it can be seen that there is information related to "announcement number" in paragraph M. Then, "announcement number_paragraph M" can be constructed as a positive sample of paragraph, where "announcement number" represents the first labeled information that satisfies the association relationship with paragraph M.

[0083] For example, paragraph M does not contain information related to "quantity of increase" and "company name," so "quantity of increase" and "company name" can be identified as the second annotation information. Then, "quantity of increase_paragraph M" and "company name_paragraph M" can be constructed as paragraph negative samples.

[0084] In some embodiments, at least one of paragraph positive samples and paragraph negative samples can be determined as training samples, and then the deep learning model can be trained using the training samples.

[0085] The technical solution provided in this disclosure can construct paragraph negative samples using paragraph positive samples, thereby increasing the number of training samples and reducing the number of manually labeled training samples.

[0086] It should be noted that operations S440 to S470 and operations S210 to S230 are two parallel schemes, and the execution order of operations S440 to S470 and operations S210 to S230 is not limited in this embodiment. For example, operations S210 to S230 can be executed first, followed by operations S440 to S470. Alternatively, operations S440 to S470 can be executed first, followed by operations S210 to S230. Operations S440 to S470 and operations S210 to S230 can be executed simultaneously. Alternatively, only operations S440 to S470 can be executed, without executing operations S210 to S230.

[0087] According to another embodiment of this disclosure, the association indicates that the text of the paragraph includes an attribute value and the first annotation information is the attribute name corresponding to the attribute value.

[0088] For example, if the text in a paragraph includes "XX Internet Co., Ltd.", then the first annotation information relating to that paragraph could be "organization". Similarly, if the text in a paragraph includes "April 1st", then the first annotation information relating to that paragraph could be "time".

[0089] For example, a paragraph can contain attribute names and attribute values. For instance, if the text in the paragraph contains "the defendant Zhang", then "the defendant" is the attribute name and "Zhang" is the attribute value.

[0090] For example, a paragraph may contain attribute values ​​but not attribute names. For instance, the text in a paragraph may contain "XX Internet Co., Ltd.", where "XX Internet Co., Ltd." is the attribute value, but the text in the paragraph may not contain the attribute name "Organization".

[0091] In the technical solution provided by this disclosure, since the association indicates that the text of the paragraph includes attribute values, and the first annotation information is the attribute name corresponding to the attribute value, it is applicable to cases where the paragraph does not contain attribute names, and has a wider range of applications.

[0092] Figure 5 This is a schematic flowchart of a training method for a deep learning model according to an embodiment of the present disclosure.

[0093] like Figure 5 As shown, the training method 500 of the deep learning model may include operations S510 to S520.

[0094] In operation S510, training samples are obtained. In some embodiments, the training samples may be generated using the training sample generation method described above.

[0095] When operating the S520, a deep learning model is trained using training samples.

[0096] The technical solution provided in this disclosure uses training samples generated by the above-described training sample generation method to train deep learning models. Therefore, it can reduce the number of manually labeled training samples during the training of deep learning models, thereby improving the efficiency of generating training samples and thus improving the training efficiency of deep learning models.

[0097] For example, the training methods of the deep learning models described above can be used to train classification models.

[0098] For example, the training method for the deep learning model described above can be used to train a sequence labeling model. During training, the start and end positions of text (e.g., slot values) in the training samples can be labeled. After obtaining the trained sequence labeling model, the target paragraph is input into the sequence labeling model. The sequence labeling model can identify the start and end positions of the target text (e.g., target slot values) in the target paragraph and extract the target text based on the start and end positions.

[0099] For example, when the text to be processed is a judgment document, a classification model can be used to identify multiple target paragraphs from the text to be processed. Then, a trained sequence labeling model can be used to extract target text from the multiple target paragraphs. The extracted target text may include the specific amount of the judgment, the specific name of the defendant, etc.

[0100] Figure 6 This is a schematic diagram illustrating the training method of a deep learning model according to an embodiment of the present disclosure.

[0101] like Figure 6 As shown in this embodiment 600, multiple paragraphs can be determined from the text to be processed 610. For example, the text to be processed 610 includes multiple paragraphs, namely paragraph A, paragraph B, and paragraph C.

[0102] Then, multiple paragraphs can be labeled manually or by other means to obtain multiple first training samples 620. In some embodiments, the first training samples 620 can be positive paragraph samples as described above, or predetermined samples as described above.

[0103] Then, based on multiple first training samples 620, sample augmentation processing can be performed to obtain multiple second training samples 630. In one example, operations S210 to S230 described above can be used to implement sample augmentation. In another example, operations S440 to S470 described above can be used to implement sample augmentation. In yet another example, operations S210 to S230 and operations S440 to S470 described above can be used to implement sample augmentation.

[0104] Then at least a portion of the samples from the plurality of first training samples 620 and the plurality of second training samples 630 can be determined as training samples 640 and a deep learning model can be trained, such as a classification model 650 and a sequence labeling model 660.

[0105] Figure 7 This is a schematic flowchart of a text extraction method according to an embodiment of the present disclosure.

[0106] like Figure 7 As shown, the text extraction method 700 may include operations S710 to S730.

[0107] In operation S710, multiple candidate paragraphs in the text to be processed are identified based on the target trigger word.

[0108] The text to be processed can be content from fund announcements, court documents, etc., and includes multiple original paragraphs. Then, based on the target trigger word, multiple candidate paragraphs can be selected from these original paragraphs. For example, if the target trigger word is "ruling amount," the original paragraph containing the text "ruling amount" can be identified as a candidate paragraph.

[0109] In some embodiments, considering that multiple texts to be processed may have different formats, such as PDF, Word, HTML (HyperText Markup Language), web pages, etc., the format of the texts to be processed can be unified into a predetermined format, which may be HTML.

[0110] When operating the S720, the first deep learning model is used to process multiple candidate paragraphs to obtain multiple target paragraphs.

[0111] For example, the first deep learning model can be trained using the training methods described above for deep learning models.

[0112] In one example, the first deep learning model could be a classification model, such as the PaddlePaddle classification model.

[0113] The input to the classification model is a set of sentences S = (S0, ..., Sn-1), where S0 represents the first sentence, and so on, with Sn-1 representing the nth sentence. The sentence set may include at least one candidate paragraph. The output of the classification model includes a set of predicted categories T for each sentence, resulting in a set of predicted categories T{T0, ..., Tn-1} for the sentence set, where T0 represents the set of predicted categories for the first sentence, and so on, with Tn-1 representing the set of predicted categories for the nth sentence.

[0114] In addition, a probability threshold can be set, which can be 0.7. For example, after processing by the classification model, if the probability of the first sentence belonging to the predicted category corresponding to the first target trigger word is 0.9, the probability of the first sentence belonging to the predicted category corresponding to the second target trigger word is 0.8, and the probability of the first sentence belonging to the predicted categories corresponding to all other target trigger words is less than 0.7, then the predicted category set of the first sentence includes both the first and second target trigger words.

[0115] For example, a paragraph may consist of multiple sentences. After processing by a classification model, each sentence corresponds to a predicted category set T. If at least one sentence in the paragraph has a predicted category set T that corresponds to the target trigger word, then the paragraph can be recalled and identified as the target paragraph.

[0116] When operating the S730, the second deep learning model is used to process multiple target paragraphs to obtain multiple target texts from the multiple target paragraphs.

[0117] For example, the second deep learning model can be trained using the training methods described above for the deep learning model.

[0118] In one example, the second deep learning model could be a sequence labeling model, such as the PaddlePaddle sequence labeling model.

[0119] For example, sequence labeling models can be used to extract content from target paragraphs, and the extracted target text can include attribute values. For instance, when the text to be processed is a court judgment, the extracted target text can include attribute values ​​such as the specific amount of the judgment and the specific name of the defendant.

[0120] The technical solution provided in this disclosure uses a deep model trained by the above-described deep learning model training method to extract target text. Even with a small number of manually labeled training samples, it still achieves good extraction results.

[0121] According to another embodiment of this disclosure, the text extraction method provided in this embodiment may further include the following operations: after obtaining multiple target texts in multiple target paragraphs, if it is determined that at least one target text in the multiple target texts is the same as a predetermined keyword, the at least one target text is cleaned according to the cleaning rules corresponding to the predetermined keyword.

[0122] For example, a dictionary can be pre-configured, which includes multiple pre-defined keywords, each with its own cleaning rules.

[0123] In one example, a cleaning rule might be to replace a predetermined keyword with another target word. For instance, if the predetermined keyword is "expiration date," the corresponding cleaning rule could be to replace "expiration date" with "due date."

[0124] In another example, one cleaning rule is to remove predetermined keywords from the target text. For instance, if the predetermined keyword is "unknown," the corresponding cleaning rule could be to remove "unknown."

[0125] The embodiments disclosed herein can clean the extracted target text, thereby making the cleaned target text more standardized.

[0126] It should be noted that, in some embodiments, the text to be processed may include table information in addition to paragraphs.

[0127] The text extraction method provided in this embodiment can also extract target text from table information. Accordingly, the text extraction method further includes the following operations: determining the table information included in the text to be processed, then determining the table header information in the table information according to the target trigger word, and then determining the table value information corresponding to the table header information.

[0128] For example, the location of table information within the text to be processed can be identified, and then the text within the table information can be identified. For example, the attributes and attribute values ​​to be extracted can be predetermined before extracting the header and value information. Taking a court judgment as an example, the predetermined attributes to be extracted could include "defendant," "judgment authority," and "judgment amount." These attributes can then be set as target trigger words, and the text in the table information that matches the target trigger words can be identified as the header information.

[0129] Furthermore, the header information corresponds to specific types of table value information. For example, if header information 'a' is "Defendant," the type corresponding to header information 'a' is a person's name or a company name. Therefore, the person's name or company name near header information 'a' can be identified as the table value information corresponding to header information 'a'. Similarly, if header information 'b' is "Judgment Amount," the type corresponding to header information 'a' is a number (e.g., uppercase or lowercase numbers). Therefore, the number near header information 'b' can be identified as the table value information corresponding to header information 'b'.

[0130] The technical solution provided in this disclosure can also extract table header information and table value information from the table information in the text to be processed, and use the extracted table header information and table value information as the target text, thus having a wider range of applications.

[0131] According to another embodiment of this disclosure, the operation of determining multiple candidate paragraphs in the text to be processed based on a target trigger word may include the following steps: determining multiple original paragraphs in the text to be processed; determining multiple word segments in each original paragraph; then determining an inverted index between each word segment and the multiple paragraphs; further determining an evaluation value for each word segment based on at least one of a predetermined matching rule and text similarity, based on the target trigger word; and then determining candidate paragraphs based on the evaluation value of each word segment and the inverted index.

[0132] For example, each paragraph contained in the text to be processed can be identified as an original paragraph.

[0133] For example, the original paragraph can be split into sentences, and then the sentences can be segmented to obtain multiple segments for each original paragraph.

[0134] For example, original paragraphs can be stored in storage media, and inverted indexes can be built. An inverted index indicates the mapping relationship between a word and the paragraph in which the word appears. For example, if the word "defendant" appears in the first, third, and fourth original paragraphs, then the word "defendant" has a mapping relationship with a set of original paragraphs. The word "defendant" is an index, and the set of original paragraphs includes the first, third, and fourth original paragraphs.

[0135] For example, retrieval and recall can be performed by using target trigger words and word segmentation. For instance, the evaluation value of word segmentation can be determined by at least one of predefined matching rules and text similarity, and then retrieval and recall can be performed based on the evaluation value.

[0136] Predefined matching rules may include at least one of full match, fuzzy match, and prefix match. Full match means that the segmented text includes the entire text of the target trigger word. Fuzzy match means that the segmented text includes a portion of the text of the target trigger word. Prefix match means that the segmented text includes the first few characters of the target trigger word.

[0137] In determining the evaluation value, a first evaluation value for the predetermined matching rule and a second evaluation value for text similarity can be determined. Then, the weighted sum of the first and second evaluation values ​​can be used as the evaluation value.

[0138] For example, word segments with evaluation values ​​higher than the evaluation value threshold are identified as target word segments, and then, based on the inverted index, the original paragraphs that have a mapping relationship with the target word segments are identified as candidate paragraphs.

[0139] The technical solution provided in this disclosure determines the evaluation value of each word segment based on at least one of a predetermined matching rule and text similarity, and performs coarse recall on the original paragraph based on the evaluation value, thus ensuring the accuracy of the recall.

[0140] Figure 8 This is a schematic diagram illustrating the principle of a text extraction method according to an embodiment of the present disclosure.

[0141] like Figure 8 As shown in this embodiment 800, the text to be processed 810 includes original paragraphs (e.g., paragraph A and paragraph B) and table information. There can be multiple texts to be processed 810, and the formats of the multiple texts to be processed 810 can be different. For example, the formats of the multiple texts to be processed 810 can be PDF, Word, HTML, web pages, etc. In the case where the text to be processed 810 is a fund announcement, the target text extracted from the text to be processed 810 may include the announcement number, the quantity of shares increased, the company name, etc.

[0142] First, the text 810 to be processed can be preprocessed. For example, the format of the text 810 to be processed can be standardized to a predetermined format, which can be HTML.

[0143] Then, the preprocessed text 810 can be parsed to obtain multiple original paragraphs and multiple table information. These original paragraphs and table information can also be stored in storage medium 820, while simultaneously building an inverted index for the original paragraphs. For example, each original paragraph can be split into sentences, each sentence can be segmented, and then an inverted index can be built based on the segmentation and the paragraph in which the segment is located.

[0144] Then, the table extraction module 830 can be used to identify the table position and content in the table information, thereby determining the table header information and table value information in the table information.

[0145] Then, the text extraction module 840 can be used to extract target text from the original paragraph. The process by which the text extraction module 840 extracts target text from the original paragraph may include a coarse recall stage, a fine recall stage, and an extraction stage.

[0146] In the coarse recall stage, retrieval can be performed using target trigger words and word segments. For example, based on the target trigger words, and at least one of the predefined matching rules and text similarity, an evaluation value for each word segment is determined. Then, based on the evaluation value of each word segment and the inverted index, candidate paragraphs are determined.

[0147] In the fine-grained recall phase, a classification model can be used to process candidate paragraphs to obtain the target text. For example, multiple candidate paragraphs can be input into a classification model, which outputs a prediction result. Then, the prediction result is used to determine whether a candidate paragraph is the target paragraph.

[0148] During the extraction phase, sequence labeling models can be used to process the target paragraph and obtain the target text. For example, the target paragraph is input into the sequence labeling model, and then the model outputs the target text to be extracted. For instance, when the text to be processed, 810, is a financial announcement, the target text to be extracted may include attribute values ​​such as announcement number, quantity of shares increased, and company name. For instance, when the text to be processed, 810, is a court judgment, the target text to be extracted may include attribute values ​​such as the judgment amount and the defendant.

[0149] Then, the cleaning module 850 can be used to clean the target text to obtain the cleaned target text. The cleaning module 850 can be implemented using a dictionary and cleaning rules. For example, a dictionary can be pre-configured, which includes multiple predefined keywords. Each predefined keyword corresponds to a cleaning rule. The cleaning rule could be, for example, replacing "due date" with "expiration date" in the target text.

[0150] Figure 9 This is a schematic structural block diagram of a training sample generation apparatus according to an embodiment of the present disclosure.

[0151] like Figure 9 As shown, the training sample generation device 900 may include a first determining module 910, a second determining module 920, and a combination module 930.

[0152] The first determining module 910 is used to determine the target scene corpus sample, which includes the target word slots to be filled.

[0153] The second determining module 920 is used to determine the target slot value based on the target slot filling conditions.

[0154] The combination module 930 is used to generate training samples by combining target word slot values ​​and target scene corpus samples.

[0155] According to another embodiment of this disclosure, the first determining module includes a second determining submodule and a first determining submodule. The first determining submodule is used to determine the similarity between the dependency parsing results of a predetermined sample and the dependency parsing results of a candidate scene corpus sample. The second determining submodule is used to determine the candidate scene corpus sample as the target scene corpus sample if the similarity is greater than or equal to a similarity threshold.

[0156] According to another embodiment of this disclosure, the second determining module includes a third determining submodule and a fourth determining submodule. The third determining submodule is used to determine candidate words. The fourth determining submodule is used to determine the candidate word as the target slot value when the part-of-speech of the candidate word is the same as the predetermined part-of-speech corresponding to the target slot, and the type of the candidate word is the same as the predetermined type corresponding to the target slot.

[0157] According to another embodiment of this disclosure, the above-mentioned training sample generation apparatus further includes a first acquisition module, a labeling information determination module, a negative sample determination module, and a third determination module. The first acquisition module is used to acquire paragraph positive samples, whereby the paragraph positive samples include a paragraph and first labeling information that satisfies a correlation relationship with the paragraph. The labeling information determination module is used to determine the labeling information other than the first labeling information in a predetermined set of labeling information as second labeling information. The negative sample determination module is used to determine paragraph negative samples based on the paragraph and the second labeling information. The third determination module is used to determine the paragraph negative samples as training samples.

[0158] According to another embodiment of this disclosure, the association indicates that the text of the paragraph includes an attribute value and the first annotation information is the attribute name corresponding to the attribute value.

[0159] Figure 10 This is a schematic structural block diagram of a training apparatus for a deep learning model according to an embodiment of the present disclosure.

[0160] like Figure 10 As shown, the training device 1000 for the deep learning model may include a second acquisition module 1010 and a training module 1020.

[0161] The second acquisition module 1010 is used to acquire training samples.

[0162] The training module 1020 is used to train a deep learning model using training samples. In some embodiments, the training samples may be generated by the aforementioned training sample generation device.

[0163] Figure 11 This is a schematic structural block diagram of a text extraction device according to an embodiment of the present disclosure.

[0164] like Figure 11 As shown, the text extraction device 1100 may include a candidate paragraph determination module 1110, a first processing module 1120, and a second processing module 1130.

[0165] The candidate paragraph determination module 1110 is used to determine multiple candidate paragraphs in the text to be processed based on the target trigger word.

[0166] The first processing module 1120 is used to process multiple candidate paragraphs using a first deep learning model to obtain multiple target paragraphs.

[0167] The second processing module 1130 is used to process multiple target paragraphs using a second deep learning model to obtain multiple target texts from the multiple target paragraphs. At least one of the first deep learning model and the second deep learning model is trained using the training device of the aforementioned deep learning model.

[0168] According to another embodiment of this disclosure, the text extraction device further includes a cleaning module, which is used to clean at least one target text according to a cleaning rule corresponding to the predetermined keyword when it is determined that at least one target text among a plurality of target texts is the same as a predetermined keyword.

[0169] According to another embodiment of this disclosure, the text extraction device further includes a table determination module, a table header determination module, and a table value determination module. The table determination module is used to determine table information included in the text to be processed. The table header determination module is used to determine table header information in the table information based on a target trigger word. The table value determination module is used to determine table value information corresponding to the table header information.

[0170] According to another embodiment of this disclosure, the candidate paragraph determination module includes an original paragraph determination submodule, a word segmentation determination submodule, an inverted index determination submodule, an evaluation value determination submodule, and a candidate paragraph determination submodule. The original paragraph determination submodule is used to determine multiple original paragraphs in the text to be processed. The word segmentation determination submodule is used to determine multiple word segments within each original paragraph. The inverted index determination submodule is used to determine the inverted index between each word segment and the multiple paragraphs. The evaluation value determination submodule is used to determine the evaluation value of each word segment based on a target trigger word, at least one of a predetermined matching rule and text similarity. The candidate paragraph determination submodule is used to determine candidate paragraphs based on the evaluation value of each word segment and the inverted index.

[0171] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0172] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.

[0173] According to embodiments of this disclosure, this disclosure also provides an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform at least one of the above-described training sample generation method, deep learning model training method, and text extraction method.

[0174] According to embodiments of this disclosure, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute at least one of the above-described training sample generation method, deep learning model training method, and text extraction method.

[0175] According to embodiments of this disclosure, this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements at least one of the above-described training sample generation method, deep learning model training method, and text extraction method.

[0176] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0177] like Figure 12 As shown, device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1202 or a computer program loaded from storage unit 1208 into random access memory (RAM) 1203. The RAM 1203 may also store various programs and data required for the operation of device 1200. The computing unit 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.

[0178] Multiple components in device 1200 are connected to I / O interface 1205, including: input unit 1206, such as keyboard, mouse, etc.; output unit 1207, such as various types of monitors, speakers, etc.; storage unit 1208, such as disk, optical disk, etc.; and communication unit 1209, such as network card, modem, wireless transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0179] The computing unit 1201 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as at least one of the above-described methods for generating training samples, training deep learning models, and extracting text. For example, in some embodiments, at least one of the above-described methods for generating training samples, training deep learning models, and extracting text can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by computing unit 1201, it can perform one or more steps of at least one of the training sample generation method, deep learning model training method, and text extraction method described above. Alternatively, in other embodiments, computing unit 1201 can be configured by any other suitable means (e.g., by means of firmware) to perform at least one of the training sample generation method, deep learning model training method, and text extraction method described above.

[0180] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0181] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0182] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0183] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0184] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0185] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0186] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0187] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A text extraction method, comprising: For each word segment in the text to be processed, a first evaluation value based on a predetermined matching rule and a second evaluation value based on text similarity are determined according to the target trigger word. The weighted sum of the first evaluation value and the second evaluation value is determined as the evaluation value for the word segmentation; Among the multiple word segments, the word segments whose evaluation value is greater than the evaluation value threshold are identified as target word segments; Based on the inverted index, the original paragraphs in the text to be processed that have a mapping relationship with the target word are identified as candidate paragraphs; the inverted index indicates the mapping relationship between the word and the original paragraph in which the word is located; The candidate paragraphs are input into the classification model, and the prediction results output by the classification model are used to determine whether the candidate paragraphs are the target paragraphs. The target paragraph is input into the sequence labeling model to obtain the target text to be extracted; At least one of the classification model and the sequence labeling model is trained using training samples, which are generated in the following way: Determine a target scene corpus sample, wherein the target scene corpus sample includes target word slots to be filled; Determining the target slot value based on the target slot filling conditions includes: determining candidate words; and determining the candidate word as the target slot value if the candidate word's part-of-speech is the same as the predetermined part-of-speech corresponding to the target slot, and the candidate word's type is the same as the predetermined type corresponding to the target slot. Training samples are generated by combining the target word slot values ​​and the target scene corpus samples.

2. The method according to claim 1, wherein, The determined target scene corpus samples include: Determine the similarity between the dependency parsing results of the predetermined samples and the dependency parsing results of the candidate scene corpus samples; and If the similarity is greater than or equal to the similarity threshold, the candidate scene corpus sample is determined as the target scene corpus sample.

3. The method according to claim 1, further comprising: Obtain positive samples of paragraphs, wherein the positive samples of paragraphs include paragraphs and first annotation information that satisfies the association relationship with the paragraphs; The annotation information other than the first annotation information in the predetermined annotation information set is determined as the second annotation information; Based on the paragraph and the second annotation information, determine the paragraph negative samples; as well as The negative samples of the paragraphs are selected as training samples.

4. The method according to claim 3, wherein, The association indicates that the text of the paragraph includes attribute values ​​and the first annotation information is the attribute name corresponding to the attribute values.

5. The method according to claim 1, further comprising: After obtaining the target text If the target text is determined to be the same as a predetermined keyword, the target text is cleaned according to the cleaning rules corresponding to the predetermined keyword.

6. The method according to claim 1, further comprising: Determine the table information included in the text to be processed; Based on the target trigger word, determine the header information in the table information; as well as Determine the table value information corresponding to the table header information.

7. The method according to any one of claims 1 to 6, further comprising: Identify multiple original paragraphs in the text to be processed; For each of the plurality of original paragraphs, determine a plurality of word segments in each original paragraph; Determine the inverted index between each word in the plurality of original paragraphs and the plurality of paragraphs.

8. A text extraction device, comprising: The candidate paragraph determination module is used for: For each word segment in the text to be processed, a first evaluation value based on a predetermined matching rule and a second evaluation value based on text similarity are determined according to the target trigger word. The weighted sum of the first evaluation value and the second evaluation value is determined as the evaluation value for the word segmentation; Among the multiple word segments, the word segments whose evaluation value is greater than the evaluation value threshold are identified as target word segments; Based on the inverted index, the original paragraphs in the text to be processed that have a mapping relationship with the target word are identified as candidate paragraphs; the inverted index indicates the mapping relationship between the word and the original paragraph in which the word is located; The first processing module is used to input the candidate paragraph into the classification model and determine whether the candidate paragraph is the target paragraph based on the prediction result output by the classification model. The second processing module is used to input the target paragraph into the sequence labeling model to obtain the target text to be extracted. At least one of the classification model and the sequence labeling model is trained using training samples, which are generated through the following modules: The first determining module is used to determine the target scene corpus sample, wherein the target scene corpus sample includes target word slots to be filled; The second determining module is used to determine the target slot value based on the target slot filling conditions; wherein the second determining module includes: a third determining submodule and a fourth determining submodule; the third determining submodule is used to determine candidate words; the fourth determining submodule is used to determine the candidate word as the target slot value when it is determined that the part-of-speech of the candidate word is the same as the predetermined part-of-speech corresponding to the target slot, and the type of the candidate word is the same as the predetermined type corresponding to the target slot; and The combination module is used to generate training samples by combining the target word slot values ​​and the target scene corpus samples.

9. The apparatus according to claim 8, wherein, The first determining module includes: The first determining submodule is used to determine the similarity between the dependency parsing results of the predetermined samples and the dependency parsing results of the candidate scene corpus samples; and The second determining submodule is used to determine the candidate scene corpus sample as the target scene corpus sample when the similarity is greater than or equal to the similarity threshold.

10. The apparatus according to claim 8, further comprising: The first acquisition module is used to acquire paragraph positive samples, wherein the paragraph positive samples include paragraphs and first annotation information that satisfies the association relationship with the paragraphs; The annotation information determination module is used to determine the annotation information other than the first annotation information in the predetermined annotation information set as the second annotation information; The negative sample determination module is used to determine negative samples of a paragraph based on the paragraph and the second annotation information; as well as The third determination module is used to determine the negative samples of the paragraph as training samples.

11. The apparatus according to claim 10, wherein, The association indicates that the text of the paragraph includes attribute values ​​and the first annotation information is the attribute name corresponding to the attribute values.

12. The apparatus according to claim 8, further comprising: The cleaning module is used to clean the target text according to the cleaning rules corresponding to the predetermined keywords when it is determined that the target text is the same as the predetermined keywords.

13. The apparatus according to claim 8, further comprising: The table determination module is used to determine the table information included in the text to be processed; The header determination module is used to determine the header information in the table information based on the target trigger word. as well as The table value determination module is used to determine the table value information corresponding to the table header information.

14. The apparatus according to any one of claims 8 to 13, wherein, The candidate paragraph determination module further includes: The original paragraph determination submodule is used to determine multiple original paragraphs in the text to be processed; The word segmentation determination submodule is used to determine multiple word segments for each of the multiple original paragraphs. The inverted index determination submodule is used to determine the inverted index between each word in the plurality of original paragraphs and the plurality of paragraphs.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and equipment for recalling sentence template based on seed sentence

    CN106502987A

  • Document attribute description content extracting method and device

    CN108920656A

  • Corpus generation and model training method

    CN111831823A

  • Method for establishing reading understanding model, reading understanding method and corresponding device

    CN113204611A