A method, device, equipment and storage medium for extracting elements

By extracting the mobilization demand text twice, the first participle of the demand object is extracted for the first time, and the second participle based on the demand attributes of the first participle is extracted, which solves the problem that the existing technology cannot effectively extract multi-level elements and retention in the mobilization demand text. The issue of factor relationship has achieved efficient and accurate factor extraction.

CN114911937BActive Publication Date: 2025-02-14HEFEI IFLY DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210560390.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-18
Publication Date
2025-02-14
Estimated Expiration
2042-05-18

AI Technical Summary

Technical Problem

The existing factor extraction scheme cannot effectively extract multi-level elements in the mobilization requirements text, and cannot retain the relationship between the elements.

Method used

By extracting the target text twice, the first participle of the demand object is obtained for the first time, and the second participle of the demand attribute corresponding to the demand object is extracted for the second time, thereby retaining the need object and the demand attribute. relationship.

Benefits of technology

The accurate extraction of the demand objects and demand attributes in the mobilization demand text is achieved, and the relationship between them is retained, improving the efficiency and accuracy of factor extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911937B_ABST
    Figure CN114911937B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for extracting elements, the method comprising: obtaining a target text to be extracted; performing a first extraction on the target text to obtain a first extraction result, wherein the first extraction result includes a first word segmentation in the target text belonging to a demand object; based on the first word segmentation, performing a second extraction on the target text to obtain a second word segmentation in the target text belonging to a demand attribute corresponding to the demand object. In the above manner, the present application can extract the demand object and the demand attribute corresponding to the demand object, and retain the corresponding relationship between the demand object and the demand attribute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method, apparatus, device and storage medium for extracting elements. Background Art

[0002] The mobilization demand text is a longer text that contains demand elements at different levels; for example: mobilization goals, mobilization themes, demand objects, quantity of demand objects, measurement units, delivery addresses and other fine-grained elements.

[0003] Existing feature extraction schemes usually use sequence labeling and reading comprehension to extract. These two schemes can only extract all the elements in the text, but cannot retain the relationship between the elements. With the development of natural language processing technology, text analysis technologies such as entity extraction, relationship extraction, and event extraction have been rapidly applied. People combine entity extraction and relationship extraction to determine the relationship between entities. For example, all entities in the text are extracted, and the entities are combined into entity pairs, and the relationship between the entity pairs is determined. In this scheme, the number of entity pairs is closely related to the number of entities, and the exponential growth seriously hinders the efficiency of entity relationship extraction. Therefore, existing technologies cannot solve the multi-level feature extraction of mobilization demand texts. Summary of the invention

[0004] The main technical problem solved by the present application is to provide a factor extraction method, device, equipment and storage medium, which can extract demand objects and demand attributes corresponding to the demand objects, and retain the correspondence between the demand objects and the demand attributes.

[0005] To solve the above technical problems, the first aspect of the present application provides a feature extraction method, which includes: obtaining a target text to be extracted; performing a first extraction on the target text to obtain a first extraction result, wherein the first extraction result includes a first word segmentation in the target text that belongs to a demand object; based on the first word segmentation, performing a second extraction on the target text to obtain a second word segmentation in the target text that belongs to a demand attribute corresponding to the demand object.

[0006] To solve the above technical problems, the second aspect of the present application provides a feature extraction device, which includes: an acquisition module, used to acquire a target text to be extracted; a first extraction module, used to perform a first extraction on the target text to obtain a first extraction result, wherein the first extraction result includes a first word segmentation in the target text that belongs to a demand object; a second extraction module, used to perform a second extraction on the target text based on the first word segmentation to obtain a second word segmentation in the target text that belongs to a demand attribute corresponding to the demand object.

[0007] To solve the above technical problems, the third aspect of the present application provides a factor extraction device, which includes a memory and a processor coupled to each other; the memory stores program instructions; the processor is used to execute the program instructions stored in the memory to implement the method of the first aspect above.

[0008] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the method of the first aspect.

[0009] The beneficial effect of the present application is that, different from the prior art, after obtaining the target text, the present application extracts the target text twice, the first time extracting the first participle belonging to the demand object in the target text, and the second time extracting the second participle belonging to the demand attribute corresponding to the demand object in the target text based on the first participle. Through the two extractions, the participles belonging to the demand object and the demand attribute in the target text can be obtained. Furthermore, since the second extraction is based on the first participle belonging to the demand object, the second participle belonging to the demand attribute corresponding to the first participle can be extracted, and the relationship between the demand object and the demand attribute can be retained. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of the first implementation method of the factor extraction method provided by the present application;

[0011] Figure 2 It is a flowchart of the second implementation method of the factor extraction method provided by this application;

[0012] Figure 3 is a schematic diagram of the first processing model;

[0013] Figure 4 It is a structural diagram of the factor extraction model;

[0014] Figure 5 It is a schematic diagram of a framework of an implementation method of an element extraction device provided by the present application;

[0015] Figure 6 It is a schematic diagram of a framework of an implementation method of a text relationship extraction device provided by the present application;

[0016] Figure 7 It is a schematic diagram of a framework of an implementation scheme of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0017] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] It should be noted that in the embodiments of the present application, there are descriptions involving "first", "second", etc., which are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0019] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0020] See also Figure 1 , Figure 1 It is a flowchart of the first implementation method of the factor extraction method provided by the present application, and the method comprises:

[0021] S110: Obtain the target text from which elements are to be extracted.

[0022] In one embodiment, the target text may be a mobilization demand text, which may include multiple elements, such as: mission purpose, mission theme, issuing unit, demand object, category, specification, quantity, measurement unit, affiliated unit, guarantee unit, handover time, handover location, handover personnel, handover contact information, etc., wherein category, specification, quantity, measurement unit, affiliated unit, guarantee unit, handover time, handover location, handover personnel, handover contact information, etc. are demand attributes of the demand object. The user may define the mission purpose, mission theme, issuing unit, and demand object as first-level tags, and define the demand attributes belonging to the demand object as second-level tags. In the process of element extraction, the text belonging to the first-level tags may be extracted first, and then the text belonging to the second-level tags may be extracted.

[0023] Furthermore, in order to improve the accuracy of the element extraction result, the user can divide the target text into paragraphs before extracting the elements, and extract the elements based on the divided paragraphs. The basis for dividing the paragraphs can be that the sentence containing the required object and its attributes is a paragraph.

[0024] S120: Perform a first extraction on the target text to obtain a first extraction result; wherein the first extraction result includes the first word segmentation belonging to the demand object in the target text.

[0025] In one embodiment, the first extraction of the target text can be performed by a first processing model and a classification model. Specifically, the target text can be input into the first processing model, and the first processing model performs a first processing on several word segments in the target text to obtain a first word vector of each word segment in the target text, the first word vector includes a vector expression of the word segment and the first tag information of the word segment, and the first tag information of each word segment is a first tag indicating that it does not belong to the demand object; then, feature extraction is performed on the first word vector to obtain a first feature vector, and the first feature vector is input into the classification model to obtain the classification results of each word segment, and the first extraction result is determined based on the classification result, and the first extraction result includes the first word segment in the target text that belongs to the demand object.

[0026] Among them, the classification result of the word segmentation includes the first probability that the word segmentation belongs to at least one preset label. The preset label (i.e., the first-level label) may include the demand object, task purpose, task theme, and issuing unit. According to the first probability, the preset label of the word segmentation can be determined, and then the first word segmentation belonging to the demand object in the target text can be determined.

[0027] S130: Based on the first segmentation, a second extraction is performed on the target text to obtain a second segmentation in the target text that belongs to the requirement attribute corresponding to the requirement object.

[0028] In one embodiment, step S130 can be performed by the second processing model and the recognition model. Specifically, after obtaining the first word segmentation in step S120, the first tag information of the first word segmentation can be modified, and then the second processing model is used to obtain the second word vectors of several word segments in the target text. The second word vector of the word segmentation includes the vector expression of the word segmentation and the second tag information of the word segmentation. The second tag information of the first word segmentation is a second tag indicating that it belongs to the demand object, and the second tag information of the remaining word segments is the first tag. Based on the second word vector, the second feature vectors of several word segmentations are obtained, and the second feature vectors are input into the recognition model. The second word segmentation belonging to the demand attribute corresponding to the demand object in the target text is obtained through the recognition model.

[0029] In this embodiment, after obtaining the target text, the target text is extracted twice. The first extraction is to extract the first participle belonging to the demand object in the target text, and the second extraction is based on the first participle to extract the second participle belonging to the demand attribute corresponding to the demand object in the target text. Through the two extractions, the participles belonging to the demand object and the demand attribute in the target text can be obtained. Furthermore, since the second extraction is based on the first participle belonging to the demand object, the second participle belonging to the demand attribute corresponding to the first participle can be extracted, and the relationship between the demand object and the demand attribute can be retained.

[0030] See also Figure 2-3 , Figure 2 is a flow chart of the second implementation method of the factor extraction method provided by this application, Figure 3 is a schematic diagram of a first processing model; the method comprises:

[0031] S210: Obtain the target text from which elements are to be extracted.

[0032] In one implementation, the target text to be extracted with elements may be divided into paragraphs to obtain a number of paragraph texts, and the basis for paragraph division is that a sentence containing the required object and its attributes is a paragraph.

[0033] S220: Obtain the first word vector of each word in the target text.

[0034] S230: Predicting based on the first word vector of each word segmentation to obtain a first extraction result, wherein the first extraction result includes the first word segmentation belonging to the demand object in the target text.

[0035] In one embodiment, the plurality of paragraph texts obtained in step S210 may be sequentially input into the first processing model, and the first processing model may be used to obtain the first word vector of each word segmentation in the target text. Specifically, before the paragraph text is input into the first processing model, a word segmentation tool matching the first processing model may be used to segment the paragraph text, and after the word segmentation, the paragraph text may be input into the first processing model to obtain the first word vector of each word segmentation.

[0036] The first word vector of a word segmentation includes the vector expression of the word segmentation and the first tag information of the word segmentation. The first tag information of each word segmentation is the first tag indicating that it does not belong to the demand object. In a specific implementation, the first tag information of each word segmentation is the paragraph tag of each word segmentation. i ) can include vector representations of word pieces (wordpiece i ), paragraph mark i ) and position vector i). Specifically, when several word segments in the target text are input into the first processing model, the word segments can be numbered, and the numbers are respectively substituted into the wordpiece, segment and position functions to obtain the vector expression, paragraph mark and position vector of the word segment. In this embodiment, the target text is sequentially input into the first processing model according to the divided paragraph text, that is, only one paragraph text is input into the first processing model each time, so the paragraph marks of several word segments in the paragraph text can be set to 0, that is, the first mark information of each word segment is 0. It can be understood that in other embodiments, the first mark information can also be other numbers.

[0037] After the first processing model obtains the first word vector of each word segment, it extracts features from the first word vector of each word segment to obtain the first feature vector of each word segment. Specifically, the first processing model can extract features from several word segments in the target text based on the encoder mechanism in the Transformer model. The self-attention mechanism used is better than the RNN (Recurrent Neural Network), CNN (Convolutional Neural Network), and LSTM (Long Short-Term Memory) neural network structures. It can self-learn more context information, improve feature extraction capabilities, and can perform parallel calculations, greatly improving the learning performance of the network. Figure 3 As shown, using the first word vectors E1, E2, E3, ... E i Feature extraction is performed to obtain the first feature vectors T1, T2, T3, ...Ti of several word segmentations. Specifically, the first word vector is transformed by a transformation layer (Transformer) to obtain a first feature vector. The first feature vector is input into the classification model, and the classification model uses the first feature vector to classify each word segmentation to obtain the classification result of each word segmentation, and based on the classification result of each word segmentation, the word segmentation belonging to each preset label in the target text is determined. Among them, the classification model can be a softmax linear classifier. It can be understood that the classification model can also be other models, which are not limited here. The classification result of the word segmentation includes the first probability that the word segmentation belongs to at least one preset label, and the first probability of the word segmentation can be calculated using Formula 1.

[0038]

[0039] In formula 1, S i is the first probability of the i-th word, e i The output vector of the first processing model is converted into a vector of each preset label through a linear layer, i,j∈|L|, where L is the number of preset labels.

[0040] In this embodiment, after determining the word segmentation that belongs to each preset label in the target text, the first extraction result can be obtained, and the word segmentation that belongs to the demand object in the target text is taken as the first word segmentation. Among them, each preset label includes: demand object, task purpose, task subject, issuing unit, and non-valid label. The word segmentation that does not belong to any of the labels of demand object, task purpose, task subject, and issuing unit belongs to the non-valid label. It can be understood that the number of preset labels can be set according to actual business needs, and is not limited here.

[0041] S240: Based on the first word segmentation, obtain the second word vector of each word segmentation.

[0042] S250: Predicting based on the second word vector of each participle, obtaining the second participle in the target text belonging to the demand attribute corresponding to the demand object.

[0043] In one embodiment, step S230 obtains a first word segmentation, that is, the paragraph text input into the first processing model contains a word segmentation belonging to the demand object, and the first tag information of the first word segmentation is modified to the second tag information. Specifically, the first tag information of the first word segmentation can be changed from 0 to 1, and 1 is used as the second tag information of the first word segmentation to obtain the second word vector of each word segmentation. The second word vector of the word segmentation includes the vector expression of the word segmentation and the second tag information of the word segmentation. The second tag information of the first word segmentation is a second tag indicating that it belongs to the demand object, and the second tag information of the remaining word segmentations are all first tags.

[0044] After obtaining the second word vector of each segmentation, the second processing model is used to extract features from the second word vector to obtain the second feature vector of each segmentation. The second feature vector is input into the recognition model so that the recognition model uses the second feature vector to perform attribute recognition on each segmentation to obtain the second probability of several groups of candidate label sequences, wherein each group of candidate label sequences is composed of a predicted label of each segmentation, and at least part of the predicted labels are used to represent the demand attributes. The demand attributes include: at least one of category, specification, quantity, unit of measurement, affiliated unit, guarantee unit, handover time, handover location, handover personnel, and handover contact information. For example, there are three segmentations X, Y, and Z, and two demand attributes a and b, then the segmentation X may belong to the a demand attribute, may also belong to the b demand attribute, or may not belong to either; similarly, the segmentations Y and Z also contain 3 cases, then there are 9 groups of candidate label sequences, one of which can be (a, b, a), that is, the segmentations X, Y, and Z correspond to the a demand attribute, the b demand attribute, and the a demand attribute, respectively.

[0045] In the process of identifying demand attributes, the BERT+CRF layer network model can be used. BERT is a common pre-trained language model. CRF is a common algorithm in sequence labeling tasks. It is a discriminant model that predicts the output sequence based on the input sequence. It is suitable for labeling demand attribute categories. For a specified sequence X(x1,x2,…x n ), whose corresponding label is Y(y1,y2,…y n ), if under the condition of a given random variable sequence X, the conditional probability distribution P(Y|X) of the random variable sequence Y constitutes a conditional random field, that is, it satisfies the Markov property: P(Y i |X,Y1,…Y i-1 ,Y i+1 ,…Y n )=P(Y i |X,Y i-1 ,Y i+1 ), let P(N,K) be the weight matrix output by the decoding layer, and then the evaluation score of each group of candidate label sequences can be calculated respectively, and the second probability of each group of candidate label sequences can be obtained based on the evaluation score. Specifically, the evaluation score can be calculated by Formula 2, and the second probability can be calculated by Formula 3.

[0046]

[0047] In formula 2, S(x,y) is the evaluation score of the candidate label sequence, P i,yi is the probability that the i-th word segment corresponds to the candidate sequence label yi, A yi,yi+1 It represents the weight of transferring the i-th label to the i+1-th label, A is the transfer matrix, and n is the length of the candidate label sequence.

[0048]

[0049] In Formula 3, P(y|x) is the second probability of the candidate label sequence, and S(x,y) is the evaluation score of the candidate label sequence.

[0050] In this embodiment, a candidate tag sequence that satisfies the second probability condition is selected as the target tag sequence, wherein the preset condition may be to select the candidate tag sequence with the largest second probability as the target tag sequence. Based on the predicted tags of each segmentation in the target tag sequence, the second segmentation in the target text belonging to the demand attribute corresponding to the demand object is determined. For example, if the predicted tag corresponding to segmentation X in the target text is quantity, segmentation X is the second segmentation belonging to the quantity demand attribute corresponding to the first segmentation.

[0051] In another embodiment, step S230 obtains multiple first participles. After the prediction of the second participle corresponding to the first first participle is completed, the above steps are repeated to predict the second participle corresponding to the second first participle, until the second participles corresponding to the multiple first participles in the paragraph text are obtained.

[0052] In this embodiment, the first processing model and the second processing model can adopt the same network structure. Both the first processing model and the second processing model can be RoBerta models. The RoBerta model is a language training model obtained by improving the masking strategy based on BERT.

[0053] This implementation method realizes the extraction of demand attribute elements of demand object elements by marking the position of the first participle through feature marks such as paragraph marks, reduces resource consumption in model calculation during element extraction and element relationship extraction, and improves extraction efficiency.

[0054] See also Figure 4 , Figure 4 It is a structural diagram of the factor extraction model.

[0055] The feature extraction method in the present application can be executed by a feature extraction model. In one embodiment, the feature extraction model includes a first processing model, a classification model, a second processing model, and a recognition model. In actual application, the user can input the target text to be extracted into the feature extraction model, and obtain the first word vector and the first feature vector of several word segments through the first processing model in the feature extraction model. The first word vector includes the vector expression of the word segment and the first tag information of the word segment, and the first tag information of each word segment is the first tag indicating that it does not belong to the demand object; the first feature vector is input into the classification model to obtain the first word segment in the target text that belongs to the demand object; the first word segment in the target text is second-tagged and then input into the second processing model, and the second word vector and the second feature vector of each word segment in the target text are obtained by the second processing model, wherein the second word vector of the word segment includes the vector expression of the word segment and the second tag information of the word segment, the second tag information of the first word segment is the second tag indicating that it belongs to the demand object, and the second tag information of the remaining word segments is the first tag; the second feature vector is input into the recognition model to obtain the second word segment in the target text that belongs to the demand attribute corresponding to the demand object, and it can be understood that the second word segment can be multiple.

[0056] See also Figure 5 , Figure 5It is a schematic diagram of a framework of an embodiment of the element extraction device provided by the present application. The element extraction device 50 includes an acquisition module 51, a first extraction module 52, and a second extraction module 53. The acquisition module 51 is used to acquire a target text to be extracted; the first extraction module 52 is used to perform a first extraction on the target text to obtain a first extraction result, wherein the first extraction result includes a first word segmentation belonging to a demand object in the target text; the second extraction module 53 is used to perform a second extraction on the target text based on the first word segmentation to obtain a second word segmentation belonging to a demand attribute corresponding to the demand object in the target text.

[0057] Among them, performing a first extraction on the target text to obtain a first extraction result includes: obtaining a first word vector of each word segmentation in the target text, wherein the first word vector of the word segmentation includes the vector expression of the word segmentation and the first tag information of the word segmentation, and the first tag information of each word segmentation is a first tag indicating that it does not belong to the demand object; performing prediction based on the first word vector of each word segmentation to obtain the first extraction result; performing a second extraction on the target text based on the first word segmentation to obtain a second word segmentation in the target text that belongs to the demand attribute corresponding to the demand object, including: obtaining a second word vector of each word segmentation based on the first word segmentation, wherein the second word vector of the word segmentation includes the vector expression of the word segmentation and the second tag information of the word segmentation, the second tag information of the first word segmentation is a second tag indicating that it belongs to the demand object, and the second tag information of the remaining words segmentation is the first tag; performing prediction based on the second word vector of each word segmentation to obtain a second word segmentation in the target text that belongs to the demand attribute corresponding to the demand object.

[0058] The first extraction result includes the word segments in the target text that belong to at least one preset tag, and the at least one preset tag includes the demand object;

[0059] The prediction based on the first word vector of each of the segmented words to obtain the first extraction result includes: performing feature extraction on the first word vector of each of the segmented words to obtain the first feature vector of each of the segmented words; classifying each of the segmented words using the first feature vector to obtain the classification result of each of the segmented words, wherein the classification result of the segmented words includes a first probability that the segmented words belong to at least one preset label respectively; based on the classification result of each of the segmented words, determining the segmented words in the target text that belong to each of the preset labels.

[0060] Among them, the step of obtaining the first word vector of each word segment in the target text and the step of extracting features from the first word vector of each word segment are performed by the first processing model; and the step of classifying each word segment using the first feature vector is performed by the classification model.

[0061] Among them, prediction is performed based on the second word vector of each of the segmentations to obtain the second segmentation in the target text that belongs to the demand attribute corresponding to the demand object, including: feature extraction is performed on the second word vector of each of the segmentations to obtain the second feature vector of each of the segmentations; attribute recognition is performed on each of the segmentations using the second feature vector to obtain the second probability of several groups of candidate label sequences, wherein each group of candidate label sequences consists of a predicted label for each segmentation, and at least part of the predicted labels are used to represent the demand attribute; a candidate label sequence that meets the conditions of the second probability is selected as a target label sequence; based on the predicted label of each segmentation in the target label sequence, the second segmentation in the target text that belongs to the demand attribute corresponding to the demand object is determined.

[0062] Among them, the step of obtaining the second word vector of each word segment in the target text and the step of extracting features from the second word vector of each word segment are performed by the second processing model; and the step of using the second feature vector to perform attribute recognition on each word segment is performed by the recognition model.

[0063] The second processing model has the same network structure as the first processing model used to perform the step of first extracting the target text.

[0064] Among them, the first word vector and the second word vector of the word segmentation both also include the position information of the word segmentation in the target text; and / or, before obtaining the first word vector of each word segmentation in the target text, the method also includes: segmenting the target text.

[0065] Among them, the first extraction result also includes: participles belonging to at least one of the task purpose, task subject, and issuing unit; and / or, the requirement attributes include: at least one of category, specification, quantity, unit of measurement, affiliated unit, guarantee unit, handover time, handover location, handover personnel, and handover contact information.

[0066] See also Figure 6 , Figure 6 It is a schematic diagram of the framework of an implementation scheme of a text relationship extraction device provided in this application.

[0067] The element extraction device 60 includes a memory 61 and a processor 62 coupled to each other, the memory 61 stores program instructions, and the processor 62 is used to execute the program instructions to implement the steps in any of the above method embodiments. Specifically, the element extraction device 60 may include but is not limited to: a desktop computer, a laptop computer, a server, a mobile phone, a tablet computer, etc., which are not limited here.

[0068] Specifically, the processor 62 is used to control itself and the memory 61 to implement the steps in any of the above method embodiments. The processor 62 can also be called a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip with signal processing capabilities. The processor 62 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 62 can be implemented by an integrated circuit chip.

[0069] See also Figure 7 , Figure 7 The computer-readable storage medium 70 stores program instructions 71, which are used to implement the steps in any of the above method embodiments when executed by a processor.

[0070] The computer-readable storage medium 70 may specifically be a medium that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program. The server may send the stored computer program to other devices for execution, or may also execute the stored computer program itself.

[0071] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0073] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0074] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0075] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A factor extraction method, characterized in that: The method comprises: Get the target text to be extracted; Obtaining a first word vector of each word segment in the target text, wherein the first word vector of the word segment includes a vector expression of the word segment and first tag information of the word segment, and the first tag information of each word segment is a first tag indicating that the word segment does not belong to the required object; Predicting based on the first word vector of each of the segmented words to obtain a first extraction result, wherein the first extraction result includes the first segmented word in the target text that belongs to the demand object; Based on the first word segmentation, obtaining a second word vector of each word segmentation, wherein the second word vector of the word segmentation includes the vector expression of the word segmentation and the second tag information of the word segmentation, the second tag information of the first word segmentation is a second tag indicating that it belongs to the demand object, and the second tag information of the remaining words segmentation is the first tag; Prediction is performed based on the second word vector of each of the segmented words to obtain the second segmented words in the target text belonging to the demand attribute corresponding to the demand object.

2. The method according to claim 1, characterized in that The first extraction result includes word segments in the target text that belong to at least one preset tag, and the at least one preset tag includes the demand object; The predicting based on the first word vector of each of the word segments to obtain the first extraction result includes: Performing feature extraction on the first word vector of each of the segmented words to obtain a first feature vector of each of the segmented words; Using the first feature vector to classify each of the segmented words, and obtain a classification result of each of the segmented words, wherein the classification result of the segmented words includes a first probability that the segmented words belong to at least one preset label; Based on the classification results of each of the segmented words, the segmented words in the target text belonging to each of the preset tags are determined.

3. The method according to claim 2, characterized in that The step of obtaining the first word vector of each word segment in the target text and the step of extracting features from the first word vector of each word segment are performed by a first processing model; The step of classifying each of the word segments using the first feature vector is performed by a classification model.

4. The method according to claim 1, characterized in that: The step of performing prediction based on the second word vector of each of the segmented words to obtain a second segmented word in the target text belonging to the demand attribute corresponding to the demand object includes: Performing feature extraction on the second word vector of each of the segmented words to obtain a second feature vector of each of the segmented words; Using the second feature vector to perform attribute recognition on each of the segmented words, obtaining second probabilities of several groups of candidate label sequences, wherein each group of candidate label sequences consists of a predicted label for each segmented word, and at least part of the predicted labels are used to represent demand attributes; Selecting a candidate tag sequence that satisfies the condition of the second probability as a target tag sequence; Based on the predicted label of each segmentation in the target label sequence, a second segmentation in the target text belonging to the requirement attribute corresponding to the requirement object is determined.

5. The method according to claim 4, characterized in that The step of obtaining the second word vector of each word segment in the target text and the step of extracting features from the second word vector of each word segment are performed by a second processing model; The step of using the second feature vector to perform attribute recognition on each of the segmented words is performed by a recognition model.

6. The method according to claim 5, characterized in that The second processing model has the same network structure as the first processing model used to perform the first extraction step on the target text.

7. The method according to claim 1, characterized in that The first word vector and the second word vector of the word segmentation both further include position information of the word segmentation in the target text; And / or, before obtaining the first word vector of each word in the target text, the method further includes: The target text is segmented.

8. The method according to claim 1, characterized in that The first extraction result also includes: a participle belonging to at least one of the task purpose, the task theme, and the issuing unit; And / or, the demand attributes include: at least one of: category, specification, quantity, unit of measurement, affiliated unit, guarantee unit, handover time, handover location, handover personnel, and handover contact information.

9. A factor extraction device, characterized in that: The device comprises: An acquisition module is used to obtain the target text to be extracted; A first extraction module is used to obtain a first word vector of each word segment in the target text, wherein the first word vector of the word segment includes a vector expression of the word segment and first tag information of the word segment, and the first tag information of each word segment is a first tag indicating that it does not belong to the demand object; based on the first word vector of each word segment, prediction is performed to obtain the first extraction result, wherein the first extraction result includes the first word segment in the target text that belongs to the demand object; A second extraction module is used to obtain a second word vector of each word segmentation based on the first word segmentation, wherein the second word vector of the word segmentation includes the vector expression of the word segmentation and the second tag information of the word segmentation, the second tag information of the first word segmentation is a second tag indicating that it belongs to the demand object, and the second tag information of the remaining word segmentations is the first tag; prediction is performed based on the second word vector of each word segmentation to obtain a second word segmentation in the target text that belongs to the demand attribute corresponding to the demand object.

10. A factor extraction device, characterized in that: The device includes a memory and a processor coupled to each other; The memory stores program instructions; The processor is used to execute the program instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Property acquisition method and device

    CN107203548A

  • Element extraction method, device and equipment and storage medium

    CN110334217A