A parameter adjustment method and apparatus thereof

By adjusting the parameters of the text recognition model, using BiLSTM and Multi-head attention models to obtain feature information, and generating various loss information to adjust the model parameters, the problem that LSTM is difficult to consider contextual information is solved, thus improving the accuracy and robustness of text recognition.

CN114611512BActive Publication Date: 2025-11-04HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011323900.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2025-11-04
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

LSTM-based named entity recognition methods struggle to effectively consider long-term contextual information, resulting in low text recognition accuracy.

Method used

By adjusting the parameters of the text recognition model, feature information is obtained using the first and second feature extraction models, generating sentence meaning loss information, single character loss information, and text loss information. The model parameters are adjusted when the adjustment conditions are met, including using BiLSTM and Multi-head attention models for feature extraction and fusion.

Benefits of technology

It improves the accuracy of text recognition, enhances the robustness of the model and the accuracy of feature information, and avoids overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114611512B_ABST
    Figure CN114611512B_ABST
Patent Text Reader

Abstract

The application provides a parameter adjustment method and device, which is used for adjusting model parameters of a text recognition model, thereby improving the accuracy of text recognition. The method can include: obtaining first feature information of training text according to a first feature extraction model, obtaining second feature information of the training text according to a second feature extraction model, and extracting feature information through the two feature extraction models, which is conducive to improving the accuracy of the feature information; generating sentence meaning loss information according to the first feature information and the second feature information; gating and fusing the first feature information and the second feature information to obtain a fusion matrix; generating single character loss information and text loss information according to the fusion matrix and sample data corresponding to the training text; and adjusting the model parameters of the text recognition model when the sentence meaning loss information, the single character loss information and the text loss information meet an adjustment condition, thereby improving the accuracy of text recognition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text recognition, and in particular to a parameter adjustment method and device. BACKGROUND

[0002] Text recognition is widely used in information extraction, knowledge base construction, intent detection, question and answer systems, syntax analysis, machine translation and other fields. In text recognition, named entity recognition is needed for entities with specific meanings in the text. Named entity recognition refers to the recognition of names of people, places, organizations, and proper nouns in the text. As the most basic and widely used application in natural language processing, named entity recognition is an important basic tool for improving the accuracy of text recognition. With the wide application of deep learning in natural language, the application of named entity recognition methods based on deep learning (such as named entity recognition methods based on Long Short-Term Memory (LSTM)) is becoming more and more common.

[0003] At present, the LSTM-based named entity recognition method cannot effectively consider long-term context information, and the processing of a single loss is not enough to generalize data, resulting in low accuracy of text recognition. SUMMARY

[0004] The embodiments of the present application provide a parameter adjustment method and device, which adjusts the model parameters of a text recognition model to improve the accuracy of text recognition.

[0005] In a first aspect, the present application provides a parameter adjustment method, which is used to adjust the model parameters of a text recognition model. The text recognition model includes a first feature extraction model and a second feature extraction model. The method includes: obtaining first feature information of training text according to the first feature extraction model, and obtaining second feature information of the training text according to the second feature extraction model; generating sentence meaning loss information according to the first feature information and the second feature information; gate-fusing the first feature information and the second feature information to obtain a fusion matrix; generating single character loss information and text loss information according to the fusion matrix and sample data corresponding to the training text; and adjusting the model parameters of the text recognition model when the sentence meaning loss information, the single character loss information and the text loss information satisfy an adjustment condition.

[0006] The two feature extraction models are used to extract feature information, which is helpful to improve the accuracy of the feature information. The model parameters of the text recognition model are adjusted according to the sentence meaning loss information, the single character loss information and the text loss information. The parameters of the text recognition model are adjusted through multiple loss information, thereby improving the accuracy of text recognition.

[0007] In a possible implementation, the sentence meaning feature extraction model is used to extract sentence meaning features from the first feature information to obtain first sentence meaning information; the sentence meaning feature extraction model is used to extract sentence meaning features from the second feature information to obtain second sentence meaning information; and the sentence meaning loss information is generated according to the matching degree of the first sentence meaning information and the second sentence meaning information. The parameters of the text recognition model are adjusted based on the sentence meaning loss information, which can avoid overfitting in the gating fusion process of the first feature information and the second feature information, and prevent the use of incorrect information and useless information to train the text recognition model.

[0008] In a possible implementation, the training text includes N single characters, the fusion matrix includes a single character feature set corresponding to each single character, N is a positive integer, and the single character loss information includes a single character loss value corresponding to each single character. The single character loss information is generated according to the fusion matrix and sample data corresponding to the training text, including: determining a target single character feature corresponding to each single character in the single character feature set corresponding to each single character; obtaining a sample single character feature corresponding to each single character in the sample data corresponding to the training text; and generating a single character loss value corresponding to the nth single character according to the matching degree of the target single character feature of the nth single character and the sample single character feature corresponding to the nth single character, where n is a positive integer and 0≤n≤N. Considering the single character loss information when training the text recognition model can enhance the robustness of the network.

[0009] In a possible implementation, the target single character feature is a single character feature in the single character feature set whose single character feature probability value satisfies a screening condition. The target single character feature is determined based on the single character feature probability value, thereby improving the accuracy of determining the single character feature.

[0010] In a possible implementation, the fusion matrix is used to indicate a plurality of text features corresponding to the training text, and the text loss information is generated according to the fusion matrix and sample data corresponding to the training text, including: determining a target text feature corresponding to the training text from the plurality of text features corresponding to the training text; obtaining a sample text feature in the sample data corresponding to the training text; and generating text loss information corresponding to the target text feature according to the matching degree of the target text feature and the sample text feature. The text loss information is considered when training the text recognition model, so that the context feature relationship of the training text is considered when adjusting the parameters of the text recognition model.

[0011] In a possible implementation, the training text corresponds to M text features, where M is a positive integer; the target text feature corresponding to the training text is determined from the plurality of text features corresponding to the training text, including: calculating a transition probability matrix of the fusion matrix, the transition probability matrix being used to indicate the plurality of text features corresponding to the training text; obtaining a first text feature probability value of each text feature in the fusion matrix; obtaining a second text feature probability value of each text feature in the transition probability matrix; determining the target text feature corresponding to the training text from the plurality of text features corresponding to the training text according to a sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature; m is a positive integer, and 0≤m≤M. According to the first text feature probability value of each text feature in the fusion matrix and the second text feature probability value of each text feature in the transition probability matrix, the target text feature is determined, which can make the determined target text feature more accurate.

[0012] In a possible implementation, the target loss information is obtained according to the sentence meaning loss information, the single character loss information, and the text loss information; and the model parameter of the text recognition model is adjusted when the target loss information satisfies the adjustment condition. The model parameter of the text recognition model is adjusted according to the plurality of loss information, thereby improving the accuracy of text recognition.

[0013] In a possible implementation, the recognition result of the training text is output according to the text recognition model when the target loss information does not satisfy the adjustment condition. The recognition result is output when the target loss information does not satisfy the adjustment condition, thereby improving the accuracy of text recognition.

[0014] In a second aspect, the present application provides a parameter adjustment device, comprising:

[0015] The feature acquisition unit is configured to acquire first feature information of the training text according to the first feature extraction model, and acquire second feature information of the training text according to the second feature extraction model.

[0016] The loss generation unit is configured to generate sentence meaning loss information according to the first feature information and the second feature information; gate fuse the first feature information and the second feature information to obtain a fusion matrix; and generate single character loss information and text loss information according to the fusion matrix and sample data corresponding to the training text.

[0017] The parameter adjustment unit is configured to adjust the model parameter of the text recognition model when the sentence meaning loss information, the single character loss information, and the text loss information satisfy an adjustment condition.

[0018] In a possible implementation, the loss generation unit is specifically configured to: extract sentence meaning features from the first feature information by using a sentence meaning feature extraction model to obtain first sentence meaning information; extract sentence meaning features from the second feature information by using the sentence meaning feature extraction model to obtain second sentence meaning information; and generate sentence meaning loss information according to a matching degree between the first sentence meaning information and the second sentence meaning information.

[0019] In a possible implementation, the training text includes N single characters, the fusion matrix includes a single character feature set corresponding to each single character, N is a positive integer, the single character loss information includes a single character loss value corresponding to each single character, and the loss generation unit is specifically configured to: determine a target single character feature corresponding to each single character in the single character feature set corresponding to each single character; obtain a sample single character feature corresponding to each single character in the sample data corresponding to the training text; and generate a single character loss value corresponding to the nth single character according to a matching degree between the target single character feature corresponding to the nth single character and the sample single character feature corresponding to the nth single character, where n is a positive integer and 0≤n≤N.

[0020] In a possible implementation, the target single character feature is a single character feature in the single character feature set, and a single character feature probability value of the single character feature meets a screening condition.

[0021] In a possible implementation, the fusion matrix is used to indicate a plurality of text features corresponding to the training text, and the loss generation unit is specifically configured to: determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text; obtain a sample text feature in the sample data corresponding to the training text; and generate text loss information corresponding to the target text feature according to a matching degree between the target text feature and the sample text feature.

[0022] In a possible implementation, the training text corresponds to M text features, M is a positive integer, and the loss generation unit is specifically configured to: calculate a transition probability matrix of the fusion matrix, the transition probability matrix is used to indicate the plurality of text features corresponding to the training text; obtain a first text feature probability value of each text feature in the fusion matrix; obtain a second text feature probability value of each text feature in the transition probability matrix; and determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text according to a sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature, where m is a positive integer and 0≤m≤M.

[0023] In a possible implementation, the parameter adjustment unit is specifically configured to: obtain target loss information according to the sentence meaning loss information, the single character loss information, and the text loss information; and adjust the model parameter of the text recognition model when the target loss information meets an adjustment condition.

[0024] In a possible implementation, the parameter adjustment apparatus further comprises a result output unit configured to output the recognition result of the training text according to the text recognition model when the target loss information does not satisfy the adjustment condition.

[0025] The beneficial effects of the second aspect can be referred to the beneficial effects of the first aspect.

[0026] In the third aspect, an embodiment of the present application provides a parameter adjustment apparatus, comprising a processor, a memory, and a communication interface, which are connected with each other, wherein the memory is configured to store a computer program, the computer program comprises program instructions, and the processor is configured to invoke the program instructions to execute the method described in the first aspect. The implementation and beneficial effects of the problem solving of the processing device can be referred to the method and beneficial effects described in the first aspect, and the repeated parts will not be described herein.

[0027] In the fourth aspect, an embodiment of the present application provides a computer readable storage medium, characterized in that the computer readable storage medium stores one or more instructions, and the one or more instructions are adapted to be loaded and executed by a processor to execute the method described in the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is an application environment diagram of a parameter adjustment method provided by an embodiment of the present application;

[0029] Figure 2 is an architecture diagram of a text recognition model provided by an embodiment of the present application;

[0030] Figure 3 is a flow structure diagram of a parameter adjustment method provided by an embodiment of the present application;

[0031] Figure 4 is a sentence meaning feature extraction model structure diagram provided by an embodiment of the present application;

[0032] Figure 5 is a fusion matrix diagram provided by an embodiment of the present application;

[0033] Figure 6 is a structure diagram of a parameter adjustment apparatus provided by an embodiment of the present application;

[0034] Figure 7 is a structure diagram of another parameter adjustment apparatus provided by an embodiment of the present application;

[0035] Figure 8 is a structure diagram of another parameter adjustment apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION

[0036] The terms "first" and "second" and the like in the description, claims and drawings of the application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprises", "comprising", "includes", "including" and the like are used herein to mean either "consists" or "consisting of" and include the terms "consisting essentially of" and "consists essentially of". The terms "comprises", "comprising", "includes", "including" and the like are used herein to mean either "consists" or "consisting of" and include the terms "consisting essentially of" and "consists essentially of". Recitation of ranges of values herein are merely intended to serve as a shorthand method of referring individually to each separate value falling within the range. Unless otherwise indicated herein, each individual value is incorporated into the specification as if it were individually recited herein. All methods described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The use of any and all examples, or exemplary language (e.g., "such as") provided herein, is intended merely to better illuminate the application and does not pose a

[0037] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "in an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all directed to the same

[0038] In the present application, "at least one" means one or more, "multiple" means two or more, "at least two" means two or three and three or more, and "and / or" is used to describe the relationship between associated objects, indicating that there can be three relationships, for example, "A and / or B" can mean: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one" or similar expressions refer to any combination of these items, including any combination of single or multiple 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, and c can be single or multiple.

[0039] In order to better understand the embodiments of the present application, the professional terms related to the embodiments of the present application are introduced as follows:

[0040] (Bidirectional long short term memory, BiLSTM) model

[0041] Long Short-Term Memory (LSTM) is a kind of recurrent neural network (RNN) with long-term memory capability. Its network structure is composed of one or more units with forgetful and memory functions. BiLSTM is a kind of recurrent neural network (RNN) that can learn long-term dependent information. BiLSTM is composed of forward LSTM and backward LSTM. BiLSTM extracts feature information of training text by forward and reverse calculation to obtain feature information of training text. The feature information of the training text includes part of speech, word form, word bank and entity category of words or single characters in the training text and other feature information. Among them, the feature information of single characters is single character feature. In the feature information extraction process, BiLSTM selectively forgets the information in the training text and selectively remembers the current node information, which leads to incomplete or incorrect feature information extraction when extracting feature information from long training text.

[0042] (II) Multi-head attention model

[0043] The multi-head attention model is used for mapping a query element to a series of key-value data pairs. The elements in the source are composed of a series of <Key, Value> data pairs. When a query element in the target is given, the multi-head attention model calculates the similarity or correlation between the query element and each key to obtain the weight coefficient of the value corresponding to each key, and then performs weighted summation on the weight coefficient and the corresponding value to obtain the final attention value. The attention value is used to indicate the feature information obtained by extracting features from the training text. Among them, the attention mechanism is used to perform weighted summation on the value of the element in the source, while the query and the key are used to calculate the weight coefficient of the corresponding value. The meaning of a word in a sentence is related to the context (contextual semantics). By using the multi-head attention model to extract features from the training text, the current node information can be focused on while extracting features according to the context of the training text.

[0044] (III) Conditional Random Field (CRF)

[0045] The CRF is used to predict the target text feature of the training text (the corresponding feature information when the training text is as a whole), and the target text feature of the training text is the entity class sequence of the whole sentence when the CRF completes the named entity recognition task. The server inputs the single character in the training text, the corresponding single character feature and the single character feature probability value into the CRF, and the CRF outputs the target text feature. The single character feature input into the CRF includes one or more entity classes of the single character.

[0046] (iv) Sequence labeling

[0047] Sequence labeling is to label each element of a sequence with a label. Specifically, a sequence refers to a sentence, and an element is a single character or a word (the result after segmentation) in the sentence. Sequence labeling can be to extract entity classes such as location (location), person (person), time (time), etc. from each single character or word in a sentence. When the sequence labeling is the entity class, the sequence labeling can be original labeling or joint labeling. The original labeling is to label the single character with the entity class, and the joint labeling is to label the segment (word or sentence) with the entity class.

[0048] Sequence labeling includes BIO (B-begin, I-inside, O-other) labeling. BIO labeling is to label each element as "B-X", "I-X" or "O". X is an entity class (such as location, name, time, etc.), "B-X" indicates that the segment where the element is located belongs to X type and the element is at the beginning of the segment, "I-X" indicates that the segment where the element is located belongs to X type and the element is at the middle or end of the segment, and "O" indicates that it does not belong to any type. For example, BIO labeling is performed on "navigate to Beijing", "navigate to" is labeled as "O", "Beijing" is labeled as "B-location", and "jing" is labeled as "I-location".

[0049] The sequence labeling can also adopt BIOE (B-begin, I-inside, O-other, E-end) labeling. The BIOES labeling labels each element as "B-X", "I-X", "O", or "E-X". X is an entity category (such as a place, a person name, a time, etc.), "B-X" indicates that the element belongs to the X type and the element is at the beginning of the segment, "I-X" indicates that the element belongs to the X type and the element is at the middle position of the segment, "E-X" indicates that the element belongs to the X type and the element is at the end position of the segment, and "O" indicates that it does not belong to any type. For example, the BIO labeling is performed on "call Zhang Xiaoli", "call" is labeled as "O", "Zhang" is labeled as "B-person", "Xiao" is labeled as "I-person", and "Li" is labeled as "E-person". The embodiment of the application takes the sequence labeling as an example of BIO labeling.

[0050] (V) loss information

[0051] The loss information is used to measure the inconsistency between the recognition result of the model and the true value. The smaller the loss value in the loss information is, the better the robustness of the model is. In the embodiment of the application, the sentence meaning loss information is the inconsistency between the first sentence meaning information corresponding to the first feature information and the second sentence meaning information corresponding to the second feature information. The smaller the loss value in the sentence meaning loss information is, the better the robustness of the first feature extraction model and the second feature extraction model is. The single character loss information is the inconsistency between the target single character feature predicted by the text recognition model and the sample single character feature. The text loss information is the inconsistency between the target text feature predicted by the text recognition model and the sample text feature.

[0052] The technical solutions in the embodiments of the application will be clearly and completely described in combination with the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.

[0053] The terms "comprise", "comprising", "include", "including", "contain", "containing", "have", "having", "composed of", and any variations thereof, in the specification and in the claims and the above drawings of the application, are intended to cover not only the listed steps or modules, but also optionally other steps or modules not listed, or optionally other steps or modules inherent to the processes, methods, systems, products or devices.

[0054] Figure 1FIG. 1 is a diagram of an application environment of a parameter adjustment method according to an embodiment. The parameter adjustment method is applied to a text recognition system. The text recognition system can include a client 101 and a server 102. The client 101 can be any one of a terminal, a standalone application, an application programming interface (API), or a software development kit (SDK). The terminal can be a mobile phone, a personal computer, a laptop computer, etc. The server 102 can include, but is not limited to, a cluster server. In one implementation, the client 101 sends training text to the server 102, the server 102 adjusts model parameters of a text recognition model according to the training text, and feeds back a recognition result of the training text to the client 101. In another implementation, the server 102 obtains training text from a database and feeds back a recognition result of the training text to the client 101. The client 101 invokes the text recognition model through the server 102, and the text recognition model can also be integrated into the server 102.

[0055] The text recognition model will be described in detail below. Figure 2 The architecture of the text recognition model will be described in detail below. Figure 2 The text recognition model shown in FIG. 2 includes a first feature extraction model 201, a second feature extraction model 202, a sentence meaning feature extraction model 203, a gated fusion model 204, and a CRF model 205.

[0056] The training text is input into the first feature extraction model 201 and the second feature extraction model 202, the first feature information of the training text is obtained according to the first feature extraction model 201, and the second feature information of the training text is obtained according to the second feature extraction model 202. The sentence meaning loss information is generated according to the first feature information, the second feature information, and the sentence meaning feature extraction model 203. The fusion matrix is obtained by gating the first feature information and the second feature information according to the gated fusion model 204. The single character loss information is generated according to the fusion matrix and the sample data corresponding to the training text. The text loss information is generated according to the fusion matrix, the sample data corresponding to the training text, and the CRF model 205. When the sentence meaning loss information, the single character loss information, and the text loss information satisfy an adjustment condition, the model parameters of the text recognition model are adjusted.

[0057] The first feature information of the training text is obtained through the first feature extraction model, and the second feature information of the training text is obtained according to the second feature extraction model, so that the obtained feature information considers long-term context information. The parameters of the text recognition model are adjusted through multiple loss information, thereby improving the accuracy of text recognition.

[0058] Please refer to Figure 3 , Figure 3A flowchart of a parameter adjustment method provided by an embodiment of the present application is shown in Figure 3 The parameter adjustment method can include S301-S305, wherein

[0059] S301, obtaining first feature information of training text according to a first feature extraction model, and obtaining second feature information of the training text according to a second feature extraction model.

[0060] The first feature extraction model and the second feature extraction model are different neural network models. In an embodiment of the present application, the first feature extraction model is a BiLSTM model, and the second feature extraction model is a Multi-head attention model.

[0061] In an implementation manner, the server obtains sample data from a database, and the server can also receive sample data uploaded by a client. The sample data includes training text (text information) and sequence labeling information corresponding to the training text (including sample single character features and sample text features). The sample single character features can be an entity category pre-labeled for each single character in the training text, and the sample text features can be an entity category sequence pre-labeled for the whole sentence in the training text. The server inputs the training text into the BiLSTM model and the Multi-head attention model respectively. The BiLSTM model encodes the training text forward and reversely, and connects the forward encoding and the reverse encoding to obtain the first feature information. The Multi-head attention model considers the relationship between contexts (context semantics), encodes and extracts features of the training text to obtain the second feature information. For example, the server inputs the training text "navigate to Beijing" into the BiLSTM model and the Multi-head attention model to encode and extract features, and obtains the first feature information and the second feature information respectively.

[0062] S302, generating sentence meaning loss information according to the first feature information and the second feature information.

[0063] The sentence meaning loss information is the difference between the first sentence meaning information and the second sentence meaning information extracted according to the first feature information and the second feature information respectively.

[0064] As shown in Figure 4 The sentence meaning feature extraction model includes a fully connected network, a convolution network, and a pooling layer. The parameter formula of the fully connected network input by the first feature information is the same as the parameter formula of the fully connected network input by the second feature information, and the parameter formula of the convolution network and the pooling layer input by the first feature information can be the same as or different from the parameter formula of the convolution network and the pooling layer input by the second feature information.

[0065] In an implementation manner, the server inputs the first feature information and the second feature information into a sentence meaning feature extraction model respectively. The server extracts the sentence meaning feature from the first feature information by using the sentence meaning feature extraction model to obtain first sentence meaning information. The server extracts the sentence meaning feature from the second feature information by using the sentence meaning feature extraction model to obtain second sentence meaning information. When the server generates the sentence meaning loss information as 0 according to the matching degree of the first sentence meaning information and the second sentence meaning information, it indicates that the first feature information and the second feature information are the same. When the server generates the sentence meaning loss information as not 0 according to the matching degree of the first sentence meaning information and the second sentence meaning information, it indicates that the first feature information and the second feature information are not the same. Figure 4 The server extracts the sentence meaning feature from the first feature information by using the sentence meaning feature extraction model to obtain first sentence meaning information. The server extracts the sentence meaning feature from the second feature information by using the sentence meaning feature extraction model to obtain second sentence meaning information. Figure 4 The server extracts the sentence meaning feature from the first feature information by using the sentence meaning feature extraction model to obtain first sentence meaning information. The server extracts the sentence meaning feature from the second feature information by using the sentence meaning feature extraction model to obtain second sentence meaning information. When the server generates the sentence meaning loss information as 0 according to the matching degree of the first sentence meaning information and the second sentence meaning information, it indicates that the first feature information and the second feature information are the same. When the server generates the sentence meaning loss information as not 0 according to the matching degree of the first sentence meaning information and the second sentence meaning information, it indicates that the first feature information and the second feature information are not the same.

[0066] S303, gate fusion of the first feature information and the second feature information to obtain a fusion matrix.

[0067] The gate fusion refers to that the server extracts important information based on the similarity of each feature information by using a gate fusion model. The gate fusion model can measure the interaction between the first feature information and the second feature information, and strengthen the feature information in the first feature information and the second feature information by using a weight, eliminate redundant information, and obtain a feature set of each element of the training text.

[0068] In an implementation manner, the server inputs the first feature information and the second feature information into a gate fusion model, uses a convolution network to perform gate fusion on the first feature information and the second feature information, performs "weight operation" on the feature information after the gate fusion, enhances useful feature information, and weakens useless information to obtain a fusion matrix. Specifically, the training text includes N single characters, and the N single characters correspond to P single character features (sequence labeling of single characters) in total. The output fusion matrix includes a single character feature set corresponding to the N single characters, each single character feature set includes P single character features, and each single character has P possible single character features. Wherein, N is a positive integer, and P is a positive integer. The fusion matrix further includes a single character feature probability value corresponding to each single character, which is used to represent the probability of a plurality of single character features (sequence labeling of single characters) corresponding to each single character.

[0069] For example, the first feature information and the second feature information of "navigate to Beijing" are input into the gate fusion model. "Navigate to Beijing" includes 5 single characters, and corresponds to 3 sequence labels (O, B-location, I-location) in total. The output is as follows: Figure 5The shown 5x3 fusion matrix. Each single character is a vector, and each single character corresponds to a single character feature set (1x3 matrix). Among them, the single character feature sets corresponding to the single characters "guide", "navigation", "to", "north" and "Beijing" are all [O, B-location, I-location], indicating that the single character features of the single characters "guide", "navigation", "to", "north" and "Beijing" can all be one of [O, B-location, I-location]. The single character feature probability values of the single character feature [O, B-location, I-location] corresponding to "guide" are [0.9, 0.05, 0.05] respectively, the single character feature probability values of the single character feature [O, B-location, I-location] corresponding to "navigation" are [0.9, 0.05, 0.05] respectively, the single character feature probability values of the single character feature [O, B-location, I-location] corresponding to "to" are [0.9, 0.05, 0.05] respectively, the single character feature probability values of the single character feature [O, B-location, I-location] corresponding to "north" are [0.1, 0.7, 0.2] respectively, and the single character feature probability values of the single character feature [O, B-location, I-location] corresponding to "Beijing" are [0.1, 0.2, 0.7] respectively.

[0070] S304, generating single character loss information and text loss information according to the fusion matrix and the sample data corresponding to the training text.

[0071] In an implementation manner, the server determines a target single character feature corresponding to each single character according to the single character feature set corresponding to each single character in the fusion matrix. The target single character feature is a single character feature in the single character feature set whose single character feature probability value satisfies a screening condition. For example, the target single character feature can be a single character feature with the maximum single character feature probability value.

[0072] For example, when the screening condition is that the single character feature with the maximum single character feature probability value is the target single character feature, in the single character feature set [O, B-location, I-location], the target single character features of "guide", "navigation" and "to" are determined as "O", the target single character feature of "north" is determined as "B-location", and the target single character feature of "Beijing" is determined as "I-location".

[0073] In an implementation, the server generates a single-character loss value corresponding to the nth single character according to a matching degree between a target single-character feature of the nth single character and a sample single-character feature corresponding to the nth single character. n is a positive integer, and 0≤n≤N.

[0074] For example, the server obtains sample single-character features in sample data corresponding to the training text: the sample single-character features of "guide", "navigation", and "to" are "O", the sample single-character feature of "north" is "B-location", and the sample single-character feature of "Beijing" is "I-location". The server matches the target single-character features of "guide", "navigation", "to", "north", and "Beijing" with the respective sample single-character features in the sample data, obtains a matching degree of 1 for each single character, generates a single-character loss value of 0 for each single character, and generates a single-character loss information of 1.

[0075] In an implementation, when the text feature is a sequence labeling of a sentence, the sequence labeling of the sentence is randomly composed of single-character features of each single character. The fusion matrix is used to indicate a plurality of text features corresponding to the training text. The server determines a target text feature corresponding to the training text from the plurality of text features corresponding to the training text according to the CRF model. Specifically, the training text corresponds to M text features, and M is a positive integer. The server obtains a first text feature probability value of each text feature in the fusion matrix. The first text feature probability value is used to indicate a possibility size of each sequence labeling of the text feature in the fusion matrix.

[0076] The server calculates a transition probability matrix of the fusion matrix and obtains a second text feature probability value of each text feature in the transition probability matrix. The server determines a text feature with a maximum sum of the first text feature probability value and the second text feature probability value from the plurality of text features corresponding to the training text as the target text feature corresponding to the training text according to the sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature. m is a positive integer, and 0≤m≤M.

[0077] For example, as shown in FIG. 6, the server obtains a first text feature probability value of each text feature in the fusion matrix. The first text feature probability value of each text feature is used to indicate a possibility size of each sequence labeling of the text feature in the fusion matrix. Figure 5The fusion matrix shows that the text feature of "navigate to Beijing" has 243, including: [O, O, O, B-location, I-location], the first text feature probability value of the text feature is the sum of the individual character feature probability value 4.1; the text feature [O, O, O, B-location, B-location], the first text feature probability value of the text feature is 3; the text feature [O, B-location, I-location, B-location, I-location], the first text feature probability value of the text feature is 2.4; the text feature [B-location, O, O, I-location, I-location], the first text feature probability value of the text feature is 2.75, and the first text feature of 243 text features can be obtained in turn. The server calculates the transition probability matrix of the fusion matrix, and in the transition probability matrix, the second text feature probability value of each text feature is obtained. The server calculates the sum of the first text feature probability value and the second text feature probability value of each text feature, and determines the text feature [O, O, O, B-location, I-location] with the largest sum of the first text feature probability value and the second text feature probability value as the target text feature.

[0078] In an implementation manner, the server obtains a sample text feature (sequence labeling of a whole sentence pre-labeled in a training text) in sample data corresponding to the training text; and generates text loss information corresponding to the target text feature according to a matching degree of the target text feature and the sample text feature. For example, the target text feature of "navigate to Beijing" output by the CRF model is [O, O, O, B-location, I-location], and the sample text feature is [O, O, O, B-location, I-location], so the matching degree of the target text feature and the sample text feature is 1, and the text loss information corresponding to the target text feature is 0.

[0079] S305, when the sentence meaning loss information, the single character loss information and the text loss information meet the adjustment condition, adjusting the model parameters of the text recognition model.

[0080] In an implementation manner, the target loss information is obtained according to the sentence meaning loss information, the single character loss information and the text loss information; and when the target loss information satisfies an adjustment condition, the model parameters of the text recognition model are adjusted. Optionally, a sum value of the sentence meaning loss information, the single character loss information and the text loss information is calculated according to the weight value, and the sum value is determined as the target loss information. For example, when the weight of the single character loss information is λ and the weight of the text loss information is γ, the target loss information is obtained according to the sentence meaning loss information + λ × the single character loss information + γ × the text loss information. When the target loss information satisfies the adjustment condition, it indicates that the parameters of the text recognition model need to be adjusted, and the adjustment condition can be that a preset threshold is reached. For example, when the adjustment condition is that the target loss information is not 0, the sentence meaning loss information corresponding to "navigate to Beijing" is 0.4, the single character loss information is 0, and the text loss information is 0, and the target loss information obtained according to the sentence meaning loss information + λ × the single character loss information + γ × the text loss information is 0.4. At this time, the target loss information of "navigate to Beijing" is not 0, which satisfies the adjustment condition, and the server adjusts the parameters of the text recognition model.

[0081] In an implementation manner, the greater the sentence meaning loss information, the single character loss information and the text loss information are, the greater the adjustment range of the server to the parameters of the text recognition model and the weight value is. For example, the greater the sentence meaning loss information is, the greater the adjustment range of the server to the parameters of the first feature extraction model, the second feature extraction model and the sentence meaning feature extraction model is. The greater the single character loss information is, the greater the adjustment range of the server to the parameters of the first feature extraction model, the second feature extraction model and the gating fusion model is. The greater the text loss information is, the greater the adjustment range of the server to the parameters of the CRF model is.

[0082] In another implementation manner, when the target loss information does not satisfy the adjustment condition, it indicates that the recognition accuracy of the text recognition model is high, and the server outputs the recognition result of the training text according to the text recognition model. For example, when the target loss information is 0, the recognition result [O, O, O, B-location, I-location] of "navigate to Beijing" is output.

[0083] In the above embodiments, first feature information of the training text is obtained according to a first feature extraction model, and second feature information of the training text is obtained according to a second feature extraction model. Extracting feature information through two feature extraction models helps improve the accuracy of the feature information. Sentence semantic loss information is generated based on the first and second feature information; the first and second feature information are gated and fused to obtain a fusion matrix; single-character loss information and text loss information are generated based on the fusion matrix and the sample data corresponding to the training text; the model parameters of the text recognition model are adjusted based on the sentence semantic loss information, single-character loss information, and text loss information. Adjusting the parameters of the text recognition model based on multiple loss information improves the accuracy of text recognition.

[0084] Figure 6 The parameter adjustment device 600 shown can be used to perform the above. Figures 3-5 The described method embodiments include some or all of the server's functions. The parameter adjustment device 600 may also be a chip system. Figure 6 The parameter adjustment device 600 shown may include a feature acquisition unit 601, a loss generation unit 602, and a parameter adjustment unit 603. Detailed descriptions of each unit are as follows:

[0085] The feature acquisition unit 601 is used to acquire first feature information of the training text according to the first feature extraction model and to acquire second feature information of the training text according to the second feature extraction model.

[0086] The loss generation unit 602 is used to generate semantic loss information based on the first feature information and the second feature information; to gating and fusing the first feature information and the second feature information to obtain a fusion matrix; and to generate single-character loss information and text loss information based on the fusion matrix and the sample data corresponding to the training text.

[0087] The parameter adjustment unit 603 is used to adjust the model parameters of the text recognition model when the semantic loss information, single character loss information and text loss information meet the adjustment conditions.

[0088] In one embodiment, the loss generation unit 602 is specifically used to extract sentence meaning features from the first feature information through a sentence meaning feature extraction model to obtain first sentence meaning information; extract sentence meaning features from the second feature information through a sentence meaning feature extraction model to obtain second sentence meaning information; and generate sentence meaning loss information based on the matching degree between the first sentence meaning information and the second sentence meaning information.

[0089] In an embodiment, the training text includes N single characters, the fusion matrix includes a single character feature set corresponding to each single character, N is a positive integer; the single character loss information includes a single character loss value corresponding to each single character; the loss generation unit 602 is specifically configured to determine a target single character feature corresponding to each single character in the single character feature set corresponding to each single character; obtain a sample single character feature corresponding to each single character in the sample data corresponding to the training text; generate a single character loss value corresponding to the nth single character according to the matching degree between the target single character feature of the nth single character and the sample single character feature corresponding to the nth single character; n is a positive integer, 0≤n≤N.

[0090] In an embodiment, the target single character feature is a single character feature in the single character feature set whose single character feature probability value satisfies a screening condition.

[0091] In an embodiment, the fusion matrix is used to indicate a plurality of text features corresponding to the training text; the loss generation unit 602 is specifically configured to determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text; obtain a sample text feature in the sample data corresponding to the training text; and generate text loss information corresponding to the target text feature according to the matching degree between the target text feature and the sample text feature.

[0092] In an embodiment, the training text corresponds to M text features, M is a positive integer; the loss generation unit 602 is specifically configured to calculate a transition probability matrix of the fusion matrix, the transition probability matrix being used to indicate the plurality of text features corresponding to the training text; obtain a first text feature probability value of each text feature in the fusion matrix; obtain a second text feature probability value of each text feature in the transition probability matrix; and determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text according to the sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature; m is a positive integer, 0≤m≤M.

[0093] In an embodiment, the parameter adjustment unit 603 is specifically configured to obtain target loss information according to the sentence meaning loss information, the single character loss information, and the text loss information; and adjust the model parameters of the text recognition model when the target loss information satisfies an adjustment condition.

[0094] In an embodiment, the parameter adjustment further includes a result output unit configured to output a recognition result of the training text according to the text recognition model when the target loss information does not satisfy the adjustment condition.

[0095] Based on the description of the method embodiments and the device embodiments, an embodiment of the present application further provides a parameter adjustment device 700. Please refer to Figure 7The parameter adjustment device at least includes a processor 701 and a memory 702. The processor 701 and the memory 702 can be connected through a bus 703 or other manners. The bus is represented by a thick line in the figure, and the connection between other components is only schematically illustrated and is not limited. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 7 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus. Figure 7

[0096] The memory 702 can include read-only memory and random access memory, and provide instructions and data for the processor 701. A part of the memory 702 can also include non-volatile random access memory.

[0097] The processor 701 can be a central processing unit (CPU), and the processor 701 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, and optionally, the processor 701 can also be any conventional processor, etc. Wherein:

[0098] The memory 702 is configured to store program instructions.

[0099] The processor 701 is configured to call the program instructions stored in the memory 702, so as to realize the data processing function of the server described in the present application.

[0100] In the embodiments of the present application, the coupling between the devices, units or modules is indirect coupling or communication connection between the devices, units or modules, which can be electrical, mechanical or other forms, and is used for information interaction between the devices, units or modules. The specific connection medium between the processor 701 and the memory 702 in the embodiments of the present application is not limited.

[0101] The embodiments of the present application and Figures 3-5 The method embodiments shown in the figure are based on the same concept, and the technical effects brought by them are the same. For specific principles, please refer to the description of the embodiment shown in the figure, which will not be described here. Figures 3-5

[0102] As an example, Figure 8 ​​This is a schematic diagram of another parameter adjustment device 800 provided in an embodiment of this application. The parameter adjustment device 800 can be a server. The parameter adjustment device 800 can perform the operations performed by the server in the above method embodiments.

[0103] For ease of explanation, Figure 8 Only the main components of the parameter adjustment device 800 are shown. (For example...) Figure 8 As shown, the parameter adjustment device 800 includes a processor, a memory, a radio frequency circuit, an antenna, and input / output devices. The processor is mainly used for processing communication protocols and data, controlling the entire parameter adjustment device 800, executing software programs, and processing software program data, such as supporting the parameter adjustment device 800 in executing... Figures 3-5 The described process is as follows: The memory is primarily used to store software programs and data. The radio frequency (RF) circuitry is mainly used for converting baseband signals to RF signals and processing RF signals. The antenna is mainly used for transmitting and receiving RF signals in the form of electromagnetic waves. The parameter adjustment device 800 may also include input / output devices, such as a touchscreen, display screen, and keyboard, mainly used to receive user input data and output data to the user. It should be noted that some types of parameter adjustment devices 800 may not have input / output devices.

[0104] When the parameter adjustment device 800 is powered on, the processor can read the software program in the storage unit, interpret and execute the software program, and process the data in the software program. When data needs to be transmitted wirelessly, the processor performs baseband processing on the data to be transmitted and outputs the baseband signal to the radio frequency (RF) circuit. The RF circuit then performs RF processing on the baseband signal and transmits the RF signal outward in the form of electromagnetic waves through the antenna. When data is sent to the parameter adjustment device 800, the RF circuit receives the RF signal through the antenna, converts the RF signal into a baseband signal, and outputs the baseband signal to the processor. The processor converts the baseband signal back into data and processes the data.

[0105] Those skilled in the art will understand that, for ease of explanation, Figure 8 Only one memory and processor are shown. In the actual parameter adjustment device 800, multiple processors and memories may exist. The memory may also be referred to as a storage medium or storage device, etc., and this application embodiment does not limit this.

[0106] As an optional implementation, the processor can include a baseband processor and a central processing unit (CPU), the baseband processor is mainly used for processing communication protocols and communication data, and the CPU is mainly used for controlling the whole parameter adjustment apparatus 800, executing a software program, and processing data of the software program. Optionally, the processor can also be a network processor (NP) or a combination of the CPU and the NP. The processor can further include a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The memory can include a volatile memory such as a random-access memory (RAM); the memory can also include a non-volatile memory such as a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); and the memory can also include a combination of the above kinds of memories.

[0107] For example, in the embodiments of the present application, as shown in Figure 8 the antenna and the radio frequency circuit having a transceiving function can be regarded as a communication unit 801 of the parameter adjustment apparatus 800, and the processor having a processing function can be regarded as a processing unit 802 of the parameter adjustment apparatus 800.

[0108] The communication unit 801 can also be referred to as a transceiver, a transceiver, a transceiver, a transceiver unit, etc., and is used to realize the transceiving function. Optionally, the devices in the communication unit 801 used to realize the receiving function can be regarded as a receiving unit, and the devices in the communication unit 801 used to realize the sending function can be regarded as a sending unit, that is, the communication unit 801 includes a receiving unit and a sending unit. For example, the receiving unit can also be referred to as a receiver, a receiver, a receiving circuit, etc., and the sending unit can be referred to as a transmitter, a transmitter, or a transmitting circuit, etc.

[0109] In some embodiments, the communication unit 801 and the processing unit 802 can be integrated into one device, or can be separated into different devices. In addition, the processor and the memory can be integrated into one device, or can be separated into different devices.

[0110] The communication unit 801 can be configured to perform the transceiving operations of the parameter adjustment apparatus 800 in the above method embodiments. The processing unit 802 can be configured to perform the data processing operations of the parameter adjustment apparatus 800 in the above method embodiments.

[0111] The embodiments of the present application also provide a computer readable storage medium, which stores instructions, when the instructions are run on a processor, the method flow of the above method embodiments is implemented.

[0112] The embodiments of the present application also provide a computer program product, when the computer program product is run on a processor, the method flow of the above method embodiments is implemented.

[0113] It should be noted that, for the above method embodiments, in order to simply describe, each is described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, some operations can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0114] The descriptions of the embodiments of the present application can be referred to each other, and each description of the embodiments has its own focus. For the parts not described in detail in a certain embodiment, please refer to the related description of other embodiments. For the convenience and brevity of description, for example, the functions of the devices and the operations performed by the devices provided in the embodiments of the present application can be referred to the related description of the method embodiments of the present application, and the method embodiments and the device embodiments can also be referred to, combined or cited each other.

[0115] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A parameter adjustment method, characterized by, The method is used for adjusting model parameters of a text recognition model, the text recognition model comprising a first feature extraction model and a second feature extraction model, and the method comprises: obtaining first feature information of a training text according to the first feature extraction model and second feature information of the training text according to the second feature extraction model; generating sentence meaning loss information according to the first feature information and the second feature information; gate-fusing the first feature information and the second feature information to obtain a fusion matrix; generating single-character loss information and text loss information according to the fusion matrix and sample data corresponding to the training text; when the sentence meaning loss information, the single-character loss information and the text loss information satisfy an adjustment condition, adjusting model parameters of the text recognition model.

2. The method of claim 1, wherein, The method for generating sentence meaning loss information according to the first feature information and the second feature information comprises: extracting sentence meaning features from the first feature information through a sentence meaning feature extraction model to obtain first sentence meaning information; extracting sentence meaning features from the second feature information through the sentence meaning feature extraction model to obtain second sentence meaning information; generating the sentence meaning loss information according to a matching degree of the first sentence meaning information and the second sentence meaning information.

3. The method of claim 1, wherein, The training text comprises N single characters, the fusion matrix comprises single-character feature sets corresponding to respective single characters, N is a positive integer, and the single-character loss information comprises single-character loss values corresponding to the respective single characters; The method for generating single-character loss information according to the fusion matrix and sample data corresponding to the training text comprises: determining target single-character features corresponding to the respective single characters in the single-character feature sets corresponding to the respective single characters; obtaining sample single-character features corresponding to the respective single characters in the sample data corresponding to the training text; generating a single-character loss value corresponding to an nth single character according to a matching degree of a target single-character feature corresponding to the nth single character and a sample single-character feature corresponding to the nth single character, n is a positive integer, and 0≤n≤N.

4. The method of claim 3, wherein, The target single-character feature is a single-character feature whose single-character feature probability value satisfies a screening condition in the single-character feature set.

5. The method of claim 1, wherein, The fusion matrix is used for indicating a plurality of text features corresponding to the training text; The method for generating text loss information according to the fusion matrix and sample data corresponding to the training text comprises: determining a target text feature corresponding to the training text from the plurality of text features corresponding to the training text; obtaining a sample text feature in the sample data corresponding to the training text; generating text loss information corresponding to the target text feature according to a matching degree of the target text feature and the sample text feature.

6. The method of claim 5, wherein, The training text corresponds to M text features, M is a positive integer; The method for determining the target text feature corresponding to the training text from the plurality of text features corresponding to the training text comprises: calculating a transition probability matrix of the fusion matrix, the transition probability matrix being used for indicating the plurality of text features corresponding to the training text; In the fusion matrix, a first text feature probability value of each text feature is obtained; In the transition probability matrix, a second text feature probability value of the text feature is obtained; According to a sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature, a target text feature corresponding to the training text is determined from a plurality of text features corresponding to the training text, m is a positive integer, and 0≤m≤M.

7. The method of claim 1, wherein, When the sentence meaning loss information, the single character loss information and the text loss information satisfy an adjustment condition, the model parameters of the text recognition model are adjusted, including: According to the sentence meaning loss information, the single character loss information and the text loss information, target loss information is obtained. When the target loss information satisfies the adjustment condition, the model parameters of the text recognition model are adjusted.

8. The method of claim 7, wherein, The method further includes: When the target loss information does not satisfy the adjustment condition, an identification result of the training text is output according to the text recognition model.

9. A parameter adjustment apparatus characterized by comprising: The device includes: A feature acquisition unit is configured to obtain first feature information of a training text according to a first feature extraction model and obtain second feature information of the training text according to a second feature extraction model; A loss generation unit is configured to generate sentence meaning loss information according to the first feature information and the second feature information, gate fuse the first feature information and the second feature information to obtain a fusion matrix, and generate single character loss information and text loss information according to the fusion matrix and sample data corresponding to the training text; A parameter adjustment unit is configured to adjust model parameters of a text recognition model when the sentence meaning loss information, the single character loss information and the text loss information satisfy an adjustment condition.

10. The apparatus of claim 9, wherein, The loss generation unit is specifically configured to extract sentence meaning features from the first feature information through a sentence meaning feature extraction model to obtain first sentence meaning information, extract sentence meaning features from the second feature information through the sentence meaning feature extraction model to obtain second sentence meaning information, and generate the sentence meaning loss information according to a matching degree of the first sentence meaning information and the second sentence meaning information.

11. The apparatus of claim 9, wherein, The training text includes N single characters, the fusion matrix includes a single character feature set corresponding to each single character, and N is a positive integer; the single character loss information includes a single character loss value corresponding to each single character; The loss generation unit is specifically configured to determine target single character features corresponding to each single character in a single character feature set corresponding to each single character, and obtain sample single character features corresponding to each single character in sample data corresponding to the training text. According to a matching degree of the target single character features corresponding to the nth single character and the sample single character features corresponding to the nth single character, a single character loss value corresponding to the nth single character is generated; n is a positive integer, and 0≤n≤N.

12. The apparatus of claim 11, wherein, The target single character features are single character features whose single character feature probability values satisfy a screening condition in the single character feature set.

13. The apparatus of claim 9, wherein, The fusion matrix is used to indicate a plurality of text features corresponding to the training text; The loss generation unit is specifically configured to determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text; obtain a sample text feature in sample data corresponding to the training text; and generate text loss information corresponding to the target text feature according to a matching degree of the target text feature and the sample text feature.

14. The apparatus of claim 13, wherein, The training text corresponds to M text features, and M is a positive integer. The loss generation unit is specifically configured to calculate a transition probability matrix of the fusion matrix, the transition probability matrix being used to indicate the plurality of text features corresponding to the training text; obtain a first text feature probability value of each text feature in the fusion matrix; obtain a second text feature probability value of the each text feature in the transition probability matrix; and determine a target text feature corresponding to the training text from the plurality of text features corresponding to the training text according to a sum of the first text feature probability value of the mth text feature and the second text feature probability value of the mth text feature, where m is a positive integer and 0≤m≤M.

15. The apparatus of claim 9, wherein The parameter adjustment unit is specifically configured to obtain target loss information according to the sentence loss information, the single-character loss information, and the text loss information; and adjust the model parameters of the text recognition model when the target loss information satisfies the adjustment condition.

16. The apparatus of claim 15, wherein, The apparatus further includes: A result output unit configured to output a recognition result of the training text according to the text recognition model when the target loss information does not satisfy the adjustment condition.

17. A parameter adjustment apparatus characterized by comprising: The apparatus includes a processor and a memory, wherein the memory is configured to store a computer program including program instructions, and the processor is configured to invoke the program instructions to execute the method of any one of claims 1-8.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more instructions, which are adapted to be loaded and executed by the processor to perform the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Text processing model training method and device and text processing method

    CN110209817A

  • Named entity recognition model training method and named entity recognition method and device

    CN110705294A