Zero reference resolution method, method for training zero reference resolution model and electronic device

By integrating the position information of zero pronouns into the vector of the precursor in the natural language processing system, the problem of low accuracy of zero reference digestion in the Chinese natural language processing system is solved, and a more efficient understanding of user intention is achieved.

CN112256868BActive Publication Date: 2025-04-15HUAWEI TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011069841.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2025-04-15
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

When the prior art deals with Chinese natural language processing systems, it is difficult to accurately eliminate the zero-referential phenomenon, resulting in difficulty in understanding user intentions.

Method used

By converting all words in the training text into vectors and fusing the position information of zero pronouns into the vectors of the predecessors, the theoretical category labels of each predecessor are determined, and then the zero reference digestion model is trained.

Benefits of technology

It improves the accuracy of zero-reference digestion, can more fully represent the relevant information of the avant-garde in the context information, and reduces the dependence of manual annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256868B_ABST
    Figure CN112256868B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of terminal artificial intelligence technology, and provides a method for zero-reference resolution, a method for training a zero-reference resolution model, and an electronic device. The method for training a zero-reference resolution model includes: converting all words in a training text into a first vector; wherein the training text includes multiple antecedents and multiple zero pronouns, the first vector includes a first antecedent vector corresponding to each antecedent and a first zero pronoun vector corresponding to each zero pronoun, and the first zero pronoun vector contains the position information of the zero pronoun; the position information of the zero pronoun is integrated into the first antecedent vector to obtain a second antecedent vector; based on the first zero pronoun vector and the second antecedent vector, the theoretical category label of each antecedent is determined; wherein each antecedent corresponds to a preset category label; the zero-reference resolution model is trained according to the theoretical category label and the preset category label of each antecedent. The above method can improve the accuracy of zero-reference resolution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal artificial intelligence technology, and in particular to a zero-reference resolution method, a method for training a zero-reference resolution model, an electronic device, and a chip system. Background Art

[0002] Zero pronoun phenomenon refers to a grammatical phenomenon in Chinese and other languages ​​where pronouns are missing. In Chinese and other languages, the part that users can infer based on the context is often omitted, and the omitted part has corresponding syntactic components in the sentence and refers back to a language unit in the previous text. The omitted part is called zero pronoun, and the language unit it refers to is called the antecedent. For example, Xiao Ming ate an apple. Very sweet. In this sentence, It indicates a zero pronoun, which refers to the "apple" that appears before, and "apple" is the antecedent.

[0003] The natural language processing system is used to extract information from the text information input by the user and display relevant content to the user based on the extracted information. Since the natural language processing system can help users obtain the required content conveniently and quickly, it has been widely used in many fields such as information retrieval, question answering, automatic summarization and machine translation. However, when using the Chinese natural language processing system, users often input text after omitting noun phrases, which makes it difficult for the natural language processing system to understand the user's intention. Therefore, in order to extract relevant information from the text more accurately and without omission, it is necessary to eliminate the zero reference phenomenon in the text.

[0004] The traditional zero-reference resolution method is mainly based on the Long Short-Term Memory (LSTM) model. First, it is necessary to manually annotate the antecedents and zero pronouns in a large amount of training text data, and then input the training text data into the LSTM model for training after word segmentation and syntax tree conversion. After the LSTM model is trained, the text sentences input by the user are subjected to zero-reference resolution through the trained LSTM model. It can be seen that the training text data in the traditional zero-reference resolution method consumes a lot of human capital, and the antecedents and zero pronouns in the manual annotation of the training text data lack relevant information of the antecedent in the context information, resulting in low accuracy of zero-reference resolution. Summary of the invention

[0005] The present application provides a zero-reference resolution method, a method for training a zero-reference resolution model, and an electronic device, which can more fully characterize the relevant information of the antecedent in the context information and improve the accuracy of zero-reference resolution.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a method for training a zero-reference resolution model, which is suitable for execution in an electronic device, and the method comprises: converting all words in a training text into a first vector; wherein the training text comprises multiple antecedents and multiple zero pronouns, the first vector comprises a first antecedent vector corresponding to each of the antecedents and a first zero pronoun vector corresponding to each of the zero pronouns, the first zero pronoun vector comprising position information of the zero pronoun; fusing the position information of the zero pronoun into the first antecedent vector to obtain a second antecedent vector; based on the first zero pronoun vector and the second antecedent vector, determining a theoretical category label for each of the antecedents; wherein each of the antecedents corresponds to a preset category label; and training the zero-reference resolution model according to the theoretical category label of each of the antecedents and the preset category label.

[0008] The above-mentioned method for training the zero-reference resolution model converts multiple antecedents in the training text into corresponding first antecedent vectors, and converts multiple zero pronouns into corresponding first zero pronoun vectors. Afterwards, the position information of the zero pronoun contained in the first zero pronoun vector is fused into the first antecedent vector to obtain a second antecedent vector. The first zero pronoun vector and the second antecedent vector are input into the linear projection layer and the classification layer to determine the theoretical category label of each antecedent. Then, the zero-reference resolution model is trained according to the theoretical category label of each antecedent and the preset category label. When performing zero pronoun resolution, it is unreasonable to only consider the first antecedent vector of the antecedent without considering the position information of the zero pronoun. Moreover, in the process of zero pronoun resolution reasoning, people can only determine the zero pronoun that needs to be resolved based on the position information of the zero pronoun. Therefore, fusing the position information of the zero pronoun into the first antecedent vector can more fully characterize the relevant information of the antecedent in the context information and improve the accuracy of zero-reference resolution.

[0009] In combination with the first aspect, in some embodiments, the zero-reference resolution model includes an embedding layer, a Transformer layer, a zero-pronoun position information integration layer, a linear projection layer and a classification layer; converting all words in the training text into a first vector includes: converting all words in the training text into a second vector through the embedding layer; converting the second vector into the first vector through the Transformer layer.

[0010] In combination with the first aspect, in some embodiments, the method includes: pre-training the training text using a masked language model to obtain pre-trained parameters of the Transformer layer; converting the second vector into the first vector through the Transformer layer includes: bringing the pre-trained parameters of the Transformer layer into the Transformer layer; and converting the second vector into the first vector through the Transformer layer.

[0011] Exemplarily, the masked language model pre-trains the training text to obtain the pre-trained parameters of the Transformer layer, which may include: masking some words in the training text, performing a denoising auto-encoding training task on the training text after the MASK processing through the masked language model to learn language representation and text features, and obtain the pre-trained parameters of the Transformer layer.

[0012] The masking process for some characters in the training text may be: selecting characters of a preset proportion in the training text; and replacing some characters in the preset proportion with arbitrary characters or preset marks.

[0013] For example, the characters in the first part of the characters in the preset proportion can be replaced with a preset mark (such as a "MASK" mark); the characters in the second part of the characters in the preset proportion can be replaced with any characters; and the characters in the third part of the characters in the preset proportion are not changed, thereby obtaining a training text. The characters in the first part, the characters in the second part and the characters in the third part constitute the characters in the preset proportion.

[0014] It should be noted that the characters in the preset proportion in the text to be trained may be randomly selected characters or characters that meet preset conditions, which is not limited in this embodiment of the present application.

[0015] Traditional language model tasks can generally only learn unidirectionally from left to right or from right to left, so pre-trained unidirectional language model tasks, such as ELMo, GPT, etc., can only learn unidirectional representations, which limits the information learned by the model from the training text. In contrast, in an embodiment of the present application, a masked language model is used to pre-train the training text to obtain the pre-trained parameters of the Transformer layer. Afterwards, in the process of training the zero-reference resolution model, an attempt is made to restore the masked words based on the pre-trained parameters of the Transformer layer, so that some text features can be learned in the process of restoration. Moreover, the zero-reference resolution model is a bidirectional language model, so the embodiment of the present application can perform bidirectional learning on the training text and improve the information learned from the training text.

[0016] In combination with the first aspect, in some embodiments, converting all words in the training text into a second vector through the embedding layer includes: replacing the position of the zero pronoun in the text to be trained with a preset marker to obtain the training text; and converting all words in the training text into a second vector through the embedding layer.

[0017] In combination with the first aspect, in some embodiments, determining the theoretical category label of each antecedent word based on the first zero-pronoun vector and the second antecedent word vector includes: inputting the first zero-pronoun vector and the second antecedent word vector into the linear projection layer and the classification layer to determine the label value corresponding to each antecedent word on multiple preset category labels; and determining the theoretical category label corresponding to each antecedent word based on the multiple label values ​​corresponding to each antecedent word.

[0018] In combination with the first aspect, in some embodiments, determining the theoretical category label corresponding to each antecedent based on multiple label values ​​corresponding to each antecedent includes: determining a first label value of a character contained in each antecedent on the multiple preset category labels; wherein the first label value is multiple, and the multiple first label values ​​correspond one-to-one to the multiple preset category labels; calculating the second label value of each antecedent on the multiple preset category labels based on the label value of each character on the multiple preset category labels; and determining the theoretical category label corresponding to each antecedent based on the multiple second label values ​​of each antecedent.

[0019] In combination with the first aspect, in some embodiments, the second label value of each antecedent on the multiple preset category labels is calculated based on the label value of each character on the multiple preset category labels, including: for each antecedent, calculating the average of the first label values ​​corresponding to each character and the first preset category label, to obtain the second label value corresponding to each antecedent and the first preset category label; wherein the first preset category label is any one of the multiple preset category labels.

[0020] In combination with the first aspect, in some embodiments, determining the theoretical category label corresponding to each antecedent based on multiple second label values ​​of each antecedent includes: determining the theoretical category label corresponding to each antecedent based on the maximum value of the multiple second label values.

[0021] In some embodiments, after determining the second label value of each antecedent, the theoretical category label of each antecedent is determined according to the maximum value of the second label value of each antecedent. If the maximum value of the second label value of a certain antecedent in the first preset category label is greater than the maximum value of the second label value of other antecedents in the first preset category label, then the theoretical category label of the antecedent is the first preset category label; if the maximum value of the second label value of a certain antecedent in the first preset category label is less than the maximum value of the second label value of other antecedents in the first preset category label, then the theoretical category label of the antecedent is not the first preset category label.

[0022] In the embodiment of the present application, the theoretical category label corresponding to each antecedent is determined according to the label values ​​of each character in each antecedent on multiple preset category labels. Since each character of each antecedent corresponds to a category label, and the antecedent corresponds to a category label, it is equivalent to sequentially labeling each character of each antecedent in the text by means of category labels, thereby determining the correct antecedent of the zero pronoun in the text according to each category label. In the embodiment of the present application, the correct antecedent of the zero pronoun can be determined by means of sequence labeling, which is simple and convenient.

[0023] In combination with the first aspect, in some embodiments, the integrating the position information of the zero pronoun into the first antecedent vector to obtain the second antecedent vector includes: performing a preset operation on the vector corresponding to the position information of the zero pronoun and the first antecedent vector of the corresponding antecedent to obtain the second antecedent vector of each antecedent; wherein the preset operation includes at least one of the following: vector summation, vector product, vector concatenation, and an attention mechanism model.

[0024] 1. The preset operation is the sum of vectors. The vector M of the position information of the zero pronoun is weightedly summed with the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent. For example, it can be X'=X+aM. Wherein, a is a preset coefficient, and a can be a positive or negative number. For example, a=1, the second antecedent vector X'=X+M; a=-1, the second antecedent vector X'=XM. Of course, a can be any other value, and there is no limitation on this.

[0025] 2. The default operation is vector multiplication. The product of the vector M of the position information of the zero pronoun and the first antecedent vector X of the antecedent is taken as the second antecedent vector X' of the antecedent. For example, X'=cX*M. Where c is a preset coefficient and a can be a positive or negative number.

[0026] 3. The default operation is vector concatenation. Concatenate the vector M of the position information of the zero pronoun with the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent. The vector M of the position information of the zero pronoun and the first antecedent vector X are not limited in the position of the second antecedent vector X'. For example, it can be X'=[X:M] or X'=[M:X].

[0027] 4. The default operation is the attention mechanism model. Various attention mechanism models can be used to process the vector M of the position information of the zero pronoun and the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent.

[0028] In combination with the first aspect, in some embodiments, the training of the zero reference resolution model is performed based on the theoretical category label of each of the antecedents and the preset category label, including: calculating the loss function of the zero reference resolution model based on the theoretical category label of each of the antecedents and the preset category label; modifying the parameters of the zero reference resolution model based on the loss function; wherein, when the loss function meets the preset conditions, the training of the zero reference resolution model is completed.

[0029] The loss function may be a cross entropy loss function. For example, the loss function may be Where I is the indicator function, and y represents the label, is the probability of an incorrect antecedent, It is expressed as the probability of the correct antecedent, i is a positive integer.

[0030] In a second aspect, an embodiment of the present application provides a method for zero reference resolution, which is suitable for execution in an electronic device, and the method includes: obtaining a text to be zero reference resolved; performing zero reference resolution on the text to be zero reference resolved through a zero reference resolution model; wherein the zero reference resolution model is obtained by a method as described in any one of the methods of the first aspect.

[0031] The above-mentioned zero reference resolution method uses the zero reference resolution model obtained by the method described in any one of the first aspects to perform zero reference resolution on the text to be zero reference resolved, which can more fully characterize the relevant information of the antecedent in the context information and improve the accuracy of zero reference resolution.

[0032] In combination with the second aspect, in some embodiments, the zero reference resolution model includes an embedding layer, a Transformer layer, a zero pronoun position information integration layer, a linear projection layer, and a classification layer; the zero reference resolution of the text to be resolved by the zero reference resolution model includes: converting all words in the text to be resolved into a third vector through the embedding layer and the Transformer layer; wherein the text to be resolved includes multiple antecedents and multiple zero pronouns, and the third vector includes a third antecedent vector corresponding to each of the antecedents and a third antecedent vector corresponding to each of the antecedents. A third zero pronoun vector corresponding to the zero pronoun, wherein the third zero pronoun vector includes the position information of the zero pronoun; through the zero pronoun position information fusion layer, the position information of the zero pronoun is fused into the third antecedent vector to obtain a fourth antecedent vector; the third zero pronoun vector and the fourth antecedent vector are input into the linear projection layer and the classification layer to determine the label value corresponding to each of the antecedents on multiple preset category labels; the antecedent with the largest label value on the first category label is used as the final resolved antecedent; wherein the first category label represents the correct antecedent.

[0033] In a third aspect, an embodiment of the present application provides a device for training a zero-reference resolution model, comprising: a conversion unit, configured to convert all words in a training text into a first vector; wherein the training text includes multiple antecedents and multiple zero pronouns, the first vector includes a first antecedent vector corresponding to each of the antecedents and a first zero pronoun vector corresponding to each of the zero pronouns, and the first zero pronoun vector contains position information of the zero pronoun; a fusion unit, configured to fuse the position information of the zero pronoun into the first antecedent vector to obtain a second antecedent vector; a category label determination unit, configured to determine a theoretical category label of each of the antecedents based on the first zero pronoun vector and the second antecedent vector; wherein each of the antecedents corresponds to a preset category label; and a training unit, configured to train the zero-reference resolution model according to the theoretical category label of each of the antecedents and the preset category label.

[0034] In a fourth aspect, an embodiment of the present application provides a zero-reference resolution device, comprising: an acquisition unit, for acquiring a text to be resolved by zero reference; a resolution unit, for performing zero-reference resolution on the text to be resolved by using a zero-reference resolution model; wherein the zero-reference resolution model is obtained by a method as described in any one of the first aspects.

[0035] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors, a memory and a display screen; the memory and the display screen are coupled to the one or more processors, the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of the first aspect, or the method as described in any one of the second aspect.

[0036] In a sixth aspect, an embodiment of the present application provides a chip system, the chip system comprising a processor, the processor coupled to a memory, the processor executing a computer program stored in the memory to implement the method as described in any one of the first aspect, or the method as described in any one of the second aspect. The chip system may be a single chip, or a chip module composed of multiple chips.

[0037] In a seventh aspect, an embodiment of the present application provides a chip system, the chip system comprising a memory and a processor, the processor executing a computer program stored in the memory to implement the method as described in any one of the first aspect or the method as described in any one of the second aspect. The chip system may be a single chip or a chip module composed of multiple chips.

[0038] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any method in the first aspect or any method in the second aspect.

[0039] In the ninth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the first aspect or the method as described in any one of the second aspect is implemented.

[0040] It can be understood that the device described in the third aspect, the device described in the fourth aspect, the electronic device described in the fifth aspect, the chip system described in the sixth and seventh aspects, the computer program product described in the eighth aspect, and the computer-readable storage medium described in the ninth aspect are all used to execute the method provided in the first aspect or the method provided in the second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of the processing flow of natural language understanding provided in an embodiment of the present application;

[0042] Figure 2A schematic diagram of the architecture of the zero reference resolution model provided in the embodiment of the present application;

[0043] Figure 3 A flowchart of a method for training a zero-reference resolution model provided in an embodiment of the present application;

[0044] Figure 4 A flowchart of a method for training a zero-reference resolution model provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of converting text into a second vector provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a process for the zero reference resolution method provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram of a process for performing zero-reference resolution on a text to be zero-reference resolution provided in an embodiment of the present application;

[0048] Figure 8 A schematic diagram of the structure of a device for training a zero-reference resolution model provided in an embodiment of the present application;

[0049] Fig. 9 A schematic diagram of the structure of a zero reference resolution device provided in an embodiment of the present application;

[0050] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0051] Fig.11 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0053] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0054] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0055] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0056] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0057] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0058] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0059] The steps involved in the method provided in the embodiments of the present application are only examples. Not all steps must be performed, or not all information or content in a message is mandatory. They can be increased or decreased as needed during use.

[0060] In the embodiments of the present application, the same step or steps or messages with the same function in different embodiments can be referenced to each other.

[0061] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0062] Artificial Intelligence (AI) is the 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 machines have the ability to perceive, reason and make decisions.

[0063] Artificial intelligence 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 mainly includes computer vision, speech processing, natural language understanding (NLU), and machine learning / deep learning. Among them, NLU is an important direction in the fields of computer science and artificial intelligence, and mainly studies various theories and methods that can enable effective communication between humans and computers through natural language.

[0064] like Figure 1 As shown, the processing flow of NLU generally includes: performing text preprocessing on the text data, obtaining relevant information, and then performing various NLU tasks according to the relevant information, such as intent recognition, slot extraction, etc. Among them, the text data can be text data directly input by the user in the electronic device. Alternatively, the text data can be text data obtained by converting the audio information sent by the user by the electronic device, which is not limited in the embodiments of the present application.

[0065] In the above text preprocessing process, it is an important task to perform zero-reference elimination on text data. When using the Chinese natural language processing system, users often input text data after omitting noun phrases, which makes it difficult for the natural language processing system to understand the user's intention. Therefore, in order to extract relevant information from the text more accurately and without omission, it is necessary to eliminate the zero-reference phenomenon in the text.

[0066] The zero-reference resolution method in the related art is mainly based on the LSTM model. First, it is necessary to manually annotate the antecedents and zero pronouns in a large amount of training text data, and then input the training text data into the LSTM model for training after word segmentation and syntax tree conversion. After the LSTM model is trained, the text sentences input by the user are subjected to zero-reference resolution through the trained LSTM model. It can be seen that the training text data in the related art consumes a lot of human capital, and the manual annotation of the antecedents and zero pronouns in the training text data lacks the relevant information of the antecedent in the context information, resulting in low accuracy of zero-reference resolution.

[0067] Figure 2 A schematic diagram of the architecture of a zero-reference resolution model provided in an embodiment of the present application is shown, and the zero-reference resolution model is built based on a BERT (Bidirectional Encoder Representations from Transformers) model.

[0068] like Figure 2 As shown, the zero-reference resolution model includes an embedding layer, a Transformer layer, a zero-pronoun position information fusion layer, a linear projection layer, and a classification layer. Among them, the Embedding layer is used to convert the input text into a second vector. The Transformer layer is used to transform the second vector to obtain a vector containing the position information of the zero pronoun and the vector of the antecedent. The Transformer layer can include multiple layers of Transformer, for example, it can include 12 layers of Transformer. The zero-pronoun position information fusion layer is used to integrate the vector of the position information of the zero pronoun into the vector of the antecedent. The linear projection layer and the classification layer are used to determine the probability of each antecedent on the preset classification label based on the output of the zero-pronoun position information fusion layer. The zero-reference resolution model outputs the antecedent with the highest positive score as the final resolution antecedent.

[0069] The method for training the zero-reference resolution model in the embodiment of the present application converts the training text into a vector corresponding to the antecedent and a vector corresponding to the zero pronoun through the embedding layer and the Transformer layer, and the vector corresponding to the zero pronoun contains the position information of the zero pronoun. Afterwards, the position information of the zero pronoun is fused into the vector corresponding to the antecedent, and then the theoretical category label of each antecedent is determined through the linear projection layer and the classification layer. Afterwards, the zero-reference resolution model is trained according to the theoretical category label and the preset category label of each antecedent. When performing zero-reference resolution, it is unreasonable to only consider the vector corresponding to the antecedent without considering the position information of the zero pronoun. Moreover, when performing zero-reference resolution reasoning, people can only determine the zero pronoun that needs to be resolved based on the position information of the zero pronoun. Therefore, the position information of the zero pronoun is fused into the vector corresponding to the antecedent, which can more fully characterize the relevant information of the antecedent in the context information and improve the accuracy of zero-reference resolution.

[0070] In addition, in the embodiment of the present application, the position of the zero pronoun can be determined according to the category label of each antecedent in the text and each character of the antecedent, that is, the correct antecedent of the zero pronoun can be determined by sequence annotation, which is simple and convenient. Moreover, when using the trained zero reference resolution model to perform zero reference resolution, all nouns before the zero pronoun can be used as antecedents, which can greatly reduce the complexity of the algorithm compared to the traditional technology of extracting antecedents through a syntactic tree.

[0071] The following is an explanation of the method for training a zero-reference resolution model provided in an embodiment of the present application based on the above-mentioned zero-reference resolution model.

[0072] Figure 3 is a flow chart of a method for training a zero-reference resolution model provided in an embodiment of the present application. Figure 3 , the method comprising:

[0073] Step 101: Convert all words in the training text into a first vector.

[0074] The training text includes multiple antecedents and multiple zero pronouns. For example, the training text includes multiple sentences, each of which may contain a zero pronoun, and all nouns before the zero pronoun in the sentence can be used as antecedents.

[0075] The first vector may include a first antecedent vector corresponding to each antecedent and a first zero pronoun vector corresponding to each zero pronoun, wherein the first zero pronoun vector includes position information of the zero pronoun.

[0076] In some embodiments, all words in the training text may be converted into a first vector through an Embedding layer and a Transformer layer in a zero-reference resolution model. Specifically, all words in the training text may be converted into a second vector through an Embedding layer, and then the second vector may be converted into a first vector through a Transformer layer.

[0077] In some embodiments, the above method may include: using a masked language model (MLM) to pre-train the training text to obtain pre-training parameters of the Transformer layer.

[0078] Exemplarily, pre-training the training text with a masked language model to obtain pre-trained parameters of the Transformer layer may include: masking some words in the training text, performing a denoising auto-encoding training task on the training text after the MASK processing through the masked language model to learn language representation and text features, and obtaining pre-trained parameters of the Transformer layer.

[0079] The masking process for some characters in the training text may include: selecting characters of a preset proportion in the training text; and replacing a part of the characters in the preset proportion with any characters or preset marks.

[0080] For example, the characters in the first part of the characters in the preset proportion can be replaced with a preset mark (such as a "MASK" mark); the characters in the second part of the characters in the preset proportion can be replaced with any characters; and the characters in the third part of the characters in the preset proportion are not changed. The characters in the first part, the characters in the second part and the characters in the third part constitute the characters in the preset proportion.

[0081] It should be noted that the characters in the preset proportion in the text to be trained may be randomly selected characters or characters that meet preset conditions, which is not limited in this embodiment of the present application.

[0082] Traditional language model tasks can generally only learn unidirectionally from left to right or from right to left, so pre-trained unidirectional language model tasks, such as ELMo, GPT, etc., can only learn unidirectional representations, which limits the information learned by the model from the training text. In contrast, in an embodiment of the present application, a masked language model is used to pre-train the training text to obtain the pre-trained parameters of the Transformer layer. Afterwards, in the process of training the zero-reference resolution model, an attempt is made to restore the masked words based on the pre-trained parameters of the Transformer layer, so that some text features can be learned in the process of restoration. Moreover, the zero-reference resolution model is a bidirectional language model, so the embodiment of the present application can perform bidirectional learning on the training text and improve the information learned from the training text.

[0083] Step 102: Merge the position information of the zero pronoun into the first antecedent word vector to obtain a second antecedent word vector.

[0084] Exemplarily, the vector corresponding to the position information of the zero pronoun can be subjected to a preset operation with the first antecedent vector of the corresponding antecedent to obtain the second antecedent vector of each antecedent. The preset operation includes at least one of the following: vector summation, vector product, vector concatenation, and attention mechanism model.

[0085] When performing zero pronoun resolution, it is unreasonable to only consider the first antecedent vector of the antecedent without considering the position information of the zero pronoun. Moreover, when performing zero pronoun resolution reasoning, people can only determine the zero pronoun that needs to be resolved based on the position information of the zero pronoun. Therefore, integrating the position information of the zero pronoun into the first antecedent vector can more fully represent the relevant information of the antecedent in the context information and improve the accuracy of zero reference resolution.

[0086] Step 103: Determine the theoretical category label of each antecedent based on the first zero-pronoun vector and the second antecedent vector.

[0087] Each antecedent word corresponds to a preset category label. For example, a preset category label can be set in advance for each antecedent word in the training text.

[0088] In one scenario, the first zero-pronoun vector and the second antecedent vector can be input into the linear projection layer and the classification layer to determine the label value corresponding to each antecedent on multiple preset category labels; based on the multiple label values ​​corresponding to each antecedent, the theoretical category label corresponding to each antecedent is determined.

[0089] Step 104: Train the zero-reference resolution model according to the theoretical category label and the preset category label of each antecedent.

[0090] Exemplarily, the loss function of the zero-reference resolution model can be calculated based on the theoretical category label and the preset category label of each antecedent. The parameters of the zero-reference resolution model are modified based on the loss function. When the loss function meets the preset conditions, the training of the zero-reference resolution model is completed.

[0091] The above-mentioned method for training the zero-reference resolution model converts multiple antecedents in the training text into corresponding first antecedent vectors, and converts multiple zero pronouns into corresponding first zero pronoun vectors. Afterwards, the position information of the zero pronoun contained in the first zero pronoun vector is fused into the first antecedent vector to obtain a second antecedent vector. The first zero pronoun vector and the second antecedent vector are input into the linear projection layer and the classification layer to determine the theoretical category label of each antecedent. Then, the zero-reference resolution model is trained according to the theoretical category label of each antecedent and the preset category label. When performing zero pronoun resolution, it is unreasonable to only consider the first antecedent vector of the antecedent without considering the position information of the zero pronoun. Moreover, in the process of zero pronoun resolution reasoning, people can only determine the zero pronoun that needs to be resolved based on the position information of the zero pronoun. Therefore, fusing the position information of the zero pronoun into the first antecedent vector can more fully characterize the relevant information of the antecedent in the context information and improve the accuracy of zero-reference resolution.

[0092] Figure 4 is a flow chart of a method for training a zero-reference resolution model provided in an embodiment of the present application. Figure 4 , the method comprising:

[0093] Step 201: Pre-train the training text using a masked language model to obtain pre-training parameters of the Transformer layer.

[0094] In some embodiments, step 201 may include: performing mask processing on some characters in the training text, performing a denoising autoencoding training task on the training text after the mask processing through a mask language model to learn language representation and text features, and obtain pre-training parameters of the Transformer layer.

[0095] Exemplarily, the text to be trained may include multiple documents, each document includes multiple sentences, and each sentence includes multiple noun phrases. The text to be trained includes multiple zero pronouns and multiple antecedents, the multiple zero pronouns are scattered in each document, and each sentence may include or not include a zero pronoun.

[0096] Among them, masking some words in the training text can be performed by: selecting a preset proportion of words in the training text; replacing some of the words in the preset proportion with arbitrary words or preset marks. It should be noted that the words in the preset proportion selected in the training text can be randomly selected words or words that meet preset conditions, and the embodiments of the present application are not limited to this.

[0097] For example, the characters in the first part of the characters in the preset proportion can be replaced with a preset mark (such as a "MASK" mark); the characters in the second part of the characters in the preset proportion can be replaced with any characters; and the characters in the third part of the characters in the preset proportion are not changed, thereby obtaining a training text. The characters in the first part, the characters in the second part and the characters in the third part constitute the characters in the preset proportion.

[0098] Step 202: Convert the training text into a second vector through an embedding layer.

[0099] For example, the training text can be converted into a second vector through word embedding, positional embedding and segment embedding. That is, for each word in the training text, the three embeddings of positional embedding, word embedding and segment embedding can be converted into corresponding embedding vectors respectively, and then the three embedding vectors corresponding to each word are added together to obtain the vector corresponding to each word, that is, the second vector of the training text.

[0100] Take the text "Xiao Ming ate an apple, it was very sweet" as an example. Each word in the text is "Xiao", "Ming", "eat", "one", "one", "apple", "fruit", "very", and "sweet".

[0101] In NLU, word order is a very important feature, so the position information of each word in the text can be encoded through Positional Embedding to obtain the position information embedding vector of each word. Word Embedding is used to convert each word in the text into a word embedding vector. Segment embedding is used to distinguish the sentences in which each word in the text is located and convert each word into a sentence embedding vector. The same word in different sentences has different corresponding Segment Embedding encodings.

[0102] Figure 5 Schematic diagram of converting the text "Xiao Ming ate an apple, it was very sweet" into a second vector. Figure 5, the two sentences in the text are separated by the separator symbol "SEP", and an identification symbol "CLS" and "SEP" are added to the front and the end of the text respectively.

[0103] Perform Word Embedding on each word in the text to get "E CLS ”, “E 小 ”, “E 明 ”, “E 吃 ”, “E 了 ”, “E 一 ”, “E 个 ”, “E 苹 ”, “E 果 ”, “E ESP ”, “E 很 ”, “E 甜 ”, “E ESP ”.

[0104] Perform Segment Embedding on each word in the text to get “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E A ”, “E B ”, “E B ”, “E B ”.

[0105] Perform positional embedding on each word in the text to get "E 0 ”, “E 1 ”, “E 2 ”, “E 3 ”, “E 4 ”, “E 5 ”, “E 6 ”, “E 7 ”E 8 ”、E 9 ”、E 10 ”、E 11 ”、E 12 ”.

[0106] The three embedding vectors corresponding to each word in the text are added together to obtain the second vector corresponding to the text.

[0107] In some embodiments, to adapt to the MASK processing of step 201 (i.e., the pre-training stage), the position of the zero pronoun in the training text can be replaced with a preset marker to obtain the training text in step 202. Afterwards, all words in the training text are converted into a second vector through an embedding layer.

[0108] Step 203: Process the second vector through the Transformer layer to obtain the first antecedent vector of each antecedent and the first zero pronoun vector of each zero pronoun in the training text data.

[0109] The first zero pronoun vector of each zero pronoun includes the position information of the zero pronoun.

[0110] Step 204: merge the position information of the zero pronoun into the first antecedent vector of the corresponding antecedent to obtain the second antecedent vector corresponding to each antecedent.

[0111] Among them, when performing zero pronoun resolution, it is unreasonable to only consider the first antecedent vector of the antecedent without considering the position information of the zero pronoun. Moreover, in the process of zero pronoun resolution reasoning, people can only determine the zero pronoun that needs to be resolved based on the position information of the zero pronoun. Therefore, in order to incorporate more relevant information about the zero pronoun into the first antecedent vector of the antecedent, the position information of the zero pronoun can be incorporated into the first antecedent vector of the antecedent.

[0112] In some embodiments, a vector corresponding to the position information of the zero pronoun may be subjected to a preset operation with the first antecedent vector of the antecedent to obtain a second antecedent vector corresponding to each antecedent. The preset operation includes at least one of the following: vector summation, vector product, vector concatenation, and an attention mechanism model.

[0113] Exemplarily, the preset operation is described below by taking the first antecedent vector of the antecedent as X, the vector of the position information of the zero pronoun as M, and the second antecedent vector of the antecedent as X′ as an example.

[0114] 1. The preset operation is the sum of vectors. The vector M of the position information of the zero pronoun is weightedly summed with the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent. For example, it can be X'=X+aM. Wherein, a is a preset coefficient, and a can be a positive or negative number. For example, a=1, the second antecedent vector X'=X+M; a=-1, the second antecedent vector X'=XM. Of course, a can be any other value, and there is no limitation on this.

[0115] 2. The preset operation is vector multiplication. The product of the vector M of the position information of the zero pronoun and the first antecedent vector X of the antecedent is taken as the second antecedent vector X' of the antecedent. For example, X'=bX*M. Where b is a preset coefficient, which can be a positive number or a negative number.

[0116] 3. The default operation is vector concatenation. Concatenate the vector M of the position information of the zero pronoun with the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent. The vector M of the position information of the zero pronoun and the first antecedent vector X are not limited in the position of the second antecedent vector X'. For example, it can be X'=[X:M] or X'=[M:X].

[0117] 4. The default operation is the attention mechanism model. Various attention mechanism models can be used to process the vector M of the position information of the zero pronoun and the first antecedent vector X of the antecedent to obtain the second antecedent vector X' of the antecedent.

[0118] Step 205: Input the second antecedent vector of the antecedent and the first zero pronoun vector of the zero pronoun into the linear projection layer and the classification layer to determine the label value corresponding to each antecedent on multiple preset category labels.

[0119] In some embodiments, the plurality of preset category labels may include three category labels, namely, non-antecedent, positive antecedent, and negative antecedent. Among them, the non-antecedent category label indicates that the corresponding noun is not an antecedent, the positive antecedent category label indicates that the corresponding noun is an antecedent and can resolve the zero pronoun (i.e., the correct antecedent), and the negative antecedent category label indicates that the corresponding noun is an antecedent but cannot resolve the zero pronoun (i.e., the incorrect antecedent).

[0120] Exemplarily, each antecedent corresponds to a label value on each preset category label, and the sum of the label values ​​of the same antecedent on each preset category label is 1. For example, taking "apple" as an example, its label value on the non-antecedent category label is 0.1, its label value on the antecedent negative category label is 0.2, and its label value on the antecedent positive category label is 0.7. The above three label values ​​indicate that the probability that "apple" is not an antecedent is small, the probability that it is an incorrect antecedent is small, and the probability that it is a correct antecedent is large.

[0121] Step 206: Determine the theoretical category label corresponding to each antecedent according to the multiple label values ​​corresponding to each antecedent.

[0122] In some embodiments, first, determine the first tag values of the characters included in each antecedent on multiple preset category tags; wherein, there are multiple first tag values, and the multiple first tag values correspond one-to-one to the multiple preset category tags. After that, calculate the second tag values of each antecedent on the multiple preset category tags according to the tag values of each character on the multiple preset category tags. After that, determine the theoretical category tag corresponding to each antecedent according to the multiple second tag values of each antecedent.

[0123] Exemplarily, calculating the second tag values of each antecedent on the multiple preset category tags according to the tag values of each character on the multiple preset category tags may specifically include: for each antecedent, calculate the average value of the first tag values corresponding to the first preset category tag of each character to obtain the second tag value corresponding to the first preset category tag of each antecedent. Wherein, the first preset category tag is any one of the multiple preset category tags.

[0124] Exemplarily, determining the theoretical category tag corresponding to each antecedent according to the multiple second tag values of each antecedent may specifically include: determining the theoretical category tag corresponding to each antecedent according to the maximum value among the multiple second tag values.

[0125] For example, taking "apple" as an example, the first tag value of the character "苹" on the non-antecedent category tag is 0.1, the first tag value of the character "苹" on the negative example category tag of the antecedent is 0.2, the first tag value of the character "苹" on the positive example category tag of the antecedent is 0.7, the first tag value of the character "果" on the non-antecedent category tag is 0.2, the first tag value of the character "果" on the negative example category tag of the antecedent is 0.2, and the first tag value of the character "果" on the positive example category tag of the antecedent is 0.6.

[0126] For the antecedent "apple", its second tag value on the non-antecedent category tag is 0.15 (i.e., the average of 0.1 and 0.2), the second tag value of "apple" on the negative example category tag of the antecedent is 0.2 (i.e., the average of 0.2 and 0.2), and the second tag value of "apple" on the positive example category tag of the antecedent is 0.65 (i.e., the average of 0.7 and 0.6).

[0127] After determining the multiple second label values ​​of each antecedent, the theoretical category label of each antecedent is determined based on the maximum value of the second label values ​​of each antecedent. For example, if the maximum value of the second label value of "apple" on the antecedent positive example category label, 0.65, is greater than the maximum value of the second label value of other antecedents on the antecedent positive example category label, then the label "antecedent positive example" corresponding to the maximum second label value of 0.65 can be determined as the theoretical category label of "apple". If the maximum value of the second label value of "apple" on the antecedent positive example category label, 0.65, is less than the maximum value of the second label value of a certain antecedent on the antecedent positive example category label, then the theoretical category label of "apple" is not "antecedent positive example".

[0128] In the embodiment of the present application, the theoretical category label corresponding to each antecedent is determined according to the label values ​​of each character in each antecedent on multiple preset category labels. Since each character of each antecedent corresponds to a category label, and the antecedent corresponds to a category label, it is equivalent to sequentially labeling each character of each antecedent in the text by means of category labels, thereby determining the correct antecedent of the zero pronoun in the text according to each category label. Therefore, the embodiment of the present application can determine the correct antecedent of the zero pronoun by means of sequence labeling, which is simple and convenient.

[0129] Step 207: Train the zero-reference resolution model according to the theoretical category label corresponding to each antecedent and the preset category label of each antecedent.

[0130] The preset category label of each antecedent can be preset. For example, a preset category label can be set for each antecedent in the training text in advance. After obtaining the theoretical category label corresponding to each antecedent, the loss function of the model is calculated according to the theoretical category label and the actual category label of each antecedent. Then, the parameters of the zero reference resolution model are modified based on the loss function.

[0131] In this embodiment, the loss function may be a cross entropy loss function. For example, the loss function may be Where I is the indicator function, and y represents the category label, is the probability of an incorrect antecedent, It is expressed as the probability of the correct antecedent, i is a positive integer.

[0132] In some embodiments, the condition for completing the training of the zero-reference resolution model may be: the loss function L(θ) is less than or equal to the loss threshold. For example, if the loss function L(θ) is greater than the loss threshold, the training of the zero-reference resolution model is not completed; if the loss function L(θ) is less than or equal to the loss threshold, the training of the zero-reference resolution model is completed, and the training parameters of the model are obtained. When the zero-reference resolution model is used to perform zero-reference resolution on the zero-reference resolution text, the training parameters of the model can be directly brought into the zero-reference resolution model to perform zero-reference resolution on the zero-reference resolution text.

[0133] In some other embodiments, the condition for completing the training of the zero-reference resolution model may be: the number of iterations is greater than or equal to the number threshold. For example, if the number of iterations is less than the number threshold, the training of the zero-reference resolution model is not completed; if the number of iterations is greater than the number threshold, the training of the zero-reference resolution model is completed and the training parameters of the model are obtained. Similarly, when performing zero-reference resolution on text data through the zero-reference resolution model, the training parameters of the model can be directly brought into the zero-reference resolution model to perform zero-reference resolution on the text data.

[0134] The above-mentioned method of training a zero-reference resolution model uses a masked language model to model the zero-reference resolution task. In the process of training the zero-reference resolution model, no manual annotation is required. It is only necessary to replace the position of the zero pronoun in the training text with a preset mark. Therefore, a large amount of unsupervised corpus in the industry can be used to reduce labor costs. Moreover, the correct antecedent of the zero pronoun can be determined by the category labels of each antecedent, which is simple and convenient to implement. In addition, when using the trained zero-reference resolution model for zero-reference resolution, all nouns before the zero pronoun can be used as antecedents. Compared with the traditional technology of extracting antecedents through a syntactic tree, the complexity of the algorithm can be greatly reduced.

[0135] The following is an experimental test on the trained zero-reference resolution model to determine the performance of the trained zero-reference resolution model.

[0136] Table 1 shows the number of documents, sentences, words, and zero-reference numbers in the training and test text data. In this experimental test, the performance of the trained zero-reference resolution model is evaluated mainly based on the harmonic mean F1 of the precision P and recall R of whether the resolution is successful. 1 =2PR / (P+R).

[0137] Table 1 Training text data and test text data

[0138] Number of documents Number of sentences Number of words Zero-index algebra Training text data 1391 36487 765K 12111 Test text data 172 6083 110K 1713

[0139] Based on the above test text data, the embodiment of the present application is compared with the benchmark system, and the experimental results are shown in Table 2. The benchmark systems are the best Chinese reference resolution systems in the world, namely Zhao and Ng (2007), Chen and Ng (2015), Chen and Ng (2016), Yin et al. (2017b), Yin et al. (2017a), Liu et al. (2017), Yin et al. (2018), and Yin et al. (2018).

[0140] Table 2 Comparison of test results

[0141]

[0142]

[0143] It can be seen from Table 2 that the model of the embodiment of the present application has a harmonic mean F 1 In terms of scoring, it significantly exceeds several of the current better models.

[0144] The following is an explanation of the zero reference resolution method provided in the embodiments of the present application.

[0145] Figure 6 is a flow chart of a zero reference resolution method provided in an embodiment of the present application. Figure 6 , the above zero reference resolution method may include:

[0146] Step 301: Obtain the text to be resolved by zero reference.

[0147] Step 302: Perform zero-reference resolution on the text to be resolved by zero-reference resolution through a zero-reference resolution model.

[0148] Among them, the zero reference resolution model in this step is Figure 3 or Figure 4 The model obtained by the embodiment shown.

[0149] The above zero reference resolution method,

[0150] Figure 7 A flowchart of performing zero-reference resolution on a text to be zero-reference resolution is provided in an embodiment of the present application. Figure 7 , the zero-reference resolution of the zero-reference resolution text may include the following steps:

[0151] Step 401: All words in the text to be zero-referenced are converted into a third vector through an embedding layer and a Transformer layer.

[0152] The text to be resolved by zero reference includes multiple antecedents and multiple zero pronouns. The third vector includes a third antecedent vector corresponding to each antecedent and a third zero pronoun vector corresponding to each zero pronoun, and the third zero pronoun vector includes the position information of the zero pronoun.

[0153] For example, all words in the text to be resolved by zero reference can be converted into a fourth vector through an embedding layer, and then the fourth vector can be converted into a third vector through a Transformer layer.

[0154] For the specific process of the embedding layer converting all words in the text to be zero-referenced and resolved into the fourth vector, please refer to step 101 and step 202, which will not be repeated here. For the specific process of the Transformer layer converting the fourth vector into the third vector, please refer to step 101 and step 203, which will not be repeated here.

[0155] Step 402: Through the zero pronoun position information fusion layer, the position information of the zero pronoun is fused into the third antecedent word vector to obtain the fourth antecedent word vector.

[0156] In some embodiments, a vector corresponding to the position information of the zero pronoun may be subjected to a preset operation with the third antecedent vector of the antecedent to obtain a fourth antecedent vector corresponding to each antecedent. The preset operation includes at least one of the following: vector summation, vector product, vector concatenation, and an attention mechanism model.

[0157] Regarding the specific process of performing a preset operation on the vector corresponding to the position information of the zero pronoun and the third antecedent vector of the antecedent, please refer to step 204, which will not be repeated here.

[0158] Step 403: Input the third zero-pronoun vector and the fourth antecedent vector to the linear projection layer and the classification layer to determine the label value corresponding to each antecedent on multiple preset category labels.

[0159] For the specific process of determining the label value corresponding to each antecedent word on multiple preset category labels, please refer to step 103, step 205 and step 206, which will not be repeated here.

[0160] Step 404: Use the antecedent with the largest label value on the first category label as the final resolved antecedent; wherein the first category label represents the correct antecedent.

[0161] For example, the label value of "Xiao Ming" on the non-antecedent category label is 0.2, the label value on the antecedent negative category label is 0.3, and the label value on the antecedent positive category label is 0.5. The label value of "one" on the non-antecedent category label is 0.5, the label value on the antecedent negative category label is 0.3, and the label value on the antecedent positive category label is 0.2. The label value of "apple" on the non-antecedent category label is 0.1, the label value on the antecedent negative category label is 0.2, and the label value on the antecedent positive category label is 0.7. Since "apple" has the largest label value on the antecedent positive category label, "apple" is used as the final resolved antecedent. As a result, "Xiao Ming ate an apple, it was very sweet" is "Xiao Ming ate an apple, the apple was very sweet".

[0162] Corresponding to the method of training the zero reference resolution model in the above embodiment, Figure 8 A structural block diagram of an apparatus 500 for training a zero-reference resolution model provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0163] See also Figure 8 The device 500 for training a zero-reference resolution model in an embodiment of the present application may include a conversion unit 501, a fusion unit 502, a category label determination unit 503 and a training unit 504.

[0164] Wherein, the conversion unit 501 is used to convert all words in the training text into a first vector. Wherein, the training text includes multiple antecedents and multiple zero pronouns, and the first vector includes a first antecedent vector corresponding to each of the antecedents and a first zero pronoun vector corresponding to each of the zero pronouns, and the first zero pronoun vector contains the position information of the zero pronoun. The fusion unit 502 is used to fuse the position information of the zero pronoun into the first antecedent vector to obtain a second antecedent vector. The category label determination unit 503 is used to determine the theoretical category label of each of the antecedents based on the first zero pronoun vector and the second antecedent vector. Wherein, each of the antecedents corresponds to a preset category label. The training unit 504 is used to train the zero reference resolution model according to the theoretical category label of each of the antecedents and the preset category label.

[0165] Corresponding to the zero reference resolution method in the above embodiment, Fig. 9 A structural block diagram of a zero reference resolution device 600 provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0166] See also Fig. 9 The zero reference resolution device 600 in the embodiment of the present application may include an acquisition unit 601 and a resolution unit 602 .

[0167] The acquisition unit 601 is used to acquire the text to be resolved by zero reference. The resolution unit 602 is used to perform zero reference resolution on the text to be resolved by zero reference through a zero reference resolution model. Figure 3 or Figure 4 The method described is obtained.

[0168] The present application also provides an electronic device, see Fig.10 The electronic device 700 may include: at least one processor 710, a memory 720, and a computer program stored in the memory 720 and executable on the at least one processor 710. When the processor 710 executes the computer program, the steps in any of the above-mentioned method embodiments are implemented, for example: Figure 3 Steps 101 to 104 in the embodiment shown, or as Figure 6 Steps 301 to 302 in the embodiment shown. Alternatively, when the processor 710 executes the computer program, the functions of each unit in the above-mentioned device embodiments are realized, for example Figure 8 The functions of modules 501 to 504 shown in FIG. Fig. 9 Functions of modules 601 to 602 are shown.

[0169] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 720, and executed by the processor 710 to complete the present application. One or more modules / units may be a series of computer program segments capable of completing specific functions, and the program segments are used to describe the execution process of the computer program in the electronic device 700.

[0170] Those skilled in the art will understand that Fig.10 These are merely examples of electronic devices and do not constitute a limitation of the electronic device. The electronic device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.

[0171] The processor 710 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0172] The memory 720 may be an internal storage unit of the electronic device, or an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 720 is used to store computer programs and other programs and data required by the electronic device. The memory 720 may also be used to temporarily store data that has been output or is to be output.

[0173] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0174] For example, Fig.11 1 is a schematic diagram of the hardware architecture of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 involved in the embodiment of the present application may include but is not limited to a personal computer (PC), a tablet computer, a portable device (e.g., a portable computer), a mobile phone, a personal digital assistant (PDA), a smart TV, a smart watch, an e-book reader, smart glasses and other devices, and the embodiment of the present application is not limited to this.

[0175] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0176] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0177] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0178] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0179] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0180] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0181] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0182] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0183] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to implement the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0184] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0185] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0186] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0187] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0188] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0189] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0190] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0191] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0192] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0193] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0194] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0195] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0196] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).

[0197] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0198] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0199] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0200] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0201] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0202] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0203] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0204] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0205] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0206] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0207] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0208] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0209] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0210] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0211] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0212] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0213] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0214] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0215] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0216] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0217] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0218] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0219] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0220] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0221] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0222] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0223] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0224] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0225] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0226] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0227] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0228] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0229] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0230] The embodiment of the present application also provides a computer program product comprising instructions, and when the computer program product is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0231] The embodiment of the present application also provides a chip system, which may include a memory and a processor, and the processor executes a computer program stored in the memory to implement one or more steps in any of the above methods. The chip system may be a single chip or a chip module composed of multiple chips.

[0232] The embodiment of the present application also provides a chip system, which may include a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement one or more steps in any of the above methods. The chip system may be a single chip or a chip module composed of multiple chips.

[0233] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0234] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0235] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for training a zero-reference resolution model, characterized in that: Suitable for execution in an electronic device, the method comprises: Convert all words in the training text into a first vector; wherein the training text includes multiple antecedents and multiple zero pronouns, the first vector includes a first antecedent vector corresponding to each of the antecedents and a first zero pronoun vector corresponding to each of the zero pronouns, and the first zero pronoun vector includes the position information of the zero pronoun; the zero reference resolution model includes an embedding layer, a Transformer layer, a zero pronoun position information integration layer, a linear projection layer, and a classification layer; Merging the position information of the zero pronoun into the first antecedent word vector to obtain a second antecedent word vector; Based on the first zero-pronoun vector and the second antecedent vector, determining the theoretical category label of each antecedent, including: inputting the first zero-pronoun vector and the second antecedent vector into the linear projection layer and the classification layer to determine the label value corresponding to each antecedent on multiple preset category labels; determining the first label value of the word contained in each antecedent on the multiple preset category labels; wherein the first label value is multiple, and the multiple first label values ​​correspond to the multiple preset category labels one by one; according to the label value of each word on the multiple preset category labels Signature value, calculate the second label value of each antecedent on the multiple preset category labels; determine the theoretical category label corresponding to each antecedent according to the multiple second label values ​​of each antecedent; wherein each antecedent corresponds to a preset category label; the multiple preset category labels include non-antecedent, positive antecedent and negative antecedent; the non-antecedent category label indicates that the corresponding noun is not an antecedent, the positive antecedent category label indicates that the corresponding noun is an antecedent and can resolve zero pronoun, and the negative antecedent category label indicates that the corresponding noun is an antecedent but cannot resolve zero pronoun; The zero reference resolution model is trained according to the theoretical category label of each antecedent and the preset category label.

2. The method according to claim 1, characterized in that The step of converting all words in the training text into a first vector includes: Convert all words in the training text into a second vector through the embedding layer; The second vector is transformed into the first vector through the Transformer layer.

3. The method according to claim 2, characterized in that The method comprises: Pre-training the training text using a masked language model to obtain pre-training parameters of the Transformer layer; The converting the second vector into the first vector through the Transformer layer includes: Bringing the pre-trained parameters of the Transformer layer into the Transformer layer; The second vector is transformed into the first vector through the Transformer layer.

4. The method according to claim 3, characterized in that The converting all words in the training text into a second vector by the embedding layer comprises: Replacing the position of the zero pronoun in the text to be trained with a preset marker to obtain the training text; All words in the training text are converted into second vectors through the embedding layer.

5. The method according to claim 1, characterized in that The step of calculating the second label value of each antecedent on the plurality of preset category labels according to the label value of each character on the plurality of preset category labels comprises: For each antecedent, the average of the first label values ​​corresponding to each character and the first preset category label is calculated to obtain the second label value corresponding to each antecedent and the first preset category label; wherein the first preset category label is any preset category label among the multiple preset category labels.

6. The method according to claim 1, characterized in that The step of determining the theoretical category label corresponding to each antecedent according to the plurality of the second label values ​​of each antecedent includes: The theoretical category label corresponding to each antecedent is determined according to the maximum value of the plurality of second label values.

7. The method according to any one of claims 1 to 6, characterized in that: The step of fusing the position information of the zero pronoun into the first antecedent word vector to obtain a second antecedent word vector includes: Performing a preset operation on the vector corresponding to the position information of the zero pronoun and the first antecedent vector of the corresponding antecedent to obtain the second antecedent vector of each antecedent; The preset operation includes at least one of the following: vector summation, vector product, vector concatenation, and an attention mechanism model.

8. The method according to any one of claims 1 to 6, characterized in that: The training of the zero reference resolution model according to the theoretical category label of each antecedent and the preset category label includes: Calculating the loss function of the zero-reference resolution model according to the theoretical category label of each antecedent and the preset category label; The parameters of the zero-reference resolution model are modified based on the loss function; wherein, when the loss function meets a preset condition, the training of the zero-reference resolution model is completed.

9. A method for resolving zero reference, characterized in that: Suitable for execution in an electronic device, the method comprises: Get the text to be resolved by zero reference; The zero reference resolution is performed on the text to be zero reference resolution by means of a zero reference resolution model; wherein the zero reference resolution model is obtained by the method described in any one of claims 1 to 8.

10. The method according to claim 9, characterized in that The zero-reference resolution model includes an embedding layer, a Transformer layer, a zero-pronoun position information integration layer, a linear projection layer, and a classification layer; The zero-reference resolution model is used to perform zero-reference resolution on the text to be zero-reference resolved, including: Through the embedding layer and the Transformer layer, all words in the text to be resolved by zero reference are converted into a third vector; wherein the text to be resolved by zero reference includes multiple antecedents and multiple zero pronouns, the third vector includes a third antecedent vector corresponding to each of the antecedents and a third zero pronoun vector corresponding to each of the zero pronouns, and the third zero pronoun vector contains position information of the zero pronoun; By integrating the position information of the zero pronoun into the third antecedent vector through the zero pronoun position information integration layer, a fourth antecedent vector is obtained; Input the third zero-pronoun vector and the fourth antecedent vector into the linear projection layer and the classification layer to determine the label value corresponding to each antecedent on multiple preset category labels; The antecedent with the largest label value on the first category label is used as the final resolved antecedent; wherein the first category label represents the correct antecedent.

11. An electronic device, characterized in that: include: one or more processors, memory, and display screens; The memory and the display screen are coupled to the one or more processors, the memory is used to store computer program codes, and the computer program codes include computer instructions; When the one or more processors execute the computer instructions, the electronic device is caused to perform the method according to any one of claims 1 to 8, or the method according to any one of claims 9 to 10.

12. A chip system, characterized in that: The chip system includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the method as described in any one of claims 1 to 8, or the method as described in any one of claims 9 to 10.

Citation Information

Patent Citations

  • Chinese zero anaphora resolution method based on LSTM

    CN106294322A

  • Chinese zero-anaphora resolution method and system based on Mask mechanism and twin network

    CN111488733A