Method, apparatus, and storage medium for presenting prompt information
By using BERT model and graph convolutional neural network in entity disambiguation technology, combining character and semantic similarity as auxiliary features, the problem of entity disambiguation accuracy in the prior art is solved, and more accurate entity-concept association is achieved, and more accurate prompt information is provided.
Patent Information
- Application Number
- CN202110295319.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-19
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-03-19
AI Technical Summary
When existing entity disambiguation techniques deal with the complexity of natural language, it is difficult to accurately distinguish the correct meaning of entities in text and associate them with correct concepts in knowledge graphs.
The BERT model is used to encode entities, and character similarity and semantic similarity are used as auxiliary features. The concepts in the knowledge graph are extracted in combination with graph convolutional neural networks, thereby improving the accuracy of correlation between entities and concepts.
By improving the accuracy of the correlation between entities and the concept of knowledge graph, users can be provided with more accurate prompt information and help users understand the correct meaning of entities in text.
Smart Images

Figure CN115114919B_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to entity disambiguation technology, and more specifically, to a method and apparatus for presenting hint information about an entity in a text by using entity disambiguation technology, and a storage medium. Background Art
[0002] In an actual language environment, there often exists a situation where one entity name corresponds to multiple concepts. For example, the entity name "Apple" appearing in a text may refer to a kind of fruit, or may refer to Apple Inc. To solve the problem of ambiguity caused by the same entity name, entity disambiguation technology has been proposed and developed currently.
[0003] Entity disambiguation technology can link the mention information (mention), that is, the entity, in the context to an appropriate concept in a knowledge graph, which plays a fundamental role in many fields such as question answering, semantic search, and information extraction. A concept refers to something that is distinguishable and exists independently, and there are interconnections between different concepts included in the knowledge graph. For example, in reality, there are two persons with similar names: Michael Jeffrey Jordan and Michael Owen Jordan. The former is a basketball star, and the latter is a leading figure in the field of machine learning. Therefore, in the knowledge graph, there may be the following two concepts: "Basketball star Michael Jeffrey Jordan" and "Machine learning expert Michael Owen Jordan". In addition, in the knowledge graph, there may also be multiple sports-related concepts associated with "Basketball star Michael Jeffrey Jordan", and multiple computer technology-related concepts associated with "Machine learning expert Michael Owen Jordan". When a text includes the entity "Michael Jordan", it is necessary to determine whether this entity refers to "Basketball star Michael Jeffrey Jordan" or "Machine learning field expert Michael Owen Jordan" in the knowledge graph according to the context of the text.
[0004] After using entity disambiguation technology to determine that the entity mentioned in the text corresponds to a specific concept, hint information can be provided to the user based on the determined concept, so that the user can understand the correct meaning of the entity. For example, for the entity "Apple" appearing in the text "Apple released a new mobile phone today...", a hint can be given to the user: "Apple Inc.: An American high-tech company, representative products include iPhone mobile phones...".
[0005] However, due to the high complexity of natural language, entity disambiguation technology faces the challenge of how to distinguish the correct meaning of an entity in the context and associate it with the correct concept in the knowledge graph.
[0006] Currently, there are mainly two entity disambiguation methods: the method of using a ranking model to model the entity disambiguation problem, and the method of using a classification model to model the entity disambiguation problem.
[0007] The method using a ranking model includes two steps: candidate concept generation and candidate concept ranking. In the step of generating candidate concepts, simple rules are usually used, which often results in the inability to screen out the correct candidate concepts, and thus cascading errors will occur in the subsequent ranking step.
[0008] The method using a classification model models the entity disambiguation problem as a single-label text classification task. For example, the model described in the paper "Medical concept normalization in social media posts with recurrent neural networks" published by Elena Tutubalina et al. in the Journal of Biomedical Informatics in June 2018 includes two parts: a neural network and auxiliary features. In the neural network part, a Gated Recurrent Unit (GRU) network and an attention mechanism network are used to encode the entities. In the auxiliary feature part, TF-IDF similarity and Word2Vec similarity are used to enhance the model. However, in this model, the Word2Vec similarity feature does not have enough semantic information, so it is difficult to correctly compare the semantic-level similarity between entities and concepts. Summary of the Invention
[0009] To solve one or more problems existing in the prior art, the present invention proposes a new method using a classification model. This method uses a BERT model to encode the entities and uses character similarity and semantic similarity as auxiliary features. The method according to the present invention can increase the probability of associating the entities mentioned in the text with the correct concepts in the knowledge graph, thereby providing more accurate prompt information for users.
[0010] According to one aspect of the present invention, there is provided a computer-implemented method for presenting prompt information to a user viewing electronic text using a neural network, wherein the neural network includes a BERT model and a graph convolutional neural network, and the method includes: inputting the electronic text, information related to the electronic text, and a plurality of predefined concepts into the neural network, wherein the electronic text includes entities and the context of the entities, the information related to the electronic text includes the types of the entities and the part-of-speech of the context, and the concepts are in text form; using the BERT model to generate a first vector (V2) based on a combination of the entities, the context, the types of the entities, and the part-of-speech of the context; using the BERT model to generate a second vector (V4) based on each of the plurality of concepts; using the graph convolutional neural network to generate a third vector (V5) based on a graph, wherein the graph is generated based on the plurality of concepts and the relationships between the concepts; generating a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5); calculating the semantic similarity between the entity and each of the plurality of concepts based on the first vector (V2) and the fourth vector (V6); determining that the entity corresponds to one of the plurality of concepts based on the first vector (V2) and the semantic similarity; and generating the prompt information based on the determined concept corresponding to the entity to be presented to the user.
[0011] According to another aspect of the present invention, there is provided an apparatus for presenting prompt information to a user viewing electronic text by using a neural network, wherein the neural network includes a BERT model and a graph convolutional neural network, and the apparatus includes: a memory storing a computer program; and one or more processors, which perform the following operations by executing the computer program: inputting the electronic text, information related to the electronic text, and a plurality of predefined concepts into the neural network, wherein the electronic text includes entities and the context of the entities, the information related to the electronic text includes the types of the entities and the part-of-speech of the context, and the concepts are in text form; using the BERT model to generate a first vector (V2) based on a combination of the entities, the context, the types of the entities, and the part-of-speech of the context; using the BERT model to generate a second vector (V4) based on each of the plurality of concepts; using the graph convolutional neural network to generate a third vector (V5) based on a graph, wherein the graph is generated based on the plurality of concepts and the relationships between the concepts; generating a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5); calculating the semantic similarity between the entities and each of the plurality of concepts based on the first vector (V2) and the fourth vector (V6); determining, based on the first vector (V2) and the semantic similarity, that the entity corresponds to one of the plurality of concepts; and generating the prompt information based on the determined concept corresponding to the entity to be presented to the user.
[0012] According to another aspect of the present invention, there is provided a device for presenting prompt information to a user viewing electronic text, wherein the electronic text includes an entity and the context of the entity, and the device includes: a main module, a semantic similarity calculation module, a character similarity calculation module, and a presentation module. The main module includes: a BERT module configured to generate a first vector (V2) based on a combination of the entity, the context, the type of the entity, and the part of speech of the context; and a classification module configured to determine that the entity corresponds to one of a plurality of predefined concepts based on the first vector (V2), the semantic similarity calculated by the semantic similarity calculation module, and the character similarity calculated by the character similarity calculation module, wherein the concept is in text form. The semantic similarity calculation module includes: a BERT module configured to generate a second vector (V4) based on each of the plurality of concepts; and a graph convolutional neural network configured to generate a third vector (V5) based on a graph, wherein the graph is generated based on the plurality of concepts and the relationships between the concepts. The semantic similarity calculation module generates a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5), and calculates the semantic similarity between the entity and each of the plurality of concepts based on the first vector (V2) and the fourth vector (V6). The character similarity calculation module is configured to calculate the character similarity between the entity and each of the plurality of concepts. The presentation module is configured to generate the prompt information based on the determined concept corresponding to the entity and present it to the user.
[0013] According to another aspect of the present invention, there is provided a storage medium storing a computer program, which when executed by a computer causes the computer to execute the method as described above. Brief Description of the Drawings
[0014] Figure 1 Schematically shows the architecture of the neural network according to the present invention.
[0015] Figure 2 Shows a combination of an entity, a context, an entity type, and a context part of speech.
[0016] Figure 3 Schematically shows a graph constructed based on all concepts.
[0017] Figure 4 Shows a module diagram of a device for presenting prompt information about an entity to a user according to the present invention.
[0018] Figure 5 Shows a flowchart of a method for presenting prompt information about an entity to a user according to the present invention.
[0019] Figure 6 The following shows a block diagram of an exemplary configuration of computer hardware for implementing the present invention. Detailed implementation manners
[0020] Figure 1 Schematically shows the architecture of a neural network according to the present invention. Figure 1 The left half in shows the main model, and the right half shows the auxiliary feature part. The main model is mainly used to perform a classification task, that is, to determine which concept (category) the entity included in the text belongs to. In the main model, an existing BERT (Bidirectional Encoder Representation from Transformers) model is adopted. In natural language processing based on neural networks, each word in the text is usually represented by a one-dimensional vector (referred to as a "word vector"). The BERT model uses the word vector as input and outputs a vector representation corresponding to the word that integrates the semantic information of the entire text. Thus, the BERT model can generate a semantic representation containing rich semantic information for a certain text. Then, for a specific natural language processing task, the semantic representation of the generated text is fine-tuned to make it applicable to the specific task.
[0021] The main model and the auxiliary feature part in the present invention will be described sequentially below.
[0022] For a certain entity appearing in the text, the present invention adopts a combination of the entity, context, entity type, and context part of speech as the input of the main model. Figure 2 Schematically shows the specific form of this combination.
[0023] As Figure 2 shown, the first line represents the text content. A start tag [E] is added before the first character of the entity, and an end tag [E / ] is added after the last character. Then, the text before the entity is placed before the start tag [E], and the text after the entity is placed after the end tag [E / ]. In this way, the entity is matched with its context. Therefore, "M1 M2..." represents the string of the entity, and "L1 L2..." and "R1 R2..." respectively represent the strings of the text before and after the entity.
[0024] In addition, referring to the dictionary resources, the entity type of the entity is marked, and the part of speech information of the corresponding context is marked. The dictionary resources include a predefined part of speech dictionary and an entity type dictionary. In the part of speech dictionary, parts of speech such as nouns, verbs, adverbs, adjectives, etc. are defined, and in the entity type dictionary, various entity types are defined, such as animals, companies, games, etc. Figure 2The second line in shows the type of the entity in the text determined with reference to the dictionary resource, Entity Type x and the part-of-speech, POS, of the context i .
[0025] Figure 2 The text content of the first line in can be represented as a two-dimensional vector [batch_size, document_token], where batch_size represents the number of input documents, and document_token represents the sequence of character IDs in each document. Similarly, the part-of-speech and entity type information of the second line can also be represented as a two-dimensional vector [batch_size, document_token].
[0026] Return reference Figure 1 , and the Embedding and Adding layer 110 converts the combination of the input entity, context, entity type, and context part-of-speech into a non-sparse vector for input to the BERT model 120.
[0027] Specifically, the Embedding and Adding layer 110 Figure 2 converts the two-dimensional vector [batch_size, document_token] corresponding to the first line in to [batch_size, document_token, embedding_dim], where embedding_dim represents the dimension of the embedding. Similarly, the Embedding and Adding layer 110 Figure 2 converts the two-dimensional vector [batch_size, document_token] corresponding to the second line in to [batch_size, document_token, embedding_dim].
[0028] Then, based on the following formula (1), the Embedding and Adding layer 110 performs a weighted sum on the first line and the second line to obtain the output vector V1.
[0029] V1 = sigmoid(W1X1 + W2X2) -(1)
[0030] where sigmoid represents the activation function sigmoid = 1 / (1 + exp(-x)), W1, W2 represent the weights to be trained, and X1, X2 respectively represent the converted vectors corresponding to Figure 2 the first line and the second line in.
[0031] The BERT model 120 receives the vector V1 output by the embedding and summation layer 110, encodes the entities in the text content, and extracts the semantic information of the entities. Since the BERT model is known to those skilled in the art, it will not be specifically described in the present invention. As described above, the vector V1 [batch_size, document_token, embedding_dim] is input to the BERT model 120, and the BERT model 120 outputs a vector V2 [batch_size, bert_dim], where bert_dim represents the hidden layer dimension of the BERT model 120, that is, the output dimension.
[0032] The concatenation layer 130 receives the output V2 of the BERT model 120 and concatenates it with the auxiliary features. The auxiliary features will be described in detail below. After concatenation, the concatenation layer 130 outputs a vector V3 [batch_size, bert_dim + 2 * class_dim], where class_dim represents the number of categories. The categories correspond to the concepts in the knowledge graph, so class_dim also represents the number of predefined concepts in the knowledge graph.
[0033] Subsequently, the output vector V3 of the concatenation layer 130 is input to the classification layer 140. As an example, the classification layer 140 can be implemented by a Softmax classifier. In the classification layer 140, the vector V3 is first converted into the one-hot encoding form, and the converted dimension is [batch_size, class_dim]. Then, the classification layer 140 generates a classification prediction result based on the converted vector. The prediction result indicates the probability that the entity in the text belongs to each concept (category) in the knowledge graph, and the concept corresponding to the maximum probability can be determined as the concept to which the entity belongs.
[0034] Specifically, in practice, it is usually impossible for the knowledge graph to include all existing concepts, but only a limited number of concepts. Therefore, the following situation may occur: an entity does not belong to any concept in the knowledge graph, and it will be inappropriate to explain the meaning of the entity with any concept. For this situation, a threshold can be set. When the maximum probability in the prediction result is greater than the threshold, the concept corresponding to the maximum probability is determined as the concept to which the entity belongs, and a prompt message for the user is generated based on the content of the determined concept to help the user understand the correct meaning of the entity. On the other hand, when all probabilities in the prediction result are less than the threshold, it means that the entity is not suitable to be classified into any concept. In this case, no prompt message will be generated for the entity.
[0035] The following describes the auxiliary features in detail. In the present invention, the similarity features between computational entities and concepts are used as auxiliary features to enhance the performance of the model. Preferably, in order to reduce the computational amount, only the concepts in the preset knowledge graph are selected. The similarity features include character similarity and semantic similarity. As an example, the present invention uses BM25 similarity as the character similarity and uses neural network-based vector similarity as the semantic similarity.
[0036] Specifically, in the case of using BM25 similarity as the character similarity, the character similarity is calculated as follows: for an entity in the text, calculate the BM25 similarity between it and each concept (in text form) in the knowledge graph. As a calculation result, a vector with a dimension of [batch_size, class_dim] will be obtained. Given that the BM25 algorithm (Best Match 25) is a text similarity algorithm known to those skilled in the art, the detailed description of calculating BM25 similarity will be omitted herein.
[0037] In addition, regarding the semantic similarity, the present invention calculates the cosine similarity between the vector representation of the entity and the vector representation of each concept in the knowledge graph. As a calculation result, a vector with a dimension of [batch_size, class_dim] will be obtained. The calculation method of the semantic similarity will be described in detail below.
[0038] See Figure 1 the auxiliary feature part shown in the right half, which makes each concept in the knowledge graph go through the processing of the embedding and summation layer 110 and the BERT model 120, and then the BERT model 120 outputs a vector V4 representing the semantic feature of each concept itself. As Figure 1 shown, the main model and the auxiliary feature part share the use of the embedding and summation layer 110 and the BERT model 120.
[0039] On the other hand, a graph is constructed based on all the concepts in the knowledge graph, Figure 3 showing an example of the constructed graph. In Figure 3 it, each node N represents a concept, and the connection lines between the nodes represent the mutual associations between the concepts.
[0040] The Laplacian matrix is calculated for the constructed graph, and then the Laplacian matrix is input into the graph convolutional neural network (GCN) 150. Given that the graph convolutional neural network (GCN) is a technology known to those skilled in the art, the present invention will not describe it in detail. GCN 150 can output a vector representing the overall features of all concepts, and this overall feature includes the mutual relationships between each concept. Since the concepts are mutually related, as Figure 3As shown in the schematic diagram, the GCN 150 can model the relationships between concepts. Therefore, the vector V5 generated by the GCN 150 contains the mutual relationships between different concepts. The dimension of the vector V5 is [batch_size, graph_dim], where graph_dim represents the dimension of the output layer of the GCN 150.
[0041] Then, both the output vector V4 of the BERT model 120 and the output vector V5 of the GCN 150 are input into the concatenation and dimension transformation layer 160. The concatenation and dimension transformation layer 160 concatenates and transforms the dimensions of the vector V4 and the vector V5, thereby outputting a vector V6 with a dimension of [batch_size, bert_dim]. It should be noted that the vector V6 is the vector representation of the concepts in the knowledge graph.
[0042] On the other hand, as mentioned above, in Figure 1 In the main model shown in the left half, the BERT model 120 obtains the vector representation V2 for the input entity. Then, based on the vector representation V2 of the entity output by the BERT model 120 in the main model and the vector representation V6 of the concept output by the concatenation and dimension transformation layer 160, the semantic similarity between the entity and the concept is calculated.
[0043] Preferably, both the vector V2 and the vector V6 are input into the mapping layer 170. The mapping layer 170 is used to map the vector V2 and the vector V6 into the same vector space for subsequent comparison of the similarity between the two. The mapping layer 170 can essentially be a fully connected layer with a hidden layer, which maps the input vector into the same vector space according to the following formula (2):
[0044] Y = sigmoid(WX + b) - (2)
[0045] where sigmoid represents the activation function sigmoid = 1 / (1 + exp(-x)), W and b represent the weights to be trained. X represents the input vector V2 or V6, and its dimension is [batch_size, bert_dim]. Y represents the mapped vector, and its dimension is [batch_size, trans_dim], where trans_dim is the dimension after the entity vector and the concept vector are mapped into the same vector space.
[0046] After that, the cosine similarity can be calculated according to the following formula (3) as the semantic similarity:
[0047]
[0048] Among them, x1 and x2 respectively represent the vector representation of the entity and the vector representation of the concept. In particular, when using the mapping layer 170, x1 and x2 respectively represent the mapped vector representations.
[0049] So far, the character similarity and semantic similarity as auxiliary features have been obtained. As described above for the main model, the auxiliary features are input together with the output vector V2 of the BERT model 120 into the splicing layer 130 to perform subsequent processing.
[0050] The training process of the model according to the present invention will be described below. During training, Figure 1 the model shown is input with a training data set, which includes text and a knowledge graph. The text includes entities and their contexts, and the knowledge graph includes a plurality of predefined concepts. The model finally generates a classification prediction result for the entity, and the prediction result indicates the concept to which the entity belongs.
[0051] Based on the predicted concept and the ground truth, the model is trained according to a loss function (such as the cross-entropy loss function) to obtain the optimal parameters of the model. During training, the initial parameters of the BERT model 120 can be set to the parameters of the BERT pre-trained model. However, those skilled in the art can also use any other known method to perform the training, and the present invention does not limit this.
[0052] After training is completed, the trained model can be used to predict the specific concept corresponding to the entity mentioned in the text. Then, a prompt message for the user can be generated based on the content of the predicted concept to help the user understand the correct meaning of the entity. The prompt message can be provided in various ways (for example, visually, auditorily). For example, when the user is browsing a document, the meaning of an entity can be prompted to the user in the form of a hyperlink or a pop-up window, or the user can be prompted by voice.
[0053] Figure 4 Schematically shows a module view of a device for presenting a prompt message to a user according to the present invention. Figure 5 Shows a flowchart of a method for presenting a prompt message to a user according to the present invention.
[0054] Referring to Figure 4 and Figure 5 According to the present invention, the device includes a main module 410, an auxiliary feature generation module 420, and a presentation module 430. In step S510, a combination of an entity, a context, an entity type, and a context part of speech (as shown in Figure 2 ) is input to the main module 410, and a plurality of predefined concepts are input to the auxiliary feature generation module 420.
[0055] The main module 410 includes a BERT module 411 and a classification module 412. In step S520, the BERT module 411 generates a vector V2 based on the combination of the input entity, context, entity type, and context part of speech.
[0056] The auxiliary feature generation module 420 includes a semantic similarity calculation module 421 and a character similarity calculation module 422. The semantic similarity calculation module 421 further includes a BERT module 4211 and a graph convolutional neural network (GCN) module 4212. It should be noted that the BERT module 4211 in the auxiliary feature generation module 420 and the BERT module 411 in the main module 410 can be the same module with the same function, but for the sake of clear description, different reference numerals are used to refer to them in the following text.
[0057] In step S530, the BERT module 4211 generates a vector V4 based on each input concept. In step S540, a graph is generated based on the input multiple concepts and the mutual relationships between the concepts, and the GCN module 4212 generates a vector V5 based on the generated graph. The vector V5 represents the overall feature of the multiple concepts, and this overall feature indicates the mutual relationships between the concepts.
[0058] Then, in the semantic similarity calculation module 421, the generated vectors V4 and V5 are concatenated to generate a vector V6 (step S550), and then based on the vectors V2 and V6, the semantic similarity between the entity and each concept is calculated according to formula (3) (step S560). Preferably, the semantic similarity can be calculated after mapping the vectors V2 and V6 to the same vector space.
[0059] In step S570, the character similarity calculation module 422 calculates the character similarity between the entity and each concept.
[0060] In step S580, the classification module 412 generates a classification prediction result based on the vector V2 generated by the BERT module 411 and the semantic similarity and character similarity calculated by the auxiliary feature generation module 420. This prediction result indicates the probability that the entity belongs to each concept, and the concept corresponding to the maximum probability can be determined as the concept to which the entity belongs.
[0061] In step S590, the presentation module 430 generates a prompt message based on the determined concept to which the entity belongs and presents it to the user. Preferably, the presentation module 430 can present the prompt message visually and / or auditorily.
[0062] It should be noted that the method according to the present invention is not necessarily in accordance with Figure 5It may be executed in the order shown, or may be executed in a different order as long as it can be technically implemented. For example, the step S570 of calculating the character similarity may also be executed before the process of calculating the semantic similarity.
[0063] The models and methods of the present invention have been described in detail in conjunction with the embodiments. The present invention provides a new entity disambiguation solution based on a classification model, which utilizes the BERT model and uses character similarity and semantic similarity as auxiliary features. In addition, the present invention uses entity type and context part-of-speech information as semantic enhancement, effectively utilizes the dictionary resource information, and helps to improve the performance of the model. Furthermore, the present invention uses a graph convolutional neural network (GCN) to extract global features for the graph composed of all concepts, so that the information contained in other concepts in the knowledge graph can be incorporated into the current concept, thereby making the semantic information contained in the current concept more complete.
[0064] The methods described in the above embodiments can be implemented by software, hardware, or a combination of software and hardware. The programs included in the software can be pre-stored in a storage medium provided inside or outside the device. As an example, during execution, these programs are written into a random access memory (RAM) and executed by a processor (such as a CPU), thereby implementing the various methods and processes described herein.
[0065] Figure 6 FIG. shows an example configuration block diagram of a computer hardware for executing the method of the present invention according to a program, and this computer hardware is an example of a device for recognizing facial actions or generating facial images according to the present invention.
[0066] As Figure 6 shown, in the computer 600, a central processing unit (CPU) 601, a read-only memory (ROM) 602, and a random access memory (RAM) 603 are connected to each other through a bus 604.
[0067] An input / output interface 605 is further connected to the bus 604. The input / output interface 605 is connected to the following components: an input unit 606 configured with a keyboard, a mouse, a microphone, etc.; an output unit 607 configured with a display, a speaker, etc.; a storage unit 608 configured with a hard disk, a non-volatile memory, etc.; a communication unit 609 formed by a network interface card (such as a local area network (LAN) card, a modem, etc.); and a drive 610 for driving a removable medium 611, which is, for example, a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory.
[0068] In a computer having the above structure, the CPU 601 loads the program stored in the storage unit 608 into the RAM 603 via the input / output interface 605 and the bus 604, and executes the program to perform the method described above.
[0069] The program to be executed by the computer (CPU 601) can be recorded on a removable medium 611 as a packaging medium, which is formed of, for example, a magnetic disk (including a floppy disk), an optical disk (including a compact disc-read only memory (CD-ROM)), a digital versatile disc (DVD), etc.), a magneto-optical disk, or a semiconductor memory. In addition, the program to be executed by the computer (CPU 601) can also be provided via a wired or wireless transmission medium such as a local area network, the Internet, or digital satellite broadcasting.
[0070] When the removable medium 611 is installed in the drive 610, the program can be installed in the storage unit 608 via the input / output interface 605. Additionally, the program can be received by the communication unit 609 via a wired or wireless transmission medium and installed in the storage unit 608. Alternatively, the program can be pre-installed in the ROM 602 or the storage unit 608.
[0071] The program executed by the computer can be a program that performs processing according to the order described in this specification, or can be a program that performs processing in parallel or when needed (such as when called).
[0072] The units or devices described herein are only logical in nature and do not strictly correspond to physical devices or entities. For example, the functions of each unit described herein may be implemented by multiple physical entities, or the functions of multiple units described herein may be implemented by a single physical entity. Additionally, the features, components, elements, steps, etc. described in one embodiment are not limited to that embodiment, but can also be applied to other embodiments, such as replacing specific features, components, elements, steps, etc. in other embodiments, or combining with them.
[0073] The scope of the present invention is not limited to the specific embodiments described herein. Those of ordinary skill in the art should understand that, depending on design requirements and other factors, various modifications or variations can be made to the embodiments herein without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
[0074] Supplementary Note:
[0075] (1) A computer-implemented method for presenting prompt information to a user viewing electronic text using a neural network, where the neural network includes a BERT model and a graph convolutional neural network, and the method includes:
[0076] Input the electronic text, information related to the electronic text, and multiple predefined concepts into the neural network, where the electronic text includes entities and the context of the entities, the information related to the electronic text includes the types of the entities and the part-of-speech of the context, and the concepts are in text form;
[0077] Use the BERT model to generate a first vector (V2) based on the combination of the entity, the context, the type of the entity, and the part-of-speech of the context;
[0078] Use the BERT model to generate a second vector (V4) based on each of the multiple concepts;
[0079] Use the graph convolutional neural network to generate a third vector (V5) based on a graph, where the graph is generated based on the multiple concepts and the relationships between the concepts;
[0080] Generate a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5);
[0081] Calculate the semantic similarity between the entity and each of the multiple concepts based on the first vector (V2) and the fourth vector (V6);
[0082] Determine that the entity corresponds to one of the multiple concepts based on the first vector (V2) and the semantic similarity;
[0083] Generate the prompt information based on the determined concept corresponding to the entity for presentation to the user.
[0084] (2) The method according to (1) further includes:
[0085] Calculate the character similarity between the entity and each of the multiple concepts;
[0086] Determine the concept corresponding to the entity based on the first vector, the semantic similarity, and the character similarity.
[0087] (3) In the method according to (2), the semantic similarity is the cosine similarity calculated based on the first vector (V2) and the fourth vector (V6), and the character similarity is the BM25 similarity between the entity and each of the multiple concepts.
[0088] (4) The method according to (1) further includes: combining the entity, the context, the type of the entity, and the part of speech of the context by performing weighted summation on the vectors corresponding to the entity and the context and the vectors corresponding to the type of the entity and the part of speech of the context.
[0089] (5) The method according to (1), wherein the third vector (V5) represents the overall features of the plurality of concepts, and the overall features indicate the interrelationships between the concepts.
[0090] (6) The method according to (1), wherein after mapping the first vector (V2) and the fourth vector (V6) to the same vector space, the semantic similarity is calculated.
[0091] (7) The method according to (2) further includes:
[0092] determining the probability that the entity corresponds to each of the plurality of concepts based on the first vector, the semantic similarity, and the character similarity,
[0093] when the maximum probability among the determined probabilities is greater than a predetermined threshold, determining the maximum probability as the concept corresponding to the entity;
[0094] when the determined probabilities are all less than the predetermined threshold, not generating the prompt information for the entity.
[0095] (8) The method according to (1), wherein the prompt information is presented to the user in at least one of a visual manner and an auditory manner.
[0096] (9) An apparatus for presenting prompt information to a user viewing an electronic text by using a neural network, wherein the neural network includes a BERT model and a graph convolutional neural network, and the apparatus includes:
[0097] a memory storing a computer program; and
[0098] one or more processors that perform the following operations by executing the computer program:
[0099] inputting the electronic text, information related to the electronic text, and a plurality of predefined concepts into the neural network, wherein the electronic text includes an entity and the context of the entity, the information related to the electronic text includes the type of the entity and the part of speech of the context, and the concepts are in text form;
[0100] using the BERT model to generate a first vector (V2) based on the combination of the entity, the context, the type of the entity, and the part of speech of the context;
[0101] Generate a second vector (V4) for each of the plurality of concepts using the BERT model;
[0102] Generate a third vector (V5) for the graph using the graph convolutional neural network, where the graph is generated based on the plurality of concepts and the relationships between the concepts;
[0103] Generate a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5);
[0104] Calculate the semantic similarity between the entity and each of the plurality of concepts based on the first vector (V2) and the fourth vector (V6);
[0105] Determine that the entity corresponds to one of the plurality of concepts based on the first vector (V2) and the semantic similarity;
[0106] Generate the prompt information based on the determined concept corresponding to the entity for presentation to the user.
[0107] (10) An apparatus for presenting prompt information to a user viewing electronic text, where the electronic text includes an entity and the context of the entity, the apparatus includes: a main module, a semantic similarity calculation module, a character similarity calculation module, and a presentation module,
[0108] The main module includes:
[0109] A BERT module configured to generate a first vector (V2) based on a combination of the entity, the context, the type of the entity, and the part of speech of the context;
[0110] A classification module configured to determine that the entity corresponds to one of a plurality of predefined concepts based on the first vector (V2), the semantic similarity calculated by the semantic similarity calculation module, and the character similarity calculated by the character similarity calculation module, where the concepts are in text form,
[0111] The semantic similarity calculation module includes:
[0112] A BERT module configured to generate a second vector (V4) for each of the plurality of concepts;
[0113] A graph convolutional neural network configured to generate a third vector (V5) for the graph, where the graph is generated based on the plurality of concepts and the relationships between the concepts,
[0114] Wherein, the semantic similarity calculation module generates a fourth vector (V6) by concatenating the second vector (V4) and the third vector (V5), and calculates the semantic similarity between the entity and each concept among the multiple concepts based on the first vector (V2) and the fourth vector (V6).
[0115] Wherein, the character similarity calculation module is configured to calculate the character similarity between the entity and each concept among the multiple concepts.
[0116] Wherein, the presentation module is configured to generate the prompt information based on the determined concept corresponding to the entity for presentation to the user.
[0117] (11) A storage medium storing a computer program, which when executed by a computer causes the computer to execute the method of presenting prompt information to a user according to any one of (1)-(8).
Claims
1. A computer-implemented method for presenting prompt information to a user viewing electronic text, wherein the neural network includes a BERT model and a graph convolutional neural network, and the method includes: Inputting the electronic text, information related to the electronic text, and a plurality of predefined concepts into the neural network, wherein the electronic text includes entities and the context of the entities, the information related to the electronic text includes the types of the entities and the part-of-speech of the context, and the concepts are in text form; Combining the entity, the context, the type of the entity, and the part-of-speech of the context by performing a weighted sum of the vectors corresponding to the entity and the context and the vectors corresponding to the type of the entity and the part-of-speech of the context; Using the BERT model to generate a first vector based on the combination of the entity, the context, the type of the entity, and the part-of-speech of the context; Using the BERT model to generate a second vector based on each of the plurality of concepts; Using the graph convolutional neural network to generate a third vector based on a graph, wherein the graph is generated based on the plurality of concepts and the relationships between the concepts; Generating a fourth vector by concatenating the second vector and the third vector; Calculating the semantic similarity between the entity and each of the plurality of concepts based on the first vector and the fourth vector; Determining that the entity corresponds to one of the plurality of concepts based on the first vector and the semantic similarity; Generating the prompt information based on the determined concept corresponding to the entity for presentation to the user.
2. The method according to claim 1, further comprising: Calculating the character similarity between the entity and each of the plurality of concepts; Determining the concept corresponding to the entity based on the first vector, the semantic similarity, and the character similarity.
3. The method according to claim 2, wherein, The semantic similarity is a cosine similarity calculated based on the first vector and the fourth vector, and the character similarity is a BM25 similarity between the entity and each of the plurality of concepts.
4. The method according to claim 1, wherein The third vector represents the overall features of the plurality of concepts, and the overall features indicate the mutual relationships between the concepts.
5. The method according to claim 1, wherein The semantic similarity is calculated after mapping the first vector and the fourth vector to the same vector space.
6. The method according to claim 2, further comprising: Determining the probability that the entity corresponds to each of the plurality of concepts based on the first vector, the semantic similarity, and the character similarity, When the maximum probability among the determined probabilities is greater than a predetermined threshold, determining the maximum probability as the concept corresponding to the entity; When the determined probabilities are all less than the predetermined threshold, not generating the prompt information for the entity.
7. The method according to claim 1, wherein Presenting the prompt information to the user in at least one of a visual manner and an auditory manner.
8. An apparatus for presenting prompt information to a user viewing electronic text, wherein the neural network includes a BERT model and a graph convolutional neural network, and the apparatus includes: A memory storing a computer program; and one or more processors that perform the following operations by executing the computer program: Input the electronic text, information related to the electronic text, and a plurality of predefined concepts into the neural network, wherein the electronic text includes an entity and the context of the entity, the information related to the electronic text includes the type of the entity and the part of speech of the context, and the concepts are in text form; Combine the entity, the context, the type of the entity, and the part of speech of the context by performing a weighted sum of the vectors corresponding to the entity and the context and the vectors corresponding to the type of the entity and the part of speech of the context; Use the BERT model to generate a first vector based on the combination of the entity, the context, the type of the entity, and the part of speech of the context; Use the BERT model to generate a second vector based on each of the plurality of concepts; Use the graph convolutional neural network to generate a third vector based on a graph, wherein the graph is generated based on the plurality of concepts and the relationships between the concepts; Generate a fourth vector by concatenating the second vector and the third vector; Calculate the semantic similarity between the entity and each of the plurality of concepts based on the first vector and the fourth vector; Determine that the entity corresponds to one of the plurality of concepts based on the first vector and the semantic similarity; Generate the prompt information based on the determined concept corresponding to the entity for presentation to the user.
9. A computer-readable storage medium storing a computer program, which when executed by a computer causes the computer to execute a method for presenting prompt information to a user viewing an electronic text using a neural network according to any one of claims 1-7.
Citation Information
Patent Citations
Entity disambiguation method and device, electronic equipment and computer readable storage medium
CN112434533A