Entity disambiguation method and device based on oracle model, electronic equipment and medium
Through the entity disambiguation method based on the oracle model, the entity disambiguation problem in traditional entity linking is solved, automated entity linking and disambiguation are realized, the accuracy and robustness of entity linking are improved, and the problem of the same entity in different texts is solved. Recognition errors caused by differences in names or descriptions.
Patent Information
- Application Number
- CN202411074856.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-29
AI Technical Summary
Traditional entity linking methods have entity disambiguation problems in the financial and medical fields and cannot handle different names or descriptions of the same entity in different texts, which limits the application scope and effect of entity linking.
The entity disambiguation method based on the oracle model is used to obtain financial text, build an entity embedding dictionary, extract entity information, perform vector conversion and semantic analysis, combine the entity embedding dictionary for disambiguation operations, and use the field-aware factor decomposition layer to classify entity links. , to achieve automated entity linking and disambiguation.
It improves the accuracy and robustness of entity linking, reduces recognition errors and inconsistencies caused by human factors, and enhances the efficiency and reliability of entity linking.
Smart Images

Figure CN118862891A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a method, device, electronic device and medium for entity disambiguation based on a prediction model. Background Art
[0002] At present, natural language processing (NLP) technology has been widely used in the fields of finance and medicine, such as text classification, sentiment analysis, entity recognition, etc. However, these technologies have some defects and deficiencies in entity linking. Traditional entity linking methods are usually based on rules or pattern matching, which requires manual writing of rules or patterns, and for new entity types or languages, the rules or patterns need to be rewritten.
[0003] In addition, traditional methods are usually unable to handle entity disambiguation problems, i.e., the same entity may have different names or descriptions in different texts. These problems limit the application scope and effect of entity linking. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose an entity disambiguation method, device, electronic device and medium based on a prediction model to achieve automated entity linking and disambiguation and improve the accuracy and robustness of entity linking.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes an entity disambiguation method based on a prediction model, the method comprising: Obtain financial text and build an entity embedding dictionary through a preset knowledge base; Performing entity extraction on the financial text based on a preset financial entity list to obtain entity information; Performing vector conversion on the entity information and the financial text to obtain a representation vector; Input the representation vector into a prediction model for semantic analysis, and output triple information corresponding to the representation vector; Performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result; The entity linking results are classified through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity linking results into entities and relationships of the financial text to obtain a disambiguation result.
[0006] In some embodiments, the prediction model includes a language representation model; and constructing an entity embedding dictionary through a preset knowledge base includes: Obtaining a description text of the knowledge base; Performing a separation operation on the description text to obtain a tag sequence, wherein the tag sequence includes a plurality of description entities; Inputting the tag sequence into the language representation model, so that the language representation model performs a vector generation operation on the description entity based on the tag sequence and outputs a plurality of embedding vectors; An entity embedding dictionary is constructed according to the description entity and the embedding vector.
[0007] In some embodiments, constructing an entity embedding dictionary according to the description entity and the embedding vector includes: For each of the described entities, determining an entity name of the described entity; Determine a target embedding vector in the embedding vector according to the number of the entity names; An entity embedding dictionary is constructed using the description entity as a key and the target embedding vector as a value.
[0008] In some embodiments, determining a target embedding vector in the embedding vector according to the number of the entity names comprises: When the entity name is one, determining a target embedding vector corresponding to the entity name in the embedding vector; or, When there are multiple entity names, determining multiple separators corresponding to the multiple entity names in the tag sequence, and determining a separation embedding vector for each separator; An average operation is performed on the multiple separated embedding vectors to obtain a target embedding vector.
[0009] In some embodiments, extracting entities from the financial text based on a preset financial entity list to obtain entity information includes: Preprocessing the financial text; Perform entity recognition on the preprocessed financial text using a preset named entity recognition tool to obtain multiple financial entities; For each of the financial entities, searching the financial entity list for the interpretation information text corresponding to the financial entity; The interpretation information text is matched with the financial entity to obtain entity information.
[0010] In some embodiments, performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result includes: Determining a first embedding value corresponding to the entity name in the triple information through the prediction model, and determining context information of the financial text through the prediction model; Determine a target embedding value according to the entity embedding dictionary and the first embedding value; Calculating a similarity score between the financial text and the financial entity list according to the target embedding value; Entities in the financial text are linked according to the context information and the similarity score to obtain entity linking results.
[0011] In some embodiments, determining a target embedding value according to the entity embedding dictionary and the first embedding value comprises: When an entity name corresponding to the triple information exists in the entity embedding dictionary, a second embedding value corresponding to the entity name is determined in the entity embedding dictionary, and an average of the first embedding value and the second embedding value is used as a target embedding value. or, When the entity name corresponding to the triple information does not exist in the entity embedding dictionary, the first embedding value is used as the target embedding value.
[0012] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes an entity disambiguation device based on a prediction model, the device comprising: The text acquisition module is used to acquire financial texts and build entity embedding dictionaries through a preset knowledge base; An entity extraction module, used to extract entities from the financial text based on a preset financial entity list to obtain entity information; A vector conversion module, used for performing vector conversion on the entity information and the financial text to obtain a representation vector; A semantic analysis module, used for inputting the representation vector into a prediction model for semantic analysis, and outputting triple information corresponding to the representation vector; A disambiguation operation module, used for performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result; A result classification module is used to classify the entity link results through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity link results into the entities and relationships of the financial text to obtain a disambiguation result.
[0013] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the entity disambiguation method based on the prediction model as described in the first aspect when executing the computer program.
[0014] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the entity disambiguation method based on the prediction model as described in the first aspect.
[0015] The entity disambiguation method, device, electronic device and storage medium based on the prediction model proposed in this application first obtain financial text and build an entity embedding dictionary through a preset knowledge base, so that a richer and more accurate entity embedding can be built through the information in the external knowledge base, integrating knowledge from different sources, and then extracting entities from the financial text based on a preset financial entity list to obtain entity information, so that noise in the financial text can be removed. By identifying and extracting entities, it is convenient for subsequent prediction models to better understand the text content and realize accurate determination of concepts and objects in the text. Afterwards, the entity information and the financial text are vectorized to obtain a representation vector, so that high-dimensional data can be converted into low-dimensional data, reducing computational complexity. The semantic information of words and phrases can be captured by the representation vector, and then the representation vector is input into the prediction model for semantic analysis, so that the semantic information of entities in different contexts can be captured, which is convenient for the subsequent understanding of the semantics and disambiguation of the entity, and the triple information corresponding to the representation vector is output. Finally, the financial text is disambiguated according to the triple information and the entity embedding dictionary to obtain the entity link result, so as to reduce the recognition errors and inconsistencies caused by human factors, improve the accuracy and robustness of the entity link, and then classify the entity link result through the field-aware factor decomposition layer of the prediction model to classify the entity link corresponding to the entity link result into the entity and relationship of the financial text, and obtain the disambiguation result, thereby improving the efficiency and reliability of the entity link. The embodiment of the present application combines the entity embedding dictionary and the financial entity list to realize automatic entity linking and disambiguation, while considering the entity context information to improve the accuracy and robustness of the entity link. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of an entity disambiguation method based on a prediction model provided in an embodiment of the present application; Figure 2 A flowchart of a method for constructing an entity embedding dictionary through a preset knowledge base provided in an embodiment of the present application; Figure 3 yes Figure 2 Flow chart of step S204 in FIG. Figure 4 A flow chart of a method for determining a target embedding vector in an embedding vector according to the number of entity names provided in an embodiment of the present application; Figure 5 yes Figure 1 Flow chart of step S102 in FIG. Figure 6 yes Figure 1 Flow chart of step S105 in FIG. Figure 7 yes Figure 6 Flowchart of step S602 in FIG. Figure 8 is a schematic diagram of the structure of an entity disambiguation device based on a prediction model provided in an embodiment of the present application; Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0020] First, some nouns involved in this application are analyzed: Natural Language Processing (NLP): NLP uses computers to process, understand, and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0021] Long Short-Term Memory (LSTM): LSTM is a special recurrent neural network architecture that can learn long-term dependencies in data. Traditional recurrent neural networks encounter the problem of gradient vanishing or gradient exploding when processing long sequence data, which limits their ability to learn long-term dependencies. LSTM solves this problem by introducing three gating mechanisms (input gate, forget gate, output gate), allowing the network to effectively maintain and update information in long sequences.
[0022] Bidirectional Encoder Representations from Transformers (BERT): BERT is a pre-trained language representation model proposed by Google in 2018. Its main function is to generate high-quality word embeddings that can capture the contextual information of words in text. The BERT model is based on the Transformer architecture and is a deep bidirectional representation model. Compared with traditional unidirectional (forward or backward) language models, BERT can consider both the previous and subsequent context information of words, thereby more accurately understanding the semantics of language.
[0023] Field-aware Factorization Machines (FFM): FFM is a machine learning model that is mainly used to process large-scale sparse data with multiple feature fields. It combines the concepts of Factorization Machines (FM) and feature fields.
[0024] The entity disambiguation method and device based on the prediction model, electronic device and storage medium provided in the embodiments of the present application can realize automatic entity linking and disambiguation, and improve the accuracy and robustness of entity linking. The following embodiments are used to illustrate the entity disambiguation method based on the prediction model in the embodiments of the present application.
[0025] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. 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.
[0026] 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, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, module management technology of online meeting systems, natural language processing technology, and machine learning / deep learning.
[0027] The entity disambiguation method based on the prediction model provided in the embodiment of the present application relates to the field of data processing technology. The entity disambiguation method based on the prediction model provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the entity disambiguation method based on the prediction model, etc., but is not limited to the above forms.
[0028] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0029] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0030] At present, natural language processing technology has been widely used in the fields of finance and medicine, such as text classification, sentiment analysis, entity recognition, etc. However, these technologies have some defects and deficiencies in entity linking. Traditional entity linking methods are usually based on rules or pattern matching, which requires manual writing of rules or patterns, and for new entity types or languages, the rules or patterns need to be rewritten.
[0031] In addition, traditional methods are usually unable to handle entity disambiguation problems, i.e., the same entity may have different names or descriptions in different texts. These problems limit the application scope and effect of entity linking.
[0032] In order to solve the above problems, this embodiment provides an entity disambiguation method, device, electronic device and storage medium based on a prediction model. First, financial text is obtained, and an entity embedding dictionary is constructed through a preset knowledge base, so that a richer and more accurate entity embedding can be constructed through information in an external knowledge base, integrating knowledge from different sources. Then, entity extraction is performed on the financial text based on a preset financial entity list to obtain entity information, so that noise in the financial text can be removed. By identifying and extracting entities, it is convenient for subsequent prediction models to better understand the text content and accurately determine the concepts and objects in the text. Afterwards, vector conversion is performed on the entity information and the financial text to obtain a representation vector, so that high-dimensional data can be converted into low-dimensional data, reducing the calculation cost. The computational complexity is reduced, and the semantic information of words and phrases can be captured by the representation vector, and then the representation vector is input into the prediction model for semantic analysis, so that the semantic information of entities in different contexts can be captured, which is convenient for the subsequent understanding of the semantics and disambiguation of the entity, and the triple information corresponding to the representation vector is output. Finally, the financial text is disambiguated according to the triple information and the entity embedding dictionary to obtain the entity link result, so as to reduce the recognition errors and inconsistencies caused by human factors, improve the accuracy and robustness of the entity link, and then classify the entity link result through the field-aware factor decomposition layer of the prediction model to classify the entity link corresponding to the entity link result into the entity and relationship of the financial text, and obtain the disambiguation result, thereby improving the efficiency and reliability of the entity link. The embodiment of the present application combines the entity embedding dictionary and the financial entity list to realize automatic entity linking and disambiguation, while considering the entity context information to improve the accuracy and robustness of the entity link.
[0033] The following is a detailed description with reference to the accompanying drawings.
[0034] Figure 1 is an optional flowchart of the entity disambiguation method based on the prediction model provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0035] Step S101, obtain financial text and build an entity embedding dictionary through a preset knowledge base.
[0036] In step S101 of some embodiments, financial text is obtained, and an entity embedding dictionary is constructed through a preset knowledge base, so that the embedding vector in the dictionary can be used to assist in determining the correct reference of the entity, thereby improving the accuracy of disambiguation. The dictionary can also ensure that the same embedding representation is used for different mentions of the same entity, thereby enhancing the consistency of the processing process.
[0037] It should be noted that the financial text in the embodiment of the present application may be financial news information, financial knowledge, financial field speeches, financial books, etc., and the embodiment of the present application does not make specific restrictions.
[0038] Step S102: extracting entities from the financial text based on a preset financial entity list to obtain entity information.
[0039] In step S102 of some embodiments, entity extraction is performed on financial text based on a preset financial entity list, and information text corresponding to the financial entity is searched from the financial entity list to ensure that the extracted information is accurate and obtain entity information, so that financial field entities and corresponding interpretation information texts can be sorted out to facilitate subsequent entity disambiguation and improve the accuracy and robustness of entity linking.
[0040] It should be noted that the financial entity list refers to a collection of specific entities in the financial field, which can be companies, individuals, products, terms, or any other entities that are important in the financial industry. Specifically, the financial entity list in the embodiment of the present application includes but is not limited to entity names, entity nicknames, entity types, entity abbreviations, geographic locations, etc., and the embodiment of the present application does not make specific restrictions.
[0041] Step S103, performing vector conversion on the entity information and the financial text to obtain a representation vector.
[0042] In step S103 of some embodiments, vector conversion is performed on the entity information and the financial text. Specifically, a word segmentation operation is first performed on the entity information and the financial text. Then, the entity information and the financial text after word segmentation are input into the prediction model for semantic capture through the BERT model in the language model. The outputs of the two LSTM layers at each moment are concatenated as the vector representation of this token. The forward LSTM processes the sequence from left to right and the backward LSTM processes the sequence from right to left. In this way, the preceding and succeeding context information of each element in the sequence can be captured, thereby enhancing the model's understanding of the context and obtaining a representation vector. The bidirectional LSTM can better understand the overall meaning of the text and improve the accuracy of vector conversion.
[0043] It is worth noting that the prediction model in the embodiment of the present application includes a BERT model, a long short-term memory network, an entity link layer, an FFM layer, etc. Specifically, the BERT model in the embodiment of the present application is followed by two layers of long short-term memory networks in different directions.
[0044] Step S104: input the representation vector into the prediction model for semantic analysis, and output triple information corresponding to the representation vector.
[0045] In step S104 of some embodiments, the representation vector is input into the prediction model for semantic analysis so that the prediction model analyzes the semantic information in the text, the prediction model identifies entity pairs in the text and the relationships between them, forms triples, and outputs triple information corresponding to the representation vector, wherein the triple information is triple information used to characterize entity-relationship-entity in financial text.
[0046] Specifically, the embodiment of the present application takes the input financial text as a sentence as an example for explanation. For example, stocks are share certificates issued by a joint-stock company to investors when raising capital. The purpose of the embodiment of the present application is to extract the relationship between the entity units therein. In this sentence, the entities are "stocks" and "share certificates", and their relationship is "is_a", or "stocks" and "joint-stock company", and their relationship is "issued".
[0047] Entity-relationship-entity triples are extracted through the above model, for example, (stock, is_a, share certificate) and (limited company, issued, stock).
[0048] Step S105, performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result.
[0049] In step S105 of some embodiments, a disambiguation operation is performed on the financial text based on the triple information and the entity embedding dictionary. Through similarity calculation and disambiguation, the entities in the text can be more accurately identified and linked, and errors and ambiguities can be reduced. In addition, by using contextual information in the disambiguation process, the model's generalization ability for new data or unseen situations can be improved, and entity linking results can be obtained.
[0050] Step S106, classifying the entity linking results through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity linking results into entities and relationships of the financial text to obtain a disambiguation result.
[0051] In step S106 of some embodiments, the entity linking results are classified by the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity linking results into entities and relationships of the financial text to obtain disambiguation results, thereby improving the efficiency and reliability of entity linking.
[0052] See also Figure 2 , Figure 2 A flow chart of a method for constructing an entity embedding dictionary through a preset knowledge base provided in an embodiment of the present application, the method includes but is not limited to steps S201 to S204.
[0053] It should be noted that the prediction model includes a language representation model, wherein the language representation model in the embodiment of the present application is a BERT (Bidirectional Encoder Representations from Transformers) model.
[0054] Step S201, obtaining the description text of the knowledge base.
[0055] Step S202: perform a segmentation operation on the description text to obtain a tag sequence.
[0056] It should be noted that the tag sequence includes multiple description entities.
[0057] Step S203: input the tag sequence into the language representation model, so that the language representation model performs a vector generation operation on the description entity based on the tag sequence and outputs a plurality of embedding vectors.
[0058] Step S204: construct an entity embedding dictionary according to the description entity and the embedding vector.
[0059] In steps S201 to S204 of some embodiments, in the process of constructing an entity embedding dictionary through a preset knowledge base, first, the description text of the knowledge base is obtained. Since the current description text is a whole paragraph of text, the embodiment of the present application will perform a separation operation on the description text, insert a separator between the description text, for example, insert a [CLS] token at the beginning of the sequence, and a separator between the entity name and the description text, and collect the separators corresponding to each description entity to obtain a tag sequence. After that, the tag sequence is input into the language representation model so that the language representation model performs a vector generation operation on the description entity based on the tag sequence. The language representation model will generate an embedding vector for each token in the sequence and output multiple embedding vectors, so as to generate high-quality embeddings that capture rich semantic information. Finally, an entity embedding dictionary is constructed based on the description entity and the embedding vector, so that the correct reference of the entity can be assisted by the embedding vector in the dictionary, thereby improving the accuracy of disambiguation. In addition, the dictionary can ensure that the same embedding representation is used for different mentions of the same entity, thereby enhancing the consistency of the processing process.
[0060] Understandably, information in external knowledge bases can help build richer and more accurate entity embeddings, integrating knowledge from different sources and enhancing the description and understanding of entities.
[0061] In some embodiments, during the process of separating the description text, the description text also needs to be cleaned and preprocessed to remove irrelevant characters, punctuation marks, etc. in the description text.
[0062] See also Figure 3 In some embodiments, step S204 may also include but is not limited to steps S301 to S303.
[0063] Step S301: for each description entity, determine the entity name of the description entity.
[0064] Step S302, determining a target embedding vector in the embedding vector according to the number of entity names.
[0065] In step S303, the entity embedding dictionary is constructed by taking the description entity as a key and the target embedding vector as a value.
[0066] In steps S301 to S303 of some embodiments, in the process of constructing an entity embedding dictionary based on the descriptive entities and the embedding vectors, first, the entity name of each descriptive entity in the tag sequence must be determined, that is, for each descriptive entity, the entity name of the descriptive entity must be determined, and then the target embedding vector is determined in the embedding vector according to the number of entity names, so as to obtain a high-quality target embedding vector. The high-quality embedding vector can improve the performance of downstream tasks. Finally, the descriptive entity is used as the key and the target embedding vector is used as the value to construct the entity embedding dictionary, so as to ensure that the vectors are on the same scale. The dictionary can ensure that the same embedding representation is used for different mentions of the same entity, thereby enhancing the consistency of the processing process. The entity embedding dictionary can serve as a bridge between different data sources to promote data integration and analysis.
[0067] See also Figure 4 , Figure 4 A flow chart of a method for determining a target embedding vector in an embedding vector according to the number of entity names provided in an embodiment of the present application, the method includes but is not limited to steps S401 to S403.
[0068] Step S401: When the entity name is one, a target embedding vector corresponding to the entity name is determined in the embedding vector.
[0069] Step S402: When there are multiple entity names, multiple separators corresponding to the multiple entity names are determined in the tag sequence, and a separation embedding vector of each separator is determined.
[0070] Step S403, performing an average operation on multiple separation embedding vectors to obtain a target embedding vector.
[0071] In steps S401 to S403 of some embodiments, since a description entity may have one or more entity names, the embodiments of the present application will perform different processing operations for different situations. Specifically, the number of entity names describing the entity is determined. When there is one entity name, the target embedding vector corresponding to the entity name can be directly determined in the embedding vector, and the value of the target embedding vector is used as the value of the entity embedding dictionary; when an entity has multiple entity names, it is necessary to determine multiple separators corresponding to the entity name in the tag sequence, and determine the separation embedding vector of each separator, and then average the multiple separation embedding vectors. Specifically, the averaging operation can be achieved by summing the embedding vectors of all aliases and dividing them by the number of aliases, that is, taking the average of multiple separation embedding vectors as the value of the dictionary to obtain the target embedding vector, ensuring that they can capture the semantic information of the entity, so that they can effectively integrate information from different aliases and generate a more comprehensive and robust entity embedding representation.
[0072] It is worth noting that the key of the entity embedding dictionary in the embodiment of the present application is the entity name, and the value of the dictionary is embedding. Specifically, the embodiment of the present application uses the description text of the external knowledge base to form embedding through the BERT model, and selects the [CLS] token as the embedding of this entity. For an entity with multiple aliases, the corresponding entity embedding uses the average value of [CLS] of multiple aliases as the value of the dictionary, and finally forms a dictionary, for example, {Hangzhou City: embedding, Zhejiang Province: embedding, BYD: embedding, ...}.
[0073] It is understandable that the contexts of different aliases may be different. Therefore, the embodiments of the present application need to consider weight adjustment to calculate the average value when calculating the average embedding, so as to effectively integrate the information from different aliases and generate a more comprehensive and robust entity embedding representation.
[0074] See also Figure 5 In some embodiments, step S102 may also include but is not limited to steps S501 to S504.
[0075] Step S501, preprocessing the financial text.
[0076] Step S502: performing entity recognition on the preprocessed financial text using a preset named entity recognition tool to obtain a plurality of financial entities.
[0077] Step S503: for each financial entity, search the financial entity list for the interpretation information text corresponding to the financial entity.
[0078] Step S504, matching the interpretation information text with the financial entity to obtain entity information.
[0079] In steps S501 to S504 of some embodiments, in the process of extracting entities from financial text based on a preset financial entity list, first, the financial text is preprocessed, for example, text cleaning, character conversion, etc., so as to remove irrelevant characters and noise. Then, the preprocessed financial text is subjected to entity recognition through a preset named entity recognition tool to obtain multiple financial entities. For each identified financial entity, the interpretation information text corresponding to the financial entity is searched from the financial entity list to ensure that the extracted information is accurate. Finally, the interpretation information text is matched with the financial entity. Specifically, the embodiments of the present application can achieve matching of the interpretation information text with the financial entity through a mapping or matching algorithm to obtain entity information, so as to sort out financial field entities and the corresponding interpretation information text, so as to facilitate subsequent entity disambiguation and improve the accuracy and robustness of entity links.
[0080] Specifically, the named entity recognition tool in the embodiment of the present application is a NER (Named Entity Recognition) tool, which inputs the preprocessed financial text into the NER model so that the NER model marks the starting and ending positions of the entities in the financial text, as well as the categories corresponding to the entities, and outputs the categories and boundaries of the entities. It then merges synonyms in the financial text, processes missing or erroneous entities, and so on.
[0081] It is understandable that, in the process of preprocessing the financial text, the embodiment of the present application may also perform word segmentation on the financial text, dividing the text into words or phrases, so as to facilitate subsequent entity recognition of the financial text and improve the accuracy of entity recognition.
[0082] See also Figure 6 In some embodiments, step S105 may also include but is not limited to steps S601 to S604.
[0083] Step S601: determine a first embedding value corresponding to an entity name in triple information through a prediction model, and determine context information of the financial text through the prediction model.
[0084] Step S602, determining a target embedding value according to the entity embedding dictionary and the first embedding value.
[0085] Step S603: Calculate the similarity score between the financial text and the financial entity list according to the target embedding value.
[0086] Step S604: link entities in the financial text according to the context information and the similarity scores to obtain entity linking results.
[0087] In steps S601 to S604 of some embodiments, in the process of performing disambiguation operations on financial texts based on triple information and entity embedding dictionaries, step S104 has already input the representation vector into the language model for semantic analysis. The embodiment of the present application first determines the first embedding value corresponding to the entity name in the triple information through the language model, and determines the context information of the financial text through the prediction model, so that the semantic relationships and patterns in the financial text can be captured through the prediction model, which facilitates a more accurate understanding of the meaning of the text in the future. The context information can correctly link the entities in the text with the corresponding entities in the knowledge base, and solve the problem. The ambiguity problem of entity reference is solved. Then, the target embedding value is determined according to the entity embedding dictionary and the first embedding value to improve the accuracy of entity matching. Then, possible candidate entities are retrieved from the financial entity list. Then, the similarity score between the financial text and the candidate entity is calculated according to the target embedding value. Then, according to the context information and the similarity score, the most likely candidate entity is selected for linking to obtain the entity linking result. Through similarity calculation and disambiguation, entities in the text can be more accurately identified and linked, errors and ambiguities can be reduced, and by using context information in the disambiguation process, the model's generalization ability for new data or unseen situations can be improved.
[0088] See also Figure 7 In some embodiments, step S602 may also include but is not limited to steps S701 to S702.
[0089] Step S701, when there is an entity name corresponding to the triple information in the entity embedding dictionary, determine the second embedding value corresponding to the entity name in the entity embedding dictionary, and take the average of the first embedding value and the second embedding value as the target embedding value.
[0090] Step S702: When there is no entity name corresponding to the triple information in the entity embedding dictionary, the first embedding value is used as the target embedding value.
[0091] In steps S701 to S702 of some embodiments, in the process of determining the target embedding value based on the entity embedding dictionary and the first embedding value, since there may be a situation where the entity embedding dictionary does not contain the entity name corresponding to the triple information, the embodiment of the present application will first determine whether there is an entity name corresponding to the triple information in the entity embedding dictionary. Specifically, when there is an entity name corresponding to the triple information in the entity embedding dictionary, the embodiment of the present application will determine the second preceding entry corresponding to the entity name in the entity embedding dictionary, and use the average of the first embedding value and the second embedding value as the target embedding value, that is, the embedding of the token of the entity name adopts the average of the two. Different aliases may be used in different contexts, and their embeddings may contain different semantic information. Averaging these embeddings helps to capture more comprehensive semantic features, thereby improving the stability and robustness of the overall representation. When there is no entity name corresponding to the triple information in the entity embedding dictionary, the first embedding value is used as the target embedding value to improve the accuracy of entity matching.
[0092] See also Figure 8 The embodiment of the present application also provides an entity disambiguation device based on a prediction model, the device comprising: The text acquisition module 801 is used to acquire financial text and construct an entity embedding dictionary through a preset knowledge base; An entity extraction module 802 is used to extract entities from financial text based on a preset financial entity list to obtain entity information; A vector conversion module 803 is used to perform vector conversion on the entity information and the financial text to obtain a representation vector; Semantic analysis module 804, used to input the representation vector into the prediction model for semantic analysis, and output triple information corresponding to the representation vector; A disambiguation operation module 805 is used to perform a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result; The result classification module 806 is used to classify the entity linking results through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity linking results into the entities and relationships of the financial text to obtain the disambiguation results.
[0093] The specific implementation of the entity disambiguation device based on the prediction model is basically the same as the specific implementation of the entity disambiguation method based on the prediction model mentioned above, and will not be repeated here.
[0094] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned entity disambiguation method based on the prediction model. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0095] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes: The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the entity disambiguation method based on the prediction model in the embodiment of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0096] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned entity disambiguation method based on the prediction model is implemented.
[0097] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] The entity disambiguation method, device, electronic device and storage medium based on the prediction model provided in the embodiment of the present application first obtain financial text and construct an entity embedding dictionary through a preset knowledge base, so that a richer and more accurate entity embedding can be constructed through information in an external knowledge base, integrating knowledge from different sources, and then extracting entities from the financial text based on a preset financial entity list to obtain entity information, thereby removing noise from the financial text. By identifying and extracting entities, it is convenient for subsequent prediction models to better understand the text content and achieve accurate determination of concepts and objects in the text. Afterwards, vector conversion is performed on the entity information and the financial text to obtain a representation vector, thereby converting high-dimensional data into low-dimensional data and reducing computational complexity. , the semantic information of words and phrases can be captured by the representation vector, and then the representation vector is input into the prediction model for semantic analysis, so as to capture the semantic information of entities in different contexts, which is convenient for the subsequent understanding of the semantics and disambiguation of the entity, and the triple information corresponding to the representation vector is output. Finally, the financial text is disambiguated according to the triple information and the entity embedding dictionary to obtain the entity linking result, so as to reduce the recognition errors and inconsistencies caused by human factors, improve the accuracy and robustness of the entity linking, and then classify the entity linking result through the field-aware factor decomposition layer of the prediction model to classify the entity link corresponding to the entity linking result into the entity and relationship of the financial text, and obtain the disambiguation result, thereby improving the efficiency and reliability of the entity linking. The embodiment of the present application combines the entity embedding dictionary and the financial entity list to realize automatic entity linking and disambiguation, while considering the entity context information to improve the accuracy and robustness of the entity linking.
[0099] The embodiments 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. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0100] It can be understood by those skilled in the art that Figure 1-9The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0101] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0102] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0103] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0104] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0105] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0106] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0109] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. An entity disambiguation method based on a prediction model, characterized in that: The method comprises: Obtain financial text and build an entity embedding dictionary through a preset knowledge base; Performing entity extraction on the financial text based on a preset financial entity list to obtain entity information; Performing vector conversion on the entity information and the financial text to obtain a representation vector; Input the representation vector into a prediction model for semantic analysis, and output triple information corresponding to the representation vector; Performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result; The entity linking results are classified through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity linking results into entities and relationships of the financial text to obtain a disambiguation result.
2. The entity disambiguation method based on a prediction model according to claim 1, characterized in that: The prediction model includes a language representation model; the entity embedding dictionary is constructed through a preset knowledge base, including: Obtaining a description text of the knowledge base; Performing a separation operation on the description text to obtain a tag sequence, wherein the tag sequence includes a plurality of description entities; Inputting the tag sequence into the language representation model, so that the language representation model performs a vector generation operation on the description entity based on the tag sequence and outputs a plurality of embedding vectors; An entity embedding dictionary is constructed according to the description entity and the embedding vector.
3. The entity disambiguation method based on a prediction model according to claim 2, characterized in that: The constructing an entity embedding dictionary according to the description entity and the embedding vector comprises: For each of the described entities, determining an entity name of the described entity; Determine a target embedding vector in the embedding vector according to the number of the entity names; An entity embedding dictionary is constructed using the description entity as a key and the target embedding vector as a value.
4. The entity disambiguation method based on a prediction model according to claim 3, characterized in that: The determining a target embedding vector in the embedding vector according to the number of the entity names comprises: When the entity name is one, determining a target embedding vector corresponding to the entity name in the embedding vector; or, When there are multiple entity names, determining multiple separators corresponding to the multiple entity names in the tag sequence, and determining a separation embedding vector for each separator; An average operation is performed on the multiple separated embedding vectors to obtain a target embedding vector.
5. The entity disambiguation method based on a prediction model according to claim 1, characterized in that: The extracting entities from the financial text based on the preset financial entity list to obtain entity information includes: Preprocessing the financial text; Perform entity recognition on the preprocessed financial text using a preset named entity recognition tool to obtain multiple financial entities; For each of the financial entities, searching the financial entity list for the interpretation information text corresponding to the financial entity; The interpretation information text is matched with the financial entity to obtain entity information.
6. The entity disambiguation method based on a prediction model according to claim 1, characterized in that: The disambiguation operation is performed on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result, including: Determining a first embedding value corresponding to the entity name in the triple information through the prediction model, and determining context information of the financial text through the prediction model; Determine a target embedding value according to the entity embedding dictionary and the first embedding value; Calculating a similarity score between the financial text and the financial entity list according to the target embedding value; Entities in the financial text are linked according to the context information and the similarity score to obtain entity linking results.
7. The entity disambiguation method based on a prediction model according to claim 6, characterized in that: The determining a target embedding value according to the entity embedding dictionary and the first embedding value comprises: When an entity name corresponding to the triple information exists in the entity embedding dictionary, a second embedding value corresponding to the entity name is determined in the entity embedding dictionary, and an average of the first embedding value and the second embedding value is used as a target embedding value. or, When the entity name corresponding to the triple information does not exist in the entity embedding dictionary, the first embedding value is used as the target embedding value.
8. An entity disambiguation device based on a prediction model, characterized in that: The device comprises: The text acquisition module is used to acquire financial texts and build entity embedding dictionaries through a preset knowledge base; An entity extraction module, used to extract entities from the financial text based on a preset financial entity list to obtain entity information; A vector conversion module, used for performing vector conversion on the entity information and the financial text to obtain a representation vector; A semantic analysis module, used for inputting the representation vector into a prediction model for semantic analysis, and outputting triple information corresponding to the representation vector; A disambiguation operation module, used for performing a disambiguation operation on the financial text according to the triple information and the entity embedding dictionary to obtain an entity linking result; A result classification module is used to classify the entity link results through the field-aware factor decomposition layer of the prediction model to classify the entity links corresponding to the entity link results into the entities and relationships of the financial text to obtain a disambiguation result.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the entity disambiguation method based on a prediction model as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the entity disambiguation method based on a prediction model according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Semantic-based financial factor expression generation method and system
CN121960704A
