Entity identification method, apparatus and device, and storage medium

By matching with entity knowledge base and using entity recognition model to combine semantic information to identify entities, the recognition problems caused by entity changes and ambiguity are solved, and the accuracy and efficiency of entity recognition are improved.

CN119227688APending Publication Date: 2024-12-31GUANGZHOU KUGOU COMP TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411462388.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing entity recognition method cannot recognize new entities when entities change, and the identification is inaccurate due to the ambiguity of the entity itself, which affects the accuracy of entity recognition.

Method used

By obtaining the input text to match the candidate entities in the entity knowledge base, obtaining the attribute information of the candidate entities, and using the entity recognition model to combine context semantic information for identification, ensuring the completeness and accuracy of the recognition.

Benefits of technology

It realizes flexible adaptation to entity changes, improves the accuracy and efficiency of entity recognition, avoids the problem of identification inaccuracy caused by entity ambiguity, and does not need to retrain the entity recognition model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227688A_ABST
    Figure CN119227688A_ABST
Patent Text Reader

Abstract

The invention discloses an entity recognition method and device, equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps of obtaining a first input text; determining at least one potential candidate entity included in the first input text based on the entity knowledge base; obtaining attribute information corresponding to the at least one potential candidate entity; and determining at least one entity included in the first input text through an entity recognition model according to the first input text and the attribute information corresponding to the at least one potential candidate entity. According to the method, the first input text is matched with the candidate entities included in the entity knowledge base, so that the identification integrity of the potential candidate entities is ensured. And through the entity recognition model, the semantic information of the first input text can be learned, so that the problem of inaccurate recognition caused by ambiguity of the entity is avoided. And the entity identification model can adapt to the new entities according to the attribute information, so that the accuracy of entity identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an entity recognition method, device, equipment and storage medium. Background Art

[0002] An entity is a thing or object that has independent meaning in a specific context. Entities can include multiple types, such as music entities.

[0003] In the related art, for the entity recognition method, there are two methods, method 1 is an entity recognition technology based on deep learning, and method 2 is an entity recognition (matching) technology based on a dictionary. Among them, method 1 includes a training phase and a use phase. The training phase may include: obtaining a sample input text and the annotation results of the sample input text; using a deep learning model to supervise the deep learning model according to the sample input text and the annotation results, so as to obtain a trained deep learning model. The use phase may include: inputting the input text to be tested into the trained deep learning model, so as to obtain the predicted entity results of the input text to be tested. Method 2 may include: first constructing an entity dictionary, each entry in the dictionary corresponds to an entity. For example, the dictionary may include a music entity dictionary, each entry of which is a music-related entity, such as a song name, an artist name, an album name, etc. Next, the input text to be tested is preprocessed, usually including word segmentation processing. Then, each word segmentation in the preprocessed text is matched with an entry in the dictionary. If a word segmentation exists in the dictionary, it is marked as a corresponding entity. Finally, the entity included in the input text to be tested is output.

[0004] In the above method 1, when an entity (such as a music entity) changes, such as an increase in music entities, since the added music entity is not labeled during the training phase of the deep learning model, the entity cannot be identified during the use phase, thereby affecting the accuracy of entity recognition. For the above method 2, since the entity itself may be ambiguous, for example, "this song" and "it's really nice" can both be song names (that is, they can both be matched in the entity dictionary), but in the context, they may not be the actual song names, but are used as rhetoric or exclamation. If the entity dictionary is used directly for matching, it will lead to the erroneous recall of the song entity. That is, when performing entity recognition, it is necessary to distinguish it in combination with the contextual semantics of the input text. Using only dictionary matching will also affect the accuracy of entity recognition. Summary of the invention

[0005] The embodiments of the present application provide an entity recognition method, apparatus, device and storage medium. The technical solutions provided by the embodiments of the present application are as follows:

[0006] According to one aspect of an embodiment of the present application, a method for entity recognition is provided, the method comprising:

[0007] Get the first input text;

[0008] Determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities;

[0009] Acquire attribute information corresponding to the at least one potential candidate entity, where the attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity;

[0010] At least one entity included in the first input text is determined by an entity recognition model according to attribute information respectively corresponding to the first input text and the at least one potential candidate entity.

[0011] According to one aspect of an embodiment of the present application, there is provided an entity identification device, the device comprising:

[0012] A first acquisition module, used to acquire a first input text;

[0013] A first determination module, configured to determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities;

[0014] A second acquisition module is used to acquire attribute information corresponding to the at least one potential candidate entity, where the attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity;

[0015] The second determination module is used to determine at least one entity included in the first input text according to the attribute information respectively corresponding to the first input text and the at least one potential candidate entity through an entity recognition model.

[0016] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above-mentioned entity recognition method.

[0017] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned entity recognition method.

[0018] According to one aspect of an embodiment of the present application, a computer program product is provided, wherein the computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the above-mentioned entity recognition method.

[0019] The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:

[0020] By matching the first input text with the candidate entities included in the entity knowledge base, this method can flexibly adapt to changes in entities, ensure the completeness and accuracy of potential candidate entity recognition, and provide more accurate input information for subsequent entity recognition models. In addition, through the entity recognition model, the semantic information of the context of the first input text can be learned. On the one hand, the problem of inaccurate recognition caused by the ambiguity of the entity itself is avoided. On the other hand, since the input of the entity recognition model includes attribute information corresponding to the potential candidate entities, even if the entities included in the first input text have not been trained in the training stage of the entity recognition model, the entity recognition model can timely identify and adapt to these new entities based on the attribute information, thereby improving the accuracy of entity recognition. In addition, this method does not require retraining of the entity recognition model, thereby improving the efficiency of entity recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0022] Figure 2 is a flow chart of an entity recognition method provided by an embodiment of the present application;

[0023] Figure 3 is a flowchart of a process for constructing an entity knowledge base provided by an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of a search tree provided by an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of a directed graph of at least one potential candidate entity provided by an embodiment of the present application;

[0026] Figure 6 is a schematic diagram of an entity recognition model structure provided by an embodiment of the present application;

[0027] Figure 7 It is a schematic diagram of entity annotation based on the LLM model provided by an embodiment of the present application;

[0028] Figure 8 It is a flow chart of an entity recognition method integrating an entity knowledge base and a deep learning model provided by an embodiment of the present application;

[0029] Fig. 9 is a schematic diagram of an entity recognition interface provided by an embodiment of the present application;

[0030] Fig.10is a block diagram of an entity identification device provided by an embodiment of the present application;

[0031] Fig.11 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0033] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include a model training device 110 and a model using device 120.

[0034] The model training device 110 may be an electronic device such as a mobile phone, a desktop computer, a tablet computer, a laptop computer, a vehicle-mounted terminal, a server, an intelligent robot, a smart TV, a multimedia playback device, or other electronic devices with strong computing capabilities, which is not limited in this application. The model training device 110 is used to train the entity recognition model.

[0035] In an embodiment of the present application, the entity recognition model is a deep neural network model. Optionally, the model training device 110 can train the entity recognition model in a machine learning manner so that it has better performance. Optionally, the training process of the entity recognition model is as follows (here is only a brief description, and the specific training process is described in the following embodiment): obtain a sample input text; based on the entity knowledge base, determine at least one potential sample candidate entity included in the sample input text, and the entity knowledge base includes multiple candidate entities; obtain the attribute information corresponding to at least one potential sample candidate entity; determine the entity prediction result corresponding to the sample input text according to the attribute information corresponding to the sample input text and at least one potential sample candidate entity through the entity recognition model; according to the difference between the entity prediction result and the entity annotation result corresponding to the sample input text, adjust the parameters of the entity recognition model to obtain the trained entity recognition model.

[0036] The model using device 120 may be an electronic device such as a mobile phone, a desktop computer, a tablet computer, a laptop computer, a vehicle terminal, a server, an intelligent robot, a smart TV, a multimedia player, or other electronic devices with strong computing capabilities, which is not limited in this application. The model using device 120 may use a trained entity recognition model to identify entities included in the first input text.

[0037] The model training device 110 and the model using device 120 may be two independent devices or the same device.

[0038] In the method provided in the embodiment of the present application, the execution subject of each step may be a computer device, which refers to an electronic device with data calculation, processing and storage capabilities. Wherein, when the computer device is a server, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The computer device may be Figure 1 The model training device 110 may also be a model using device 120.

[0039] Please refer to Figure 2 , which shows a flow chart of an entity recognition method provided by an embodiment of the present application. The execution subject of each step of the method may be a computer device, for example, the computer device may be Figure 1 The model in the solution implementation environment shown uses a device 120. The method may include at least one of the following steps 210-240.

[0040] Step 210: Obtain a first input text.

[0041] The first input text refers to the original text input into the entity recognition model for entity recognition.

[0042] An entity refers to a thing or object with a specific meaning and category. Entities can include multiple types, for example, they can include music entities, sports entities, film and television entities, book entities, etc. For example, music entities can include songs, singers, and music IP (Intellectual Property). Music IP refers to entity concepts such as movies, games, and novels related to music. The related relationships include but are not limited to: movie title songs, character BGM (Background Music) songs, etc. For example, film and television entities can include movie names, TV series names, directors, film and television types, etc. This application does not limit the entity types.

[0043] Entity Recognition (ER) is a natural language processing technology that aims to identify and classify specific entities from text. Exemplarily, entity recognition may refer to identifying music entities from a first input text.

[0044] In some possible implementations, the first input text can be obtained through local selection and input by the user, or by downloading retrieved text from a network platform (such as a user comment area). This application does not limit the method for obtaining the first input text.

[0045] Step 220: Determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities.

[0046] The entity knowledge base is a systematic database for storing and managing information of candidate entities for quick retrieval and use. Exemplarily, the entity knowledge base can be used to store data related to music entities. Candidate entities refer to entity objects with specific meanings or types that are pre-stored in the entity knowledge base.

[0047] In some embodiments, determining at least one potential candidate entity included in the first input text includes at least the following steps: (1) matching the first input text with multiple candidate entities, and determining at least one entity included in the first input text among the multiple candidate entities as at least one first candidate entity.

[0048] The first entity to be selected refers to an entity object preliminarily identified from the first input text and matched with an entity stored in the entity knowledge base. Exemplarily, the entity knowledge base may be a music entity knowledge base, and the candidate entity may be a candidate music entity, such as the song title "this song", the song title "abcd", and the song title "It's really nice to listen to". The first input text is: "This song abcd is really nice to listen to". By matching the first input text with the candidate music entities in the music entity knowledge base, the first entity to be selected can be obtained as "this song", "abcd", and "It's really nice to listen to".

[0049] (2) Segmenting the first input text according to at least one first entity to be selected to obtain a first segmentation result of the first input text.

[0050] Word segmentation refers to dividing the continuous first input text into a number of meaningful vocabulary units. It is understandable that when the first input text is segmented, a first candidate entity is regarded as a complete vocabulary unit. Exemplarily, in the above example, since the first candidate entities determined are "this song", "abcd", and "it sounds really good". The first word segmentation result is "this song / abcd / is really good". The vocabulary units included in the first word segmentation result are "this song", "abcd", and "it sounds really good".

[0051] (3) Determine at least one potential candidate entity based on the first word segmentation result.

[0052] In some embodiments, the first word segmentation result may include one or more vocabulary units, and the vocabulary units and potential candidate entities are in a one-to-one correspondence, that is, one vocabulary unit corresponds to one potential candidate entity, and different vocabulary units correspond to different potential candidate entities. Exemplarily, according to the above example, at least one potential candidate entity includes: "this song", "abcd", "really nice".

[0053] It is understandable that, assuming that when matching the first input text with multiple candidate entities in the entity knowledge base, the first input text does not include an entity that matches the candidate entity in the entity knowledge base, in this case, the first input text is taken as a potential candidate entity, and the attribute information of the potential candidate entity is non-entity. Please see the following for the relevant content of the attribute information.

[0054] In some embodiments, the candidate entities included in the entity knowledge base can be updated regularly to ensure that the information in the entity knowledge base remains up-to-date and accurate. By timely updating the entity knowledge base, the system can quickly include new entities in the recognition scope when they appear, so as to avoid the problem that the new entity is not recognized as the first candidate entity, thereby improving the quality and credibility of subsequent potential candidate entity recognition and information extraction.

[0055] Step 230: Acquire attribute information corresponding to at least one potential candidate entity. The attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity.

[0056] In some embodiments, the entity category may include entity and non-entity. Entity is used to indicate that the potential candidate entity is a thing or object with a specific meaning and category, and non-entity is used to indicate that the potential candidate entity is not a thing or object with a specific meaning and category.

[0057] It can be understood that, from the above word segmentation method, the potential candidate entities include the first candidate entity and other entities, and the other entities refer to the entities other than the first candidate entity in the potential candidate entities. The attribute information of the first candidate entity is entity, and the other entities are non-entities.

[0058] In some embodiments, when the attribute information is an entity, the attribute information also includes type information. Type information refers to the entity type to which the potential candidate entity specifically belongs. Exemplarily, the attribute information is used to indicate that the potential candidate entity is a music entity, and further, the attribute information is used to indicate that the potential candidate entity is a song title, a singer, or a music IP. This application does not limit this.

[0059] Step 240: Determine at least one entity included in the first input text according to the attribute information corresponding to the first input text and at least one potential candidate entity through an entity recognition model.

[0060] The entity recognition model refers to a deep learning model for identifying entities included in the first input text. Deep learning (DL) refers to learning based on artificial neural networks and is often used to process complex pattern recognition tasks, such as entity recognition in ER. The deep learning model can capture more complex features and semantic relationships of the context. In some embodiments, the entity recognition model is a natural language processing model (Natural Language Processing, NLP). The NLP model can comprehensively identify the entities included in the first input text based on the attribute information corresponding to the potential candidate entities and combined with the complete semantic information of the first input text. Specifically, the NLP model can use natural language processing technology to deeply analyze the semantic structure of the first input text, including contextual relationships, grammatical features and semantic clues, to understand the specific references and potential semantic intentions of the entities in the first input text. Based on the combination of attribute information and semantic information, the model can identify entity ambiguities that may exist in the first input text. For example, a vocabulary unit (that is, a potential candidate entity) may be an entity when viewed alone, but it has different interpretations in the context. By comprehensively analyzing the complete semantic information of the first input text, the model can determine the entity interpretation that best fits the context, thereby eliminating ambiguity.

[0061] In some embodiments, the NLP model can be constructed based on a Transformer model or other neural network models (such as a recurrent neural network), which is not limited in this application. For the specific structure of the entity recognition model and the training method, please refer to the description below.

[0062] In the above step 220, by matching the first input text with the candidate entities included in the entity knowledge base, this method can flexibly adapt to changes in entities. For example, when new entities are added, they can still be included in the potential candidate entities in a timely manner, ensuring the completeness and accuracy of the potential candidate entity identification, and providing more accurate input information for subsequent entity recognition models.

[0063] In the above step 230, on the one hand, the semantic information of the context of the first input text can be learned through the entity recognition model, thereby avoiding the problem of inaccurate recognition due to the ambiguity of the entity itself. On the other hand, since the input of the entity recognition model includes attribute information corresponding to potential candidate entities, even if the entities included in the first input text have not been trained during the training phase of the entity recognition model, the entity recognition model can timely identify and adapt to these new entities based on the attribute information, thereby improving the accuracy of entity recognition. In addition, this method does not require retraining of the entity recognition model, thereby improving the efficiency of entity recognition.

[0064] In summary, the technical solution provided by the embodiment of the present application, by matching the first input text with the candidate entities included in the entity knowledge base, can flexibly adapt to the situation of entity changes, ensure the integrity and accuracy of potential candidate entity recognition, and provide more accurate input information for the subsequent entity recognition model. And through the entity recognition model, the semantic information of the context of the first input text can be learned. On the one hand, the problem of inaccurate recognition caused by the ambiguity of the entity itself is avoided. On the other hand, since the input of the entity recognition model includes the attribute information corresponding to the potential candidate entity, even if the entity included in the first input text is not trained in the training stage of the entity recognition model, the entity recognition model can timely identify and adapt to these new entities based on the attribute information, thereby improving the accuracy of entity recognition. In addition, this method does not need to retrain the entity recognition model, thereby improving the efficiency of entity recognition.

[0065] The specific implementation of the entity knowledge base is introduced below.

[0066] In some embodiments, the entity knowledge base includes multiple candidate entities, weight information corresponding to the multiple candidate entities, and attribute information corresponding to the multiple candidate entities. The weight information is used by the user to indicate the popularity value of the candidate entity, and the attribute information of the candidate entity is used to indicate the entity category of the candidate entity.

[0067] It is understandable that the greater the heat value, the greater the value of the weight information. The smaller the heat value, the smaller the weight information. In some embodiments, the heat value can be determined based on the user's operation behavior on the candidate entity. When the user's attention to the candidate entity is greater, the heat value is greater, and when the user's attention to the candidate entity is less, the heat value is smaller.

[0068] In some embodiments, Figure 3 As shown, the steps of determining candidate entities include: (1) obtaining entity data. For example, when the entity data is music data, music domain knowledge can be collected from multiple channels such as music libraries, specifically singer names, song names, music IPs, etc. This process continuously obtains massive data to ensure that the latest music entities can be quickly saved in the entity knowledge base.

[0069] (2) Filter the entity data to obtain multiple candidate entities.

[0070] The screening operation is used to remove non-compliant, invalid or irrelevant data in the entity data. Exemplarily, when the entity is a music entity, the music data can be authenticated to remove the influence of factors such as song theft and no right, and the authorized music data can be filtered. Exemplarily, the music data can be filtered for content security to ensure that the music data in the entity knowledge base does not have pornography, violence, and prohibited problems. Exemplarily, low-quality or inferior music data, such as low-quality, repeated or obviously wrong files, can be removed to ensure that the entity knowledge base is stored with high-quality music works. Exemplarily, music data that does not meet specific format requirements, such as audio types whose file formats are not supported, can be removed to ensure data consistency and availability. Exemplarily, duplicate music files or music entities with the same content are identified and removed to ensure the uniqueness of the candidate list. Exemplarily, music data that has not been officially released, such as music works in pre-release and draft states, can be removed to ensure that the data set contains music that has been officially released. This application does not limit the screening method of entity data.

[0071] (3) Determine weight information corresponding to each of the multiple candidate entities based on the user's behavior information for the multiple candidate entities. The behavior information is used to indicate the user's attention to the candidate entity, and the weight information is used to indicate the popularity value of the candidate entity.

[0072] In some embodiments, the behavior information may include various behavior information of users with respect to candidate entities, such as clicks, browsing, dwell time, searches, favorites, shares, downloads, comments, etc. The behavior information may reflect the user's degree of attention to the candidate entities.

[0073] In some embodiments, the user's behavior towards the candidate entity can be quantified into a specific value or score to determine the weight information corresponding to the multiple candidate entities. It is understandable that there is a one-to-one correspondence between the behavior and its specific value or score, and one behavior corresponds to a specific value or score. Exemplarily, the weight of click behavior is 1, the weight of long-term stay is 2, the weight of collection is 3, the weight of sharing is 5, etc. This application is not limited to this.

[0074] In some embodiments, for each candidate entity, its weight information can be determined according to multiple behavior information of the user for the candidate entity. In some embodiments, the sum of the quantized values ​​or scores corresponding to the multiple behavior information is used as the weight information of the candidate entity.

[0075] In some embodiments, each behavior information is weighted. For example, considering the time sensitivity of user behavior, a more recent behavior is given a higher weight, while an earlier behavior is subjected to time decay. The weight information of the candidate entity is determined based on the weight of each behavior information and the quantitative value or score corresponding to each behavior information.

[0076] In some embodiments, the weight information corresponding to the candidate entities may be updated regularly, and the weight information may be adjusted according to the latest behavior of the user to ensure that the weight information can reflect the popularity of the candidate entities in a timely manner.

[0077] Exemplarily, for a candidate music entity, the weight information corresponding to the candidate music entity can be determined based on the user's playback behavior for the candidate music entity in a certain time period (such as one day, one week, etc.). Specifically: parse the playback data of each user's played songs, then parse each played song into the corresponding music entity (i.e., the candidate music entity), then bind the playback data to the candidate music entity, and finally summarize the playback data of the same candidate music entity as the weight information of the candidate music entity. For example, if the playback data of the song "singer A-song A" is 10,000 times, and the playback data of "singer A-song B" is 15,000 times, then the weights of each candidate music entity obtained by splitting it in turn are: the weight information of "singer A" is 10,000+15,000=25,000; the weight information of "song A" is 10,000; the weight information of "song B" is 15,000.

[0078] The above method can effectively improve the data reliability of candidate entities by screening entity data, and by assigning a weight to each candidate entity, a basis is provided for determining subsequent path information.

[0079] In some embodiments, the entity knowledge base is distributed and stored in multiple storage nodes, and each of the multiple storage nodes periodically updates new candidate entities to be added to the storage node.

[0080] In some embodiments, the entity knowledge base is distributedly deployed in multiple storage nodes to solve the problem of insufficient memory and hard disk when a single machine cleans and collects massive entity data, and the entire cleaning and data collection process can be deployed to a timing scheduling platform, and each storage node can periodically and continuously obtain the latest entity data.

[0081] In some embodiments, within the entity knowledge base, a double-tree trie (retrieval) tree is used to store data in the entity knowledge base, thereby enabling rapid retrieval and acquisition of the first entity to be selected.

[0082] In some embodiments, the principle of using a dual array search tree for data storage is to store the search tree through a base array and a check array. Wherein, the base array is used to store the state transfer information of each node in the search tree, and the check array is used to store the constraint information of the state transfer, and each node in the search tree is used to indicate a character in a plurality of candidate entities. That is, the base array is used to represent the starting position of the child node from the current node downward. The check array is used to verify whether the position of the current node is valid. The construction and query of the dual array search tree may include the following steps:

[0083] (1) Construct a double array retrieval tree, such as Figure 4 As shown in the figure, assuming there are three candidate entities "abcd", "ab", and "cd", the double array retrieval tree can be as follows Figure 4 Build, Figure 4 The end in the string indicates a leaf node, which means the end of the word has been reached.

[0084] (2) The calculation formula of the double array base array and check array is shown in the following formula 1. The base array records the node with index i. If the transfer is performed according to character x, it will transfer to the node with index j. The check array is used to identify the previous state of each state in the base array. Its main function is to verify the correctness of the transfer according to the base array. code(x) is the code of character x. Here, "a" can be encoded as 1, "b" as 2, "c" as 3, and "d" as 4.

[0085]

[0086] (3) The construction process of the dual array retrieval tree.

[0087] (3.1) Initialize the base and check arrays, set base[0] = 1, check[0] = 0, as shown in Table 1 below, where position is the node.

[0088] Table 1

[0089] position base check 0 1 0

[0090] (3.2) Place the first-level node (a, c) in the retrieval tree. According to the above base calculation formula, the nodes to be placed are 2 and 4 nodes, respectively, and the base and check arrays are updated accordingly. The check array records the position of the previous state, where the position of the previous state is 0. For the base value, the base value of the parent node is used by default, that is, the value of base[0] is assigned to base[2] and base[4], as shown in the following formula 2 and Table 2.

[0091]

[0092] Table 2

[0093] position base check character 0 1 0 1 2 1 0 a 3 4 1 0 c

[0094] (3.3) Place the second-level nodes (b, d) in the retrieval tree. According to the above base calculation formula, the nodes to be placed are 3 and 5, respectively, and the base and check arrays are updated accordingly. The check array records the position of the previous state, which is 2 and 4 here. For the base value, the base value of the parent node is used by default, that is, the values ​​of base[2] and base[4] are assigned to base[3] and base[5] respectively, as shown in the following formula 3 and table 3.

[0095]

[0096] Table 3

[0097] position base check character 0 1 0 1 2 1 0 a 3 1 2 ab 4 1 0 c 5 1 4 cd

[0098] (3.4) Place the third-level node (c) in the retrieval tree. According to the above base calculation formula, the node to be placed is 4. However, since node 4 has been used to place "c", the default base[3] value needs to be adjusted from 1 to increase continuously until it does not conflict with other nodes. When adjusting base[3] to 2, the node to be placed is 5, but since node 5 has been used to place "cd". Therefore, continue to adjust base[3] to 3, and then place it at node 6. At this time, there is no conflict, and the value of check[6] is also recorded as the previous state 3. For the base value, the base value of the parent node is used by default, that is, the value of base[3] is assigned to base[6], as shown in the following formula 4 and the following table 4.

[0099]

[0100] Table 4

[0101]

[0102]

[0103] (3.5) Place the fourth-level node (d) in the retrieval tree. According to the above base calculation formula, the node to be placed is 7. The base and check arrays are updated accordingly. The check array records the position of the previous state, where the position of the previous state is 6. For the base value, the base value of the parent node is used by default, that is, the base[6] value is assigned to base[7], as shown in the following formula 5 and table 5.

[0104] base[6]+code(d)=3+4=7 (Formula 5)

[0105] Table 5

[0106] positiOn base check character 0 1 0 1 2 1 0 a 3 3 2 ab 4 1 0 C 5 1 4 cd 6 3 3 abc 7 3 6 abcd

[0107] (3.6) For the convenience of subsequent searches, there is no need to insert the end node into the double array search tree when searching for the end of a word. Instead, the base value of the end node position can be directly negative. This saves memory space. However, the conversion formula of the base needs to be adjusted to an absolute value, as shown in Formula 6 and Table 6.

[0108] |base[i]|+code(x)=j (Formula 6)

[0109] Table 6

[0110]

[0111]

[0112] In some embodiments, based on the storage process of the above-mentioned entity knowledge base, a specific implementation process of matching the first input text with multiple candidate entities to determine the first candidate entity is introduced. The process may include the following steps: matching the first input text based on the base array and the check array of the retrieval tree corresponding to the multiple candidate entities, and determining at least one entity included in the first input text in the multiple candidate entities as at least one first candidate entity.

[0113] Specifically, the following steps may be included:

[0114] (1) Starting from the root, the transfer process is calculated according to the calculation formula of the base array. At each transfer step, verify whether the value of the check array at the transferred position is equal to the previous state. If it is equal, it means that the string exists in the double array search tree. If the value of the base array is found to be negative, it means that the string item has reached the end of the word.

[0115] (2) The above process is explained below using "abcd" as an example.

[0116] |base[0]|+code(a)=1+1=2, verification check(2)==0,

[0117] |base[2]|+code(b)=1+2=3, verification check(3)==2,

[0118] |base[3]|+code(c)=3+3=6, verification check(6)==3,

[0119] |base[6]|+code(d)=3+4=7, verification check(7)==6,

[0120] Since base[7]<0, "abcd" is retrieved.

[0121] In some embodiments, the first candidate entity in the input text can also be matched by fuzzy matching, using predefined rules or dictionaries. Among them, fuzzy matching refers to using a string similarity algorithm (such as Jaccard similarity, Levenshtein distance) to determine the similarity between the words in the first input text and the entities in the entity knowledge base. Conventional rule matching refers to using predefined rules or dictionaries to match the first candidate entity in the first input text. The present application does not limit the method of matching the first input text with the entity knowledge base to obtain the first candidate entity.

[0122] In the above method, since the dual-array search tree is an array-based data structure, the state transfer can be completed in a constant time through the efficient cooperation of the base array and the check array, which greatly improves the matching speed of the first candidate entity. In addition, the structure of the dual-array search tree is relatively simple, easy to implement and debug. At the same time, due to its array-based design, it is easy to dynamically update and expand.

[0123] The following describes a specific method for determining potential candidate entities when multiple first word segmentation results are determined based on the first candidate entity.

[0124] For example, suppose there are five candidate entities, "this song", "abcd", "ab", "cd", and "really nice to listen to". The first input text is "this song abcd is really nice to listen to". Then the first candidate entity is determined to be "this song", "ab", "cd", "abcd", and "really nice to listen to". Based on the first candidate entity, multiple first word segmentation results can be determined.

[0125] In some embodiments, non-conflicting entities are determined among a plurality of first entities to be selected, and the non-conflicting entities are used as second entities to be selected. Non-conflicting entities refer to entities that do not overlap or cover each other in the text. In other words, the positions of these entities in the first input text do not interfere with each other, and the position intervals of characters do not intersect. Exemplarily, the non-conflicting entities are "this song" and "It's really nice to listen to." The conflicting entities are "abcd", "ab", and "cd".

[0126] In some embodiments, multiple first word segmentation results can be determined based on the conflicting entities (it can be understood that at this time, the first candidate entity without conflict has been segmented into a complete word unit in the first input text).

[0127] For example, the word segmentation is performed based on "ab", "cd" (it can be understood that the potential meaning is to perform word segmentation based on "this song", "really nice to listen to", "ab", "cd", and the following examples have the same meaning), then the first word segmentation result is "this song / ab / cd / is really nice to listen to". For example, the word segmentation is performed based on "abcd", then the first word segmentation result is "this song / abcd / is really nice to listen to".

[0128] The above is an example of determining multiple first word segmentation results based on the first candidate entity when there are conflicting entities in the first candidate entity. The following describes how to determine one first word segmentation result from the multiple first word segmentation results to obtain a potential candidate entity.

[0129] In some embodiments, according to the first word segmentation result, the method of determining at least one potential candidate entity may include the following steps:

[0130] (1) When there are multiple first word segmentation results, at least one entity is determined from at least one first candidate entity according to weight information corresponding to each of the multiple candidate entities as at least one second candidate entity.

[0131] In some embodiments, when there are multiple first word segmentation results, a conflicting first candidate entity is determined from the first candidate entities according to the weight information corresponding to the multiple candidate entities; an entity is determined from the conflicting first candidate entity as the second candidate entity. It is understandable that for entities that do not conflict in the first candidate entities, they are directly determined as potential candidate entities. It is understandable that determining the second candidate entity from the first candidate entity hereinafter refers to determining the second candidate entity from the conflicting first candidate entity, that is, from the conflicting first candidate entity. The first candidate entity that does not conflict can be directly used as the second candidate entity.

[0132] In some embodiments, the maximum weight information among the weight information respectively corresponding to at least one first candidate-selected entity is determined, and the first candidate-selected entity corresponding to the maximum weight information is determined as the second candidate-selected entity.

[0133] For example, for the above example, assume that the weight information corresponding to "ab" is 3000, the weight information corresponding to "cd" is 4000, and the weight information corresponding to "abcd" is 2000. Then determine "ab" and "cd" as the second candidate entities. Based on "ab" and "cd", determine the first analysis result as "this song / ab / cd / is really good". Then the potential candidate entities include: "this song", "ab", "cd", "really good".

[0134] In some embodiments, weight information exceeding a first threshold among weight information corresponding to at least one first candidate entity is determined, and the first candidate entity corresponding to the weight information exceeding the first threshold is determined as the second candidate entity. The setting method of the first threshold can be set based on the experience of technicians, and this application does not limit this.

[0135] In some embodiments, the number of first entities to be selected can be one or more. In some embodiments, if there are multiple first entities to be selected, and the multiple first entities to be selected can uniquely determine the first word segmentation result, the multiple first entities to be selected are determined as the second entities to be selected. Exemplarily, the first entities to be selected are "ab" and "cd", and the first word segmentation result is "This song / ab / cd / is really nice", then "ab" and "cd" are both determined as the second entities to be selected.

[0136] In some embodiments, determining at least one entity from at least one first candidate entity as at least one second candidate entity may further include the following steps:

[0137] (1.1) Determine probability information corresponding to at least one first candidate entity based on weight information corresponding to each of the plurality of candidate entities, wherein the probability information is used to indicate the probability that the first candidate entity is an entity included in the first input text.

[0138] In some embodiments, the step of determining the probability information corresponding to the first candidate entity may include: Figure 5As shown, a directed graph of at least one first candidate entity is generated, the directed graph includes at least one node and edges between the nodes, each node is used to indicate a character in at least one first candidate entity, and each edge is used to indicate the relationship between the characters contained in at least one first candidate entity; according to the directed graph, path information corresponding to at least one first candidate entity is determined, and the path information is used to indicate the situation where a first candidate entity contains other first candidate entities; according to the path information corresponding to at least one first candidate entity, probability information corresponding to at least one first candidate entity is determined.

[0139] For example, the characters included in the first candidate entities "ab", "cd", and "abcd" may be: "a", "b", "c", and "d", and the four characters are used as nodes of the directed graph. It can be understood that there is a one-to-one correspondence between characters and nodes, that is, one character corresponds to one node, and different characters correspond to different nodes. According to the order of the characters in the three first candidate entities, the edges of the directed graph are constructed to obtain the following: Figure 5 The directed graph shown.

[0140] In some embodiments, the weight information corresponding to the first candidate entities is normalized. In some embodiments, for each first candidate entity, the first weight information of the first candidate entity is determined based on the weight information of the first candidate entity and the sum of the weight information corresponding to the multiple candidate entities. In some embodiments, for each first candidate entity, the ratio of the weight information of the first candidate entity to the sum of the weight information is used as the first weight information of the first candidate entity, and the sum of the weight information refers to the sum of the weight information corresponding to the multiple candidate entities.

[0141] Exemplarily, the weight information can be determined based on the user's playback behavior for the music candidate entity. First, the number of playbacks corresponding to the multiple candidate entities is obtained, and the number of playbacks is used as the weight information corresponding to the candidate entity. Then, the sum of the number of playbacks corresponding to the multiple candidate entities is determined. Finally, the sum of the number of playbacks corresponding to the first candidate entity and the number of playbacks corresponding to the multiple candidate entities is used as the first weight information of the first candidate entity.

[0142] In some embodiments, for each first candidate entity, the log value of the first weight information of the first candidate entity is used as the second weight information, as shown in the following formula 7, Node prob Refers to the second weight information, Entity prob Refers to the first weight information.

[0143] Node prob =log(Entity prob ) (Formula 7)

[0144] In some embodiments, other first candidate entities included in each first candidate entity are determined according to the directed graph. Exemplarily, for the first candidate entity "abcd", it includes the first candidate entities "ab" and "cd", while the first candidate entity "ab" does not include other first candidate entities, and the first candidate entity "cd" does not include other first candidate entities.

[0145] In some embodiments, according to the directed graph, the quantity information of other first to-be-selected entities included in each first to-be-selected entity is determined, and the quantity information is used to indicate the quantity of other first to-be-selected entities included in the first to-be-selected entity. Exemplarily, for the first to-be-selected entity "abcd", its quantity information is 2. The quantity information of the first to-be-selected entity "ab" is 0, and the quantity information of the first to-be-selected entity "cd" is also 0.

[0146] In some embodiments, probability information corresponding to at least one first candidate entity is determined based on weight information corresponding to multiple candidate entities and quantity information corresponding to at least one first candidate entity, and the quantity information is positively correlated with the probability information.

[0147] It can be understood that when the quantity information of the first to-be-selected entities is larger, the corresponding probability information is larger, and when the quantity information of the first to-be-selected entities is smaller, the corresponding probability information is smaller.

[0148] In some embodiments, the probability information corresponding to the first candidate entity is determined based on the second weight information of the first candidate entity and the second weight information of other first candidate entities included in the first candidate entity. In some embodiments, for each first candidate entity, the second weight information of the first candidate entity and the sum of the second weight information of other first candidate entities included in the first candidate entity are used as the probability information of the first candidate entity. As shown in the following formula 8, where refers to the probability information.

[0149] Path prob =∑Node eprob (Formula 8)

[0150] (1.2) According to the probability information respectively corresponding to the at least one first candidate-selected entity, at least one entity is determined from the at least one first candidate-selected entity as the at least one second candidate-selected entity.

[0151] In some embodiments, maximum probability information among probability information respectively corresponding to at least one first candidate-selected entity is determined, and the first candidate-selected entity corresponding to the maximum probability information is determined as the second candidate-selected entity.

[0152] In some embodiments, the probability information that exceeds the second threshold is determined, and the first candidate entity corresponding to the probability information that exceeds the second threshold is used as the second candidate entity. The second threshold can be set based on the experience of the staff, and this application does not limit this.

[0153] In some embodiments, the maximum quantity information among the quantity information respectively corresponding to at least one first candidate-selected entity is determined, and the first candidate-selected entity corresponding to the maximum quantity information is used as the second candidate-selected entity.

[0154] (2) Segmenting the first input text according to at least one second candidate entity to obtain a second segmentation result of the first input text. (3) Determining the second segmentation result as at least one potential candidate entity.

[0155] The above steps (2) and (3) are the same as the principle of the method for determining a potential candidate entity based on the first candidate entity. Please refer to the above description.

[0156] The following introduces a specific implementation method for determining at least one entity included in the first input text based on the entity recognition model.

[0157] (1) Obtaining a text embedding corresponding to each character included in the first input text, where the text embedding refers to a vector representation determined based on semantic information of the first input text.

[0158] In some embodiments, the first input text is split into three groups of inputs (Token Embeddings, Segment Embeddings, Position Embeddings). Token Embeddings is word embedding, Segment Embeddings is segment embedding, and Position Embeddings is position embedding. Word embedding refers to the vector representation corresponding to each character included in the first input text, position embedding refers to the vector representation corresponding to the position information of each character included in the first input text, and segment embedding refers to the vector representation determined based on the first input text.

[0159] (2) Obtaining a word segmentation embedding corresponding to each character included in at least one potential candidate entity, where the word segmentation embedding refers to a vector representation determined based on a word segmentation result for the first input text.

[0160] (3) Obtaining attribute embedding corresponding to each character included in at least one potential candidate entity, where attribute embedding refers to a vector representation corresponding to attribute information.

[0161] In some embodiments, potential candidate entities are split into two groups of inputs (Area Embeddings, Entity Embeddings. Among them, word segmentation embeddings can also be called Area Embeddings. It can be understood that a potential candidate entity is regarded as an area. Exemplarily, E_1 and E_2 can be used to distinguish alternately.

[0162] Attribute embeddings can also be called entity embeddings.

[0163] In some embodiments, for any one of the at least one potential candidate entity, if the attribute information corresponding to the potential candidate entity includes an entity attribute category, the attribute embedding corresponding to each character included in the potential candidate entity is determined based on the entity attribute category.

[0164] In some embodiments, for any one of the at least one potential candidate entity, if the attribute information corresponding to the potential candidate entity includes multiple entity attribute categories, the attribute embedding corresponding to each character included in the potential candidate entity is determined based on the multiple entity attribute categories.

[0165] For example, for a music entity, entity attribute categories may include singer name, song name, music IP, and non-entity attributes. If the attribute information corresponding to the potential candidate entity includes an entity attribute category, the attribute embedding may include: E_So, E_Si, E_Ip. Among them, E_So represents the song entity attribute; E_Si represents the singer entity attribute; and E_Ip represents the music IP entity attribute.

[0166] Exemplarily, if the attribute information corresponding to the potential candidate entity includes multiple entity attribute categories, the attribute embedding may include: E_SoSi, E_SoIp, E_SiIp, E_SoSiIp. Among them, E_SoSi represents the entity attributes of songs and singers; E_SoIp represents the entity attributes of songs and IPs; E_SiIp represents the entity attributes of singers and IPs; E_SoSiIp represents the entity attributes of songs, singers, and music IPs. E_None represents no entity attributes.

[0167] In some embodiments, the above attribute embedding can be represented using a one hot method, which is a commonly used data encoding method, especially for representing categorical variables. In this method, each possible attribute embedding is represented as a unique binary vector, in which only one position is 1, representing the attribute embedding, and the rest of the positions are 0. Exemplarily, E_So may be [1,0,0,0,0,0,0,0], E_Si may be [0,1,0,0,0,0,0,0], E_Ip may be [0,0,1,0,0,0,0,0], E_SoSi may be [0,0,0,1,0,0,0,0], E_SoIp may be [0,0,0,0,1,0,0,0], E_SiIp may be [0,0,0,0,0,1,0,0], E_SoSiIp may be [0,0,0,0,0,1,0,0], E_SoSiIp may be [0,0,0,0,0,0,1,0], and E_None may be [0,0,0,0,0,0,0,1].

[0168] (4) Determine at least one entity included in the first input text according to text embedding, word segmentation embedding and attribute embedding through an entity recognition model.

[0169] In some embodiments, through the above steps (2) and (3), the potential candidate entities of the first input text can be obtained through the entity knowledge base, and the format can be (first input text, potential candidate entity) position-level corresponding information. For example: "This song abcd is really good to listen to." Assume that the attribute information of "this song" is the song attribute, the attribute information of "abcd" is the song attribute, and the attribute information of "really good to listen to" is the song attribute. Then the character granularity information of the first input text is "this; song; a; b; c; d; really; good; to listen to; ah", and the potential candidate entities obtained can be: "Song0; Song0; Song1; Song1; Song1; Song2; Song2; Song2; Song2". The area with the same suffix number indicates that the word segmentation result treats the suffix number as a word segmentation result; Song (song) indicates that the area has the song name entity attribute.

[0170] In some embodiments, the entity recognition model outputs attribute information of each character included in the first input text according to text embedding, word segmentation embedding, and attribute embedding, and the attribute information of the character is used to indicate the entity category of the character; at least one entity included in the first input text and the attribute information corresponding to the at least one entity are determined according to the attribute information of each character included in the first input text. In other words, the entity recognition model can recognize at least one entity and the attribute information corresponding to the at least one entity from the first input text.

[0171] like Figure 6 As shown, the attribute information output by the characters "a", "b", "c", and "d" is song, and the attribute information output by "this", "first", "real", "good", "listen", and "ah" is empty (that is, non-entity). Therefore, it is determined that the entity included in the first input text is "abcd", and the attribute information of the entity is the song attribute. In this way, the deep learning model can identify the semantic information of the first input text. By analyzing the context, the model can accurately understand the semantics of "this song" and "it's really nice to listen to", thereby effectively avoiding the problem of inaccurate entity recognition caused by entity ambiguity.

[0172] In some embodiments, the entity recognition model outputs attribute information of each character included in the first input text based on text embedding, word segmentation embedding and attribute embedding. When the attribute information of each character is non-entity or empty, it is determined that the first input text does not include an entity.

[0173] The following introduces the training method of the entity recognition model.

[0174] (1) Obtain sample input text.

[0175] In some embodiments, the sample input text may be derived from the original text of the review in the review scenario. It may also be derived from social media posts, for example, posts posted by users on social media platforms. The text in these posts may include comments and discussions on music, movies, books, etc. This application does not limit this.

[0176] (2) Based on an entity knowledge base, determining at least one potential sample candidate entity included in the sample input text, wherein the entity knowledge base includes a plurality of candidate entities.

[0177] (3) Obtaining attribute information corresponding to at least one potential sample candidate entity, where the attribute information corresponding to the potential sample candidate entity is used to indicate the entity category of the potential sample candidate entity.

[0178] (4) Determine an entity prediction result corresponding to the sample input text according to the attribute information corresponding to the sample input text and at least one potential sample candidate entity through the entity recognition model, and the entity prediction result includes at least one predicted entity.

[0179] (5) According to the entity prediction results and the difference between the entity annotation results corresponding to the sample input text, the parameters of the entity recognition model are adjusted to obtain the trained entity recognition model.

[0180] In some embodiments, during the model training process, Crossloss (cross entropy loss) can be used for training to obtain the transformer vector weights of each layer, as well as Token Embeddings, Segment Embeddings, Position Embeddings, Entity Embeddings, Area Embeddings and other information. Through the above model training, the entity recognition model will judge which are real entities and which are just interference items based on the attribute information of the input potential candidate entities and the context semantics.

[0181] In some embodiments, the parameters of the entity recognition model are adjusted to minimize the difference between the entity prediction result and the entity annotation result corresponding to the sample input text, thereby obtaining a trained entity recognition model.

[0182] In some embodiments, the entity annotation result is determined by LLM (Large Language Model) based on the sample input text, such as Figure 7 As shown, it may specifically include one of the following steps: determining a first entity annotation result according to a sample input text through a first LLM, the first entity annotation result including an entity and attribute information corresponding to the entity; determining a second entity annotation result according to the sample input text through a second LLM, the second entity annotation result including an entity and attribute information corresponding to the entity; when the first entity annotation result is consistent with the second entity annotation result, the first entity annotation result or the second entity annotation result is used as the entity annotation result corresponding to the sample input text.

[0183] In some embodiments, in order to prevent the large model LLM from producing hallucinations and thus causing mislabeling, a dual LLM mechanism can be used, using two LLMs to independently label samples, and finally comparing whether the two samples are consistent. Only when they are consistent, will they be considered to be highly reliable, and will the result be finally adopted as the correct labeling result of the sample input text and finally sent to the training set. In the specific LLM configuration, the temperature can be set to 0 so that the LLM can output the maximum confidence result.

[0184] In some embodiments, if the two LLMs are inconsistent, a readjustment phase may be entered to re-output the two LLMs. In this process, a third threshold value for the number of readjustments may be set, and the third threshold value may be set based on the experience of the technician. Exemplarily, the third threshold value may be 3, that is, if the number of readjustments exceeds 3, the sample will be discarded to avoid an infinite loop.

[0185] The above method uses a large language model to perform data annotation to solve the problem of lack of annotation data. This system can annotate the sample input text with actual entity results without a lot of manual intervention, so as to efficiently train the entity recognition model.

[0186] For content not mentioned above about the training side, please refer to the relevant description of the model usage side.

[0187] Please refer to Figure 8 , which shows a flow chart of an entity recognition method that integrates an entity knowledge base and a deep learning model provided by an embodiment of the present application. (1) First, a distributed processing method is used to process massive entity data. When the entity is a music entity, music field knowledge can be collected from multiple channels such as the music library, specifically singer name, song name, music IP, etc. This process continuously cleans massive entity data to ensure that the latest music entities can be quickly saved to the entity knowledge base. Within the knowledge base, the candidate music entities are saved in the form of a dual-tree group retrieval tree. This solution facilitates subsequent rapid retrieval and matching of the first input text. Finally, the potential candidate entities contained in the first input text are determined according to the path information as the output of the entity knowledge base. This information will be input as part of the subsequent deep learning model.

[0188] (2) Then, based on the potential candidate entity information output by the entity knowledge base obtained in (1), the first input text is input into the deep learning model. The deep learning model combines the entity knowledge base and the first input text, and outputs the entities included in the first input text and the attribute information of the entities through semantic understanding. During the model training process, LLM is used to quickly annotate entities to save labor costs and improve model training efficiency.

[0189] In some embodiments, Fig. 9 As shown, the present application also shows a schematic diagram of the entity recognition interface 90.

[0190] In some embodiments, an entity recognition interface 90 is displayed, and the entity recognition interface 90 includes a first input text 91 and at least one entity included in the first input text 91. The at least one entity is displayed distinctively in the entity recognition interface.

[0191] In some embodiments, the entity recognition interface 90 can be applied to the comment scene. For example, in the music comment scene, it is necessary to identify the singer name, song name, music IP and other entities mentioned in the user's comment, so as to provide a search jump function to facilitate users to explore music songs of related entities. This simplifies the user's operation (no need to copy and paste to the search box), improves the user's experience (directly search for related entities with one click), and thus increases the user's product stickiness (conveniently transfer to explore new songs).

[0192] In some embodiments, the distinguishing display may be at least one of the following: highlighting, underlining, bolding, and adding a border. Among them, highlighting, such as highlighting the recognized entity with a different color or background to make it more conspicuous in the text. Underlining, such as adding an underline under the recognized entity to facilitate the user to quickly locate and identify it. Bolding, such as bolding the recognized entity to highlight its importance. Adding a border, such as adding a border to the recognized entity to visually distinguish it from the surrounding text.

[0193] In some embodiments, at least one entity is marked using the first element 92. For example, a magnifying glass icon 92 may be marked in the upper right corner of the identified entity, or a special symbol (such as an asterisk, an exclamation mark, etc.) may be added to the identified entity, or a label (such as "[singer]", "[song]", "[music IP]", etc.) may be added after the identified entity. This application does not limit this, and the specific marking method may be adjusted according to the actual application scenario and user needs.

[0194] Please refer to Fig.10 , which shows a block diagram of an entity recognition device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned entity recognition method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be a computer device, or it can be set in a computer device. The device 1000 may include: a first acquisition module 1010, a first determination module 1020, a second acquisition module 1030 and a second determination module 1040.

[0195] The first acquisition module 1010 is used to acquire a first input text.

[0196] The first determination module 1020 is used to determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities.

[0197] The second acquisition module 1030 is used to acquire attribute information corresponding to the at least one potential candidate entity, where the attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity.

[0198] The second determination module 1040 is used to determine at least one entity included in the first input text according to the attribute information respectively corresponding to the first input text and the at least one potential candidate entity through an entity recognition model.

[0199] In some embodiments, the first determination module 1020 is used to match the first input text with the multiple candidate entities, determine at least one entity in the first input text included in the multiple candidate entities, as at least one first candidate entity; based on the at least one first candidate entity, segment the first input text to obtain a first segmentation result for the first input text; and determine the at least one potential candidate entity based on the first segmentation result.

[0200] In some embodiments, the entity knowledge base also includes weight information corresponding to the multiple candidate entities, and the weight information is used to indicate the popularity value of the candidate entity; the first determination module 1020 is used to determine at least one entity from the at least one first candidate entity as at least one second candidate entity according to the weight information corresponding to the multiple candidate entities when there are multiple first segmentation results; according to the at least one second candidate entity, the first input text is segmented to obtain a second segmentation result of the first input text; and the second segmentation result is determined as the at least one potential candidate entity.

[0201] In some embodiments, the first determination module 1020 is used to determine the probability information corresponding to the at least one first candidate entity according to the weight information corresponding to the multiple candidate entities, and the probability information is used to indicate the probability that the first candidate entity is an entity included in the first input text; according to the probability information corresponding to the at least one first candidate entity, at least one entity is determined from the at least one first candidate entity as the at least one second candidate entity.

[0202] In some embodiments, the first determination module 1020 is used to generate a directed graph of the at least one first candidate entity, the directed graph comprising at least one node and edges between the nodes, each node being used to indicate a character in the at least one first candidate entity, and each edge being used to indicate the relationship between the characters contained in the at least one first candidate entity; based on the directed graph, path information corresponding to the at least one first candidate entity is determined, the path information is used to indicate the situation where the first candidate entity contains other first candidate entities; based on the path information corresponding to the at least one first candidate entity, probability information corresponding to the at least one first candidate entity is determined.

[0203] In some embodiments, the path information includes quantity information, and the quantity information is used to indicate the quantity of other first candidate entities contained in the first candidate entity; the first determination module 1020 is used to determine the probability information corresponding to the at least one first candidate entity according to the weight information corresponding to the multiple candidate entities respectively, and the quantity information corresponding to the at least one first candidate entity respectively, and the quantity information is positively correlated with the probability information.

[0204] In some embodiments, the first determination module 1020 is used to determine the maximum probability information among the probability information respectively corresponding to the at least one first candidate entity, and determine the first candidate entity corresponding to the maximum probability information as the second candidate entity.

[0205] In some embodiments, the first determination module 1020 is used to match the first input text based on the base array and check array of the retrieval tree corresponding to the multiple candidate entities, and determine at least one entity included in the first input text among the multiple candidate entities as the at least one first candidate entity; wherein the base array is used to store state transition information of each node in the retrieval tree, the check array is used to store constraint information of state transition, and each node in the retrieval tree is used to indicate a character among the multiple candidate entities.

[0206] In some embodiments, the second acquisition module 1030 is used to obtain a text embedding corresponding to each character included in the first input text, wherein the text embedding refers to a vector representation determined based on the semantic information of the first input text; obtain a word segmentation embedding corresponding to each character included in the at least one potential candidate entity, wherein the word segmentation embedding refers to a vector representation determined based on the word segmentation result of the first input text; obtain an attribute embedding corresponding to each character included in the at least one potential candidate entity, wherein the attribute embedding refers to a vector representation corresponding to the attribute information; and determine at least one entity included in the first input text according to the text embedding, the word segmentation embedding and the attribute embedding through the entity recognition model.

[0207] In some embodiments, the second acquisition module 1030 is used to determine the attribute embedding corresponding to each character included in the potential candidate entity for any one of the at least one potential candidate entity, based on the multiple entity attribute categories if the attribute information corresponding to the potential candidate entity includes multiple entity attribute categories.

[0208] In some embodiments, the second acquisition module 1030 is used to output attribute information of each character included in the first input text according to the text embedding, the word segmentation embedding and the attribute embedding through the entity recognition model, wherein the attribute information of the character is used to indicate the entity category of the character; and determine at least one entity included in the first input text and the attribute information corresponding to the at least one entity according to the attribute information of each character included in the first input text.

[0209] In some embodiments, the device 1000 further includes: a third acquisition module ( Fig.10 not shown).

[0210] The third acquisition module is used to obtain entity data; filter the entity data to obtain the multiple candidate entities; determine the weight information corresponding to the multiple candidate entities according to the user's behavior information for the multiple candidate entities, the behavior information is used to indicate the user's attention level to the candidate entity, and the weight information is used to indicate the popularity value of the candidate entity.

[0211] In some embodiments, the entity knowledge base also includes weight information corresponding to the multiple candidate entities, and attribute information corresponding to the multiple candidate entities. The entity knowledge base is distributed and stored in multiple storage nodes, and each of the multiple storage nodes periodically updates new candidate entities and adds them to the storage nodes.

[0212] In some embodiments, the device 1000 further includes: a fourth acquisition module ( Fig.10 not shown).

[0213] The fourth acquisition module is used to obtain a sample input text; based on the entity knowledge base, determine at least one potential sample candidate entity included in the sample input text; obtain attribute information corresponding to the at least one potential sample candidate entity, and the attribute information corresponding to the potential sample candidate entity is used to indicate the entity category of the potential sample candidate entity; determine the entity prediction result corresponding to the sample input text according to the attribute information corresponding to the sample input text and the at least one potential sample candidate entity through the entity recognition model, and the entity prediction result includes at least one predicted entity; according to the difference between the entity prediction result and the entity annotation result corresponding to the sample input text, adjust the parameters of the entity recognition model to obtain the trained entity recognition model.

[0214] In some embodiments, the entity annotation result is determined through LLM based on the sample input text, and the fourth acquisition module is used to determine a first entity annotation result based on the sample input text through a first LLM, and the first entity annotation result includes an entity and attribute information corresponding to the entity; determine a second entity annotation result based on the sample input text through a second LLM, and the second entity annotation result includes an entity and attribute information corresponding to the entity; when the first entity annotation result is consistent with the second entity annotation result, the first entity annotation result or the second entity annotation result is used as the entity annotation result corresponding to the sample input text.

[0215] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0216] Please refer to Fig.11 , which shows a structural block diagram of a computer device 1100 provided in one embodiment of the present application.

[0217] Typically, the computer device 1100 includes a processor 1110 and a memory 1120 .

[0218] The processor 1110 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1110 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1110 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1110 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1110 may also include an AI processor for processing computing operations related to machine learning.

[0219] The memory 1120 may include one or more computer-readable storage media, which may be non-transitory. The memory 1120 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1120 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned entity recognition method.

[0220] Those skilled in the art will understand that Fig.11 The structure shown in the figure does not constitute a limitation on the computer device 1100, and the computer device 1100 may include more or less components than shown in the figure, or combine some components, or adopt a different arrangement of components.

[0221] In some embodiments, a computer-readable storage medium is further provided, wherein a computer program is stored in the storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned entity recognition method.

[0222] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0223] In some embodiments, a computer program product is also provided, the computer program product comprising a computer program, the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the above-mentioned entity recognition method.

[0224] It should be noted that the collection and processing of relevant data in this application (such as candidate entities included in the entity knowledge base) should be strictly in accordance with the requirements of relevant national laws and regulations when applied in instances, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0225] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0226] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An entity recognition method, characterized in that: The method comprises: Get the first input text; Determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities; Acquire attribute information corresponding to the at least one potential candidate entity, where the attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity; At least one entity included in the first input text is determined by an entity recognition model according to attribute information respectively corresponding to the first input text and the at least one potential candidate entity.

2. The method according to claim 1, characterized in that The determining, based on the entity knowledge base, at least one potential candidate entity included in the first input text comprises: Matching the first input text with the multiple candidate entities, and determining at least one entity in the first input text included in the multiple candidate entities as at least one first entity to be selected; According to the at least one first entity to be selected, segment the first input text to obtain a first segmentation result of the first input text; The at least one potential candidate entity is determined according to the first word segmentation result.

3. The method according to claim 2, characterized in that The entity knowledge base also includes weight information corresponding to the multiple candidate entities, and the weight information is used to indicate the popularity value of the candidate entity; The determining, according to the first word segmentation result, the at least one potential candidate entity comprises: In the case that there are multiple first word segmentation results, determining at least one entity from the at least one first candidate entity according to weight information respectively corresponding to the multiple candidate entities as at least one second candidate entity; According to the at least one second entity to be selected, segment the first input text to obtain a second segmentation result of the first input text; The second word segmentation result is determined as the at least one potential candidate entity.

4. The method according to claim 3, characterized in that The determining, according to the weight information respectively corresponding to the plurality of candidate entities, at least one entity from the at least one first candidate entity as at least one second candidate entity comprises: Determine, based on the weight information respectively corresponding to the plurality of candidate entities, probability information respectively corresponding to the at least one first candidate entity, the probability information being used to indicate the probability that the first candidate entity is an entity included in the first input text; At least one entity is determined from the at least one first candidate entity according to the probability information respectively corresponding to the at least one first candidate entity as the at least one second candidate entity.

5. The method according to claim 4, characterized in that The determining, according to the weight information respectively corresponding to the plurality of candidate entities, the probability information respectively corresponding to the at least one first candidate entity comprises: Generate a directed graph of the at least one first entity to be selected, the directed graph comprising at least one node and edges between the nodes, each node is used to indicate a character in the at least one first entity to be selected, and each edge is used to indicate a relationship between characters included in the at least one first entity to be selected; Determining, according to the directed graph, path information corresponding to each of the at least one first candidate-selected entity, wherein the path information is used to indicate that the first candidate-selected entity includes other first candidate-selected entities; According to the path information respectively corresponding to the at least one first candidate-selected entity, probability information respectively corresponding to the at least one first candidate-selected entity is determined.

6. The method according to claim 5, characterized in that The path information includes quantity information, where the quantity information is used to indicate the quantity of other first to-be-selected entities included in the first to-be-selected entity; The determining, according to the path information respectively corresponding to the at least one first candidate-selected entity, probability information respectively corresponding to the at least one first candidate-selected entity comprises: According to the weight information respectively corresponding to the multiple candidate entities and the quantity information respectively corresponding to the at least one first candidate entity, the probability information respectively corresponding to the at least one first candidate entity is determined, and the quantity information is positively correlated with the probability information.

7. The method according to claim 4, characterized in that The determining at least one entity from the at least one first candidate entity as the at least one second candidate entity according to the probability information respectively corresponding to the at least one first candidate entity comprises: The maximum probability information among the probability information respectively corresponding to the at least one first candidate-selected entity is determined, and the first candidate-selected entity corresponding to the maximum probability information is determined as the second candidate-selected entity.

8. The method according to claim 2, characterized in that: The matching of the first input text with the plurality of candidate entities to determine at least one entity in the first input text included in the plurality of candidate entities as at least one first entity to be selected includes: Based on the base array and the check array of the search tree corresponding to the multiple candidate entities, the first input text is matched to determine at least one entity in the first input text included in the multiple candidate entities as the at least one first candidate entity; The base array is used to store state transfer information of each node in the search tree, the check array is used to store constraint information of state transfer, and each node in the search tree is used to indicate a character in the multiple candidate entities.

9. The method according to claim 1, characterized in that: The determining, by the entity recognition model, at least one entity included in the first input text according to the attribute information respectively corresponding to the first input text and the at least one potential candidate entity, comprises: Obtaining a text embedding corresponding to each character included in the first input text, where the text embedding refers to a vector representation determined based on semantic information of the first input text; Obtaining a word segmentation embedding corresponding to each character included in the at least one potential candidate entity, wherein the word segmentation embedding refers to a vector representation determined based on a word segmentation result for the first input text; Obtaining an attribute embedding corresponding to each character included in the at least one potential candidate entity, wherein the attribute embedding refers to a vector representation corresponding to the attribute information; At least one entity included in the first input text is determined by the entity recognition model according to the text embedding, the word segmentation embedding and the attribute embedding.

10. The method according to claim 9, characterized in that The obtaining of attribute embedding corresponding to each character included in the at least one potential candidate entity includes: For any one of the at least one potential candidate entity, if the attribute information corresponding to the potential candidate entity includes multiple entity attribute categories, the attribute embedding corresponding to each character included in the potential candidate entity is determined according to the multiple entity attribute categories.

11. The method according to claim 6, characterized in that The determining, by the entity recognition model according to the text embedding, the word segmentation embedding, and the attribute embedding, at least one entity included in the first input text comprises: Outputting attribute information of each character included in the first input text through the entity recognition model according to the text embedding, the word segmentation embedding and the attribute embedding, wherein the attribute information of the character is used to indicate the entity category of the character; At least one entity included in the first input text and attribute information corresponding to the at least one entity are determined according to attribute information of each character included in the first input text.

12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: Get entity data; Screening the entity data to obtain the multiple candidate entities; According to the user's behavior information for the multiple candidate entities, weight information corresponding to the multiple candidate entities is determined, the behavior information is used to indicate the user's attention to the candidate entities, and the weight information is used to indicate the popularity value of the candidate entities.

13. The method according to any one of claims 1 to 11, characterized in that The entity knowledge base also includes weight information corresponding to the multiple candidate entities and attribute information corresponding to the multiple candidate entities. The entity knowledge base is distributed and stored in multiple storage nodes, and each of the multiple storage nodes periodically updates new candidate entities and adds them to the storage nodes.

14. The method according to any one of claims 1 to 11, characterized in that The training method of the entity recognition model includes: Get sample input text; Based on the entity knowledge base, determining at least one potential sample candidate entity included in the sample input text; Acquire attribute information corresponding to the at least one potential sample candidate entity, where the attribute information corresponding to the potential sample candidate entity is used to indicate the entity category of the potential sample candidate entity; Determine, by the entity recognition model, an entity prediction result corresponding to the sample input text according to the attribute information corresponding to the sample input text and the at least one potential sample candidate entity, wherein the entity prediction result includes at least one predicted entity; According to the entity prediction result and the difference between the entity annotation results corresponding to the sample input text, the parameters of the entity recognition model are adjusted to obtain a trained entity recognition model.

15. The method according to claim 14, characterized in that The entity annotation result is determined by a large language model LLM according to the sample input text, and the method further includes: Determine, by a first LLM, a first entity annotation result according to the sample input text, wherein the first entity annotation result includes an entity and attribute information corresponding to the entity; Determine, by a second LLM, a second entity annotation result according to the sample input text, wherein the second entity annotation result includes an entity and attribute information corresponding to the entity; When the first entity annotation result is consistent with the second entity annotation result, the first entity annotation result or the second entity annotation result is used as the entity annotation result corresponding to the sample input text.

16. An entity recognition device, characterized in that: The device comprises: A first acquisition module, used to acquire a first input text; A first determination module is used to determine at least one potential candidate entity included in the first input text based on an entity knowledge base, wherein the entity knowledge base includes a plurality of candidate entities; A second acquisition module is used to acquire attribute information corresponding to the at least one potential candidate entity, where the attribute information corresponding to the potential candidate entity is used to indicate the entity category of the potential candidate entity; The second determination module is used to determine at least one entity included in the first input text according to the attribute information respectively corresponding to the first input text and the at least one potential candidate entity through an entity recognition model.

17. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 15.

19. A computer program product, characterized in that The computer program product comprises a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 15.

Citation Information

Cited By

  • Entity recognition method and apparatus, device, and storage medium

    WO2026082184A1