Method, device and equipment for querying data, medium and program product
By combining vector retrieval and text matching in text processing and entity popularity, the accuracy and efficiency of identifying and completing entities in the prior art are solved, and more efficient entity recognition and user experience are achieved.
Patent Information
- Application Number
- CN202411784883.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-01-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the field of text processing, it is difficult for the existing technology to efficiently identify and complete diverse entities in e-commerce and other scenarios. Especially when facing massive data, traditional methods lack dynamic and real-time nature and are difficult to deal with emerging entities. The recall rate is low and the computing resources are consumed, which affects the user experience.
By determining the input entity in the target input text, vector search and text matching are performed based on the quantitative representation, combining vector similarity and text matching, target entity is determined from the candidate entity set, and considering entity popularity, improving recognition accuracy and user experience .
It improves the accuracy of entity recognition and user query experience, can dynamically adapt to changes, update in real time, cover more entities, reduce computing resource consumption, and improve the recognition recall rate.
Smart Images

Figure CN119322839A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to the field of text processing, and more particularly to methods, devices, equipment, media, and program products for querying data. Background Art
[0002] At present, the development of the machine learning industry is becoming faster and faster. More and more different types of machine learning models have emerged and are widely used in different industries and fields. For example, vision-related models can be applied to visual inspection and intelligent driving, and language-related models can be applied to text processing and knowledge question-answering. There are also multimodal machine learning models that integrate various models with different focuses, which can be used in more complex operations that connect multiple different fields.
[0003] With the accelerated development of the machine learning industry, new technologies related to machine learning are emerging one after another, and the application scenarios of machine learning models are becoming more and more numerous. Especially in the field of text processing, the application of machine learning models is becoming more and more extensive. When processing text data, there are more and more discussions on how to apply machine learning models and how to apply machine learning models more efficiently. For large amounts of text data, applying machine learning models when processing will also encounter considerable challenges. Therefore, when faced with massive amounts of text data, how to flexibly and efficiently use machine learning models to handle related text processing tasks has become a hot research topic. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, apparatus, device, medium, and program product for querying data.
[0005] According to a first aspect of the present disclosure, a method for querying data is provided. The method includes determining an input entity in a target input text for querying. The method also includes determining a first plurality of candidate entities from a plurality of entities by performing a vector search based on a quantized representation of the input entity. The method also includes determining a second plurality of candidate entities from a plurality of entities by performing a text match based on the text for the input entity. The method also includes determining a set of vector similarities and a set of text matches corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities. The method also includes determining a set of target entities for the input entity from the candidate entity set based on a set of vector similarities and a set of text matches.
[0006] In a second aspect of the present disclosure, a device for querying data is provided. The device includes an input entity determination module, configured to determine an input entity in a target input text for query; a first plurality of candidate entity determination module, configured to determine a first plurality of candidate entities from a plurality of entities by performing vector retrieval based on a quantitative representation of the input entity; a second plurality of candidate entity determination module, configured to determine a second plurality of candidate entities from a plurality of entities by performing text matching based on the text for the input entity; a vector similarity and text matching determination module, configured to determine a set of vector similarities and a set of text matching corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities; and a set of target entity determination modules, configured to determine a set of target entities for the input entity from the candidate entity set based on a set of vector similarities and a set of text matching.
[0007] In a third aspect of the present disclosure, an electronic device is provided, comprising at least one processor; and a storage device for storing at least one program, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to the first aspect and the second aspect of the present disclosure.
[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect and the second aspect of the present disclosure is implemented.
[0009] In a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method according to the first aspect and the second aspect of the present disclosure when executed by a processor.
[0010] It should be understood that the contents described in this content section are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.
[0012] Figure 1 A schematic diagram illustrating an example environment in which the apparatus and / or methods of some embodiments of the present disclosure may be implemented; Figure 2 A schematic diagram illustrating an example method 200 for querying data according to some embodiments of the present disclosure is illustrated; Figure 3 A schematic diagram illustrating an example of a system architecture for querying data according to some embodiments of the present disclosure; Figure 4 A schematic diagram illustrating an example of a completion display for querying data according to some embodiments of the present disclosure is illustrated; Figure 5 A schematic diagram illustrating another example of a completion display for query data according to some embodiments of the present disclosure; Figure 6 A schematic diagram illustrating yet another example of a completion display for querying data according to some embodiments of the present disclosure is illustrated; Figure 7 A schematic block diagram of a device for querying data according to some embodiments of the present disclosure is illustrated; Figure 8 A schematic block diagram of an example device suitable for implementing various embodiments of the present disclosure is illustrated.
[0013] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0014] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0015] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0016] For example, when receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0017] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0018] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0021] In e-commerce application scenarios, the query input entered by users usually includes multiple types of entities, such as store names, brand names, and author nicknames. The identification and completion of these entities are crucial to improving user experience and data processing efficiency. Generally speaking, entities in e-commerce scenarios have some characteristics, such as diversity. Store names, brand names, and author nicknames are named in a variety of ways and may also contain pinyin, English, special characters, etc. Another characteristic is the high base dimension value. The number of these entities is extremely large. Store names can reach hundreds of thousands or more, and author nicknames can reach hundreds or even tens of millions or more. Characteristics such as difficulty in distinguishing. Due to the diversity and similarity of naming methods, it is difficult to achieve accurate retrieval and distinction simply by relying on literal or semantic values.
[0022] In the above traditional solutions, the following methods can be used to realize entity recognition. One method is static dictionary and rule matching, which uses pre-built static dictionaries and rule bases to match and recognize the text entered by the user. These dictionaries and rule bases usually contain common store names, brand names and author nicknames. Another method is to use a keyword-based retrieval system, using keyword retrieval technology to perform keyword matching and retrieval on the text entered by the user. These systems usually rely on technologies such as inverted indexes. Another way is classification and recognition based on machine learning, which uses machine learning models (such as support vector machines, decision trees, etc.) to classify and recognize the text entered by the user. These machine learning models usually require a large amount of data annotation for training. In addition, there is another method of named entity recognition based on machine learning, which uses machine learning models (bidirectional transformer models, bidirectional long short-term memory networks combined with conditional random fields, etc.) to recognize named entities, and then recognize and classify the text entered by the user. The above-mentioned methods have some defects. For example, they cannot dynamically adapt to changes in user input, cannot update and process newly emerged entities in real time, lack dynamism and real-time performance, and due to the large number of entities, it is difficult to cover all possible entities, resulting in low recall rate. In addition, it may be difficult to achieve accurate retrieval due to poor performance in handling diverse naming methods and semantic relationships. In addition, a large amount of computing resources will be consumed during the training and reasoning process of the machine learning model, making it difficult to apply in scenarios with high real-time requirements, reducing the user experience.
[0023] At least to solve the above and other potential problems, an embodiment of the present disclosure proposes a method for querying data. In this method, a computing device may first determine an input entity in a target input text for querying. Then, after the input entity is determined, a first plurality of candidate entities are determined from a plurality of entities by performing vector retrieval based on a quantitative representation of the input entity. Then, based on the text for the input entity, a second plurality of candidate entities are determined from a plurality of entities by performing text matching. Subsequently, after the first plurality of candidate entities and the second plurality of candidate entities are determined, a set of vector similarities and a set of text matching corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities are determined. Finally, after a set of vector similarities and a set of text matching are determined, a set of target entities for the input entity is determined from the candidate entity set. Through this method, the determined vector similarities and text matching are simultaneously used to perform entity recognition on the text input by the user, so that the accuracy of the entity recognized during the query is improved, and the user's experience when querying data is improved.
[0024] The embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. Figure 1An example environment in which the device and / or method of an embodiment of the present disclosure can be implemented is shown. In environment 100, computing device 102 is used to process computing tasks required by a user when querying data. The target input text 104 can be completely consistent with the user's input text, and the target input text 104 can also be a text after preprocessing the user's input text. Multiple entities 112 can be pre-stored in an entity library and can be updated. For example, the entity library is updated every 3 days, and new entities are added to the multiple entities 112 through updates. The first multiple candidate entities 114 and the second multiple candidate entities 116 are both part of the multiple entities 112, and the first multiple candidate entities 114 and the second multiple candidate entities 116 can overlap partially or completely.
[0025] Examples of computing device 102 include, but are not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant (PDA), a media player, etc.), a multiprocessor system, consumer electronics, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like.
[0026] First, in Figure 1 In the environment 100, the computing device 102 first determines the input entity 106 in the target input text 104 for query. When querying data, when the user enters the page for querying data and inputs the input text for querying, the computing device 102 first obtains the input interface identifier corresponding to the page for querying data, and the input interface identifier can correspond to a scene.
[0027] For example, the computing device 102 determines the input interface identifier corresponding to the page of the query data currently entered by the user, and further obtains the scene corresponding to the input interface identifier and the entity category and prompt text for the scene according to the determined input interface identifier. The types and quantities of entity categories vary according to the corresponding scenes.
[0028] After obtaining the prompt text, entity category, and target input text 104 , they may be applied to a machine learning model to determine the input entity 106 in the target input text 104 .
[0029] The computing device 102 then determines a first plurality of candidate entities 114 and a second plurality of candidate entities 116 from the plurality of entities 112 based on the quantified representation 108 and the text 110 determined by the input entity 106. The first plurality of candidate entities 114 and the second plurality of candidate entities 116 may form a candidate entity set 120.
[0030] Subsequently, the computing device 102 can use the input entity and the candidate entity set 120 to determine a set of vector similarities 118 and a set of text matches 122. The set of vector similarities 118 indicates the similarity between the candidate entities in the candidate entity set 120 and the vectors of the input entity 106, and the set of text matches 122 indicates the similarity between the candidate entities in the candidate entity set 120 and the text of the input entity 106.
[0031] Finally, the computing device 102 selects a set of target entities 124 corresponding to the input entity 106 from the candidate entity set 120 according to a set of vector similarities 118 and a set of text matches 122 .
[0032] Additionally, in addition to determining a set of target entities 124 based on a set of vector similarities 118 and a set of text matches 122, a set of target entities 124 corresponding to the input entity 106 may also be determined by comprehensively judging the heat of the candidate entities in the candidate entity set 120.
[0033] Through this method, the determined vector similarity and text matching are used to perform entity recognition on the text input by the user. The popularity index of entities among multiple entities can also be considered to further determine the high-popularity entities among multiple entities, thereby improving the accuracy of entities recognized during queries and improving the user experience when querying data.
[0034] Combined with the above Figure 1 A schematic diagram of an example environment in which the devices and / or methods of some embodiments of the present disclosure may be implemented is described below. Figure 2 A schematic diagram depicting an example method 200 for querying data according to some embodiments of the present disclosure. The example method may be performed by Figure 1 Executed by computing device 102 or any suitable device.
[0035] like Figure 2 As shown, in the example method 200, at block 202, the computing device 102 determines an input entity in a target input text for a query. For a target input text for a query, an input entity in the target input text may be determined during the input process so that similar entities may be retrieved for user selection or reference.
[0036] In some embodiments, the target input text 104 may be completely consistent with the user's input text, and the target input text 104 may also be a text obtained by preprocessing the user's input text.
[0037] Preprocessing may include text normalization. By using text normalization to process the user's original input text, the recognition of the input entity 106 can be made more accurate and more efficient. For example, the user's original input text is "xx store's latest...product", then after the text normalization step in the preprocessing, the target input text 104 can be normalized to "xx store's latest product". Through text normalization, the redundant spaces and special characters in the user's original input text are removed. In some embodiments, when the user's original input text includes English text in addition to Chinese text. For example, the user's original input text is "XxxXx brand" and a letter in it is mistakenly capitalized, then after text normalization, the target input text 104 becomes "xxxxx brand".
[0038] In some embodiments, after the user's original input text is normalized, the normalized input text may be segmented, and a group of segments for the normalized input text may be generated after the segmentation. After determining a group of segments, the phonetic attribute and radical attribute of each segmented word may be further determined, and the phonetic attribute and radical attribute may be used for subsequent error correction processing of the input text.
[0039] In some embodiments, a feature extraction process is also performed on a determined group of words to determine feature information for the input text, wherein the determined feature information includes at least one of the following: word frequency or part of speech. Additionally, word frequency can be determined using a BM-25 (Best Matching 25) retrieval algorithm or a term frequency-inverse document frequency (TF-IDF) algorithm. Part of speech can be determined using a part-of-speech tagging algorithm such as a hidden Markov model (HMM), conditional random fields (CRFs), etc. Other algorithms can also be used to determine word frequency or part of speech, and this application is not limited thereto.
[0040] Before performing error correction processing on the input text, a hot predetermined entity set may be determined first, which is used to indicate some entities that are currently frequently used. For example, in the current e-commerce scenario, the predetermined entity set may include predetermined entities such as store names and brand names.
[0041] After the predetermined entity set is determined, the predetermined entities in the predetermined entity set and the predetermined phonetic attributes and the predetermined radical attributes for each of the plurality of predetermined entities are further determined. Subsequently, the segmented words in the input text can be corrected according to the phonetic attributes and the radical attributes of the segmented words in a group of segmented words in the input text and the predetermined phonetic attributes and the predetermined radical attributes of the predetermined entities in the predetermined entity set.
[0042] Additionally, the computing device 102 can determine the first similarity between the phonetic attribute of the segmentation and the predetermined phonetic attribute of the predetermined entity, for example, by calculating the Jaro distance to determine the similarity. The computing device can also determine the second similarity between the radical attribute of the segmentation and the predetermined radical attribute of the predetermined entity, for example, using the vector of the radical to search and calculate the similarity using the hierarchical navigation small world algorithm. And after determining the first similarity and the second similarity, then determine the similarity between the segmentation and the predetermined entity. For example, the two similarities can be weighted to determine the similarity between the segmentation and the predetermined entity. Additionally, when the similarity is higher than a predetermined threshold, the segmentation can be corrected, for example, the predetermined entity with a similarity higher than a predetermined threshold replaces the original segmentation. Alternatively, the predetermined entity can also be provided to the user to determine whether to replace the original segmentation by the user.
[0043] In one example, the computing device 102 may directly replace the segmentation with a predetermined entity with the highest similarity among the predetermined entities with similarity higher than a threshold. In another example, if the computing device 102 determines that there are multiple predetermined entities with similarity higher than a threshold, the multiple determined predetermined entities are sorted from high to low according to similarity, and the sorted predetermined entities are presented to the user, who may select them by himself, and after the selection is completed, press the "Tab" key on the keyboard to determine to replace the original segmentation with the selected predetermined entity.
[0044] In some embodiments, whenever a user enters a query page to query data, the computing device 102 will determine the input interface identifier associated with the target input text. Different input interface identifiers may have different application scenarios. For example, the input interface identifier may be A, which may be in an e-commerce scenario, and the input interface identifier may be B, which may be in a knowledge question and answer scenario.
[0045] After the computing device 102 determines the input interface identifier, it will further determine the corresponding scene and the entity category and prompt text for the scene based on the determined input interface identifier. Among them, the types and quantities of entity categories vary according to different scenarios and can be updated in real time. For example, the types and quantities of entity categories will be updated every 3 days, and the new entity categories and corresponding quantities generated will be added to the repository for storing these data. The prompt text is also automatically generated according to different scenarios, used to describe fixed task information, and has a fixed output format, and will also change dynamically according to different scenarios.
[0046] The computing device can then apply the determined prompt text, entity category, and target input text to the machine learning model to determine the input entity in the target input text. Additionally, the computing device 102 only determines the input entity in the target input text with a heat value higher than a predetermined value, and does not recognize the input entity with a heat value lower than the predetermined value, so as to save computing resources and improve recognition efficiency.
[0047] In some embodiments, the machine learning model used to determine the input entity is specifically fine-tuned and trained to handle scenarios corresponding to the input interface identifier, such as a language model that is specifically fine-tuned and trained to handle e-commerce scenarios.
[0048] In some embodiments, after an input entity in the target input text is determined, it will be highlighted, for example, by highlighting it with a bold dashed line below the input entity, or by framing the edge of the input entity to highlight the determined input entity.
[0049] At block 204, a first plurality of candidate entities are determined from the plurality of entities by performing a vector search based on the quantized representation of the input entity. The computing device 102 may first determine an input quantized representation corresponding to the input entity and a plurality of quantized representations corresponding to the plurality of entities, and then determine a group of quantized representations similar to the input quantized representation from the determined plurality of quantized representations. Additionally, a group of quantized representations having a high similarity to the input quantized representation may be determined from the plurality of quantized representations based on vector similarity.
[0050] For example, an algorithm for determining vector similarity can be used to determine a set of quantized representations that are similar to the input quantized representation. For example, a hierarchical navigable small-world graph algorithm is used to determine some of the quantized representations in multiple quantized representations as a set of quantized representations that are similar to the input quantized representation. Other vector retrieval algorithms can also be used to implement this process, which is not limited here. For example, vector similarity is defined as a closed interval of 0-1, where 0 represents complete dissimilarity and 1 represents complete similarity, that is, the same. Then, the vectors in multiple quantized representations whose vector similarity to the input quantized representation is greater than or equal to 0.8 are determined as a set of quantized representations that are similar to the input quantized representation.
[0051] Subsequently, the computing device 102 determines candidate entities corresponding to a group of quantized representations that are determined to be similar to the input quantized representation as a first plurality of candidate entities.
[0052] At block 206 , a second plurality of candidate entities are determined from the plurality of entities by performing text matching based on the text for the input entity. At this point, computing device 102 may determine a degree of matching between the text corresponding to the input entity and the text corresponding to each of the plurality of entities.
[0053] When determining the degree of text matching, some traditional text matching algorithms such as BM-25 BestMatching 25) retrieval algorithm or term frequency-inverse document frequency (TF-IDF) algorithm can be used. It is understandable that other algorithms capable of implementing text matching can also be used to determine the degree of text matching, and this application does not limit this.
[0054] In some embodiments, the text matching degree is defined as a closed interval of 0-1, where 0 represents complete dissimilarity and 1 represents complete similarity, that is, the same. Then, the text matching degree greater than or equal to 0.9 among the multiple matching degrees is determined as a second plurality of candidate entities similar to the input entity. Subsequently, the computing device 102 determines some of the multiple entities that match the input entity text as the second plurality of candidate entities. At box 208, the computing device 102 determines a set of vector similarities and a set of text matches corresponding to the candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities. In order to better determine the entity corresponding to the input entity in the target input text, it is necessary to further calculate a set of vector similarities and a set of text matches corresponding to the input entity and the candidate entity set.
[0055] In some embodiments, after determining the first plurality of candidate entities and the second plurality of candidate entities, the computing device 102 combines the first plurality of candidate entities and the second plurality of candidate entities into a candidate entity set. The computing device 102 may determine the first plurality of quantized representations of the first plurality of candidate entities to determine a set of vector similarities corresponding to the input quantized representations, and may also determine a set of text matching degrees corresponding to the second plurality of texts of the second plurality of candidate entities and the text of the input entity, for example, the similarity calculated when selecting the candidate entities above may be used.
[0056] At block 210, a set of target entities for the input entity is determined from the candidate entity set based on a set of vector similarities and a set of text matches. In some embodiments, the computing device 102 may perform a weighted operation based on a previously determined set of vector similarities and a set of text matching degrees to determine a set of scores for the candidate entity set, and determine a set of target entities for the input entity from the candidate entity set based on the determined set of scores.
[0057] Additionally, before performing the weighting operation, the query heat corresponding to the candidate entity set may be determined first, and the query heat is used to indicate how frequently the candidate entities in the candidate entity set are queried. In one example, the query heat may be determined based on the search volume of the candidate entity. In another example, the query heat may be determined based on the page views of the candidate entity. In yet another example, the query heat may be determined based on the frequency of occurrence of the candidate entity within a predetermined time interval, for example, the query heat of the candidate entity may be determined based on the average number of times the candidate entity has been queried per day in the past three days. In some embodiments, the query heat of the candidate entity may be determined based on a comprehensive judgment of the search volume, page views, and frequency of occurrence of the candidate entity within a predetermined time interval mentioned above.
[0058] In some embodiments, after the input entity in the target input text is determined and highlighted, a group of target entities can be displayed when the cursor hovers over the input entity. In one example, a group of target entities is displayed above the input entity. In another example, when the content of a group of target entities is too long, a group of target entity content is scrolled and displayed in the target area.
[0059] In some embodiments, a group of target entities may include only one target entity. In other embodiments, a group of target entities may include multiple target entities.
[0060] Through this method, the determined vector similarity and text matching are used to perform entity recognition on the text input by the user. The popularity index of entities among multiple entities can also be considered to further determine the high-popularity entities among multiple entities, thereby improving the accuracy of entities recognized during queries and improving the user experience when querying data.
[0061] Combined with the above Figure 2 A schematic diagram of an example method for querying data according to some disclosed embodiments is described. Figure 3 A schematic diagram depicting an example of a system architecture for querying data according to some embodiments of the present disclosure.
[0062] like Figure 3 As shown in example 300, after the user enters text in the search engine, the computing device starts a processing flow for the entered text. Figure 3 The illustrated process may be performed in computing device 102 or any suitable computing device.
[0063] In example 300, first, the computing device 102 inputs the input text to the input processing module 302. After the input processing module receives the input text, it pre-processes the input text. The pre-processing of the text is generally to facilitate the subsequent application of the text data to the machine learning model more efficiently and effectively, and to improve the efficiency of querying the data.
[0064] In the process of preprocessing the user's input text, the input text is first normalized 304. The text normalization process can remove redundant spaces in the input text, and when there are English letters in the input text, the upper and lower case letters of the English letters can be converted. For example, if the input text is "How is the weather today", after text normalization, the processing result obtained is "How is the weather today".
[0065] In some embodiments, in addition to removing spaces and converting uppercase and lowercase letters, punctuation marks in the input text can also be standardized, such as processing full-width and half-width conversions, and processing the mixing of Chinese and English punctuation marks. It is also possible to process the conversion between Arabic numerals and Chinese numerals, and process the standardization of special numerical forms such as scientific notation and fractions. In other embodiments, it is also possible to convert simplified and traditional Chinese characters, unify variant forms, process special characters, etc.
[0066] In the text normalization process for the input text, different text normalization methods or tools may be used. Any other method or tool capable of achieving text normalization may also be used, and this application does not limit this.
[0067] In the process of preprocessing the user's input text, the input text also needs to be segmented 306. In this process, the input text is segmented, and a word sequence for the input text is generated according to the result of the segmentation.
[0068] For example, if the user inputs the text "xx's concert date", the input text will be divided into three words "xx", "concert", and "date" during word segmentation, and the words will be sorted in order to generate a word sequence for the input text. In addition, the way to sort the words is defined by the user, for example, they can be sorted in the order in which they appear in the input text, or they can be sorted by the first letter of the pinyin.
[0069] Additionally, during the word segmentation process, the text input by the user may be segmented according to the previous word segmentation history records, which include information such as the user's input habits, the text often input by the user, and the user's query field.
[0070] In the process of preprocessing the user's input text, it is also necessary to perform feature extraction 308 on the input text. By extracting the word frequency, part of speech, etc. of the input text, it is convenient to subsequently apply the text features to the machine learning model to improve the efficiency of querying data.
[0071] In some embodiments, a dictionary library can be established, which contains all the words in the training corpus used to train the machine learning model, and each word corresponds to a unique identifier. One-hot encoding can be used to indicate whether the words in the input text exist in the dictionary library, so as to facilitate feature extraction of the input text.
[0072] In some embodiments, for extracting the word frequency of the input text, a BM-25 (Best Matching 25) retrieval algorithm or a term frequency-inverse document frequency (TF-IDF) algorithm may be used to extract features of the word frequency of the input text.
[0073] In some embodiments, for extracting the part of speech of the input text, a part of speech tagging algorithm can be used to tag the part of speech, thereby achieving effective extraction of the part of speech. The part of speech tagging algorithm that can be used is such as Hidden Markov Model (HMM), Conditional Random Fields (CRFs), etc.
[0074] During the text normalization process, the input text also needs to be processed for phonetic spelling 310. The phonetic spelling input is processed by converting the input text into phonetic spelling.
[0075] For example, convert the input text "recent news" into its pinyin form "zui jin de xin wen". When the input text is in simplified Chinese, usually the input text can be converted into pinyin form according to the original encoding method of the input text.
[0076] In some actual examples, when the input text is in simplified Chinese and the encoding method of the input text is GB2312, since the encoding method of GB2312 is a 16-bit encoding method, each simplified Chinese character in the input text can have its encoding represented in decimal every 8 bits. For example, "啊" can be represented as [176 | 161] in a two-dimensional coordinate system, and "我" can be represented as [206 | 210]. Then, each simplified Chinese character can be located through the two-dimensional coordinates, and a two-dimensional table can be established to realize the correspondence between Chinese and pinyin, thus realizing the conversion from simplified Chinese to pinyin.
[0077] In the process of preprocessing the user's input text, it is also necessary to perform error correction on the input text 312. By correcting the input text, the accuracy of the input text is ensured, the user's input errors are corrected, and the deviation of the processing result caused by the user's input errors is avoided.
[0078] In some embodiments, the error correction for the input text queried by the user can be performed by using one of the algorithms in the edit distance algorithm, Jaro-Winkler, to calculate the similarity between the input text and a predetermined entity. If the similarity is inconsistent, the input text needs to be corrected so that the input text is the same as the predetermined entity.
[0079] When calculating the similarity between the input text and the predetermined entity, the literal distance between the input text and the predetermined entity can be calculated by using the Jaro-Winkler algorithm. The calculation method is shown in formula (1):
[0080] where, is the length of the string , m is the number of matching characters, and t is the number of character conversions. Only when and have the same characters and the distance does not exceed will the two characters be considered matching.
[0081] In the process of text normalization, it is also necessary to perform homophone processing on the input text 314. Processing the homophones in the input text is to avoid wrongly confusing the input of homophones with different meanings when inputting the text. For example, when the input text is "Avoid making mistakes again when writing", where "在" and "再" are homophones.
[0082] In some embodiments, during the training of a machine learning model, training on semantic understanding of text context can be enhanced. The machine learning model can be trained using both incorrect samples and correct samples, and hyperparameters can be adjusted to achieve better performance in understanding context, so as to facilitate subsequent processing of homophones in the input text and improve the error correction accuracy.
[0083] During the preprocessing of the user's input text, it is also necessary to perform radical classification processing 316 on the input text. For Chinese characters, each character contains a radical, and different radicals can be used to form different Chinese characters.
[0084] In some embodiments, radical classification processing can be performed by processing each character in the input text. For example, for simplified Chinese characters, the radical can be taken from the left, top, or outside. For example, the radical of "彬" is the left "木", and the radical of "问" is "门". If the left, top, or outside is not a radical, then the right or bottom position is taken as the radical. For example, the radical of "颖" is "页", and the radical of "染" is "木". If none of the above positions are radicals, then the radical is taken from the side position in the order of left first and then right, top first and then bottom. For example, the radical of "赜" is "贝", and the radical of "嬴" is "月". Radical classification processing can increase the accuracy of recognizing complex characters and is beneficial to the correctness and effectiveness of text standardization.
[0085] After the preprocessing of the input text is completed, the computing device starts dynamic recognition of a set of candidate entities. In the dynamic recognition module 318, when starting the dynamic recognition of a set of candidate entities, it is necessary to first perform dynamic configuration of the predefined categories 320.
[0086] For example, in the case of an e-commerce scenario, the predefined categories can be stores, nicknames of store owners, brand names, product categories, etc.
[0087] The computing device 102 first obtains the input interface identifier corresponding to the preprocessed target input text, generates a prompt text 322, the entity categories of the scenario corresponding to the input interface identifier based on the input interface identifier, and further applies the generated prompt text, entity categories, and the target input text to the machine learning model to determine the entities in the target input text.
[0088] Among them, in the model loading 324 stage, a model specifically used to process tasks related to the scenario corresponding to the input interface identifier can be selected. For example, if the scenario is e-commerce, then in the model loading stage, a language model trained and fine-tuned using data related to the e-commerce scenario is selected for processing.
[0089] Then, after the model is added, the input prompt text, entity category and target input text are encoded using the text encoding 326 function in the language model, thereby achieving entity recognition 328 for the target input text.
[0090] Additionally, dynamic recognition is performed after the input text is preprocessed. Dynamic recognition can also be performed directly on the input text without preprocessing the input text in advance.
[0091] After entity recognition is performed on the target input text, further processing is required at the multi-way recall module 330 in order to further determine a set of target entities.
[0092] First, embedding generation 332 is performed for input entities in the target input text, that is, input quantized representations for the input entities are determined, and then vector retrieval 334 is performed among multiple entities, and a first plurality of quantized representations similar to the input quantized representations are determined from multiple quantized representations corresponding to the multiple entities, and a group of entities corresponding to the first plurality of quantized representations are determined as first plurality of candidate entities. A group of vector similarities is determined based on the multiple quantized representations of the first plurality of candidate entities and the input quantized representation.
[0093] Subsequently, a literal match 336, i.e., text matching, is performed to determine a group of entities in the plurality of entities that are similar to the entity corresponding to the input text as a second plurality of candidate entities through text matching, and a set of text matching degrees is determined based on the matching degree of each entity in the second plurality of candidate entities with the entity of the input text.
[0094] Additionally, a popularity recall 338 is performed to determine the popularity of the candidate entities in the candidate entity set. The popularity indicates how frequently the candidate entities are queried, and the popularity can be determined based on one or more of the search volume, the browsing volume, or the frequency of occurrence within a predetermined time interval of the candidate entities.
[0095] Finally, a set of scores for the candidate entity set is determined based on the multi-way fusion scoring 348. In one example, a set of vector similarities and a set of text matching degrees can be used to perform a weighted operation to determine a set of scores for the candidate entity set to determine a set of target entities. In another example, a set of scores for the candidate entity set can also be determined by weighting the heat of the candidate entity, a set of vector similarities, and a set of text matching degrees.
[0096] Finally, after a group of target entities are determined, the determined group of target entities can be displayed using a completion display module 340 to perform real-time processing 342 on the group of target entities, such as performing a real-time online search to determine completion display information for the group of target entities.
[0097] In some embodiments, a group of target entities may be highlighted during real-time processing, such as by underlining 344 , and then, when the cursor is positioned over the group of target entities, completion suggestions 346 for the group of target entities may be displayed.
[0098] Combined with the above Figure 3 A schematic diagram of an example of a system architecture for querying data according to some disclosed embodiments is described. Figure 4 A schematic diagram describing an example of a completion display for querying data according to some embodiments of the present disclosure.
[0099] like Figure 4 As shown, in example 400, when the user enters the text "gmv of anchor A in the last 7 days" in the search box 408, the input entity "anchor A" 406 in the input text is identified as the target entity, and "anchor A" 406 is highlighted with an underline.
[0100] Subsequently, after real-time processing by the search engine, such as real-time online search or real-time retrieval from a local database, suggestions related to "anchor A" are displayed in box 402, wherein a completion suggestion 404 is displayed.
[0101] Additionally, the attributes corresponding to "Host A" are also displayed in the completion suggestion, that is, the attribute of "Host A" is "user / expert".
[0102] Combined with the above Figure 4 A schematic diagram of an example of a complete display for querying data according to some disclosed embodiments is described. Figure 5 A schematic diagram describing another example of a completion display for query data according to some embodiments of the present disclosure.
[0103] like Figure 5 As shown, in example 500, when the user enters the text "gmv of x group in the last 7 days" in the search box 508, the input entity "x group" 506 in the input text is identified as a target entity and is also underlined and highlighted.
[0104] It can be seen that the completion suggestion 504 related to "x Group" is also displayed in the frame 502, and the attribute of "x Group recently cleared out a high-end sports store" is determined as a fact in the completion suggestion 504.
[0105] In some embodiments, there may be one completion suggestion. In other embodiments, there may be more than one completion suggestion.
[0106] Combined with the above Figure 5 A schematic diagram of another example of a complete display for querying data according to some embodiments of the present disclosure is described. Figure 6 A schematic diagram describing yet another example of a completion display for querying data according to some embodiments of the present disclosure.
[0107] like Figure 6 As shown, in example 600, when the user enters the text "the order quantity of xx wine in this week's order quantity" in the search box 610, the input entity "xx wine" 608 in the input text is identified as the target entity and is also underlined and highlighted.
[0108] It can be seen that the completion suggestion 604 "xx wine stock price" and the completion suggestion 606 "xx wine" related to "xx wine" are also displayed in the box 602 of the suggestions related to "xx wine". And the attribute of the completion suggestion 604 is determined to be information, and the attribute of the completion suggestion 606 is determined to be brand.
[0109] In some embodiments, the selection of the completion suggestion can be determined by moving the cursor. In other embodiments, the selection of the completion suggestion can be switched by pressing the "Tab" key.
[0110] like Figure 7 As shown, the device 700 includes an input entity determination module 702, which is configured to determine an input entity in a target input text for query; a first plurality of candidate entity determination module 704, which is configured to determine a first plurality of candidate entities from a plurality of entities by performing vector retrieval based on a quantitative representation of the input entity; a second plurality of candidate entity determination module 706, which is configured to determine a second plurality of candidate entities from a plurality of entities by performing text matching based on the text for the input entity; a vector similarity and text matching determination module 708, which is configured to determine a set of vector similarities and a set of text matching corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities; and a set of target entity determination module 710, which is configured to determine a set of target entities for the input entity from the candidate entity set based on a set of vector similarities and a set of text matching.
[0111] In some embodiments, the input entity determination module 702 includes: an input interface identifier determination module, configured to determine the input interface identifier associated with the target input text; a scene and entity category and prompt text acquisition module, configured to acquire the scene corresponding to the input interface identifier and the entity category and prompt text for the scene based on the input interface identifier; and an input entity determination module, configured to determine the input entity in the target input text by applying the prompt text, entity category and target input text to a machine learning model.
[0112] In some embodiments, the machine learning model is a language model fine-tuned using data relevant to the scenario.
[0113] In some embodiments, the first plurality of candidate entity determination module 704 includes: an input quantitative representation and multiple quantitative representation determination module, configured to determine an input quantitative representation of an input entity and multiple quantitative representations corresponding to multiple entities; a group of quantitative representation determination module, configured to determine a group of quantitative representations similar to the input quantitative representation from multiple quantitative representations; and a first plurality of candidate entity determination module, configured to determine the candidate entities corresponding to the group of quantitative representations as the first plurality of candidate entities.
[0114] In some embodiments, the group of quantized representation determining module includes: a hierarchical navigable small-world graph algorithm application module configured to determine a group of quantized representations similar to the input quantized representation from multiple quantized representations by utilizing a hierarchical navigable small-world graph algorithm.
[0115] In some embodiments, the second plurality of candidate entity determination module 706 includes: a text matching degree determination module, configured to determine the matching degree between the text of the input entity and the text of each entity in a plurality of entities; and a second plurality of candidate entity selection module, configured to select a second plurality of candidate entities from a plurality of entities based on a plurality of matching degrees for the plurality of entities.
[0116] In some embodiments, a set of target entity determination modules 710 includes: a set of query heat determination modules, configured to determine a set of query heats corresponding to a set of candidate entities, the query heat indicating how frequently an entity is queried; and a set of target entity determination modules, configured to determine a set of target entities for an input entity from the set of candidate entities based on a set of vector similarities, a set of text matches and a set of query heats.
[0117] In some embodiments, a set of target entity determination modules includes: a set of score determination modules, configured to determine a set of scores for a set of candidate entities by performing weighted operations on a set of vector similarities, a set of text matches, and a set of query heats; and a set of target entity determination modules, configured to determine a set of target entities for an input entity from the set of candidate entities based on the set of scores.
[0118] In some embodiments, the query heat includes at least one of the following: the search volume, the browsing volume, or the occurrence frequency of the candidate entity within a predetermined time interval.
[0119] In some embodiments, the device 700 also includes: a normalization processing module, configured to perform normalization processing on the input text to generate a normalized input text; a word segmentation processing module, configured to perform word segmentation processing on the normalized input text to generate a group of words for the input text; a pinyin attribute and radical attribute determination module, configured to determine the pinyin attributes and radical attributes of the words in a group of words; and an error correction processing module, configured to perform error correction processing on the input text based on the pinyin attributes and radical attributes to determine the target input text.
[0120] In some embodiments, the normalization processing module includes: an extra space removal module configured to remove extra spaces in the input text; or a case conversion module configured to convert the case of text in the input text.
[0121] In some embodiments, the apparatus 700 further comprises: a feature information determination module configured to determine feature information of the input text by processing a group of words; and wherein the feature information comprises at least one of the following: word frequency or part of speech.
[0122] In some embodiments, the error correction processing module includes: a predetermined entity combination determination module, configured to determine a predetermined entity set, the predetermined entity set including multiple predetermined entities and predetermined pinyin attributes and predetermined radical attributes for each of the multiple predetermined entities; and an error correction processing module, configured to perform error correction processing on the input text based on the pinyin attributes, radical attributes, predetermined pinyin attributes and predetermined radical attributes.
[0123] In some embodiments, the error correction processing module includes: a first similarity determination module, configured to determine a first similarity between a pinyin attribute and a predetermined pinyin attribute; a second similarity determination module, configured to determine a second similarity between a radical attribute and a predetermined radical attribute; a similarity determination module, configured to determine the similarity between a word segment and a predetermined entity based on the first similarity and the second similarity; and an error correction processing module, configured to perform error correction processing on the word segment using a predetermined entity in response to the similarity being higher than a predetermined threshold.
[0124] In some embodiments, the device 700 also includes: a highlight display module configured to highlight the input entity; and a group of target entity display module configured to display a group of target entities for the input entity in response to receiving a hover operation of the cursor on the input entity.
[0125] Figure 8 A schematic block diagram of an example device 800 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The computing device 102 in the embodiment can be implemented by using the device 800. As shown in the figure, the device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0126] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks. High pitch technique, voice training, articulation, breathing, falsetto and correct singing method 2.
[0127] The various processes and processing described above, such as the example method 200 and examples 300 to 600, may be performed by the processing unit 801. For example, in some embodiments, the example method 200 and examples 300 to 600 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU 801, one or more actions of the example method 200 and examples 300 to 600 described above may be performed.
[0128] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0129] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive lists) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer-readable storage medium used herein is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0130] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0131] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0132] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0133] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0134] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0135] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0136] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for querying data, comprising: determining an input entity in a target input text for a query; Based on the quantized representation of the input entity, determining a first plurality of candidate entities from a plurality of entities by performing a vector search; Based on the text of the input entity, determining a second plurality of candidate entities from the plurality of entities by performing text matching; determining a set of vector similarities and a set of text matches corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities; as well as Based on the set of vector similarities and the set of text matching degrees, a set of target entities for the input entity is determined from the candidate entity set.
2. The method according to claim 1, wherein determining an input entity in a target input text for query comprises: Determining an input interface identifier associated with the target input text; Acquire, based on the input interface identifier, a scene corresponding to the input interface identifier and an entity category and a prompt text for the scene; as well as The input entity in the target input text is determined by applying the prompt text, the entity category, and the target input text to a machine learning model.
3. The method of claim 2, wherein the machine learning model is a language model fine-tuned using data related to the scenario.
4. The method according to claim 1, wherein determining a first plurality of candidate entities from a plurality of entities by performing vector retrieval comprises: determining an input quantized representation of the input entity and a plurality of quantized representations corresponding to the plurality of entities; determining from the plurality of quantized representations a set of quantized representations similar to the input quantized representation; as well as Candidate entities corresponding to the set of quantized representations are determined as the first plurality of candidate entities.
5. The method of claim 4, wherein determining a set of quantized representations similar to the input quantized representation from the plurality of quantized representations comprises: A set of quantized representations similar to the input quantized representation is determined from the plurality of quantized representations by utilizing a hierarchical navigable small-world graph algorithm.
6. The method according to claim 1, wherein determining a second plurality of candidate entities from the plurality of entities by performing text matching comprises: determining a degree of match between text of the input entity and text of each of the plurality of entities; as well as The second plurality of candidate entities are selected from the plurality of entities based on a plurality of matching degrees for the plurality of entities.
7. The method according to claim 1, wherein determining a set of target entities for the input entity from the set of candidate entities comprises: Determining a set of query heats corresponding to the candidate entity set, the query heats indicating how frequently an entity is queried; as well as Based on the set of vector similarities, the set of text matching degrees, and the set of query heats, a set of target entities for the input entity is determined from the candidate entity set.
8. The method according to claim 7, wherein determining a set of target entities for the input entity from the candidate entity set based on the set of vector similarities, the set of text matching degrees and the set of query heats comprises: Determine a set of scores for the candidate entity set by performing a weighted operation on the set of vector similarities, the set of text matching degrees, and the set of query heats; as well as Based on the set of scores, a set of target entities for the input entity is determined from the set of candidate entities.
9. The method according to claim 8, wherein the query heat includes at least one of the following: The search volume, pageview volume or appearance frequency of the candidate entity within a predetermined time interval.
10. The method according to claim 1, further comprising: Normalizing the input text to generate normalized input text; Performing word segmentation processing on the normalized input text to generate a group of words for the input text; Determine the phonetic attribute and radical attribute of the participle in the group of participles; as well as The input text is subjected to error correction processing based on the pinyin attribute and the radical attribute to determine the target input text.
11. The method according to claim 10, wherein normalizing the input text to generate the normalized input text comprises at least one of the following: Remove extra spaces from the input text; or Convert the case of text in the input text.
12. The method according to claim 10, further comprising: Determining feature information of the input text by processing the group of words; and The feature information includes at least one of the following: word frequency or part of speech.
13. The method according to claim 10, wherein performing error correction processing on the input text based on the pinyin attribute and the radical attribute comprises: Determine a predetermined entity set, the predetermined entity set comprising a plurality of predetermined entities and a predetermined phonetic attribute and a predetermined radical attribute for each of the plurality of predetermined entities; as well as Based on the pinyin attribute, the radical attribute, the predetermined pinyin attribute and the predetermined radical attribute, error correction processing is performed on the input text.
14. The method according to claim 13, wherein based on the pinyin attribute, the radical attribute, the predetermined pinyin attribute and the predetermined radical attribute, performing error correction processing on the input text comprises: Determining a first similarity between the pinyin attribute and the predetermined pinyin attribute; Determining a second similarity between the radical attribute and the predetermined radical attribute; Determining the similarity between the word segment and the predetermined entity based on the first similarity and the second similarity; and In response to the similarity being higher than a predetermined threshold, the predetermined entity is used to perform error correction processing on the word segmentation.
15. The method according to claim 1, further comprising: highlighting the input entity; as well as In response to receiving a hover operation of a cursor over the input entity, a group of target entities for the input entity are displayed.
16. A device for querying data, comprising: An input entity determination module, configured to determine an input entity in a target input text for query; A first plurality of candidate entity determination module is configured to determine a first plurality of candidate entities from a plurality of entities by performing vector retrieval based on the quantized representation of the input entity; A second plurality of candidate entity determination module is configured to determine a second plurality of candidate entities from the plurality of entities by performing text matching based on the text of the input entity; a vector similarity and text matching determination module configured to determine a set of vector similarities and a set of text matching corresponding to a candidate entity set formed by the first plurality of candidate entities and the second plurality of candidate entities; as well as A group of target entity determination modules is configured to determine a group of target entities for the input entity from the candidate entity set based on the group of vector similarities and the group of text matching degrees.
17. An electronic device comprising: at least one processor; as well as A storage device, used to store at least one program, when the at least one program is executed by the at least one processor, so that the at least one processor implements the method according to any one of claims 1-15.
18. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 15 when executed by a processor.
19. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Method and device for standardizing medical nonstandard names
CN109949938A
Named entity recognition system and method, electronic equipment and medium
CN114048748A
Chinese wrongly written character correction data enhancement method and device, equipment and medium
CN117313710A
Entity matching method and system based on combination of multiple strategies and multiple large language models
CN118467606A
Entity search method, and fine tuning method, device and equipment of large language model
CN118733633A