Text information extraction method, model training method, device and storage medium
By using multiple text attribute information to cross-combination in text information extraction and combining text feature information extracted by deep learning models, the problem that deep learning models cannot effectively extract manual rule features is solved, and the accuracy of text information extraction is improved.
Patent Information
- Application Number
- CN202110124953.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-01-29
AI Technical Summary
Deep learning models may not be able to effectively extract features extractable by manual rules in text information extraction tasks, resulting in unsatisfactory prediction results.
By obtaining multiple text attribute information of the to-process text, and cross-combining these attribute information using the second machine learning model, generating combined attribute information, and combining text feature information extracted by the first machine learning model, classification processing is performed to determine the target text information.
By introducing multiple text attribute information and cross-combining, the interaction between different text attribute information can be strengthened, the most distinctive feature combination representation can be identified, and the accuracy of text information extraction can be improved.
Smart Images

Figure CN113609862B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to natural language processing technology, and in particular to a text information extraction method, a model training method, a device and a storage medium. Background Art
[0002] With the development of artificial intelligence (AI) technology and the growing demand for applications in specific fields, research on applying artificial intelligence technology to specific fields such as the medical field has developed. Among them, natural language processing (NLP) technology is an important branch of artificial intelligence technology. Among them, text information extraction is an important task in natural language processing technology. At present, deep learning models are usually used for text information extraction tasks. The good effect of deep learning models is based on a large amount of high-quality labeled data. The larger the amount of data, the easier it is to generalize and practical the trained deep learning model. Although the deep learning method can automatically extract data features that are difficult to obtain by artificial rules, its process belongs to a black box model, which means that for some features that can be extracted by artificial rules, the deep transfer learning model may not guarantee that the feature can be extracted. Therefore, the deep learning model still needs to use artificial features, so it is proposed to combine artificial features with deep transfer learning features to optimize the overall performance of the model, but the prediction effect of the above combination method is not ideal at present. Summary of the invention
[0003] In order to solve at least one of the above-mentioned technical problems, the present application provides a text information extraction method, a model training method, a text information extraction device, a model training device and a computer-readable storage medium to improve the accuracy of text information extraction.
[0004] According to a first aspect of the present application, a text information extraction method is provided, comprising the following steps:
[0005] Get the text to be processed;
[0006] Acquire multiple text attribute information of the text to be processed;
[0007] Inputting the text to be processed into a first machine learning model, performing feature extraction on the text to be processed to obtain a plurality of first text feature information;
[0008] Inputting the plurality of text attribute information into a second machine learning model, cross-combining the respective text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, and the second machine learning model combining the plurality of text attribute information and the plurality of text interaction attribute information to obtain combined attribute information;
[0009] The combined attribute information is respectively concatenated with each of the first text feature information to obtain a plurality of second text feature information;
[0010] The plurality of second text feature information are input into a classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
[0011] According to a second aspect of the present application, a model training method is provided, comprising the following steps:
[0012] Obtain training data, the training data comprising training text and annotation information, the annotation information being used to annotate target text information of the training text;
[0013] Acquire multiple text attribute information of the training text;
[0014] Inputting the training text into a first machine learning model, performing feature extraction on the training text to obtain a plurality of first training text feature information;
[0015] Inputting the plurality of text attribute information into a second machine learning model, cross-combining the respective text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, and the second machine learning model combines the plurality of text attribute information and the plurality of text interaction attribute information to obtain training text combination attribute information;
[0016] The training text combination attribute information is respectively concatenated with each of the first training text feature information to obtain a plurality of second training text feature information;
[0017] Inputting the plurality of second training text feature information into a classification model for classification processing to determine a predicted text extraction result of the training text;
[0018] According to the predicted text extraction result and the annotation information, the parameters of at least one of the first machine learning model, the second machine learning model, and the classification model are modified.
[0019] According to a third aspect of the present application, a text information extraction device is provided, comprising:
[0020] A text acquisition device, used for acquiring the text to be processed;
[0021] A text acquisition device, used for acquiring the text to be processed;
[0022] A text attribute acquisition device, used for acquiring a plurality of text attribute information of the text to be processed;
[0023] A text feature recognition unit, used for inputting the text to be processed into a first machine learning model, performing feature extraction on the text to be processed to obtain a plurality of first text feature information;
[0024] An attribute combination unit, used for inputting the plurality of text attribute information into a second machine learning model, cross-combining the respective text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, wherein the second machine learning model combines the plurality of text attribute information and the plurality of text interaction attribute information to obtain combined attribute information;
[0025] A text feature concatenation unit, used for concatenating the combined attribute information with each of the first text feature information to obtain a plurality of second text feature information;
[0026] The prediction unit is used to input the plurality of the second text feature information into a classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
[0027] According to a fourth aspect of the present application, a model training device is provided, comprising:
[0028] A training data acquisition device, used to acquire training data, wherein the training data includes training text and annotation information, and the annotation information is used to annotate target text information in the training text;
[0029] A training text attribute acquisition device, used to acquire a plurality of text attribute information of the training text;
[0030] A training text feature recognition unit, used for inputting the training text into a first machine learning model, performing feature extraction on the training text to obtain a plurality of first training text feature information;
[0031] An attribute combination unit, used for inputting the plurality of text attribute information into a second machine learning model, cross-combining the respective text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, wherein the second machine learning model combines the plurality of text attribute information and the plurality of text interaction attribute information to obtain training text combination attribute information;
[0032] A training text feature combination unit, used for respectively splicing the training text combination attribute information with each of the first training text feature information to obtain a plurality of second training text feature information;
[0033] A prediction unit, used for inputting the plurality of second training text feature information into a classification model for classification processing, and determining a predicted text extraction result of the training text;
[0034] A correction unit is used to correct the parameters of at least one of the first machine learning model, the second machine learning model, and the classification model according to the predicted text extraction result and the annotation information.
[0035] According to a fifth aspect of the present application, a text information extraction device is provided, comprising:
[0036] at least one memory for storing a program;
[0037] At least one processor is used to load the program to execute the above-mentioned text information extraction method.
[0038] According to a sixth aspect of the present application, a model training device is provided, comprising:
[0039] at least one memory for storing a program;
[0040] At least one processor is used to load the program to execute the above-mentioned model training method.
[0041] According to the seventh aspect of the present application, a computer-readable storage medium is provided, storing computer-executable instructions, wherein the computer-executable instructions are executed by a processor to perform the above-mentioned text information extraction method, or to execute the above-mentioned model training method.
[0042] The beneficial effects of the embodiments of the present application are:
[0043] The obtained text to be processed is input into the first machine learning model to extract the first text feature information of the text to be processed. In addition, multiple text attribute information of the text to be processed is obtained, and multiple text interaction attribute information is obtained after cross-combining the multiple text attribute information through the second machine learning model. The text interaction attribute information and the text attribute information are further combined to obtain combined attribute information. Multiple second text feature information is obtained by splicing the combined attribute information with each of the first text feature information respectively, and the multiple second text feature information is input into the classification model for classification processing to obtain classification prediction results to determine the target text information in the text to be processed. By introducing multiple text attribute information and cross-combining the multiple text attribute information, the interaction between different text attribute information can be strengthened to identify the most distinguishing feature combination representation. The combined attribute information can also enrich the diversity of candidate prediction results, which can effectively assist in the extraction of text information and improve the accuracy of text information extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the structure of an existing text information extraction model;
[0045] Figure 2 It is a schematic diagram of a usage scenario of the text information extraction method provided in an embodiment of the present application;
[0046] Figure 3 is a method flow chart of a text information extraction method provided in an embodiment of the present application;
[0047] Figure 4 is a schematic diagram of the model structure of the third machine learning model provided in an embodiment of the present application;
[0048] Figure 5 It is a schematic diagram of the structure of the text information extraction model provided in the embodiment of the present application;
[0049] Figure 6 yes Figure 3 A specific method flow chart of an embodiment of step 330;
[0050] Figure 7 This is a schematic diagram of the structure of an embodiment of the BERT model;
[0051] Figure 8 yes Figure 3 A specific method flow chart of an embodiment of step 340;
[0052] Fig. 9 This is the structural principle diagram of the softmax classifier;
[0053] Fig.10 is a method flow chart of the model training method provided in an embodiment of the present application;
[0054] Fig.11 yes Fig.10 A specific method flow chart of an embodiment of step 1040. DETAILED DESCRIPTION
[0055] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0056] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0059] 1) Text information: refers to the information carried by the text, including the text’s semantics, categories, keywords, or entity pairs.
[0060] 2) Text attribute information: refers to the characteristic type information of general text, such as the category of text information content (such as news information, entertainment information, etc.), the category of keywords in the text (such as sports nouns, musical instrument nouns, architectural nouns, etc.), and the general characteristics of the text (such as sentence length, word frequency).
[0061] 3) Natural Language Processing (NLP): It is a branch of artificial intelligence and linguistics. This field explores how to process and use natural language. Natural language processing includes many aspects and steps, including cognition, understanding, generation and other parts. Natural language cognition and understanding is to let the computer turn the input language into meaningful symbols and relationships, and then process it according to the purpose. The natural language generation system converts computer data into natural language.
[0062] 4) Keyword extraction: Extract words or phrases from the text that are thematically relevant and commercial.
[0063] 5) Artificial features: artificially constructed features that help the model to be trained, such as introducing text classification information recognized by the model, identifying text information in images, etc. as features into the model.
[0064] 6) String matching algorithm: It matches the string to be analyzed with the entries in a machine dictionary according to a certain strategy. If a string is found in the dictionary, the match is successful (a word is recognized).
[0065] 7) Word segmentation algorithm for n-gram grammar: The basic idea is to first perform a simple match on the sentence according to the dictionary (which can be a dictionary extracted from the training corpus or an external dictionary) to find all possible dictionary words. Then, use them and all single words as nodes to construct an n-gram segmentation graph. The nodes in the graph represent possible word candidates, the edges represent paths, and the n-gram probabilities on the edges represent costs. Finally, use the relevant search algorithm (dynamic programming) to find the path with the minimum cost from the graph as the final word segmentation result.
[0066] 8) Feature fusion strategy: a strategy for adding artificial features to machine learning models / deep learning models.
[0067] 9)RNN: The full name is Recursive Neural Networks, which is an artificial neural network with a tree-like hierarchical structure and network nodes recursively respond to input information in the order of their connection.
[0068] 10) BERT: The full name is Bidirectional Encoder Representations from Transformers, a language model training method that uses massive text. This method is widely used in various natural language processing tasks, such as text classification, text matching, and machine reading comprehension.
[0069] 11) Artificial Neural Network: Neural Network (NN) for short, in the field of machine learning and cognitive science, is a mathematical model or computational model that imitates the structure and function of biological neural networks and is used to estimate or approximate functions.
[0070] 12) Model parameter: It is a quantity that uses universal variables to establish the relationship between functions and variables. In artificial neural networks, model parameters are usually real number matrices.
[0071] 13) Factor Machine (FM) algorithm: A machine learning algorithm based on matrix decomposition. It solves the feature combination problem in large-scale sparse data by combining two features and introducing cross-term features.
[0072] 14) Token: Before any actual processing of the input text, it needs to be segmented into language units such as words, punctuation marks, numbers or pure alphanumeric characters. These units are called tokens.
[0073] 15) Softmax: Normalized exponential function, which is a generalization of the logic function. It can "compress" a K-dimensional vector containing any real number into another K-dimensional real vector, so that each element is between [0, 1] and the sum of all elements is 1.
[0074] The text information extraction method and model training method of the text provided in the embodiment of the present application can be applied to artificial intelligence. Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.
[0075] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0076] Artificial intelligence cloud service is generally referred to as AIaaS (AIas a Service). This is the service mode of a mainstream artificial intelligence platform. Specifically, the AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall: all developers can access and use one or more artificial intelligence services provided by the platform through the API interface. Some senior developers can also use the AI framework and AI infrastructure provided by the platform to deploy and operate their own cloud artificial intelligence services.
[0077] Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0078] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0079] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0080] In the task of text information extraction, deep learning models are usually used for text information extraction tasks. Among them, deep learning models are currently used for text information extraction tasks. The good effect of deep learning models is based on a large amount of high-quality labeled data. The larger the amount of data, the easier it is to generalize and practical the trained deep learning model. Although deep learning methods can automatically extract data features that are difficult to derive from artificial rules, their process is a black box model, which means that for some features that can be extracted by artificial rules, the deep transfer learning model may not be able to guarantee that the feature can be extracted.
[0081] Therefore, the deep learning model still needs to use auxiliary training features, and the artificially constructed auxiliary training features are artificial features. Therefore, a method of combining artificial features with deep transfer learning features is proposed to optimize the overall performance of the model, that is, the deep learning model processes sparse features and dense features at the same time, so that the model has both memory and generalization capabilities. Figure 1 As shown, it is a deep learning algorithm model, including Figure 1 The deep semantic model 110 shown on the left and Figure 1 The artificial feature model 120 shown on the right side is, for example, a given input text T, where the input text T consists of multiple words, that is, T = [t1, t2, ..., t n ], t iis the i-th word in the input text T. A word segmentation algorithm can be used to split an input text T into multiple words t i For example, a string matching algorithm, a word segmentation algorithm based on n-grams, or a word segmentation algorithm based on a machine learning model can be used for word segmentation. Figure 1 As shown, the deep semantic model 110 includes a sequence model, such as a sequence model based on an RNN model or a BERT model. For example, for the input text "Guide to Playing Piano", it can be divided into three phrases "play", "piano", and "guide" through a word segmentation algorithm, and then input into the deep semantic model 110. Taking the BERT model as an example, the above phrases t i Enter into Figure 1 The BERT model shown processes the characters of the input text to generate a word vector X, which is represented by:
[0082] X=x1,x2,…,x n ,X=f BERT ([t1,t2,...t n ]);
[0083] Reference Figure 1 As shown, the vector X is then processed by semantic model 111 for semantic recognition, where Figure 1 The semantic model shown in the figure combines and averages the above word vectors to generate candidate words K = {p1, p2, ..., p m}, where m is the number of candidate keywords, p i is the vector representation of each candidate word, where
[0084] p i =average(x l ,x l+1 ,…,x r ),x l ,x l+1 ,…,x r is the semantic output representation of each word in the i-th candidate word. Figure 1 p3 (corresponding to the candidate word "piano guide") is obtained by averaging x2 (corresponding to the word vector "piano") and x3 (corresponding to the word vector "guide", for example, by Figure 1 The Avg function shown calculates the average.
[0085] See also Figure 1 As shown, for the input text T, there are two artificial features: text category C d and candidate word category C i , where text category C d and candidate word category C iis a manually constructed feature to help the model train, and for the above input text T "Guide to Playing Piano" corresponding to the text category C d is "vocal music", the corresponding candidate word category C i is "Musical Instrument". Text Category C d and candidate word category C i They are converted into feature vectors through the fully connected weight matrix LookUp Table, respectively, represented as f doc and f i, Then, f doc and f i, With each candidate word vector p i Direct concatenation is performed, and the prediction vector of the generated candidate word is represented by y i =W[k i ;f doc ;f i, ]+b, where i, j are positive integers greater than or equal to 1, and [·] represents the concatenation of vectors by dimension. Finally, the predicted vector is input into the normalization layer Softmax model to determine whether the i-th candidate word is the target keyword label i ,Right now: Through careful study of the above model, the applicant found that the semantic features of the keywords and the auxiliary training features in the above model did not interact and merge effectively, so the keyword extraction model itself could not be effectively assisted in the prediction, resulting in unsatisfactory prediction results for the text information extraction task.
[0086] In view of this, the present application can help extract text information and improve the prediction effect of text information extraction tasks by cross-integrating multiple text attribute features into the information represented by text semantics.
[0087] Figure 2 2 is a schematic diagram of a use scenario of a text information extraction method provided by an embodiment of the present invention, and a system architecture 200 may include terminal devices 201, 202, 203, a network 204, and a server 205. The network 204 is used to provide a medium for a communication link between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0088] The user can use the terminal devices 201, 202, 203 to interact with the server 205 through the network 204 to receive or send messages, etc. The terminal devices 201, 202, 203 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart home devices, etc.
[0089] The server 205 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 201, 202, and 203. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.
[0090] The server 205 can, for example, obtain the training text and its annotation information from the training data, wherein the annotation information is used to annotate the target text information of the current text information extraction task in the training text. The training text is processed by the first machine learning model of the target model, and the multiple text attribute information of the training text is processed by the second machine learning model of the target model, and then the output result of the first machine learning model and the output result of the second machine learning model are combined and reclassified to obtain the target text information of the training text, and the target loss is determined according to the target text information and the annotation information of the training text to train the target model.
[0091] It should be understood that Figure 2 The number of terminal devices, networks 204 and servers 205 is merely illustrative. The server 205 may be a physical server or may be composed of multiple servers. According to actual needs, there may be any number of terminal devices, networks and servers.
[0092] Reference Figure 3 , an optional flowchart of a text information extraction method provided in an embodiment of the present application, Figure 4 The method steps include steps 310 to 360;
[0093] Step 310, obtaining the text to be processed.
[0094] In this step, the text to be processed may include only one sentence, or may include a paragraph consisting of multiple sentences, or even an article consisting of multiple paragraphs. The text to be processed may be obtained from the Internet, input by a local input device, or read from a memory. For example, the text to be processed may be extracted from a server by searching web pages that a user has browsed (e.g., web page titles, software descriptions, and original text information obtained from information articles as the text to be processed).
[0095] Step 320, obtaining multiple text attribute information of the text to be processed.
[0096] In this step, there is an association between the text attribute information and the text to be processed. The text attribute information is the characteristic type of the text to be processed. In one embodiment, it can be the category of the text information content, for example, the content of the text information is about news information, entertainment information, sports information and other categories. In one embodiment, it can also be the category of keywords in the text, for example, the category of keywords in the text information is games, sports, musical instruments, architecture and the like. In one embodiment, it can also be a general text characteristic that is unrelated to the content of the text information, such as sentence length, word frequency and the like. In this step, it is necessary to obtain multiple text attribute information, wherein the types of the text attribute information can be the same or different. For example, the text category of the text to be processed "S game is online today" can include both the game category and the news information category, so the text attribute information of the game category and the news information category can be obtained, and the types of the two text attribute information are both text categories. For another example, the text category in the text to be processed "Real arcade fishing" is "game", and the category of the keyword is also "game", but the types of the two text attributes are different. The above-mentioned categories can be primary categories or multi-level categories. For example, in the third-level category, under the primary category of information, there can be a secondary category of entertainment, and under the secondary category of entertainment, there can be a third-level category of games. By setting up multi-level categories, it is easy to classify and organize the information of each category.
[0097] In one embodiment, the text attribute types of the above-mentioned multiple text attribute information can be preset. Taking the acquisition of two text attribute information as an example, the type of the first text attribute information can be limited to a text category, and the type of the second text attribute information can be limited to a keyword category. The setting method can be constructed manually, for example, a text category set and a keyword category set are constructed for text categories and keyword categories respectively, and the text attribute information is selected from the text category set and the keyword category set, or an algorithm or prediction model for extracting text categories and keyword categories is constructed respectively to realize automatic acquisition of text categories and keyword categories.
[0098] In one embodiment, text attribute information can be obtained together with the text to be processed. For example, if a user is browsing an article in a game category or a game webpage, the webpage category or game category of the browsing page can be extracted as text attribute information while the article is obtained as the text to be processed. In another embodiment, the text to be processed obtained in step 310 can also be further processed to extract text attribute information from the text to be processed, such as extracting multiple text attribute information of the text to be processed through an algorithm or a third machine learning model. In the process of training the third machine learning model, the user can adjust the type of text attribute information output by the third machine learning model by constructing specific training samples.
[0099] Step 330: Input the text to be processed into the first machine learning model to extract multiple first text feature information from the text to be processed.
[0100] In this step, the first machine learning model is a pre-trained machine learning model. The processing object of the first machine learning model is the text to be processed, which is used to directly extract the first text feature information of the text to be processed. Among them, the first text feature information can be keyword features, classification information, semantic information, etc. of the text to be processed. In one embodiment, the first machine learning model includes a deep sequence model (such as an RNN model or a BERT model) and a semantic model. The deep sequence model is used to convert the text to be processed into vector features, and the semantic model further extracts multiple candidate text features (such as candidate keywords) from the vector features to form the first text feature information. For example, for the text to be processed "real person arcade fishing", after being processed by the first machine learning model, the first text feature information representing "real person arcade fishing", "arcade", "arcade fishing", and "fishing" will be obtained.
[0101] In one embodiment, the text to be processed can be segmented first using a word segmentation algorithm or a word segmentation model and then input into the deep sequence model.
[0102] In addition, in one embodiment, the first machine learning model can also use models such as semantic matching to perform matching prediction on the first text feature information to obtain the first text feature information.
[0103] Step 340: Input multiple text attribute information into the second machine learning model, perform cross-combination on each text attribute information input into the second machine learning model to obtain multiple text interaction attribute information, and the second machine learning model combines the multiple text attribute information and the multiple text interaction attribute information to obtain combined attribute information.
[0104] In this step, the second machine learning model is a pre-trained machine learning model, which is used to fuse and interact with the input multiple text attribute information. The process of fusion and interaction is: cross-combine each text attribute information to form text interaction attribute information, and then combine the text interaction attribute information with each text interaction attribute information to obtain combined attribute information. That is to say, the combined attribute information includes text attribute information and text interaction attribute information cross-combined by each text attribute. In one embodiment, the second machine learning model can adopt a factorization machine algorithm model.
[0105] Step 350: Concatenate the combined attribute information with each of the first text feature information respectively to obtain multiple second text feature information.
[0106] In this step, the output results of the first machine learning model and the second machine learning model are spliced, wherein the first machine learning model forms a plurality of first text feature information, and the second machine learning model fuses and interacts a plurality of text attribute information to form a combined attribute information. By splicing the combined attribute new type with each first text feature, a plurality of second text information is obtained. In one embodiment, the combined attribute new type can be spliced at the end of each first text feature.
[0107] Step 360: Input the plurality of second text feature information into the classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
[0108] In this step, the classification model is a pre-trained learning model. The second text feature combined with the text attribute information feature is input into the classification model for classification processing, and the classification model predicts the probability that the meaning represented by the input second text feature information belongs to the target text information. For example, each second text feature information is represented as Y=y1, y2, ..., yi, and yi is represented as the i-th candidate word. The second text feature information is input into the classification model for prediction. For example, the output result of the classification model is (0.4, 0.05, 0.5, ...., 0.05). This shows that in this classification result, the probability that y1 is the target feature is 0.4, the probability that y2 is the target feature is 0.05, the probability that y3 is the target feature is 0.5, and the probability that yi is the target feature is 0.05. For the above probabilities, in combination with certain threshold conditions, the target feature can be determined. For example, if the probability above 0.3 is set as the target feature, then y1 and y3 are both target features, and the text feature information corresponding to y1 and y3 is the target text information.
[0109] The technical solution provided by the embodiment of the present application inputs the acquired text to be processed into the first machine learning model, extracts the first text feature information of the text to be processed, and also obtains multiple text attribute information of the text to be processed, and obtains multiple text interaction attribute information after cross-combining the multiple text attribute information through the second machine learning model, and further combines the text interaction attribute information and the text attribute information to obtain the combined attribute information. By splicing the combined attribute information with each first text feature information respectively, multiple second text feature information is obtained, and the multiple second text feature information is input into the classification model for classification processing to obtain the classification prediction result to determine the target text information in the text to be processed. By introducing multiple text attribute information and cross-combining the multiple text attribute information, the interaction between different text attribute information can be strengthened to identify the most distinguishing feature combination representation, and the combined attribute information can also enrich the diversity of candidate prediction results, which can effectively assist in the extraction of text information and improve the accuracy of text information extraction.
[0110] In one embodiment, among the multiple pieces of text attribute information obtained, it includes the first text attribute information with the text attribute type being the text category, and the second text attribute information with the text attribute type being the candidate word category. By defining the types of text attributes as the text category and the candidate word category, and then fusing the text category and the candidate word category through the second machine learning model, the embodiments of the present application can be applicable to the extraction of keyword information. For example, for the two pieces of text attribute information C1 and C2 obtained, the text attribute type of C1 can be defined as the text category, and the text attribute type of C2 can be defined as the candidate word category. Among them, the setting method can be constructed manually. For example, a text category set and a keyword category set are constructed for the text category and the keyword category respectively. The text attribute information C1 is selected from the text category set, and the text attribute information C2 is selected from the keyword category set. Additionally, referring to the above embodiments, algorithms or prediction models for extracting the text category and the keyword category can also be constructed respectively to achieve the automatic acquisition of the text category and the keyword category. For example, referring to Figure 4 As shown in the third machine learning model, the third machine learning model is trained through the manually constructed training data so that it can identify the text category and the candidate word category in the text to be processed. For example, for the text to be processed "Real Person Arcade Fishing", after inputting it into the third machine learning model for identification, the text attribute information C of the text category will be extracted d = "Game", and the text attribute information C of the candidate word category will be extracted i = "Game". Among them, the third machine learning model can adopt currently mature machine learning models, such as decision tree, neural network model, support vector machine model, etc.
[0111] Referring to Figure 5 As shown, it is an embodiment of a target model in the server 205. The target model includes a first machine learning model 510, a second machine learning model 520, and a classification model 530. Among them, the first machine learning model 510 includes a deep sequence model 511 and a semantic model 512.
[0112] Referring to Figure 6 As shown, in one embodiment, the above step 330 specifically includes the following steps:
[0113] Step 610, perform character processing on the text to be processed to obtain multiple phrases.
[0114] In this step, the text to be processed is divided into multiple phrases by a word segmentation algorithm or a word segmentation model. For example, for the text to be processed "Real Person Arcade Fishing", after word segmentation, it forms three phrases: "Real Person", "Arcade", and "Fishing". The text to be processed is represented by T, then T = [t1, t2,..., t n , t iis the i-th word in the input text T. Then t1 = "real person", t2 = "arcade", t3 = "fishing". By performing character processing on the text to be processed, the recognition processing of the first machine learning model 510 can be facilitated, and the recognition processing efficiency of the first machine learning model 510 can be improved.
[0115] Step 620, input the multiple phrases into the first machine learning model, perform semantic recognition on the multiple phrases, and obtain multiple first text feature information, wherein the first text feature information is a candidate word feature vector.
[0116] In this step, if Figure 7 As shown, the deep sequence model 511 in the first machine learning model 510 adopts the BERT model, wherein the BERT model is obtained through transfer learning (secondary training on a pre-trained model of others for one's own application). The text to be processed is in units of phrases T = [t1, t2, ..., t n ], as Tok1, Tok2, …, TokN on the BERT model input side, the BERT model processes the characters of the input text to generate a word vector X, which is expressed as: X = x1, x2, …, x n ,X=f BERT ([t1,t2,...t n ]).
[0117] Then, the semantic model is used to perform semantic recognition processing on the vector X, where Figure 5 The semantic model 512 shown in FIG. 5 combines and averages the above-mentioned word vectors to generate the first text feature information K={p1, p2, …, p m}, where m is the number of candidate keywords, p i is the feature vector representation of each candidate word, where p i =average(x l ,x l+1 ,…,x r ),x l ,x l+1 ,…,x r is the semantic output representation of each word in the i-th candidate word. Figure 5 In the equation, p3 (corresponding to the candidate word “arcade fishing”) is obtained by averaging x2 (corresponding to the word vector “arcade”) and x3 (corresponding to the word vector “fishing”). Figure 5 The Avg function is used to calculate the average.
[0118] In addition, in one embodiment, in addition to using combined averaging, the semantic model 512 may also use a weighted and convolutional processing model for semantic recognition.
[0119] Through the above steps 610 and 620, the first text feature information is extracted from the text to be processed, so as to facilitate the subsequent further classification process.
[0120] Reference Figure 8 As shown, in one embodiment, the above step 340 may further include the following steps:
[0121] Step 810, cross-combining each text attribute information input into the second machine learning model in pairs to obtain multiple text interaction attribute information.
[0122] In this step, the second machine learning model is used to cross-combine the text attribute information of each input in pairs to obtain text attribute interaction information. For example, when there are two text attribute information C1 and C2, C1 and C2 are cross-combined to form text attribute interaction information C 12 When there are three text attribute information C1, C2 and C3, C1 is cross-combined with C2 and C3, and C2 is cross-combined with C3 to form C 12 , C 12 and C 23 Text interaction attribute information. Similarly, more text attribute information can be obtained for cross-fusion. By cross-combining two text attribute information, each text attribute information can be fully interactive.
[0123] In step 820, the second machine learning model weights the multiple text attribute information and the multiple text interaction attribute information to obtain text combination attribute information.
[0124] In this step, multiple text attribute information and multiple text interaction attribute information are weighted to obtain combined attribute information. For example, for two text attribute information C1 and C2, the text attribute interaction information C of C1 and C2 is obtained through the above steps. 12 In this step, C1, C2 and C 12 Weighted, combined attribute information is obtained.
[0125] In one embodiment, in combination Figure 5 The working process of the second machine learning model 520 is further described as shown in FIG. 5 , wherein the second machine learning model 520 adopts a factorization machine algorithm model (FM model), and the type of text attribute information is the text category C d and candidate word category C i Take the following example to obtain the text attribute information C corresponding to the text to be processed T. d = "Game", text attribute information C i = "game". The text attribute information can be obtained together with the text to be processed, or can be obtained from the text to be processed T through an algorithm or machine learning model. The obtained text category Cd and candidate word category C i They are converted into feature vectors through the fully connected weight matrix LookUp Table, denoted as f1 and f2 respectively.
[0126] Input f1 and f2 into the FM model for cross-fusion processing. Specifically, the vector obtained by FM modeling can be expressed as:
[0127]
[0128] Where i, j are positive integers greater than or equal to 1, w0, w1 and w ij is the parameter of the FM model, and fi is the value of each text attribute information. In the above FM model, w0 is the bias term, is the first-order term, w1 represents the weight of the first-order term, and the first-order term includes all the text attribute information input to the FM model. is the second-order term, w ij Represents the weight of the second-order term, which realizes the cross-combination of each text attribute information and forms text attribute interaction information. It can be obtained by molecular decomposition, thereby reducing the computational complexity:
[0129]
[0130] In the above formula, k is the dimension of the feature vector, <v i , v j > represents the weight of the second-order term, v i , v j f i Corresponding latent vectors. After decomposing the text to be processed using the FM model, the corresponding attribute characteristics, latent vectors, and bias items can be obtained. The text category and candidate word category in the above-mentioned text to be processed correspond to an attribute feature respectively. The first-order features of these attribute features constitute the above-mentioned first-order items, and the latent vectors of the text category and candidate word category constitute the above-mentioned second-order items.
[0131] Finally, the above bias terms, first-order terms and second-order terms are summed to form the combined attribute information, which can also be understood as the attribute information of each text f i Interaction information with each text attribute f i f j Weighted combination attribute information x FM , w0, w1 and w ij The FM model can further strengthen the interaction between different text attribute information. It creatively proposes cross terms and solves the problem of cross term parameter system by using latent vectors, which can better extract low-order terms in samples.
[0132] Reference Figure 5 As shown, the first machine learning model 510 performs semantic recognition processing on the processed text T to obtain a plurality of second text feature information p i =average(x l ,x l+1 ,…,x r ); The second machine learning model 520 processes each text attribute information to obtain combined attribute information In one embodiment, the second text feature information P i and combined attribute information x FM are represented by vectors, so x can be combined using a character merging algorithm such as the CONCAT function. FM Vector and each P i Vectors are concatenated to obtain the second text feature information y i =[p i ,x FM ], where i, j are positive integers greater than or equal to 1, and [·] represents the concatenation of vectors by dimension.
[0133] Reference Figure 5 As shown, the concatenated second text feature information y i The input is processed into the classification model 530 to obtain the classification prediction result to determine the target text information of the text to be processed. Among them, the classification model 530 can be implemented using a normalized index (softmax) classifier, referring to Fig. 9 As shown, the softmax classifier consists of an input layer 910, a first hidden layer 920, a second hidden layer 930 and an output layer 940. The n+m dimensional vector is normalized by the softmax classifier, and finally the n+m dimensional vector is mapped to a z dimensional output vector. The actual function of the softmax classifier is to map the input vector to the classification result. The classification model predicts the probability that the meaning represented by the input second text feature information belongs to the target text information. For example, each second text feature information is represented as y i =y1,y2,...,y i ,y i It is represented as the i-th candidate word, and the classification model can be used to determine whether the i-th candidate word is a keyword label i ,Right now:
[0134]
[0135] For example, the output result of the classification model is (0.4, 0.1, 0.4, 0.1). This means that in this classification result, the probability that y1 is the target feature is 0.4, the probability that y2 is the target feature is 0.1, the probability that y3 is the target feature is 0.4, and the probability that y4 is the target feature is 0.1. With certain threshold conditions, the target feature can be determined. For example, if the probability above 0.3 is set as the target feature, then y1 and y3 are determined to be the target features, and the text feature information corresponding to y1 and y3 is the target text information. For example, Figure 5 As shown, the target text information corresponding to y1 is "real person arcade fishing", and the target text information corresponding to y3 is "arcade fishing". It can be seen that through Figure 5 The target model shown extracts target text information from the text to be processed.
[0136] Reference Fig.10 is a flow chart of a model training method provided in this embodiment. The model trained by this method can be applied to Figure 4 In the text information extraction method shown in FIG. Figure 3 The server 305 shown is an example of an execution subject, and a target model is set in the server, and the target model includes a first machine learning model 510, a second machine learning model 520 and a classification model 530. The first machine learning model 510 includes a deep sequence model 511 and a semantic model 512.
[0137] See also Fig.10 , the model training method of this embodiment includes the following steps 1010 to 1070.
[0138] Step 1010: Acquire training data, where the training data includes training text and annotation information, where the annotation information is used to annotate target text information of the training text.
[0139] In this step, the training data includes the training text and its corresponding annotation information. The training text may include only one sentence, or may include a paragraph consisting of multiple sentences, or even an article consisting of multiple paragraphs. The training text may be obtained from the Internet, input by a local input device, or read from a memory. The annotation information is the expected output result of the training text in the current text information extraction task, that is, the target text information of the training text. For example, if the current text extraction task is to extract keywords, the annotation information is the keywords of the training text. If the text extraction task is to classify the text, the annotation information is the classification of the text. The annotation information can be annotated manually, and the annotation information can also be automatically generated by an algorithm, such as matching keywords in the training text through a vocabulary.
[0140] Step 1020, obtaining multiple text attribute information of the training text.
[0141] In this step, the text attribute type of the text attribute information can be pre-set. Taking the acquisition of two text attribute information as an example, the type of the first text attribute information can be limited to a text category, and the type of the second text attribute information can be limited to a keyword category. The setting method can be constructed manually, for example, a text category set and a keyword category set are constructed for the text category and the keyword category respectively, and the text attribute information is selected from the text category set and the keyword category set, or an algorithm or prediction model for extracting text categories and keyword categories is constructed respectively to realize the automatic acquisition of text categories and keyword categories. The text attribute information can be obtained together with the training text, or the text attribute information can be extracted from the training text, for example, multiple text attribute information of the training text is extracted by an algorithm or a third machine learning model. Among them, the user can train the third machine learning model by constructing a specific training sample to construct the type of text attribute information output by the third machine learning model.
[0142] Step 1030: Input the training text into the first machine learning model, extract features from the training text to obtain a plurality of first training text feature information. Figure 3 The specific implementation method of step 330 is the same.
[0143] Step 1040: Input multiple text attribute information into the second machine learning model, cross-combine each text attribute information input into the second machine learning model to obtain multiple text interaction attribute information, and the second machine learning model combines the multiple text attribute information and the multiple text interaction attribute information to obtain training text combination attribute information. Figure 3 The specific implementation method of step 340 is the same.
[0144] Step 1050: Combine the training text combination attribute information with each first training text feature information to obtain a plurality of second training text feature information. Figure 3 The specific implementation method of step 350 is the same.
[0145] Step 1060: Input the plurality of second training text feature information into the classification model for classification processing to determine the predicted text extraction result of the training text. Figure 3 The specific implementation method of step 350 is the same.
[0146] Step 1070, based on the predicted text extraction results and the annotation information, modify the parameters of at least one of the first machine learning model, the second machine learning model, and the classification model.
[0147] In this step, the annotation information is compared with the predicted text extraction result output by the target model. The cross entropy is calculated, and then the parameters of the relational target model are updated through the BP (Backpropagation, i.e., error back propagation) algorithm. The input-output relationship of the BP network is essentially a mapping relationship: the function performed by a BP neural network with m inputs and m outputs is a continuous mapping from a one-dimensional Euclidean space to a finite field in an m-dimensional Euclidean space, and this mapping is highly nonlinear. Its information processing ability comes from the multiple compounding of simple nonlinear functions, so it has a strong function reproduction ability. This is the basis for the application of the BP algorithm. The back propagation algorithm mainly consists of two links (excitation propagation and weight update) that are repeatedly iterated until the network's response to the input reaches a predetermined target range. In the model learning stage, if the expected output value is not obtained in the output layer, the sum of the squares of the output and the expected error is taken as the objective function, and back propagation is started to calculate the partial derivative of the objective function with respect to the weight of each neuron layer by layer, forming the gradient of the objective function with respect to the weight vector as the basis for modifying the weight. The learning of the network is completed in the process of weight modification. When the error reaches the expected value, the network learning ends.
[0148] In one embodiment, the first machine learning model, the second machine learning model, and the classification model in the target model can be jointly trained at the same time to adjust the parameters of each model. It is also possible to train and adjust the parameters of a certain learning model separately, such as adjusting the parameters of the second machine learning model separately, or fix one model and train the parameters of the other two learning models, such as fixing the first machine learning model and jointly training the second machine learning model and the classification model.
[0149] Reference Fig.11 As shown, in one embodiment, the above step 1040 further includes:
[0150] Step 1110, cross-combining each text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information. Figure 8 The specific implementation method of step 810 is the same as that of step 810. By cross-combining the text attribute information in pairs, each text attribute information can be fully interacted.
[0151] Step 1120: The second machine learning model weights the multiple text attribute information and the multiple text interaction attribute information to obtain the training text combination attribute information. Figure 8 The specific implementation method of step 820 is the same.
[0152] The text information extraction method provided in the embodiment of the present application has better recognition performance than existing similar algorithms. By introducing multiple text attribute information and cross-combining the multiple text attribute information, it can strengthen the interaction between different text attribute information to identify the most distinctive feature combination representation. The combined attribute information can also enrich the diversity of candidate prediction results, which can effectively assist in the extraction of text information and improve the accuracy of text information extraction.
[0153] The embodiments of the present application provide a text information extraction method, which can be applied to various text information extraction tasks, such as text classification, entity extraction or keyword extraction. Taking keyword extraction as an example, an artificially constructed keyword extraction model optimized by text attribute information can be used to apply to user keyword tag mining under the advertising business, applied as keyword targeting to targeted advertising delivery, or applied as a feature to the rough and fine ranking models of the advertising system, or to assist in industry population package mining.
[0154] Specifically: first obtain the original text information from data such as advertising titles, APP descriptions, and information articles, and then use the model optimized by this solution to extract keywords that are text-relevant and commercial, and then associate them with users as user label data. When the traffic end delivers advertisements to relevant groups based on advertising requests, it can be delivered based on user-related keyword tags. For the keyword extraction task, the applicant tested text categories and candidate word categories as categories of text attribute information. For the two category features, a total of 19 first-level categories, 214 second-level categories, and 935 third-level category features are included. For training data, in actual business, training data was constructed in different texts in four scenarios: advertising, APP descriptions, e-commerce titles, and information articles. The candidate keywords in the training data are matched using the existing commercial vocabulary, and then the category features in the data set are obtained using the existing category extraction service. Through the training and testing of the target model, the superiority of the model extraction performance of the FM model integrating artificial features was verified.
[0155] The following is a performance comparison test of the information extraction model provided in the embodiments of the present application and other existing algorithm models.
[0156]
[0157] Table 1 Dataset test results
[0158] Referring to the data set shown in Table 1, a comparative experiment was conducted between the model using the FM model to fuse artificial features strategy model of the embodiment of the present application and the model not using artificial features and the model using direct splicing of artificial features. Among them, P is the precision rate (Precision), which is the proportion of accurate number of searches in the prediction; R is the recall rate (Recall), which is the ratio of the truly correct predictions to all correct ones in the prediction. F1 is a comprehensive consideration parameter for the precision rate and recall rate, and its calculation formula is: F1 = 2*P*R / (P+R). From Table 1, it can be seen that the model extraction performance of using the FM model to fuse artificial features is superior.
[0159] The present application embodiment discloses a text information extraction device, comprising:
[0160] A text acquisition device, used for acquiring the text to be processed;
[0161] A text acquisition device, used for acquiring the text to be processed;
[0162] A text attribute acquisition device, used to acquire a plurality of text attribute information of the text to be processed;
[0163] A text feature recognition unit, used for inputting the to-be-processed text into a first machine learning model, and performing feature extraction on the to-be-processed text to obtain a plurality of first text feature information;
[0164] An attribute combination unit, used for inputting a plurality of text attribute information into a second machine learning model, cross-combining each text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, and the second machine learning model combines the plurality of text attribute information and the plurality of text interaction attribute information to obtain combined attribute information;
[0165] A text feature concatenation unit, used for concatenating the combined attribute information with each of the first text feature information to obtain a plurality of second text feature information;
[0166] The prediction unit is used to input the plurality of second text feature information into the classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
[0167] The present application embodiment discloses a model training device, comprising:
[0168] A training data acquisition device is used to acquire training data, the training data includes training text and annotation information, and the annotation information is used to annotate target text information in the training text;
[0169] A training text attribute acquisition device, used to acquire a plurality of text attribute information of the training text;
[0170] A training text feature recognition unit, used to input the training text into a first machine learning model, and perform feature extraction on the training text to obtain a plurality of first training text feature information;
[0171] An attribute combination unit, used for inputting a plurality of text attribute information into a second machine learning model, cross-combining each text attribute information input into the second machine learning model to obtain a plurality of text interaction attribute information, and the second machine learning model combines the plurality of text attribute information and the plurality of text interaction attribute information to obtain training text combination attribute information;
[0172] A training text feature combination unit, used for respectively splicing the training text combination attribute information with each first training text feature information to obtain a plurality of second training text feature information;
[0173] A prediction unit, used for inputting the plurality of second training text feature information into the classification model for classification processing, and determining a predicted text extraction result of the training text;
[0174] The correction unit is used to correct the parameters of at least one of the first machine learning model, the second machine learning model, and the classification model according to the predicted text extraction results and the annotation information.
[0175] The present application embodiment discloses a text information extraction device, comprising:
[0176] at least one memory for storing a program;
[0177] At least one processor is used to load a program to execute the text information extraction method of any of the above embodiments.
[0178] The present application embodiment discloses a model training device, comprising:
[0179] at least one memory for storing a program;
[0180] At least one processor, configured to load a program to execute the model training method of any embodiment.
[0181] An embodiment of the present application discloses a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are used by a processor to execute the text information extraction method of any of the above embodiments, or to execute the model training method of any of the above embodiments.
[0182] This embodiment discloses a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the information extraction method of any of the above embodiments or implements the model training method of any of the above embodiments.
[0183] The terms "first", "second", "third", "fourth", etc. (if any) in the specification 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 sequence. 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 an order other than those illustrated or described herein, for example. 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 that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0184] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0185] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0186] 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 solution of this embodiment.
[0187] 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.
[0188] 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, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0189] The step numbers in the above method embodiment are only provided for the convenience of explanation and description, and no limitation is imposed on the order of the steps. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0190] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the described embodiments. Technical personnel familiar with the field may make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A text information extraction method, characterized in that: The following steps are involved: Get the text to be processed; Acquire multiple text attribute information of the text to be processed; Inputting the text to be processed into a first machine learning model, performing feature extraction on the text to be processed to obtain a plurality of first text feature information; Inputting the plurality of text attribute information into a second machine learning model, cross-combining each of the text attribute information input into the second machine learning model in pairs to obtain a plurality of text interaction attribute information, and the second machine learning model weighting the plurality of text attribute information and the plurality of text interaction attribute information to obtain combined attribute information; The combined attribute information is respectively concatenated with each of the first text feature information to obtain a plurality of second text feature information; The plurality of second text feature information are input into a classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
2. A text information extraction method according to claim 1, characterized in that: The step of obtaining a plurality of text attribute information of the text to be processed includes: The text to be processed is input into a third machine learning model to extract text attribute information to obtain multiple text attribute information of the text to be processed.
3. A text information extraction method according to claim 1, characterized in that: The multiple text attribute information include first text attribute information whose text attribute type is text category and second text attribute information whose text attribute type is candidate word category.
4. A text information extraction method according to any one of claims 2 to 3, characterized in that: The text attribute type of the text attribute information is preset.
5. A text information extraction method according to claim 1, characterized in that: The step of inputting the text to be processed into a first machine learning model and extracting features from the text to be processed to obtain a plurality of first text feature information includes: Performing character processing on the text to be processed to obtain multiple phrases; Input the multiple phrases into a first machine learning model, perform semantic recognition on the multiple phrases, and obtain multiple first text feature information, wherein the first text feature information is a candidate word feature vector.
6. A text information extraction method according to claim 1, characterized in that: The step of inputting the plurality of second text feature information into a classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed includes: Input each of the second text feature information into a normalized index classifier for classification to obtain multiple classification prediction results; A target classification that meets a threshold condition is determined from the classification prediction results, and target text information of the text to be processed is determined according to the target classification.
7. A model training method, characterized in that: The following steps are involved: Acquire training data, wherein the training data includes training text and annotation information, wherein the annotation information is used to annotate target text information of the training text; Acquire multiple text attribute information of the training text; Inputting the training text into a first machine learning model, performing feature extraction on the training text to obtain a plurality of first training text feature information; Inputting the plurality of text attribute information into a second machine learning model, cross-combining each of the text attribute information input into the second machine learning model, obtaining a plurality of text interaction attribute information, and the second machine learning model weighting the plurality of text attribute information and the plurality of text interaction attribute information, to obtain training text combination attribute information; The training text combination attribute information is respectively concatenated with each of the first training text feature information to obtain a plurality of second training text feature information; Inputting the plurality of second training text feature information into a classification model for classification processing to determine a predicted text extraction result of the training text; According to the predicted text extraction result and the annotation information, the parameters of at least one of the first machine learning model, the second machine learning model, and the classification model are modified.
8. A model training method according to claim 7, characterized in that: The step of obtaining a plurality of text attribute information of the training text includes: The training text is input into a third machine learning model to extract text attribute information to obtain multiple text attribute information of the training text.
9. A model training method according to any one of claims 7 to 8, characterized in that: The target text information is the keyword information of the training text, and the multiple text attribute information include first text attribute information whose text attribute type is text category, and second text attribute information whose text attribute type is candidate word category.
10. A text information extraction device, characterized in that: include: A text acquisition device, used for acquiring the text to be processed; A text attribute acquisition device, used for acquiring a plurality of text attribute information of the text to be processed; A text feature recognition unit, used for inputting the text to be processed into a first machine learning model, performing feature extraction on the text to be processed to obtain a plurality of first text feature information; An attribute combination unit, used for inputting the plurality of text attribute information into a second machine learning model, cross-combining each of the text attribute information input into the second machine learning model in pairs to obtain a plurality of text interaction attribute information, and the second machine learning model weighting the plurality of text attribute information and the plurality of text interaction attribute information to obtain combined attribute information; A text feature concatenation unit, used for concatenating the combined attribute information with each of the first text feature information to obtain a plurality of second text feature information; The prediction unit is used to input the plurality of the second text feature information into a classification model for classification processing to obtain a classification prediction result to determine the target text information of the text to be processed.
11. A text information extraction device, characterized in that: include: at least one memory for storing a program; At least one processor is used to load the program to execute the text information extraction method described in any one of claims 1 to 6.
12. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer executable instructions are executed by the processor, the text information extraction method as described in any one of claims 1 to 6, or the model training method as described in any one of claims 7 to 9 is implemented.
Citation Information
Patent Citations
Data identification method and device and computer readable storage medium
CN111061840A