Text feature extraction method, device, non-volatile storage medium and electronic device

By determining the requirement description information and annotation information, automatically selecting and executing multiple atomic algorithm levels, it solves the problem of text feature extraction when user requirements change, and realizes fast and flexible text feature extraction with a small amount of data.

CN115859973BActive Publication Date: 2025-10-03CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211625841.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2025-10-03
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

In the existing technology, when user needs change, the machine learning model needs to be rebuilt and trained, resulting in the inability to quickly extract text features, especially when there is a small amount of data.

Method used

By determining the demand description information corresponding to the business type of the target text, training samples with annotation information are obtained, and multiple atomic algorithms and their execution order are determined based on the training samples. Multiple atomic algorithms are trained through the training samples, and these algorithms are executed layer by layer to extract text features.

Benefits of technology

It achieves rapid extraction of text features with a small number of training samples, adapts to changes in user needs, improves the flexibility of text feature extraction and the reusability of algorithms, and is suitable for application scenarios with complex text feature extraction logic and diverse algorithm categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115859973B_ABST
    Figure CN115859973B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, non-volatile storage medium, and electronic device for extracting text features. The method comprises: determining demand description information corresponding to the business type of a target text; obtaining training samples based on the demand description information, wherein the training samples carry annotation information; determining multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples, and training the multiple atomic algorithms using the training samples; obtaining a target text, and sequentially executing multiple atomic algorithms in the execution order to process the target text, thereby obtaining text features corresponding to the demand description information in the target text. The present application solves the technical problem of being unable to quickly extract text features from a target text when user needs change, which is caused by the need to rebuild and train a machine learning model in related technologies when user needs change.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text processing, and specifically, to a text feature extraction method, device, non-volatile storage medium, and electronic device. Background Art

[0002] In related technologies, feature extraction from unstructured text data typically requires building a specific machine learning model based on the requirements and then training it with large amounts of data. However, in some applications, the amount of text is relatively small, making it difficult to provide sufficient data for training machine learning models. Furthermore, in related technologies, if the text features to be extracted change, the machine learning model often needs to be rebuilt and trained to ensure extraction results.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present application provide a text feature extraction method, device, non-volatile storage medium and electronic device to at least solve the technical problem of being unable to quickly extract text features in the target text when user needs change, which is caused by the need to rebuild and train the machine learning model when user needs change in the related technology.

[0005] According to one aspect of an embodiment of the present application, a text feature extraction method is provided, including: determining demand description information corresponding to a business type of a target text, wherein the demand description information is used to determine text features to be extracted; obtaining a training sample based on the demand description information, wherein the training sample carries annotation information, and the annotation information is used to express text features in the training sample corresponding to the demand description information; determining multiple atomic algorithms and an execution order of the multiple atomic algorithms based on the training sample, and training the multiple atomic algorithms through the training sample; obtaining a target text, and sequentially executing the multiple atomic algorithms in the execution order to process the target text, to obtain text features in the target text corresponding to the demand description information.

[0006] Optionally, the annotation information includes feature value information in the training sample and feature key information in the training sample, and the feature key information includes whether it is a subject-related feature.

[0007] Optionally, the step of determining multiple atomic algorithms and the execution order of multiple atomic algorithms based on training samples includes: determining the text feature information of the training samples based on the annotation information; determining multiple atomic algorithms based on the text feature information and text structure information of the training samples, and determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms; determining the execution order of multiple atomic algorithms based on the algorithm level, wherein the smaller the algorithm level corresponding to the atomic algorithm, the smaller the serial number corresponding to the atomic algorithm in the execution order.

[0008] Optionally, based on the annotation information and text structure information of the training sample, multiple atomic algorithms are determined, and the steps of determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms include: determining the first atomic algorithm of the first level based on the text structure information of the training sample, wherein the text structure information includes the paragraph pattern of the training sample; determining whether there is a target keyword in the training sample, and when it is determined that there is a target keyword, determining the second atomic algorithm of the second level based on the target keyword, wherein the second atomic algorithm is a keyword positioning algorithm; determining the third atomic algorithm of the third level based on the text feature information of the training sample; determining the feature word weight of the training sample and the weight vector of the feature word, and determining the fourth atomic algorithm of the fourth level based on the feature word weight and the weight vector; determining the fifth atomic algorithm of the fifth level based on the annotation information, wherein the fifth atomic algorithm is used to standardize the data output by the fourth atomic algorithm.

[0009] Optionally, the step of determining the algorithm level corresponding to each of the multiple atomic algorithms further includes: responding to an operation instruction of the target object, adjusting the algorithm level corresponding to the atomic algorithm.

[0010] Optionally, the first atomic algorithm is a text segmentation algorithm; the second atomic algorithm is a keyword positioning algorithm; the third atomic algorithm is a text interception algorithm, used to intercept sentences containing target keywords from training samples; the fourth atomic algorithm is a feature calculation algorithm, used to determine feature information in training samples; the fifth atomic algorithm is a result normalization algorithm, used to standardize the data output by the fourth atomic algorithm.

[0011] Optionally, the standardization processing includes at least one of the following: padding processing, truncation processing, summing processing, finding the maximum value, finding the minimum value, and numerical normalization.

[0012] Optionally, the step of training multiple atomic algorithms using training samples includes: obtaining feature results output by the multiple atomic algorithms after processing the training samples; and determining that the multiple atomic algorithms have completed training when the feature results meet preset requirements.

[0013] According to another aspect of an embodiment of the present application, a text feature extraction device is also provided, including: an interaction module, used to determine the demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine the text features to be extracted; a first input module, used to obtain training samples based on the demand description information, wherein the training samples carry annotation information, and the annotation information is used to express the text features in the training samples corresponding to the demand description information; a processing module, used to determine multiple atomic algorithms and the execution order of multiple atomic algorithms based on the training samples, and train the multiple atomic algorithms through the training samples; a second input module, used to obtain the target text, and execute multiple atomic algorithms in sequence according to the execution order to process the target text, so as to obtain the text features in the target text corresponding to the demand description information.

[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, wherein a program is stored in the non-volatile storage medium, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute a text feature extraction method.

[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the program executes a text feature extraction method when the program is run.

[0016] In an embodiment of the present application, a method is adopted in which demand description information corresponding to the business type of the target text is determined, wherein the demand description information is used to determine the text features that need to be extracted; a training sample is obtained based on the demand description information, wherein the training sample carries annotation information, and the annotation information is used to express the text features corresponding to the demand description information in the training sample; multiple atomic algorithms and the execution order of the multiple atomic algorithms are determined based on the training sample, and the multiple atomic algorithms are trained through the training sample; the target text is obtained, and the target text is processed by multiple atomic algorithms in sequence according to the execution order to obtain the text features corresponding to the demand description information in the target text. By obtaining training samples based on the demand description information and determining multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples to extract features from the target text, the purpose of obtaining a feature extraction algorithm by selecting and combining multiple atomic algorithms in the case of a small number of training samples is achieved, thereby achieving the technical effect of only needing to obtain training samples with annotation information corresponding to the demand to automatically determine multiple atomic algorithms and extract text features through multiple atomic algorithms when user needs change, thereby solving the technical problem in the related technology that the text features in the target text cannot be quickly extracted when user needs change, which is caused by the need to rebuild and train the machine learning model when user needs change. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a flowchart of a text feature extraction method based on related technology;

[0019] Figure 2 is a structural diagram of a computer terminal according to an embodiment of the present application;

[0020] Figure 3 1 is a flow chart of a text feature extraction method according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of an atomic algorithm at different levels according to an embodiment of the present application;

[0022] Figure 5 is a flowchart of an atomic algorithm training process according to an embodiment of the present application;

[0023] Figure 6 is a flowchart of a text feature extraction process according to an embodiment of the present application;

[0024] Figure 7 This is a flowchart of a practical application process of a text feature extraction method according to an embodiment of the present application;

[0025] Figure 8 1 is a flow chart of a sentence vector conversion process according to an embodiment of the present application;

[0026] Figure 9 It is a structural diagram of a text feature extraction device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] In related technologies, when it is necessary to extract text features, the processing flow is as follows: Figure 1 As shown. Usually, the target user needs to describe the needs, and then the staff will analyze the user needs, and then customize the algorithm and train it. During the training process, a large amount of text data is needed as training samples, and the training process is determined to be complete based on the text features output by the algorithm. It can be seen that in related technologies, when the user's needs change, the algorithm also needs to be redesigned and trained, which leads to poor timeliness. In addition, in some specific fields, it is impossible to pass the test due to the inability to provide a large number of training samples. Figure 1 To solve this problem, a related solution is provided in the embodiment of the present application, which is described in detail below.

[0030] According to an embodiment of the present application, a method embodiment of a text feature extraction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 2 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a text feature extraction method. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 2 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 2 Different configurations shown.

[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the text feature extraction method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the text feature extraction method of the above-mentioned application. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0036] In the above operating environment, the embodiment of the present application provides a text feature extraction method, such as Figure 3 As shown, the method includes the following steps:

[0037] Step S302: Determine the demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine the text features to be extracted;

[0038] In the technical solution provided in step S302, the annotation information includes feature value information in the training sample and feature key information in the training sample, and the feature key information includes whether it is a subject-related feature.

[0039] Specifically, the feature key information can be used to select the atomic algorithm. For example, when it is determined based on the feature key information that the features in the training sample include subject-related features, the subject feature recognition algorithm can be selected as the atomic algorithm of the corresponding level.

[0040] Step S304: obtaining a training sample based on the requirement description information, wherein the training sample carries annotation information, and the annotation information is used to describe text features in the training sample corresponding to the requirement description information;

[0041] In the technical solution provided in step S304, the training samples are unstructured text data, and in the embodiment of the present application, there is no need to provide a large number of samples, only a small number of samples carrying annotation information are required.

[0042] Step S306, determining multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples, and training the multiple atomic algorithms using the training samples;

[0043] In the technical solution provided in step S306, the step of determining multiple atomic algorithms and the execution order of multiple atomic algorithms based on training samples includes: determining the text feature information of the training samples based on the annotation information; determining multiple atomic algorithms based on the text feature information and text structure information of the training samples, and determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms; determining the execution order of multiple atomic algorithms based on the algorithm level, wherein the smaller the algorithm level corresponding to the atomic algorithm, the smaller the serial number corresponding to the atomic algorithm in the execution order.

[0044] Specifically, in the embodiments of the present application, based on the annotated feature text, the training can be performed layer by layer (the layer is represented by Li, where i is a natural number starting from 1, such as L1, L2, L3, L4, L5, etc.) to automatically select the appropriate atomic algorithm. Each layer has multiple atomic algorithms. Based on the analysis of the labeled sample, the appropriate atomic algorithm is selected and the algorithm parameter values ​​are derived.

[0045] It should be noted that the atomic algorithm provided in the embodiment of the present application does not necessarily have to be five-layered. The number of layers can be set by the user or changed based on the annotation information in the training sample.

[0046] In some embodiments of the present application, multiple atomic algorithms are determined based on the annotation information and text structure information of the training sample, and the steps of determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms include: determining a first atomic algorithm of the first level based on the text structure information of the training sample, wherein the text structure information includes the paragraph pattern of the training sample; determining whether there is a target keyword in the training sample, and when it is determined that there is a target keyword, determining a second atomic algorithm of the second level based on the target keyword, wherein the second atomic algorithm is a keyword positioning algorithm; determining a third atomic algorithm of the third level based on the text feature information of the training sample; determining the feature word weight of the training sample and the weight vector of the feature word, and determining a fourth atomic algorithm of the fourth level based on the feature word weight and the weight vector; determining a fifth atomic algorithm of the fifth level based on the annotation information, wherein the fifth atomic algorithm is used to standardize the data output by the fourth atomic algorithm.

[0047] Specifically, the above process of determining the atomic algorithm and the corresponding level of the algorithm is as follows: Figure 4 As shown. Figure 4It can be seen that when determining the atomic algorithm of level L1, the labeled sample file and the template file in the standard library can be compared to determine the paragraph pattern in the atomic algorithm standard library that the paragraph where the labeled sample data is located in the training sample complies with, thereby determining the first algorithm of the first level. When determining the atomic algorithm of level L2, it can be determined based on semantic analysis whether the sentence where the feature data is located contains the target keyword. If so, the atomic algorithm of level L2 is determined. If not, it is skipped. When determining the algorithm of level L3, basic classification can be performed based on the feature type of the feature in the labeled sample to determine the third target algorithm, wherein the feature type of the feature includes whether the feature is a subject, whether the feature is a subject attribute, etc. Later, when determining the algorithm of level L4, operations such as word segmentation statistics and word vector generation can be performed on the training sample to determine the weight of the feature word, and a feature extraction formula is formed based on the feature word weight and word vector as well as the sample data, thereby determining the fourth target algorithm. Finally, when determining the algorithm of level L5, the corresponding standardized algorithm can be selected from the atomic algorithm standard library for processing based on the content extracted by the algorithm of level L4.

[0048] In some embodiments of the present application, the first atomic algorithm is a text segmentation algorithm; the second atomic algorithm is a keyword location algorithm; the third atomic algorithm is a text interception algorithm, which is used to intercept sentences containing target keywords from training samples; the fourth atomic algorithm is a feature calculation algorithm, which is used to determine feature information in the training samples; and the fifth atomic algorithm is a result normalization algorithm, which is used to normalize the data output by the fourth atomic algorithm. In addition, except for the first-level atomic algorithm, the input of the remaining atomic algorithms is the output of the atomic algorithm in the previous level.

[0049] As an optional implementation, the step of determining the algorithm level corresponding to each of the multiple atomic algorithms further includes: adjusting the algorithm level corresponding to the atomic algorithm in response to an operation instruction of the target object. For example, the second atomic algorithm can be used as the atomic algorithm of the first level, and the first atomic algorithm can be used as the atomic algorithm of the second level, etc.

[0050] In some embodiments of the present application, the processing method of the standardization processing includes at least one of the following: padding processing, truncation processing, summation processing, maximum value calculation, minimum value calculation, and numerical normalization.

[0051] In some embodiments of the present application, the step of training multiple atomic algorithms through training samples includes: obtaining feature results output by multiple atomic algorithms after processing the training samples; and determining that multiple atomic algorithms have completed training when the feature results meet preset requirements.

[0052] Specifically, the complete process of training multiple atomic algorithms is as follows: Figure 5 shown. Figure 5To assume that there is no second atomic algorithm training process, from Figure 5 As can be seen in the figure, after obtaining the atomic algorithm, the training dataset can be input into the text feature extraction algorithm composed of multiple atomic algorithms in a hierarchical manner to obtain the output result set. This result set is then compared with the pre-annotated data, and the parameters of each atomic algorithm are adjusted based on the comparison and verification results. If the comparison and verification results meet the requirements, the adjusted text annotation algorithm composed of multiple atomic algorithms in a hierarchical manner can be output.

[0053] Step S308 , obtaining the target text, and executing multiple atomic algorithms in sequence according to the execution order to process the target text, and obtaining text features in the target text corresponding to the requirement description information.

[0054] In order to facilitate understanding of the text feature extraction method provided in the embodiments of the present application, the text feature extraction method provided in the present application is further explained below with reference to a specific example.

[0055] First of all, it should be noted that the complete process of the text feature extraction method provided in this application is as follows: Figure 6 As shown. It can be seen that when using the text feature extraction method provided by this application, the feature-annotated training samples can be determined according to the demand description, and then multiple levels of atomic algorithms can be automatically selected and arranged according to the feature-annotated training samples. Then, the multiple levels of atomic algorithms are combined hierarchically to obtain a feature extraction algorithm combination, which is applied to the feature extraction process of other texts. In addition, when the text is a test text, after obtaining the feature extraction results, the feature extraction results can be compared with the test text with annotated information, and the parameters of each atomic algorithm can be adjusted based on the comparison results.

[0056] Taking a legal document describing the crime of dangerous driving as an example, the entire feature extraction process is as follows: Figure 7 As shown. First, the requirement description information must be obtained, for example: extracting the alcohol concentration in dangerous driving charges. Then, training samples labeled with alcohol concentration are required. Based on the training samples, multiple atomic algorithms are automatically determined, hierarchically sorted, and combined to obtain an alcohol concentration extraction algorithm. After obtaining the alcohol concentration extraction algorithm, the text to be processed can be input into the algorithm to obtain the feature results. At this point, the user can choose to manually verify or add annotation information to the text to be processed and compare the annotation information with the feature results, thereby adjusting the various atomic algorithms based on the feature results.

[0057] In some embodiments of the present application, taking a legal document describing the crime of dangerous driving as an example, the sample can be marked with a subject, the subject is a person's name, the attribute is a numerical value, and the specific alcohol concentration is marked in the text.

[0058] In some embodiments of the present application, taking the legal document describing the crime of dangerous driving as an example, the steps to determine the atomic algorithms at each level are as follows:

[0059] First level: Determine whether it is a feature related to the subject according to the annotation. If so, select the [Subject Recognition Algorithm] in layer L1. Case of alcohol concentration feature: According to the annotation, there is a subject, and the subject is a person's name. Therefore, the algorithm in layer L1 automatically selects the atomic algorithm L1 "Extract Subject Person Name Algorithm" in the [Subject Recognition Algorithm].

[0060] Second level; Characteristics of the text block where it is located: Based on the text segmentation algorithm, analyze the text block starting or ending with a specific keyword and calculate the text similarity of the feature text block (using cosine similarity) through sample information, and calculate the parameters of the feature text block algorithm, that is, select the [Text Block Algorithm] and parameters in layer L2.

[0061] [ Among them, the process of converting a sentence into a vector is as Figure 8 shown. It includes the following steps:

[0062] S802, determine the sentence to be converted, for example, "After legal review and verification";

[0063] S804, segment the determined sentence to be converted, for example, "After / legal / review / verification";

[0064] S806, list all the words segmented, and calculate the word frequency of each word, for example, "After 1 legal 1 review 1 verification 1";

[0065] S808, vectorize the word frequency to obtain the vector model corresponding to the sentence to be converted, for example, (1, 1, 1, 1).

[0066] After obtaining the vector model corresponding to the sentence to be converted, the similarity between the two sentences to be converted can be calculated by substituting the vectors corresponding to the two sentences to be determined for the cosine similarity into the cosine similarity calculation formula.

[0067] In this way, according to the annotation value, the text block where the target value is located can be compared, and after analyzing and calculating the similarity value, it is concluded that there are the same start sentence and end sentence. Therefore, the "Start Marker Block" atomic algorithm in L2 [Text Block Algorithm] is selected, with the parameter start sentence: After legal review and verification, end sentence: The evidence is as follows.

[0068] The third level: characteristics of the text sentences: through word segmentation, word frequency statistics, and analysis of the annotated samples to see if the sentence contains a certain type of identical keywords, combined with the annotation information of the extracted features, if the annotation selection contains keywords, the keywords are calculated through word frequency calculations, and the keywords are used as positioning to locate the specific feature sentences. This level derives the L3 layer's [Text Truncation Algorithm] and its parameters. Example of alcohol concentration characteristics: Based on the subject, word segmentation, word frequency statistics, and annotation information (keywords), the atomic algorithm of the L3 [Text Truncation Algorithm] is derived as "the sentence containing the subject's name and the keyword", and the parameter keywords are: alcohol, ethanol, subject: name.

[0069] The fourth level: Feature value features: By analyzing the extracted key sentences, a model of characteristic key sentences is constructed through word segmentation, part-of-speech (POS) weights, and offset analysis. Keywords are used as landmarks, and the L4 layer's feature calculation algorithm and parameters are derived by combining POS weights, part-of-speech (noun, verb, quantifier, adjective), offset, and feature attributes (value, address, time). For the alcohol concentration feature example, the L4 layer's feature calculation algorithm is determined to be "keyword post-offset," with parameters: keyword: alcohol or ethanol; offset: 1; POS: quantifier; value: 1.

[0070] Level 5: Feature Verification: By analyzing sample annotations and selecting the appropriate L5 Result Normalization Algorithm, the selected value is processed, such as padding, truncating, summing, maximizing, and minimizing the result. For the alcohol concentration feature example, the final result value is a numeric value, so the atomic algorithm for the L5 Result Normalization Algorithm is "Normalize Numeric Value," which normalizes the value.

[0071] The final atomic algorithms and execution order are as follows:

[0072] The first level is “algorithm for extracting subject names”;

[0073] The second level, the "Starting Mark Block Algorithm" parameter starts with the sentence: After investigation and verification according to law, the ending sentence: The evidence is as follows;

[0074] The third level is "the algorithm for extracting sentences containing the subject's name and keywords", the parameter keywords are: alcohol or ethanol, subject: name

[0075] The fourth level is "keyword post-offset algorithm", with parameter keywords: alcohol@ethanol, alcohol or ethanol; offset: 1; part of speech: quantifier; value: 1.

[0076] The fifth level is “standardized numerical algorithms”.

[0077] Through the above steps, we achieve the goal of addressing different feature extraction requirements by simply selecting a small number of documents as training material for feature annotation. By defining the attributes of these features, such as the subject and case circumstances, we automatically analyze the scope and logic of feature extraction, thereby automatically selecting, arranging, and executing document atomic algorithms to meet different text feature extraction needs and mine implicit, unknown, and business-significant information from large amounts of text data. This data is labeled data for business decision-making applications. It is the product of combining textual patterns and business relationships within large amounts of data using various analytical algorithms. It represents a beneficial combination of statistics, data technology, and artificial intelligence, and is suitable for application scenarios with complex text feature extraction logic and diverse algorithm types.

[0078] In addition, the text feature extraction method provided in the embodiment of the present application can automatically arrange atomic algorithms according to different feature requirement descriptions, and directly generate algorithm combinations corresponding to the feature requirements, thereby improving the flexibility of the data extraction direction and the reusability of the algorithm; through a small number of samples, the text feature extraction algorithm can be automatically and flexibly arranged, effectively improving the algorithm logic implementation under different feature requirements, and realizing the big data application of small data.

[0079] The present invention provides a text feature extraction device. Figure 9 It is a structural diagram of the text feature extraction device, such as Figure 9 As shown, the device includes: an interactive module 40, used to determine the demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine the text features that need to be extracted; a first input module 42, used to obtain training samples based on the demand description information, wherein the training samples carry annotation information, and the annotation information is used to express the text features in the training samples corresponding to the demand description information; a processing module 44, used to determine multiple atomic algorithms and the execution order of multiple atomic algorithms based on the training samples, and train the multiple atomic algorithms through the training samples; a second input module 46, used to obtain the target text, and execute multiple atomic algorithms in sequence according to the execution order to process the target text, so as to obtain the text features in the target text corresponding to the demand description information.

[0080] In some embodiments of the present application, the annotation information includes feature value information in the training sample and feature key information in the training sample, where the feature key information includes whether it is a subject-related feature.

[0081] In some embodiments of the present application, the steps of the processing module 44 determining multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples include: determining the text feature information of the training samples based on the annotation information; determining multiple atomic algorithms based on the text feature information and text structure information of the training samples, and determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms; determining the execution order of the multiple atomic algorithms based on the algorithm level, wherein the smaller the algorithm level corresponding to the atomic algorithm, the smaller the serial number corresponding to the atomic algorithm in the execution order.

[0082] In some embodiments of the present application, the processing module 44 determines multiple atomic algorithms based on the annotation information and text structure information of the training sample, and the steps of determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms include: determining the first atomic algorithm of the first level based on the text structure information of the training sample, wherein the text structure information includes the paragraph pattern of the training sample; determining whether there is a target keyword in the training sample, and when it is determined that there is a target keyword, determining the second atomic algorithm of the second level based on the target keyword, wherein the second atomic algorithm is a keyword positioning algorithm; determining the third atomic algorithm of the third level based on the text feature information of the training sample; determining the feature word weight of the training sample and the weight vector of the feature word, and determining the fourth atomic algorithm of the fourth level based on the feature word weight and the weight vector; determining the fifth atomic algorithm of the fifth level based on the annotation information, wherein the fifth atomic algorithm is used to standardize the data output by the fourth atomic algorithm.

[0083] In some embodiments of the present application, the step in which the processing module 44 determines the algorithm level corresponding to each of the multiple atomic algorithms further includes: adjusting the algorithm level corresponding to the atomic algorithm in response to an operation instruction of the target object.

[0084] In some embodiments of the present application, the first atomic algorithm is a text segmentation algorithm; the second atomic algorithm is a keyword positioning algorithm; the third atomic algorithm is a text interception algorithm, which is used to intercept sentences containing target keywords from training samples; the fourth atomic algorithm is a feature calculation algorithm, which is used to determine the feature information in the training samples; the fifth atomic algorithm is a result normalization algorithm, which is used to standardize the data output by the fourth atomic algorithm.

[0085] In some embodiments of the present application, the processing method of the standardization processing includes at least one of the following: padding processing, truncation processing, summation processing, maximum value calculation, minimum value calculation, and numerical normalization.

[0086] In some embodiments of the present application, the step of the processing module 44 training multiple atomic algorithms through training samples includes: obtaining feature results output by multiple atomic algorithms after processing the training samples; and determining that the multiple atomic algorithms have completed training when the feature results meet preset requirements.

[0087] It should be noted that the various modules in the above-mentioned text feature extraction device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0088] According to an embodiment of the present application, a non-volatile storage medium is also provided, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following text feature extraction method: determine the demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine the text features to be extracted; obtain training samples based on the demand description information, wherein the training samples carry annotation information, and the annotation information is used to express the text features corresponding to the demand description information in the training samples; determine multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples, and train the multiple atomic algorithms through the training samples; obtain the target text, and execute the multiple atomic algorithms in sequence according to the execution order to process the target text, so as to obtain the text features corresponding to the demand description information in the target text.

[0089] According to an embodiment of the present application, an electronic device is also provided, which includes a processor and a memory, and the processor is used to run a program stored in the memory, wherein the following text feature extraction method is executed when the program is running: determining the demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine the text features to be extracted; obtaining a training sample based on the demand description information, wherein the training sample carries annotation information, and the annotation information is used to express the text features corresponding to the demand description information in the training sample; determining multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples, and training the multiple atomic algorithms through the training samples; obtaining the target text, and executing the multiple atomic algorithms in sequence according to the execution order to process the target text, to obtain the text features corresponding to the demand description information in the target text.

[0090] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0091] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0092] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, 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, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0094] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0095] 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 relevant technology 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 for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0096] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text feature extraction method, characterized in that: include: Determining demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine text features that need to be extracted; Acquire a training sample based on the requirement description information, wherein the training sample carries annotation information, the annotation information is used to express text features in the training sample corresponding to the requirement description information, the annotation information includes feature value information in the training sample and feature key information in the training sample, the feature key information including whether it is a subject-related feature; Determining a plurality of atomic algorithms and an execution order of the plurality of atomic algorithms based on the training samples, and training the plurality of atomic algorithms through the training samples, including: determining text feature information of the training samples based on the annotation information; determining the plurality of atomic algorithms based on the text feature information and text structure information of the training samples, and determining an algorithm level corresponding to each of the plurality of atomic algorithms; determining an execution order of the plurality of atomic algorithms based on the algorithm level, wherein the smaller the algorithm level corresponding to the atomic algorithm is, the smaller the sequence number corresponding to the atomic algorithm in the execution order is; The target text is acquired, and the multiple atomic algorithms are sequentially executed in the execution order to process the target text, so as to obtain text features in the target text corresponding to the requirement description information.

2. The text feature extraction method according to claim 1, wherein: The step of determining the multiple atomic algorithms based on the annotation information and text structure information of the training sample, and determining the algorithm level corresponding to each of the multiple atomic algorithms includes: Determining a first atomic algorithm of a first level according to the text structure information of the training sample, wherein the text structure information includes a paragraph pattern of the training sample; Determining whether a target keyword exists in the training sample, and if it is determined that the target keyword exists, determining a second atomic algorithm of a second level according to the target keyword, wherein the second atomic algorithm is a keyword positioning algorithm; Determining a third atomic algorithm of a third level based on the text feature information of the training sample; Determining the feature word weights of the training sample and the weight vectors of the feature words, and determining a fourth atomic algorithm of the fourth level based on the feature word weights and the weight vectors; A fifth atomic algorithm of a fifth level is determined based on the annotation information, wherein the fifth atomic algorithm is used to perform standardization processing on data output by the fourth atomic algorithm.

3. The text feature extraction method according to claim 2, characterized in that: The step of determining the algorithm level corresponding to each of the multiple atomic algorithms further includes: In response to the operation instruction of the target object, the algorithm level corresponding to the atomic algorithm is adjusted.

4. The text feature extraction method according to claim 2, wherein: The first atomic algorithm is a text segmentation algorithm; the second atomic algorithm is a keyword positioning algorithm; the third atomic algorithm is a text interception algorithm, which is used to intercept sentences containing target keywords from the training sample; the fourth atomic algorithm is a feature calculation algorithm, which is used to determine the feature information in the training sample; the fifth atomic algorithm is a result standardization algorithm, which is used to standardize the data output by the fourth atomic algorithm.

5. The text feature extraction method according to claim 2, characterized in that: The standardization processing includes at least one of the following processing methods: padding processing, truncation processing, summing processing, finding the maximum value, finding the minimum value, and numerical normalization.

6. The text feature extraction method according to claim 1, characterized in that: The step of training the multiple atomic algorithms using the training samples includes: Obtaining feature results output after the multiple atomic algorithms process the training samples; When the feature results meet the preset requirements, it is determined that the multiple atomic algorithms have completed training.

7. A text feature extraction device, characterized in that: include: An interactive module, configured to determine demand description information corresponding to the business type of the target text, wherein the demand description information is used to determine text features to be extracted; A first input module is configured to obtain a training sample based on the requirement description information, wherein the training sample carries annotation information, the annotation information being used to describe text features in the training sample corresponding to the requirement description information, the annotation information including feature value information in the training sample and feature key information in the training sample, the feature key information including whether it is a subject-related feature; The processing module is used to determine multiple atomic algorithms and the execution order of the multiple atomic algorithms based on the training samples, and train the multiple atomic algorithms through the training samples, including: determining the text feature information of the training samples based on the annotation information; determining the multiple atomic algorithms based on the text feature information and text structure information of the training samples, and determining the algorithm level corresponding to each atomic algorithm in the multiple atomic algorithms; determining the execution order of the multiple atomic algorithms based on the algorithm level, wherein the smaller the algorithm level corresponding to the atomic algorithm is, the smaller the sequence number corresponding to the atomic algorithm in the execution order is; The second input module is used to obtain the target text and execute the multiple atomic algorithms in sequence according to the execution order to process the target text, so as to obtain text features in the target text corresponding to the requirement description information.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the text feature extraction method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the text feature extraction method according to any one of claims 1 to 6 when running.

Citation Information

Patent Citations

  • Service quality inspection method and device, storage medium and electronic device

    CN110147726A

  • Training method and device of sequence labeling model, electronic equipment and storage medium

    CN113220836A