Speech retrieval method, system and medium based on semantic analysis and high-dimensional modeling
By synchronizing the data between the basic database and the retrieval database, and utilizing multidimensional semantic tags and text data models, combined with text retrieval methods based on statistical data, semantic embedding, and context embedding, the problem of missing context information in existing voice retrieval has been solved. This has enabled fast and accurate retrieval of hundreds of millions of data points, improving the accuracy and efficiency of text retrieval.
Patent Information
- Application Number
- CN202310131020.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-02-17
AI Technical Summary
Existing voice retrieval technologies cannot effectively consider contextual information in text retrieval, have simple data dimensions, poor query results, lack multi-dimensional high-strain condition queries, have insufficient single-path search performance, cannot support large-scale data search, and data synchronization has a significant impact on business logic.
By synchronizing the data between the basic database and the retrieval database, filtering conditions are generated using multidimensional semantic tags and text data models. Text recall is performed by combining statistical data, semantic embedding, and contextual embedding. Recall processing is carried out using a dual-tower model and a BiLSTM model. Efficient retrieval is achieved through heterogeneous data synchronization and the construction of rich semantic tags.
It improves the accuracy and efficiency of text retrieval, supports fast and accurate retrieval of hundreds of millions of data points, solves the problem of missing contextual information, and enhances the performance and accuracy of multi-turn conversational text retrieval.
Smart Images

Figure CN116361416B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to a voice retrieval method and system based on semantic analysis and high-dimensional modeling, and a medium. BACKGROUND
[0002] With the rapid development of natural language processing, there are more and more scenarios of text retrieval, which are based on user input text, analyze user intent, analyze entities, pronouns and other information in the input text, and then retrieve the response information. Or through text matching FAQ method to match existing documents, so as to display the documents needed by the user. The main goal of text recall is to identify the user's true search intent according to the user's search text and return relevant results. The higher the relevance of the returned results to the search text, the better the effect of text recall. The current text recall technology still has certain deficiencies:
[0003] (1) By analyzing customer intent, analyzing entities, etc., it is necessary to summarize the business intent and archive and classify each existing document, which is time-consuming and difficult to expand and modify when new intents are added or modified.
[0004] (2) Through the way of text matching, by matching the existing problems, although it reduces the time of adding and modifying existing knowledge. But in the multi-round dialogue, the information of the previous and next sentences is still not considered, such as the customer asks "how is your line connection rate", the salesperson answers, and then the customer asks "how is the line connection rate in Guangzhou", the customer's underlying meaning is "how is the line connection rate in Guangzhou", which needs to be supplemented with logical information in combination with the context. But the existing voice retrieval method based on semantic analysis and high-dimensional modeling usually cannot consider the context information.
[0005] (3) The method based on knowledge graph needs to spend a lot of effort to maintain the knowledge of the entire graph.
[0006] (4) The existing scheme usually only has basic call data, the data dimension is simple, and it cannot support the need of complex query analysis, and there is no rich semantic label definition for each conversation or each sentence. Therefore, the basic data is not good, and the query effect is naturally not good.
[0007] (5) The existing scheme often directly inserts data synchronization code in the business code when performing data synchronization, which not only "pollutes" the business logic code, but also has potential risks. If one side goes wrong, the other side will be affected.
[0008] (6) The existing scheme lacks support for multi-dimensional high-screen condition queries with keywords and key sentences, and there is no scheme design for different data model queries according to different query conditions.
[0009] (7) For text query, the existing scheme does not have the function of word association and synonym expansion, only simple text matching or fuzzy search is performed on the input text, so the search result has limitations, the recall rate is low, and the precision is not enough. Moreover, the existing scheme is often single-path search, the concurrent performance is insufficient, and there is no pre-computed search and cache, so the performance is relatively low, which is insufficient to support search of data of tens of millions or even hundreds of millions or more. SUMMARY
[0010] In order to solve at least one of the above technical problems, the first aspect of the present application discloses a voice retrieval method based on semantic analysis and high-dimensional modeling, the method comprising:
[0011] Obtaining voice data and translating it into text data;
[0012] Building a basic database and storing the text data in the basic database;
[0013] Building a retrieval database and establishing data synchronization between the basic database and the retrieval database;
[0014] In the data synchronization process, multi-dimensional semantic labels are constructed for the text data according to business requirements, and a text data model is defined based on the application scenario of the text data, and the filtering conditions of the text data are created through the semantic labels and the text data model;
[0015] Determine the search text and the filtering conditions;
[0016] Based on the filtering conditions, high-screen processing is performed on the text data in the retrieval database, and text recall is performed based on the high-screen processed text data to obtain a first recall candidate set corresponding to the search text;
[0017] Based on the semantic embedding of the search text, text recall is performed on the search text to obtain a second recall candidate set corresponding to the search text;
[0018] Based on the context embedding of the search text, text recall is performed on the search text to obtain a third recall candidate set corresponding to the search text;
[0019] Based on the keywords of the search text, the first recall candidate set, the second recall candidate set and the third recall candidate set are sorted and filtered;
[0020] Based on the first recall candidate set, the second recall candidate set and the third recall candidate set after sorting and filtering, the final recall candidate set corresponding to the search text is determined.
[0021] In an optional embodiment, the recall of the second and third recall candidate sets is performed by a double tower model, wherein the double tower model comprises a search text tower and a document tower;
[0022] When recalling the second recall candidate set, the representation models of the search text tower and the document tower are of the same structure and share weights;
[0023] When recalling the third recall candidate set, the document tower is used to convert multiple inputs of the representation model into a single result output by BiLSTM, and the representation models of the search text tower and the document tower are of different structures and do not share weights.
[0024] In an optional embodiment, the text recall based on the high-screened text data obtains the first recall candidate set corresponding to the search text, comprising:
[0025] According to the search text, a predetermined database is queried to obtain a candidate set of the search text;
[0026] Based on the BM25 algorithm, the candidate set is screened to obtain the first recall candidate set corresponding to the search text.
[0027] In an optional embodiment, the sorting process comprises:
[0028] The keywords in the search text are extracted by TextRank, the keywords are semantically embedded in the first recall candidate set, and then merged into the second and third recall candidate sets.
[0029] In an optional embodiment, the data synchronization of the establishment of the basic database and the retrieval database comprises:
[0030] The operation events of the basic database are listened to, and the operation events comprise adding a database table, updating a database table, and deleting a database table;
[0031] If the operation event of the basic database is listened to, the data synchronization is performed by a middleware, and the middleware is used to complete the data synchronization of the different structure data between the basic database and the retrieval database;
[0032] According to the field name and type of the target database table, the text data is mapped, and the data content of the basic database is synchronized to the database table of the corresponding retrieval database.
[0033] In an optional embodiment, the multi-dimensional semantic label of the text data is constructed according to the business requirements, comprising:
[0034] The preset creation label model is used to create corresponding semantic labels for each group of call data, and each group of call data is classified and stored according to the corresponding semantic label of each group of call data.
[0035] In an optional embodiment, the text-based application scenario defines a text data model, which includes:
[0036] The text-based application scenario defines a data model hierarchy, which includes a text-level data model, a paragraph-level data model, a sentence-level data model, and a conversation-level data model, and the semantic labels are stored in the hierarchical text data model as semantic representation vectors.
[0037] In an optional embodiment, the text data in the search database is subjected to high screening based on the screening condition, which includes:
[0038] When performing semantic search on the database based on the search text, the search text is subjected to synonym expansion and / or sentence association;
[0039] An algorithm model is called to perform word / sentence judgment on the search text;
[0040] If the search condition is keyword search, the multi-dimensional high screening query condition and the keyword and the sorting condition are used to retrieve results from the data model through phrase matching;
[0041] If the search condition is a multi-dimensional high screening condition query with a key sentence, two concurrent queries are started to quickly retrieve data;
[0042] The first concurrent query is to retrieve the top K data with the highest matching degree from the data model through the BM25 relevance score algorithm based on the multi-dimensional high screening query condition and the key sentence; the second concurrent query is to first calculate the semantic representation vector of the sentence by calling an algorithm model, and then retrieve the top K data from the sentence-level data model by ANN algorithm based on the representation vector and the multi-dimensional high screening query condition.
[0043] The query results are sorted by multi-path merging to obtain M data, and the top N data are selected, the unmatched data in the N data are excluded, and the matched result data are returned and output.
[0044] The second aspect of the application discloses a voice retrieval system based on semantic analysis and high-dimensional modeling, which includes:
[0045] A data acquisition module is used to obtain voice data and translate it into text data;
[0046] A basic database module is configured to build a basic database and store text data in the basic database;
[0047] A data synchronization module is configured to build a retrieval database, establish data synchronization between the basic database and the retrieval database, construct multi-dimensional semantic labels for the text data according to business requirements, and create a filtering condition for the text data based on a text data model defined according to an application scenario of the text data and the semantic labels and the text data model;
[0048] A text filtering module is configured to determine a search text and a filtering condition, and perform high filtering processing on the text data in the retrieval database based on the filtering condition;
[0049] A first recall module is configured to perform text recall based on the text data after the high filtering processing, and obtain a first recall candidate set corresponding to the search text;
[0050] A second recall module is configured to perform text recall on the search text based on semantic embedding of the search text, and obtain a second recall candidate set corresponding to the search text;
[0051] A third recall module is configured to perform text recall on the search text based on context embedding of the search text, and obtain a third recall candidate set corresponding to the search text;
[0052] A processing module is configured to perform sorting processing and filtering processing on the first recall candidate set, the second recall candidate set and the third recall candidate set based on a keyword of the search text;
[0053] A determining module is configured to determine a final recall candidate set corresponding to the search text based on the first recall candidate set, the second recall candidate set and the third recall candidate set after the sorting processing and the filtering processing.
[0054] The third aspect of the present application discloses a computer storage medium, the computer storage medium stores computer instructions, when the computer instructions are called, part or all steps of the voice retrieval method based on semantic analysis and high-dimensional modeling disclosed in the first aspect of the present application are executed.
[0055] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0056] In the embodiment of the present application, first, text data translated from voice call data is obtained and stored in a basic database, then a retrieval database is constructed, and data synchronization between the basic database and the retrieval database is established, in the data synchronization process, a filtering condition for text data retrieval is generated through multi-dimensional semantic labels and a text data model, after the user determines the search text and the filtering condition required for retrieval, the corresponding text data in the retrieval database is filtered through high filtering processing, then the recall candidate set required by the user is generated through text recall based on statistical data, text recall based on semantics and text recall based on context association, finally, the final recall candidate set corresponding to the search text and the filtering condition is obtained through sorting processing and filtering processing.
[0057] The above embodiment can realize recall based on semantics, improve the quality of text recall, realize recall based on context embedding of search text, realize recall based on context information, solve the problem that the existing retrieval cannot consider context information, and comprehensively consider the characteristics of the three recall modes to improve the accuracy of text recall as much as possible while ensuring the performance of text recall. In addition, the high filtering design based on multi-dimensional semantic labels and a text data model can realize fast and accurate voice retrieval of data amount of more than 100 million, and meanwhile, multi-path concurrent retrieval, multi-path result merging sorting, algorithm accurate filtering and pre-search calculation cache are introduced to ensure the retrieval accuracy and greatly improve the retrieval efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0059] Figure 1 is a flowchart of a voice retrieval method based on semantic analysis and high-dimensional modeling disclosed by the embodiment of the present application;
[0060] Figure 2 is a flowchart of semantic high-filtering query disclosed by the embodiment of the present application;
[0061] Figure 3 is a flowchart of pre-computed asynchronous tasks disclosed by the embodiment of the present application;
[0062] Figure 4 is a flowchart of loading next page data disclosed by the embodiment of the present application;
[0063] Figure 5 is a schematic diagram of a voice retrieval system based on conversation semantic analysis and high-dimensional modeling disclosed by the embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0065] The terms "first," "second," and so on, in the description and claims of the present invention and the accompanying drawings are used to distinguish between different items, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or end comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed therein, or may optionally include other steps or elements inherent to such process, method, product, or end.
[0066] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0067] The present invention discloses a speech retrieval method based on semantic analysis and high-dimensional modeling. First, text data translated from voice call data is obtained and stored in a newly created basic database. Then, a retrieval database is constructed, and data synchronization between the basic database and the retrieval database is established. In the data synchronization process, multi-dimensional semantic tags and text data models are further constructed. During retrieval, filtering conditions for text data retrieval are generated through the semantic tags and the text data model. After the user determines the search text and filtering conditions required for retrieval, the corresponding text data in the retrieval database is filtered through high-dimensional screening processing. Then, the text data is respectively recalled based on statistical data, based on semantics, and based on context association to generate a recall candidate set required by the user. Finally, the recall candidate set corresponding to the search text and the filtering conditions is obtained through sorting processing and filtering processing.
[0068] The method can realize semantic-based recall, improve the quality of text recall, realize context information-based recall based on search text context embedding, solve the problem that the existing retrieval cannot consider context information, and comprehensively consider the characteristics of the three recall methods to improve the accuracy of text recall as much as possible while ensuring the performance of text recall.
[0069] Embodiment one
[0070] Please refer to Figure 1 , Figure 1 is a flowchart of a voice retrieval method based on semantic analysis and high-dimensional modeling according to an embodiment of the present application. As shown in Figure 1 , the voice retrieval method based on semantic analysis and high-dimensional modeling can include the following operations:
[0071] 101. Obtain voice data and translate it into text data.
[0072] In this embodiment, the voice data can come from a third-party system such as a call system, a customer service center, etc. The process of translating voice data into text data can be realized by a translation program or a translation script.
[0073] 102. Build a basic database and store the text data in the basic database.
[0074] In this embodiment, the basic database is a database that can store text data, such as a MongoDB database and a Mysql database, etc. When storing text data, the basic database can be connected to the third-party system to complete the storage of text data by importing.
[0075] 103. Build a retrieval database and establish data synchronization between the basic database and the retrieval database.
[0076] In this embodiment, the retrieval database can be an ElasticSearch database that can perform full-text retrieval.
[0077] In an optional embodiment, the establishment of data synchronization between the basic database and the retrieval database includes:
[0078] Listening to operation events of the basic database, the operation events including adding a database table, updating a database table, and deleting a database table;
[0079] If the operation event of the basic database is listened to, data synchronization is performed through a middleware, and the middleware is used to complete the data synchronization of the differential structure data between the basic database and the retrieval database.
[0080] Perform text data mapping based on the field name and type of the target database table, and synchronize the data content of the basic database to the database table of the corresponding search database, thereby providing data support for the subsequent high-resolution screening design.
[0081] Specifically, for heterogeneous data synchronization, after call data enters the system from third-party systems such as the call system, the basic call data will first be stored in databases such as MongoDB or Mysql. After the data is entered into the database, it is necessary to synchronize the data to the full-text search ElasticSearch database to provide data support for the subsequent high-screening design. The data synchronization here is carried out through self-developed middleware with excellent performance, stability and reliability. The principle is to monitor the operation events of the MongoDB database. When it is found that the database table has operations such as addition, update, and deletion, data synchronization is triggered, and the data content of the MongoDB database table is automatically synchronized to the corresponding ElasticSearch database table through the custom and target database table field name and type mapping.
[0082] 104. The data synchronization process constructs multi-dimensional semantic tags for text data according to business needs, defines a text data model based on the application scenario of the text, and creates screening conditions for text data through the semantic tags and the text data model.
[0083] 105. Determine the search text and filter conditions.
[0084] In this embodiment, before conducting a search, the user will customize the filtering conditions and search questions according to the required search content, and generate a search text from the search questions. The search text includes search keywords. The search database completes the voice search through the input filtering conditions and search text to obtain the voice text information required by the user.
[0085] 106. Performing high-level screening on the text data in the search database based on the screening condition, and performing text recall based on the high-level screening text data to obtain a first recall candidate set corresponding to the search text;
[0086] In an optional embodiment, performing text recall based on the text data after high-screening processing to obtain a first recall candidate set corresponding to the search text includes:
[0087] Querying a preset database according to the search text to obtain an alternative set of the search text;
[0088] The candidate set is screened based on the BM25 algorithm to obtain a first recall candidate set corresponding to the search text.
[0089] The first mode of recall can be understood as a recall based on statistical information. The recall is to quickly obtain an answer that can match the user query (i.e., search text). The accuracy of the recall based on statistical information can not be high, but the performance is relatively good. Subsequently, the BM25 algorithm can be selected for recall.
[0090] Specifically, all candidate words can be imported into an ElasticSearch database, and statistical information of all documents is automatically calculated. When the query of the user is obtained, the database is queried by using the query through a match syntax to obtain top k candidate words with the highest bm25 scores of the query as a candidate set to form a first recall candidate set.
[0091] 107. Perform text recall on the search text based on semantic embedding of the search text to obtain a second recall candidate set corresponding to the search text.
[0092] The second mode of recall can be understood as a sentence embedding recall based on contrastive learning. The first mode of recall based on statistical information usually cannot understand the semantics of the sentence, and therefore a semantic-based method needs to be selected for recall, i.e., the second mode of recall. The present application uses the unsupervised part of ESimCSE to train a double-tower model for recall.
[0093] Specifically, one piece of data can be randomly selected from all documents as an anchor, and another piece of data can be randomly selected as a negative sample. A word can be randomly repeated for the anchor as a positive sample. In this way, a triple data is constructed, RoBerta is selected as a backbone, and contrastive loss is used for training. After training, recall is performed by vector retrieval.
[0094] 108. Perform text recall on the search text based on context embedding of the search text to obtain a third recall candidate set corresponding to the search text.
[0095] The third mode of recall can be understood as a context embedding recall based on contrastive learning. The query of the user sometimes contains multiple attributive phrases or rich information, such as "how much is the accuracy of the hardware line for calling Beijing numbers?", but in real bills, the key information will not be in the same sentence, but will be distributed in the context, and therefore it is difficult to match based on the sentence-level embedding, i.e., the recall effect of the second mode of recall is not good in this case.
[0096] After learning the expression of each sentence in step 107, a query with rich information and a corresponding document answer are constructed, and the heterogeneous dual-tower model is further trained based on step 107 through supervised contrastive learning. The parameters of the query tower (i.e., the search text tower) and the parameters of the document tower are not shared, and the input of the document tower is the current sentence and the context sentence. All sentences are passed through BiLSTM, and the embedding expression of the current sentence is obtained through a full connection layer, which is the embedding expression of the current sentence combined with the context. The subsequent steps are the same as step 107.
[0097] 109. Perform sorting processing and filtering processing on the first, second and third recall candidate sets based on keywords of the search text.
[0098] In an optional embodiment, the sorting processing comprises:
[0099] The keywords in the search text are extracted through TextRank, the keywords are semantically embedded to the first recall candidate set, and then merged into the second and third recall candidate sets.
[0100] When performing fine ranking, the fine ranking can be based on keyword attention. First, the keywords in the query and the document are extracted through the TextRank method, and then the keywords are attached to the original query, and the additional keywords are additionally embedded at the word level, and merged into the original sentence-level and context-level embedding through pooling. After performing fine ranking on the first, second and third recall candidate sets, a certain range (e.g., top 100, top 10) of the ranked candidate sets can be selected as the final recall candidate set. Some candidate sets can also be filtered out according to the ranking.
[0101] In an optional embodiment, the recall of the second and third recall candidate sets is performed through a dual-tower model, wherein the dual-tower model comprises a search text tower and a document tower.
[0102] When recalling the second recall candidate set, the representation models of the search text tower and the document tower are of the same structure and share weights.
[0103] When recalling the third recall candidate set, the document tower is used to convert multiple inputs of the representation model into a single result output through BiLSTM, and the representation models of the search text tower and the document tower are of different structures and do not share weights.
[0104] In an optional embodiment, the constructing of the multi-dimensional semantic label according to the business requirement comprises:
[0105] Create corresponding semantic labels for each group of call data through a preset creation label model, and store each group of call data according to the corresponding semantic labels of each group of call data.
[0106] The system defines a conversation-level labeled data model Conversation and a sentence-level labeled data model Sentence based on an ElasticSearch database with semantic vector search capability. In addition to the basic call data dimensions, the conversation-level data model Conversation also includes the dimension data calculated by the rating model and the label model. In the multi-dimensional high-screen query without key sentences or keywords, the high-performance query capability of the ElasticSearch database can quickly retrieve data from Conversation and return the results. The sentence-level data model Sentence also adopts a multi-label dimension design and redundantly includes a part of the dimension data of the conversation-level data model Conversation. In addition, it also saves the semantic vector dimension. In the multi-dimensional high-screen query with key sentences, it can accurately and quickly return the results. The semantic vector of the sentence can be obtained by calling the algorithm service. The semantic vector is stored in the sentence-level data model Sentence.
[0107] Specifically, by creating a custom label model, rich semantic labels can be built for each call or each sentence. Each label model establishes the condition content that needs to be monitored, the scope of application, and a multi-dimensional high screening condition group. For example, monitoring the call text for keywords or key sentences can build a business attribute label for the call, emotion recognition for the caller and callee can build an emotion label, calculation of speaking speed can build a label for the speed of speech, voice endpoint detection can build a label for whether it is a cold scene, and matching and screening of multiple dimensional data can build a call rating label. By analogy, custom label models can build rich semantic labels that meet business needs. The process of building labels will inevitably involve a large amount of data calculation. In order to improve the efficiency of screening data and label calculation, a data storage scheme is designed to quickly screen data for label calculation. The core is to classify and store data, which can replace real-time database queries and reduce the impact on the business system. The principle of the scheme is illustrated by an example of screening data for rating calculation based on call time and call duration. First, the enterprise id to which the data belongs is used as the top-level directory, and then the call time (usually the date) is used as the lower-level directory. Then the call text and some dimensional data needed are saved in a file. The file is named by the call duration range, for example, 0-15.txt, which means that the call data with a call duration of 0-15s is saved in the 0-15.txt file, and the dimensional data is separated by \t. The complete directory structure is as follows: company_id / 20221201 / 0-15.txt. The content of the txt file is as follows: conversation_id\tsentence_id\ttext content\tcalled area.
[0108] When performing call data rating calculation, the top-level file directory where the data belongs is first located according to the enterprise id to which the data belongs, and then one or more directories under the directory are located according to the call time range to be screened, and then the data files that meet the call duration are searched one by one in these directories. The file content is read out by iteration, and then each data is calculated for rating label. In order to improve the calculation speed, the searched files are divided into batches, and multiple concurrent calculations are performed.
[0109] Figure 2 is a flowchart of semantic high screening query disclosed by the embodiment of the present application, Figure 3 is a flowchart of pre-computed asynchronous tasks disclosed by the embodiment of the present application, Figure 4 is a flowchart of loading next page data disclosed by the embodiment of the present application.
[0110] As Figure 2 , Figure 3 andFigure 4 In an optional embodiment, the method further comprises:
[0111] Synonym expansion and / or sentence association are performed on the search text when performing a semantic search on the database based on the search text;
[0112] An algorithm model is called to perform word / sentence judgment on the search text;
[0113] If the search condition is a keyword search, the results are retrieved from the data model through short phrase matching by multi-dimensional high screening query conditions and keywords and sorting conditions;
[0114] If the search condition is a multi-dimensional high screening condition query with a key sentence, two concurrent queries are started to quickly retrieve data;
[0115] The first concurrent query is a direct retrieval of the top K data with the highest matching degree from the data model through a BM25 relevance score algorithm by multi-dimensional high screening query conditions and the key sentence. The second concurrent query first needs to call an algorithm model to calculate the semantic representation vector of the sentence, and then retrieve the top K data from the sentence-level data model through an ANN algorithm by using the representation vector and the multi-dimensional high screening query conditions.
[0116] The query results are sorted by multi-path merging to obtain M pieces of data, top N pieces of data are selected, non-matching data are excluded from the N pieces of data, and the matching result data are returned and output.
[0117] Fast and accurate semantic search of data volume of more than 100 million, such as Figure 2As shown, when the user inputs a key sentence or keyword and multi-dimensional high screening query conditions for semantic search, the system first associates similar sentences or expands synonyms from the key sentence, and then calls the algorithm model for word judgment. If it is a pure keyword search, the system directly retrieves the results from the Conversation data model through the multi-dimensional high screening query conditions, keywords, and sorting conditions through the match_phrase phrase matching. Then, the top k data is selected and directly returned to the user. If the search condition is a multi-dimensional high screening condition query with a key sentence, the system quickly retrieves data through two concurrent routes. The principle is that one route directly retrieves the top K data with the highest matching degree from the Sentence data model through the BM25 relevance scoring algorithm based on the multi-dimensional high screening query conditions and the key sentence. The other route first needs to call the algorithm model to calculate the semantic representation vector of the sentence, and then retrieve the top K data from the Sentence data model through the ANN algorithm based on the representation vector and the multi-dimensional high screening query conditions. When both routes retrieve the corresponding data, the M data is obtained through merging and sorting, and the top N data is selected. Then, the algorithm fine sorting model is called to exclude the unmatched data in the N data, and the matched data is directly returned to the user. In addition, in order to speed up the search speed of the next page, the asynchronous pre-computation and caching technology is introduced. As shown, Figure 3 The principle is that after the above-mentioned M data is sorted and N data is obtained, the remaining data is placed in the cache C1, and the pre-computation asynchronous task is started. The asynchronous task takes the N data from the C1 cache, updates the remaining data in the cache C1, calls the algorithm fine sorting model to exclude the unmatched data in the N data, and then stores the matched data in the cache C2. As shown, Figure 4 When the user initiates the next page retrieval, the data is directly read from the cache C2 and returned.
[0118] Through the above process, a high-efficiency and accurate voice retrieval system is constructed from the aspects of heterogeneous data synchronization, rich semantic label construction, high screening design based on labeled conversation data, and fast and accurate semantic search of the order of 100 million data.
[0119] The embodiments of the present application have at least the following beneficial effects:
[0120] (1) The unsupervised contrast learning is used to represent the semantics of the sentence, which can recall candidate texts with high quality without increasing a large amount of labeled resources. On this basis, the BiLSTM is used to transmit the sentence expression information learned by the unsupervised contrast learning to other sentences, so that the representation of each sentence contains context information.
[0121] (2) In the multi-round conversation text retrieval, the BiLSTM mode is introduced to automatically learn the context text information, naturally solve the long text problem, and selectively use the context information by focusing on the information of the current round of conversation using the BiLSTM mechanism.
[0122] (3) In the multi-round conversation text retrieval, the context text information is solved by fully utilizing the unsupervised sentence expression training, and then fine-tuning through supervised data. At this time, the query tower and the document tower two model parameters are not shared, and the structure is heterogeneous.
[0123] (4) Heterogeneous data automatic synchronization. Through the self-developed synchronization middleware, the field name and type mapping between the definition and the target database are defined, and the data of different structure types are automatically synchronized to the ElasticSearch database by listening to the data update event of the MongoDB database. It is stable, reliable and has excellent performance.
[0124] (5) Rich semantic label construction. By creating a label model, the model sets monitoring content, scope of application, and high screening conditions based on multiple dimensions, which can label each conversation or each sentence. In order to avoid the need to recalculate the existing label data after changing the label monitoring content, scope of application or high screening conditions, the label results of each conversation or each sentence are stored in the file system after each calculation. For the unchanged label content, the label result is obtained directly through the label file, and for the changed label content, the algorithm service is called to calculate the label data, and then the new label result is updated back to the file system.
[0125] (6) High screening design based on labeled conversation. According to different query conditions, the system defines a conversation-level data model based on labeling and a sentence-level data model based on labeling. The conversation-level data model uses multi-label dimension design and is used for multi-dimensional high screening query without sentence semantic query; the sentence-level data model also uses multi-label dimension design and redundantly stores part of the dimension data of the conversation-level data model, and has a sentence vector dimension, mainly used for multi-dimensional high screening query with sentence semantic query. By using different data models for different query scenarios, not only can the query be efficient, but also the accuracy is higher.
[0126] (7)Support fast and accurate semantic search capability of hundreds of millions of data. Through the construction of rich semantic tags and high screening design based on tagged conversation, in multi-round conversation text search, different data models are used according to different search conditions. For multi-dimensional high screening query without semantic query, search results are directly searched through the accurate query of ElasticSearch database; for multi-dimensional high screening query with semantic query, different search methods are used according to whether it is a sentence or a word. If it is a word search, it is directly matched and queried through the ElasticSearch short sentence math_pharse. If it is a sentence search, two concurrent searches are adopted, one is through ElasticSearch BM25 for recall, and the other is to call the algorithm to calculate the semantic vector and then search through ElasticSearch ANN for recall. Then the results of the two searches are aggregated and sorted, and then the algorithm is used to exclude the data that does not match, and finally the top k results are returned. At the same time, in order to speed up the next page query, the matched data is pre-calculated and placed in the cache through asynchronous, and the next page query can directly read the cache to return the results.
[0127] (8)A set of heterogeneous data synchronization, rich semantic tag construction, high screening design based on tagged conversation data, fast and accurate semantic analysis search is designed, and an efficient and accurate voice retrieval system construction method is provided. The self-developed heterogeneous data synchronization middleware can efficiently and accurately synchronize the updated data from the MongoDB database to the ElasticSearch database used for retrieval data. Each call or each sentence can construct a set of rich semantic tags through a custom tag model, so that the data can be accurately queried through these rich tag dimensions. Based on the ElasticSearch database with semantic vector search capability, the Conversation data model of conversation-level tagging and the Sentence data model of sentence-level tagging are defined, which can support multi-dimensional high screening query without semantic search or with semantic search. Through multi-path concurrent search and multi-path result merging and sorting, as well as algorithmic sentence vector calculation and accurate exclusion model, pre-search calculation and cache, etc. Technical solutions can support data query of more than 100 million, and have excellent performance, accurate query results, and greatly improve user experience.
[0128] It can be seen that the implementation Figure 1The speech retrieval method based on semantic analysis and high-dimensional modeling described first obtains text data translated from voice call data, and stores the text data in a newly created basic database, then constructs a retrieval database, and establishes data synchronization between the basic database and the retrieval database, further constructs a multi-dimensional semantic label and a text data model during the data synchronization process, generates a filtering condition for text data retrieval through the semantic label and the text data model during retrieval, and after a user determines a search text and a filtering condition required during retrieval, filters corresponding text data in the retrieval database through high filtering processing, then generates a recall candidate set required by the user through text recall based on statistical data, text recall based on semantics, and text recall based on context association, and finally, after sorting processing and filtering processing, obtains a final recall candidate set corresponding to the search text and the filtering condition. Through this method, recall based on semantics can be realized, the quality of text recall can be improved, recall based on the context embedding of the search text can be realized, recall based on context information can be realized, the problem that existing retrieval cannot consider context information is solved, the characteristics of the three recall modes are comprehensively considered, the accuracy of text recall is improved as much as possible under the condition of ensuring the performance of text recall. In addition, the high filtering design based on the multi-dimensional semantic label and the text data model can realize fast and accurate speech retrieval of data amount of more than 100 million, and meanwhile, multi-path concurrent retrieval, multi-path result merging sorting, algorithm accurate filtering, and pre-search calculation cache are introduced, so that the retrieval efficiency is greatly improved while ensuring the retrieval accuracy.
[0129] Embodiment Two
[0130] Please refer to Figure 5 , Figure 5 is a schematic diagram of a speech retrieval system based on semantic analysis and high-dimensional modeling disclosed by an embodiment of the present application. As Figure 5 shown, the speech retrieval system based on semantic analysis and high-dimensional modeling can include:
[0131] A data acquisition module is configured to obtain voice data and translate the voice data into text data.
[0132] A basic database module is configured to construct a basic database and store the text data in the basic database.
[0133] A data synchronization module is configured to construct a retrieval database, establish data synchronization between the basic database and the retrieval database, construct multi-dimensional semantic labels according to business requirements, and create filtering conditions for text data based on a text data model defined according to text length through the semantic labels and the text data model.
[0134] A text filtering module is configured to determine a search text and a filtering condition, and perform high filtering processing on text data in the retrieval database based on the filtering condition.
[0135] A first recall module, configured to perform text recall based on the text data after high-screening processing, and obtain a first recall candidate set corresponding to the search text;
[0136] A second recall module is configured to perform text recall on the search text based on the semantic embedding of the search text to obtain a second recall candidate set corresponding to the search text;
[0137] A third recall module, configured to perform text recall on the search text based on the context embedding of the search text, and obtain a third recall candidate set corresponding to the search text;
[0138] a processing module, configured to perform sorting and filtering on the first recall candidate set, the second recall candidate set, and the third recall candidate set based on keywords of the search text;
[0139] A determination module is configured to determine a final recall candidate set corresponding to the search text based on the first recall candidate set, the second recall candidate set, and the third recall candidate set after sorting and filtering.
[0140] For the detailed description of the speech retrieval system based on semantic analysis and high-dimensional modeling, please refer to the detailed description of the speech retrieval method based on semantic analysis and high-dimensional modeling, which will not be described in detail here.
[0141] Example 3
[0142] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps of the speech retrieval method based on semantic analysis and high-dimensional modeling disclosed in the first embodiment of the present invention.
[0143] The device embodiments described above are merely illustrative. Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0144] Those skilled in the art can clearly understand the implementation of the various embodiments by means of software and necessary general hardware platforms through the above specific description of the embodiments, and of course, the embodiments can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in the sense of contribution to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, which includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM), or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other medium that can be used to carry or store computer readable instructions.
[0145] Finally, it should be noted that: the disclosed speech retrieval method based on semantic analysis and high-dimensional modeling disclosed by the embodiments of the present application is only the preferred embodiment of the present application, and is used to illustrate the technical solutions of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that; it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A speech retrieval method based on semantic analysis and high dimensional modeling, characterized in that, The method comprises: obtaining voice data and translating it into text data; building a basic database and storing the text data in the basic database; building a retrieval database and establishing data synchronization between the basic database and the retrieval database; the data synchronization process, according to the business requirements, constructs a multi-dimensional semantic label for the text data, and defines a text data model based on the application scenario of the text, and creates a filtering condition for the text data through the semantic label and the text data model; determining the search text and the filtering condition; based on the filtering condition, the text data in the retrieval database is processed, and text recall is performed based on the high-screen processed text data to obtain a first recall candidate set corresponding to the search text; based on the semantic embedding of the search text, the search text is recalled to obtain a second recall candidate set corresponding to the search text; based on the context embedding of the search text, the search text is recalled to obtain a third recall candidate set corresponding to the search text; based on the key words of the search text, the first recall candidate set, the second recall candidate set and the third recall candidate set are sorted and filtered; based on the first recall candidate set, the second recall candidate set and the third recall candidate set after sorting and filtering, the final recall candidate set corresponding to the search text is determined; the recall of the second recall candidate set and the third recall candidate set is performed through a double-tower model, wherein the double-tower model comprises a search text tower and a document tower; when recalling the second recall candidate set, the representation models of the search text tower and the document tower are of the same structure and share the same weight; when recalling the third recall candidate set, the document tower is used to convert multiple inputs of the representation model into a single result output through BiLSTM, and the representation models of the search text tower and the document tower are of different structures and do not share the same weight. 2.The voice search method based on semantic analysis and high-dimensional modeling according to claim 1, wherein, The text recall based on the high-screen processed text data to obtain the first recall candidate set corresponding to the search text comprises: querying a preset database according to the search text to obtain a candidate set of the search text; based on the BM25 algorithm, the candidate set is filtered to obtain the first recall candidate set corresponding to the search text. 3.The voice search method based on semantic analysis and high-dimensional modeling according to claim 1, wherein, The sorting process comprises: extracting key words in the search text through TextRank, performing semantic embedding of the key words on the first recall candidate set, and then merging into the second recall candidate set and the third recall candidate set. 4.The voice search method based on semantic analysis and high-dimensional modeling according to claim 1, wherein, The data synchronization between the basic database and the retrieval database comprises: listening to operation events of the basic database, the operation events comprising adding a database table, updating a database table and deleting a database table; if the operation event of the basic database is listened to, data synchronization is performed through a middleware, the middleware being used to complete data synchronization of the differential structure data between the basic database and the retrieval database; according to the field name and type of the target database table, the text data is mapped, and the data content of the basic database is synchronized to the database table of the corresponding retrieval database.
5. The speech retrieval method based on semantic analysis and high dimensional modeling according to claim 1, characterized in that, The multi-dimensional semantic label constructed according to the business requirements for the text data comprises: A preset creation label model is used to create a corresponding semantic label for each group of call data, and each group of call data is classified and stored according to the corresponding semantic label of each group of call data.
6. The speech retrieval method based on semantic analysis and high dimensional modeling according to claim 1, wherein, The text-based application scenario defines a text data model, which includes: The text-based application scenario defines a data model hierarchy, which includes a text-level data model, a paragraph-level data model, a sentence-level data model, and a conversation-level data model. The hierarchical text data model represents the application scenario of the text, and the semantic label is stored as a semantic representation vector in the hierarchical text data model.
7. The speech retrieval method based on semantic analysis and high dimensional modeling according to claim 1, wherein, Based on the screening condition, the text data in the retrieval database is subjected to high screening processing, which includes: When performing semantic search on the database based on the search text, synonym expansion and / or sentence association are performed on the search text; An algorithm model is called to perform word and sentence judgment on the search text; If the search condition is keyword search, the results are retrieved from the data model by phrase matching through multi-dimensional high screening query conditions, keywords, and sorting conditions; If the search condition is a multi-dimensional high screening condition query with a key sentence, two concurrent queries are started to quickly retrieve data; The first concurrent query is to retrieve the top K data with the highest matching degree from the data model by the BM25 relevance score algorithm through multi-dimensional high screening query conditions and key sentences. The second concurrent query first needs to call an algorithm model to calculate the semantic representation vector of the sentence, and then retrieve the top K data from the sentence-level data model by the ANN algorithm using the representation vector and multi-dimensional high screening query conditions. The query results are sorted by multi-path merging to obtain M data, and the top N data are selected, and the unmatched data are excluded, and the matched result data are returned and output.
8. A speech retrieval system based on conversational semantic analysis and high dimensional modeling, characterized by, The system includes: A data acquisition module is used to obtain voice data and translate it into text data; A basic database module is used to build a basic database and store text data in the basic database; A data synchronization module is used to build a retrieval database, establish data synchronization between the basic database and the retrieval database, construct multi-dimensional semantic labels for text data according to business requirements, define text data models based on text application scenarios, and create filtering conditions for text data based on the semantic labels and the text data models; A text filtering module is used to determine search text and filtering conditions, and to perform high screening processing on text data in the retrieval database based on the filtering conditions; A first recall module is used to perform text recall based on high screening processed text data to obtain a first recall candidate set corresponding to the search text; A second recall module is used to perform text recall based on semantic embedding of the search text to obtain a second recall candidate set corresponding to the search text; A third recall module is used to perform text recall based on context embedding of the search text to obtain a third recall candidate set corresponding to the search text; The processing module is configured to perform sorting processing and filtering processing on the first, second and third recall candidate sets based on keywords of the search text; The determining module is configured to determine a final recall candidate set corresponding to the search text based on the first, second and third recall candidate sets after the sorting processing and filtering processing; The second and third recall candidate sets are recalled by a double-tower model, wherein the double-tower model comprises a search text tower and a document tower; When the second recall candidate set is recalled, the search text tower and the document tower have the same structure and share the same weight value; When the third recall candidate set is recalled, the document tower is configured to convert multiple inputs of a representation model into a single result output by BiLSTM, and the search text tower and the document tower have different structures and do not share the same weight value.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program, when executed by a processor, implements the voice retrieval method based on semantic analysis and high-dimensional modeling according to any one of claims 1-7.
Citation Information
Patent Citations
Intelligent question answering method and device based on medical knowledge graph
CN113505243A
Semantic retrieval method and system, equipment and computer readable storage medium
CN115357691A