Model reasoning acceleration method, electronic equipment and program product

The text tree structure database is used to assist in determining the question keywords input by the user and generate a complete question. It is combined with the model inference engine to generate reply text, which solves the problem of slow inference speed of the model inference engine and achieves high concurrency support and improvement in inference speed. .

CN118761471APending Publication Date: 2024-10-11SHANGHAI BIREN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410950293.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When the model inference engine handles user questions, due to the complexity and diversity of natural language, the inference speed is slow and cannot effectively support high concurrency.

Method used

A text tree structure database is used to assist in determining the complete question through the question keywords input by the user, and the model inference engine and the database are used to jointly generate a complete reply text, which reduces the burden of the model inference engine and improves the inference speed.

Benefits of technology

It realizes the acceleration of the model inference engine, supports more concurrent processing, and improves user experience and system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761471A_ABST
    Figure CN118761471A_ABST
Patent Text Reader

Abstract

The invention provides a model reasoning acceleration method, electronic equipment and a program product, and the method comprises the steps: determining a complete question text matched with a question keyword inputted by a user based on a text tree structure database constructed for a question reply text of a task in a preset business field; and based on the model inference engine and the text tree structure database, determining a complete reply text corresponding to the complete question text, and feeding back the complete reply text to the user. The text tree structure database is utilized to assist the user to quickly determine the complete question when the user inputs the question keyword, the user does not need to input the complete question at one time, and meanwhile, the model inference engine is assisted to generate a complete reply, so that the burden of the model inference engine is relieved, and the user experience is improved. It is ensured that a single reasoning model engine can also support more concurrency, and meanwhile the purpose of accelerated reasoning of the model reasoning engine is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a model reasoning acceleration method, electronic equipment and program product. Background Art

[0002] The model inference engine can infer and predict user questions sent by the server and generate reply text. However, due to the complexity and diversity of natural language, as well as the expression habits and context differences of different users, the model inference engine needs to spend a long time to infer and predict user questions before generating reply text, resulting in a very slow model inference speed. Summary of the invention

[0003] The present invention provides a model reasoning acceleration method, electronic device and program product to solve the defect of slow model reasoning speed in related technologies. A text tree structure database is used to assist users to quickly determine the complete question when the user inputs the question keywords, without the need for the user to input the complete question at one time. At the same time, it also assists the model reasoning engine to generate a complete response, thereby reducing the burden of the model reasoning engine, ensuring that a single reasoning model engine can also support a large amount of concurrency, and also achieving the purpose of accelerating the reasoning of the model reasoning engine.

[0004] The present invention provides a model reasoning acceleration method, comprising the following steps.

[0005] Based on a text tree structure database constructed for question answering texts of tasks in a preset business field, determine a complete question text that matches the question keyword input by the user; Based on the model inference engine and the text tree structure database, a complete reply text corresponding to the complete question text is determined, and the complete reply text is fed back to the user.

[0006] According to a model reasoning acceleration method provided by the present invention, the text tree structure database constructed based on the question reply text for the task in the preset business field determines the complete question text that matches the question keyword input by the user, including: based on the question keyword, performing a keyword search on each root node of the text tree structure database, and determining a candidate prompt word based on the search results; and determining the complete question text based on the target prompt word fed back by the user for the candidate prompt word and the question keyword.

[0007] According to a model reasoning acceleration method provided by the present invention, the determining of candidate prompt words based on search results includes: searching for multiple question branches whose target root nodes are the question keywords in the text tree structure database, and determining from the multiple question branches a target question branch whose cumulative occurrence frequency of the target root node exceeds a preset question frequency threshold, and then determining from the target question branch the candidate prompt words that match a preset prompt word quantity threshold.

[0008] According to a model reasoning acceleration method provided by the present invention, the complete response text corresponding to the complete question text is determined based on the model reasoning engine and the text tree structure database, including: when the complete question text exists in the text tree structure database, each question response text branch containing the complete question text is determined in the text tree structure database, and each partial response text whose cumulative reasoning frequency of response word units exceeds a preset reasoning frequency threshold is determined in the response text of each of the question response text branches; and the complete response text that matches both the complete question text and the each partial response text is determined by using the model reasoning engine.

[0009] According to a model reasoning acceleration method provided by the present invention, the use of the model reasoning engine to determine the complete reply text that matches the complete question text and the partial reply texts includes: determining the inference frequency means corresponding to each of the partial reply texts; voting based on the proportion of each inference frequency mean in all the inference frequency means, and determining the target partial reply text from the different partial reply texts based on the voting results; and using the model reasoning engine to infer and predict the splicing result of the complete question text and the target partial reply text to generate the complete reply text.

[0010] According to a model reasoning acceleration method provided by the present invention, the creation process of the text tree structure database includes: obtaining manual annotation results for each original question reply text feedback in the original database, the manual annotation results include each target question reply text, the cumulative number of requests for the target question text in each target question reply text exceeds the number threshold and is a task-based dialogue, and the original question reply text represents different tasks in the preset business field; for each target question reply text, splicing the target question text and the target reply text in the target question reply text into a complete text, and taking the first character in the complete text as the main node and the remaining word units as branches, and accumulating and counting the occurrence frequencies of each character and each word unit in the complete text according to the tree structure; based on the accumulated statistical results and the target question reply texts, creating an initial text tree structure database, and determining the text tree structure database based on the pruning results fed back for the initial text tree structure database.

[0011] According to a model reasoning acceleration method provided by the present invention, the manual annotation results also include annotation results of the required question asking method and the required model reply method, as well as at least one of cleaning the screened task-based dialogue question reply texts.

[0012] According to a model reasoning acceleration method provided by the present invention, the method also includes: updating the text tree structure database based on the complete question text, the target reply text and the complete reply text.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model reasoning acceleration method described above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned model reasoning acceleration methods.

[0015] The present invention provides a model reasoning acceleration method, an electronic device, and a program product, wherein the model reasoning acceleration method first determines a complete question text that matches a question keyword input by a user based on a text tree structure database constructed based on a question reply text for a task in a preset business field; and further determines a complete reply text corresponding to the complete question text based on a model reasoning engine and a text tree structure database, so as to feed back the complete reply text to the user. In this way, the text tree structure database is used to assist the user in quickly determining the complete question when the user inputs the question keyword, without the user having to input the complete question at one time, and also assists the model reasoning engine in generating a complete reply, without the model reasoning engine generating a reply only for the complete question, thereby reducing the burden of the model reasoning engine, ensuring that a single reasoning model engine can also support a large amount of concurrency, and also achieving the purpose of accelerating the reasoning of the model reasoning engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a schematic diagram of the model reasoning process provided by related technologies.

[0018] Figure 2 This is one of the flow charts of the model reasoning acceleration method provided by the present invention.

[0019] Figure 3 It is a schematic diagram of the process of constructing a text tree structure database provided by the present invention.

[0020] Figure 4 This is one of the flow charts of the model reasoning acceleration method provided by the present invention.

[0021] Figure 5 It is a structural schematic diagram of the model reasoning acceleration device provided by the present invention.

[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In the embodiments of the present invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. In the textual description of the present invention, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship. In addition, it should be noted that the serial numbers themselves, such as "first", "second", etc., used to distinguish the objects described in the present invention are only used to distinguish the objects described, and do not have any order or technical meaning.

[0025] Currently, task-based dialogue systems are designed to understand the user's intentions and perform corresponding tasks based on these intentions. These tasks may include querying information, booking services, controlling devices, etc. However, due to the complexity and diversity of natural language, as well as the differences in expression habits and contexts of different users, the design and implementation of task-based dialogue systems are very challenging. Model reasoning engines have strong semantic understanding capabilities, rich context information capture capabilities, and flexible generalization capabilities, and play a significant role in task-based dialogues. More and more companies and businesses are applying large models to task-based dialogue businesses.

[0026] For the model inference engine, it can infer and predict the user questions sent by the server and generate reply text. The user questions sent by the server to the model inference engine are encrypted and encoded, and then cached in the queue after pre-processing. Then, according to the preset queuing strategy, the corresponding pre-processed user questions in the queue are fed back to the model inference engine, so that the model inference engine can generate the reply text of the user question and feed it back to the client.

[0027] However, since the model inference engine can only generate corresponding reply text for the complete questions originally input by the user, in the case of hundreds or thousands of user questions at the same time in the Internet mode, the server needs to pre-process and queue all user questions at the same time before sending them to the model inference engine to generate the corresponding reply text, which results in a very slow model inference speed.

[0028] Reference Figure 1The schematic diagram of the model reasoning process provided by the related technology shown shows that for the model reasoning engine, when it is applied in a task-based dialogue scenario, the model reasoning process is implemented through four steps.

[0029] Step 1: The client sends the user question to the server; Step 2: The server encrypts and encodes the received user question and caches it in the queue, and then feeds back the corresponding preprocessed user question in the queue to the model inference engine according to the preset queuing strategy; Step 3: The model inference engine generates a reply text for the input user question; Step 4: The server transmits the generated reply text to the client to complete the closed loop.

[0030] However, since the model inference engine can only generate corresponding reply text for the complete questions originally input by the user, in the case of hundreds or thousands of user questions at the same time in the Internet mode, the server needs to pre-process and queue all user questions at the same time before sending them to the model inference engine to generate the corresponding reply text, which results in a very slow model inference speed.

[0031] For example, large models have a huge number of parameters. Even after inference optimization, they still require a lot of computing power and video memory, which are expensive resources. In the Internet model, a single engine often cannot support too much concurrency. In task-based dialogue scenarios, the service content provided by developers is limited, so some questions and replies are mostly similar. Repeated questions not only consume a lot of computing power; in task-based dialogue scenarios, users express the same question in different ways, which may affect the final output of the model. The client lacks guidance on the most suitable question-asking method for the model, which will also reduce the model's reasoning speed.

[0032] In order to solve the above technical problems, the present invention provides a model reasoning acceleration method, electronic device and program product. Figure 2~Figure 6 The model reasoning acceleration method, electronic device and program product provided by the present invention are described, wherein the execution subject of the model reasoning acceleration method is the server, and the server is respectively connected to the client and the electronic device or server with a built-in model reasoning engine. The client can be a program corresponding to the server and providing local services to users, which is usually installed on the electronic device and needs to cooperate with the server to run; the server can be a targeted service program, whose main purpose is to provide services and resources to the client; the electronic device can be a personal computer (PC), portable device, laptop computer, smart phone, tablet computer, portable wearable device and other devices. The present invention does not specifically limit the specific form of the electronic device. The following describes the model reasoning acceleration method by taking the execution subject of the model reasoning acceleration method as the server as an example.

[0033] To facilitate the understanding of the model inference acceleration method provided by the embodiments of the present invention, hereinafter, several exemplary embodiments will be used to elaborate on the model inference acceleration method provided by the present invention in detail. It can be understood that these several exemplary embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0034] Referring to Figure 2 , which is one of the flow diagrams of the model inference acceleration method provided by the present invention. As Figure 2 shown, the model inference acceleration method includes the following steps 210 and 220.

[0035] Step 210: Based on the text tree structure database constructed for the question-answer texts of tasks in a preset business domain, determine the complete question text that matches the question keyword input by the user.

[0036] Among them, the number of preset business domains can be 1 or at least 2.

[0037] Exemplarily, the preset business domains can include but are not limited to at least one of other business domains such as the technology field, the financial field, the medical field, the education field, and the industrial field.

[0038] The text tree structure database can be constructed according to a large number of tasks, and the large number of tasks can come from 1 preset business domain or multiple different preset business domains.

[0039] Exemplarily, the large number of tasks can include but are not limited to querying information, booking services, controlling devices, managing customer relationships, and optimizing products, etc.

[0040] The text tree structure database at least includes each question-answer text branch of the tree structure, and the root node of each question-answer text branch is the keyword in the corresponding question text. This keyword can be the character at a preset position in the corresponding question text; the character at the preset position here can be the character at the first position, or it can also be the character group spliced by the characters at the first and the second first positions, etc.; for example, "修" in the question text "修改联系人" can be used as its keyword, or "修改" in the question text "修改联系人" can be used as its keyword; no specific limitation is made here.

[0041] Specifically, when the user enters the question text character by character in the question input interface of the client, the server can also receive it character by character correspondingly, and use 1 character or 2 characters received character by character as the question keyword input by the user. For example, the server can receive "修改" or "修" input by the user.

[0042] At this time, based on the received question keyword, the server can filter out at least one question text containing the question keyword in the pre-built text tree structure database, and then feed back the at least one question text to the client, so that the corresponding user of the client can determine the required complete question text from the at least one question text, and then feed back the complete question text to the server. In this way, the server determines the complete question text that matches the question keyword input by the user. Alternatively, the remaining characters except the question keyword in the at least one question text containing the question keyword can also be fed back to the client, so that the user can select the remaining characters required and splice them with the user keyword to obtain the complete question text that matches the question keyword.

[0043] Step 220: Based on the model inference engine and the text tree structure database, determine the complete response text corresponding to the complete question text, and feed back the complete response text to the user.

[0044] Among them, the model inference engine is an acceleration engine used to implement neural network inference based on large models. It is usually used to process inference tasks of large models, that is, to calculate the output results of the model based on the model parameters and input data.

[0045] Specifically, for the determined complete question text, the server can query at least one question response text branch containing the complete question text from the text tree structure database, and determine at least one response prompt word with the greatest response possibility in the at least one question response text branch, and then use the at least one response prompt word and the complete question text as input to the model inference engine to generate a complete response text corresponding to the complete question text.

[0046] At this time, the server can feed back the determined complete reply text to the user by transparent transmission; here, it can be fed back to the client corresponding to the user, so that the corresponding user of the client can view this complete reply text.

[0047] It should be noted that transparent transmission means that the server is only responsible for transmitting the complete reply text that needs to be transmitted to the destination node (such as the user's corresponding client) while ensuring the transmission quality, without processing the transmitted complete reply text.

[0048] The model reasoning acceleration method provided by the embodiment of the present invention first determines the complete question text that matches the question keyword input by the user based on the text tree structure database constructed for the question reply text of the task in the preset business field; and further determines the complete reply text corresponding to the complete question text based on the model reasoning engine and the text tree structure database, so as to feed back the complete reply text to the user. In this way, the text tree structure database is used to assist the user to quickly determine the complete question when the user enters the question keyword, without the user having to enter the complete question at one time, and also assists the model reasoning engine to generate a complete reply, thereby reducing the burden of the model reasoning engine, ensuring that a single reasoning model engine can also support a large amount of concurrency, and also achieving the purpose of accelerating the reasoning of the model reasoning engine.

[0049] Based on the above Figure 2 In the model reasoning acceleration method shown, in an exemplary embodiment, step 210 can be specifically implemented through the following process.

[0050] First, based on the question keywords, keyword search is performed on each root node of the text tree structure database, and candidate prompt words are determined based on the search results; then, based on the target prompt words fed back by the user for the candidate prompt words and the question keywords, the complete question text is determined.

[0051] Specifically, in the case where the text tree structure database includes at least various question-answer text branches in the tree structure, and the root node of each question-answer text branch is a keyword in the corresponding question text, the server can perform a keyword search on each root node of the text tree structure database based on the question keyword input by the user, so as to retrieve at least one question text where the root node containing the question keyword is located, and use the remaining non-keywords except the question keyword in each retrieved question text as candidate prompt words, and then feed back at least one candidate prompt word to the client, so that the user can determine the target prompt word that best meets the question requirement from the at least one candidate prompt word. In this way, the server can integrate the question keyword and the target prompt word fed back by the user, such as splicing the question keyword and the target prompt word from left to right; thereby obtaining a complete question text.

[0052] For example, when the keyword of the question is "modify" and the candidate prompt words are "contact", "password" and "user name", if the target prompt word fed back by the user is "contact", the server can concatenate "modify" and "contact" into a complete question text "modify contact".

[0053] Based on the above Figure 2The model reasoning acceleration method shown, in an example embodiment, takes into account that different users in the task dialogue scenario have different ways of expressing the same question, which may affect the accuracy of the final output result of the model. Therefore, the text tree structure database can be used to recommend a small number of candidate prompt words with sufficient question frequency to the user, taking into account that the more frequently asked questions are in line with the user's expression and the model's questioning method. Based on this, the server determines the candidate prompt words based on the search results, which can be specifically implemented through the following process.

[0054] A plurality of question branches whose target root nodes are question keywords are searched in a text tree structure database, and a target question branch whose cumulative occurrence frequency of the target root node exceeds a preset question frequency threshold is determined from the plurality of question branches, and then a candidate prompt word matching a preset prompt word quantity threshold is determined from the target question branch.

[0055] Specifically, for multiple question branches searched from the text tree structure database, the target root node of each question branch is a question keyword, such as each target root node is "modify". At this time, the cumulative occurrence frequency of each root node in the target root node of each question branch can be compared with the preset frequency threshold in turn to determine the N target question branches with the largest cumulative occurrence frequency exceeding the preset question frequency threshold from the multiple question branches, until the candidate prompt word is determined from the N target question branches.

[0056] Exemplarily, the question keyword input by the user is "modify", the preset question frequency threshold M=500, N=1 and the preset prompt word quantity threshold C=2, and the cumulative occurrence frequency from left to right in one of the searched question texts "modify password" is "1000-800-600-550", and the cumulative occurrence frequency from left to right in another searched question text "modify contact" is "1000-800-300-280-250". After comparison, it is found that in "modify password", not only the cumulative occurrence frequencies (1000 and 800) of "modify" and "change" respectively exceed 500, but also the cumulative occurrence frequencies (600 and 550) of "secret" and "code" respectively in "modify password" also exceed 500; therefore, "modify password" can be used as the target question branch, and "password" can be fed back to the client as a candidate prompt word; in this way, the server can determine the complete question text by guiding the user to select "password" on the question input interface of the client and then click the send button.

[0057] Therefore, for the client, the text tree structure database can effectively guide the user input, so that each user question is more in line with the corresponding business scenario, and at the same time, the model inference engine can predict more accurate user questions; and by controlling the values of the three parameters M, N, and C, the sentence length and the number of sentences of each user question can be flexibly controlled, improving the question asking efficiency and user experience.

[0058] Here, it should be noted that the values of the three parameters M, N, and C can be pre-configured by the developer; or, they can also be determined based on the constructed text tree structure database. For example, 60% of the maximum cumulative question frequency in the text tree structure database is used as the preset question frequency threshold M, the number of remaining words in the question text corresponding to the maximum cumulative question frequency except the keyword of the question root node is used as the hint word number threshold C, and when there are at least two question texts corresponding to the maximum cumulative question frequency, the total number of the at least two question texts is used as the candidate hint threshold N.

[0059] Based on the above Figure 2 In an example embodiment of the model inference acceleration method shown above, step 220 can be specifically implemented through the following process.

[0060] First, when the complete question text exists in the text tree structure database, determine each question reply text branch in the text tree structure database that contains the complete question text, and determine each partial reply text in the reply text of each question reply text branch where the cumulative inference frequency of the reply token exceeds the preset inference frequency threshold; then, use the model inference engine to determine the complete reply text that matches both the complete question text and each partial reply text.

[0061] Among them, each question reply text branch includes the aforementioned complete question text and the reply text generated by the model inference engine for the complete question text, that is, each question reply text branch is a question-reply pair for task-based dialogue.

[0062] The cumulative inference frequency of each reply token can represent the total frequency of the model inference engine's inference prediction of the corresponding reply token, indicating how many times the model inference engine has made the same prediction when inferring the corresponding reply token. For example, when the cumulative inference frequency of a certain reply token "use" is 300, it can be considered that the model inference engine has made the same prediction of "use" 300 times in total; similarly, when the cumulative inference frequency of another reply token ",", it can also be considered that the model inference engine has made the same prediction of "," 100 times in total.

[0063] Specifically, for the complete question text input by the user, the server can first determine whether the complete question text exists in the text tree structure database, and if the complete question text exists in the text tree structure database, for each question reply text branch containing the complete question text in the text tree structure database, the server can compare the cumulative inference frequency of each reply word in the reply text of the question reply text branch with the preset inference frequency threshold, and determine the partial reply text containing multiple reply words exceeding the preset inference frequency threshold; traverse all question reply text branches according to the above process until all partial reply texts are determined.

[0064] Exemplarily, when a question-reply text branch includes a complete question text and a reply text of “Change password—Hello user, password” and the cumulative inference frequencies of all words in the reply text “Hello user, password” are “300-300-250-250-100-80-80” respectively, if the preset inference frequency threshold K=200, it is determined that part of the reply text is “Hello user”; similarly, when another question-reply text branch includes a complete question text and a reply text of “Change password—The password can be modified as follows” and the cumulative inference frequencies of all words in the reply text “The password can be modified as follows” are “250-250-120-100-70-70-50-50-30-30” respectively, if the preset inference frequency threshold K=200, it is determined that part of the reply text is “Password”.

[0065] At this time, the server can first determine a partial response text from all partial response texts as the target partial response text, and then concatenate the complete question text and the target partial response text as the input of the model inference engine to generate the corresponding complete response text.

[0066] It should be noted that, for the server, the constructed text tree structure database can be used to directly obtain part of the reply content for user questions. This part of the reply content, with the intervention of manual annotation, can not only reduce the reasoning pressure of the model inference engine, but also guide the model to output a reply text that is more in line with the task scenario; further, according to the size of the preset reasoning frequency threshold K, the diversity of the reply text can be flexibly controlled; therefore, when the same question text is requested repeatedly, the frequency of the corresponding question reply text branch increases, and the preset reasoning frequency threshold K remains unchanged, the fixed reply text length also increases accordingly, thereby effectively alleviating the computing power loss of similar question texts.

[0067] In an exemplary embodiment, the server uses a model inference engine to determine a complete response text that matches both the complete question text and different partial response texts, which is specifically achieved through the following process.

[0068] First, determine the corresponding inference frequency means for each partial response text; further, vote based on the proportion of each inference frequency mean in all inference frequency means, and determine the target partial response text from the different partial response texts based on the voting results; then, use the model inference engine to infer and predict the splicing result of the complete question text and the target partial response text to generate a complete response text.

[0069] Specifically, for each determined partial reply text, the server first determines the mean inference frequency corresponding to each partial reply text, that is, adds up the cumulative inference frequencies of all reply words in each partial reply text, and then divides the added result by the total number of reply words, in this way to obtain the mean of all inference frequencies.

[0070] For example, when a part of the reply text is "Hello user" and its respective cumulative inference frequencies are "300-300-250-250", the corresponding mean inference frequency is (300+300+250+250) / 4=275; when another part of the reply text is "password" and its respective cumulative inference frequencies are "250-250", the corresponding mean inference frequency is (250+250) / 2=250.

[0071] At this point, the server can calculate the proportion of each inference frequency mean in all inference frequency means, and then vote according to a random number randomly generated between 0 and 1, and use the voted partial reply text as the target partial reply text.

[0072] For example, when the average inference frequency corresponding to a partial reply text "Hello user" is 275, and the average inference frequency corresponding to another partial reply text "password" is 250, the two occupancy ratios are calculated as 275 / (275+250)=52.4% and 250 / (275+250)=47.6% respectively. At this time, voting is performed according to the generated random number. If "Hello user" is voted, "Hello user" is used as the target partial reply text, and "Change password-Hello user" is used as the final input of the model reasoning engine; if "Password" is voted, "Password" is used as the target partial reply text, and "Change password-Password" is used as the final input of the model reasoning engine, and some replies can be omitted.

[0073] It should be noted that, when the complete question text does not exist in the text tree structure database, the server can use the complete question text as the final input of the model inference engine for inference prediction, thereby generating a complete response text corresponding to the complete question text. Since the complete response text contains the target partial response text, it can also accelerate model inference.

[0074] Based on the above Figure 2 In the model reasoning acceleration method shown, in an exemplary embodiment, the text tree structure database can be created specifically according to the following process.

[0075] Firstly, the manual annotation results of the feedback of each original question reply text in the original database are obtained, and the manual annotation results include each target question reply text. The cumulative number of requests of the target question text in each target question reply text exceeds the number threshold and is a task-based dialogue, and each original question reply text represents different tasks in the preset business field; further, for each target question reply text, the target question text and the target reply text in the target question reply text are spliced ​​into a complete text, and the first character in the complete text is used as the main node, and the remaining words are used as branches, and the occurrence frequency of each character and each word in the complete text is accumulated and counted according to the tree structure; then, based on the accumulated statistical results and each target question reply text, an initial text tree structure database is created, and based on the pruning results fed back to the initial text tree structure database, the text tree structure database is determined.

[0076] Each original question reply text includes the original question text and the original reply text generated by the model inference engine based on the corresponding original question text.

[0077] The original database is a database system specifically used to store enterprise business data and information. The business database usually contains multiple types of data, such as customer data, product data, order data, transaction data, employee data, etc., and is a key component of enterprise operations and management.

[0078] The original database and the business database are the same set of databases, and the present invention will not add extra burden to the business database.

[0079] Specifically, refer to Figure 3 The flowchart of constructing a text tree structure database is shown in FIG. Figure 3 As shown, the server first obtains the original question response text of the task in the preset business field and stores it in the original database, such as first collecting all the original question response texts, then saving them in the original database, and storing each original question response text in the original database; at this time, the server can instruct relevant operators to perform data annotation on all the original question response texts in the original database. The purpose of data annotation is to manually screen out all target question response texts with a sufficient number of cumulative requests and / or containing popular business question keywords, etc., and each target question response text is a task-based dialogue.

[0080] A text tree database is constructed based on the answer texts of each target question. All the answer texts of the target question selected after manual annotation can be traversed, that is, the complete text (such as a sentence) spliced ​​together from the target question text and the target answer text in each target question answer text, and the first word in each complete text is used as the trunk, and all the remaining words are used as branches in turn, and the occurrence frequency of each word and each word in the complete text is accumulated and counted respectively according to the tree structure; after the accumulated statistical results corresponding to all the answer texts of the target questions are obtained, the initial text tree structure database is created in combination with the answer texts of each target question.

[0081] At this point, the server can instruct the developer to prune the initial text tree structure database, that is, to prune the question response branches that do not meet the preset question response branch requirements, such as removing question response branches that do not meet business specifications, question response texts with a small cumulative reasoning frequency, and question response texts with a small cumulative occurrence frequency. In this way, not only can the drawback of the text tree structure database being too large be avoided, but also the question response texts with a large frequency and the most suitable for business scenarios can be sorted and accumulated, thereby improving the reliability of the text tree structure database and the task management capabilities of the model reasoning engine. So that the server can determine that the text tree structure database is complete based on the pruning results fed back by the developer.

[0082] It should be noted that the server can also construct a corresponding initial text tree structure database for all original question response texts, and then instruct the developers to prune it, so as to eliminate question response texts in at least one of the following situations: question response branches that do not meet business specifications, question response text branches with small cumulative reasoning frequencies and small cumulative occurrence frequencies, and question response text branches for non-task-based dialogues. Alternatively, the operation and maintenance personnel can be instructed to manually annotate target question texts that do not require repeated reasoning by the model reasoning engine, and then save the annotated target question texts and their corresponding target response texts to the original database to construct a tree structure; the screening here can be performed in batches using regular methods or text language tools in related technologies, such as screening out a batch of question response texts containing multiple keywords by searching for multiple keywords. The present invention does not specifically limit the process of constructing a text tree structure database.

[0083] Based on the above Figure 2In the model reasoning acceleration method shown, in an exemplary embodiment, in order to ensure that the constructed text tree structure database can greatly improve the reasoning speed of the model reasoning engine, the operator can be prompted to clean the screened task-based dialogue question response texts to obtain each target question response text, and then annotate each target question response text with the user's questioning method and the model response method. Based on this, in the model reasoning acceleration method provided by the present invention, the manual annotation results also include the required question questioning method annotation results and the required model response method annotation results, as well as at least one of cleaning the screened task-based dialogue question response texts.

[0084] It should be noted that during the data labeling stage, the operation and maintenance personnel can be prompted to add appropriate manual modifications, that is, the operation and maintenance personnel should first perform a cleaning operation on all the task-based dialogue question response texts screened out through data labeling, so as to delete the task-based dialogue question response texts containing invalid questions, invalid responses, and question response pairs that violate social public order and good morals, and then perform a frequency judgment on the question response texts obtained after the cleaning operation, so as to determine the response texts for each target question.

[0085] Afterwards, the operation and maintenance personnel can also be instructed to modify the questioning method for the target question text in at least one target question reply text, and / or, modify the reply method for the target reply text in at least one target question reply text, wherein the modification of the reply method is intended to require the corresponding user to ask the question in a specific method, and the modification of the reply method is intended to require the model inference engine to answer the user's question in a specific method.

[0086] Based on the above Figure 2 In the model reasoning acceleration method shown, in an exemplary embodiment, in order to improve the performance and retrieval efficiency of the constructed text tree structure database, the server can save the input and output of the model reasoning engine as new question reply text to facilitate subsequent updating of the text tree structure database. Based on this, the model reasoning acceleration method provided by the present invention can also include: updating the text tree structure database based on the complete question text, the target reply text and the complete reply text.

[0087] Specifically, when the complete question text sent by the user exists in the constructed text tree structure database, the server can use the text tree structure database to determine the target partial reply text that answers the complete question text. At this time, the concatenation result of the complete question text and the target partial reply text can be used as the final input of the model reasoning engine, and the final output of the model reasoning engine is the complete reply text containing the target partial reply text. At this time, the server can use the final input and final output of the model reasoning engine as the new question reply text and save it in the original database to facilitate subsequent updating of the text tree structure database.

[0088] It should be noted that, in the case where the complete question text sent by the user does not exist in the constructed text tree structure database, the final input of the model reasoning engine is the complete question text, and the final output of the model reasoning engine is the complete response text inferred and predicted for the complete question text. At this time, the server can also use the final input and final output of the model reasoning engine as new question response texts and save them in the original database to facilitate subsequent updates to the text tree structure database. In this way, for the text tree structure database, by collating and accumulating the question response texts with a large number of counts and that best fit the business scenario, the model reasoning engine can be directly fine-tuned with a slight modification, further enhancing the task management capabilities of the model reasoning engine.

[0089] For example, refer to Figure 4 The second flowchart of the model reasoning acceleration method shown in Figure 4 As shown, the model reasoning acceleration method provided by the present invention implements the model reasoning process through 8 steps.

[0090] Step 1: The client receives the question inputted by the user word by word, and sends the text inputted by the user each time to the client as the question keyword, such as using "modify" inputted by the user on the client as the question keyword; Step 2: The server receives the user keyword sent by the client, searches from the root node of the text tree structure database, determines the candidate prompt word based on the search results and then feeds it back to the client; Step 3: When the user selects the target prompt word based on the candidate prompt words displayed by the client and clicks the send button, the complete question text is sent to the server; Step 4: The server determines the final input to be sent to the model reasoning engine according to the complete question text inputted by the user, and the final input is the complete question text or the concatenation result of the complete question text and the target partial reply text; Step 5: The server feeds back the above final input to the model reasoning engine; Step 6: The model reasoning engine generates a complete reply text according to the above final input and feeds it back to the server; Step 7: The server feeds back the complete reply result to the client through transparent transmission; Step 8: The server saves the final input and final output of the model reasoning engine as new question reply text in the original database to facilitate the subsequent update of the text tree structure database. In this way, the text tree structure database constructed can not only be used to guide users to ask questions, but also obtain the most likely partial or full responses based on their statistical distribution, thereby reducing the pressure on the reasoning engine and increasing the concurrency. The specific process involved can refer to the above embodiment. No further description is given here.

[0091] The model reasoning acceleration device provided by the present invention is described below. The model reasoning acceleration device described below and the model reasoning acceleration method described above can be referenced to each other.

[0092] Reference Figure 5 , which is a schematic diagram of the structure of the model reasoning acceleration device provided by the present invention, such as Figure 5 As shown, the model reasoning acceleration device 500 includes: a first reasoning acceleration unit 510 and a second reasoning acceleration unit 520.

[0093] The first reasoning acceleration unit 510 is used to determine a complete question text that matches a question keyword input by the user based on a text tree structure database constructed from question reply texts for tasks in a preset business field.

[0094] The second reasoning acceleration unit 520 is used to determine the complete response text corresponding to the complete question text based on the model reasoning engine and the text tree structure database, and feed back the complete response text to the user.

[0095] Optionally, the first reasoning acceleration unit 510 is specifically used to perform a keyword search on each root node of the text tree structure database based on the question keyword, and determine the candidate prompt word based on the search results; determine the complete question text based on the target prompt word feedback by the user for the candidate prompt word and the question keyword.

[0096] Optionally, the first reasoning acceleration unit 510 is specifically used to search for multiple question branches whose target root nodes are question keywords in the text tree structure database, and determine from the multiple question branches a target question branch whose cumulative occurrence frequency of the target root node exceeds a preset question frequency threshold, and then determine from the target question branch a candidate prompt word that matches a preset prompt word quantity threshold.

[0097] Optionally, the second reasoning acceleration unit 520 is specifically used to determine, when the complete question text exists in the text tree structure database, each question-response text branch containing the complete question text, and determine, in the reply text of each question-response text branch, each partial reply text whose cumulative reasoning frequency of reply words exceeds a preset reasoning frequency threshold; and use the model reasoning engine to determine the complete reply text that matches both the complete question text and each partial reply text.

[0098] Optionally, the second reasoning acceleration unit 520 is specifically used to determine the reasoning frequency mean corresponding to each partial reply text; vote based on the proportion of each reasoning frequency mean in all reasoning frequency means, and determine the target partial reply text from the different partial reply texts based on the voting results; use the model reasoning engine to infer and predict the splicing result of the complete question text and the target partial reply text to generate a complete reply text.

[0099] Optionally, the model reasoning acceleration device provided by the present invention may also include a tree database creation unit, which is used to obtain manual annotation results for each original question reply text feedback in the original database, the manual annotation results include each target question reply text, the cumulative number of requests for the target question text in each target question reply text exceeds the number threshold and is a task-based dialogue, and each original question reply text represents a different task in a preset business field; for each target question reply text, the target question text and the target reply text in the target question reply text are spliced ​​into a complete text, and the first character in the complete text is used as the main node, and the remaining word units are used as branches, and the occurrence frequency of each character and each word unit in the complete text is accumulated and counted according to the tree structure; based on the accumulated statistical results and each target question reply text, an initial text tree structure database is created, and based on the pruning results fed back to the initial text tree structure database, the text tree structure database is determined.

[0100] Optionally, the tree database creation unit is specifically used to determine that the manual annotation results also include the annotation results of the required question asking method and the annotation results of the required model reply method, and to at least clean the screened task-based dialogue question reply texts.

[0101] Optionally, the model reasoning acceleration device provided by the present invention may also include a tree database updating unit for updating the text tree structure database based on the complete question text, the target reply text and the complete reply text.

[0102] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communications interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the model reasoning acceleration method, which includes: determining a complete question text matching the question keyword input by the user based on a text tree structure database constructed for question reply texts of tasks in a preset business field; determining a complete reply text corresponding to the complete question text based on the model reasoning engine and the text tree structure database, and feeding back the complete reply text to the user.

[0103] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0104] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the model reasoning acceleration method provided by the above methods, and the method includes: based on a text tree structure database constructed based on question reply texts for tasks in a preset business field, determining a complete question text that matches the question keywords input by the user; based on a model reasoning engine and a text tree structure database, determining a complete reply text corresponding to the complete question text, and feeding back the complete reply text to the user.

[0105] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the model reasoning acceleration method provided by the above-mentioned methods, the method comprising: determining a complete question text that matches the question keywords input by the user based on a text tree structure database constructed based on question reply texts for tasks in a preset business field; determining a complete reply text corresponding to the complete question text based on a model reasoning engine and a text tree structure database, and feeding back the complete reply text to the user.

[0106] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A model reasoning acceleration method, characterized in that: include: Based on a text tree structure database constructed for question answering texts of tasks in a preset business field, determine a complete question text that matches the question keyword input by the user; Based on the model inference engine and the text tree structure database, a complete reply text corresponding to the complete question text is determined, and the complete reply text is fed back to the user.

2. The model reasoning acceleration method according to claim 1, characterized in that: The text tree structure database constructed based on the question reply text for the task in the preset business field determines the complete question text that matches the question keyword input by the user, including: Based on the question keywords, keyword search is performed on each root node of the text tree structure database, and candidate prompt words are determined based on the search results; The complete question text is determined based on the target prompt word fed back by the user for the candidate prompt word and the question keyword.

3. The model reasoning acceleration method according to claim 2, characterized in that: The step of determining a candidate prompt word based on the search results includes: In the text tree structure database, multiple question branches whose target root nodes are the question keywords are searched, and a target question branch whose cumulative occurrence frequency of the target root node exceeds a preset question frequency threshold is determined from the multiple question branches, and then the candidate prompt words that match a preset prompt word quantity threshold are determined from the target question branch.

4. The model reasoning acceleration method according to any one of claims 1 to 3, characterized in that: The method of determining a complete response text corresponding to the complete question text based on the model inference engine and the text tree structure database includes: In the case where the complete question text exists in the text tree structure database, determining each question reply text branch containing the complete question text in the text tree structure database, and determining each partial reply text whose cumulative inference frequency of reply word units exceeds a preset inference frequency threshold value in the reply text of each question reply text branch; The model inference engine is used to determine the complete response text that matches both the complete question text and the partial response texts.

5. The model reasoning acceleration method according to claim 4, characterized in that: The using the model inference engine to determine the complete response text that matches both the complete question text and each of the partial response texts includes: Determine the inference frequency means corresponding to each of the parts of the response text; Voting is performed based on the proportion of each of the inference frequency means in all the inference frequency means, and determining a target partial reply text from the different partial reply texts based on the voting result; The model inference engine is used to perform inference and prediction on the splicing result of the complete question text and the target partial reply text to generate the complete reply text.

6. The model reasoning acceleration method according to any one of claims 1 to 3, characterized in that: The creation process of the text tree structure database includes: Obtaining manual annotation results for each original question reply text feedback in the original database, wherein the manual annotation results include each target question reply text, the cumulative number of requests for the target question text in each target question reply text exceeds a number threshold and is a task-based dialogue, and each original question reply text represents a different task in the preset business field; For each target question reply text, the target question text and the target reply text in the target question reply text are spliced ​​into a complete text, and the first character in the complete text is used as the main node and the remaining words are used as branches, and the occurrence frequency of each character and each word in the complete text is accumulated and counted according to the tree structure; Based on the accumulated statistical results and the target question reply texts, an initial text tree structure database is created, and based on the pruning results fed back to the initial text tree structure database, the text tree structure database is determined.

7. The model reasoning acceleration method according to claim 6, characterized in that: The manual annotation results also include annotation results of the required question asking method and the required model answering method, as well as at least one of cleaning the screened task-based dialogue question answering texts.

8. The model reasoning acceleration method according to claim 5, characterized in that: The method further comprises: The text tree structure database is updated based on the complete question text, the target response text and the complete response text.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the model reasoning acceleration method as described in any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the model reasoning acceleration method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and system to generate mapping among a question and content with relevant answer

    CA2715777A1

  • Intelligent dialogue method and device

    CN116204621A

  • Production problem record recommendation method and device, electronic equipment and medium

    CN117435616A

  • Intelligent question and answer method and device, equipment and medium

    CN117764176A

  • Vector database retrieval method and device based on large model, terminal and medium

    CN118312594A