Task request optimization method and system, and related device
By introducing different prompts from the domain knowledge graph into the task request, the problem of low accuracy in generating large language models (LLM) across different task requests in the same specific domain is solved, achieving more efficient request result generation.
Patent Information
- Application Number
- PCT/CN2025/091065
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-28
- Filing Date
- 2025-04-24
- Publication Date
- 2025-11-06
AI Technical Summary
In existing technologies, using the same optimized prompt information for different task requests in the same specific domain leads to low accuracy of request results generated by Large Language Models (LLMs), which cannot provide differentiated information.
By introducing domain knowledge graphs, we can optimize the introduction of different prompts related to specific domains during the task request process. By using knowledge from the domain knowledge graph as prompts, we can enrich and improve the quality of the prompts and ensure that each task request carries unique prompts.
This improves the ability of Large Language Models (LLMs) to understand different task requests in the same specific domain, generating more accurate request results and enhancing the accuracy of the request results.
Smart Images

Figure CN2025091065_06112025_PF_FP_ABST
Abstract
Description
Task request optimization method, system and related device
[0001] The present application claims priority to the Chinese patent application No. 202410530290.4, filed on April 28, 2024, with the State Intellectual Property Office of China, and entitled "Task request optimization method, system and related device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the technical field of computer, and in particular to a task request optimization method, system and related device. BACKGROUND
[0003] In order to help the large language model (LLM) better understand the task and generate more accurate and natural request results based on the task request, the task request will carry not only the content but also the prompt information. The content is the data to be processed. The prompt information is the information related to the task. For example, the task request A0 is "What is the tax theme of the text 'Article 3 of the Provisional Regulations of the People's Republic of China on Urban Maintenance and Construction Tax: The taxable sales amount refers to the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services and transferring real estate, etc.'?", and the tax theme includes tax base, tax item, tax rate, tax subject, tax location, tax time point, tax preference, tax collection range, tax calculation, tax collection management.", the content C0 is "What is the tax theme of the text 'Article 3 of the Provisional Regulations of the People's Republic of China on Urban Maintenance and Construction Tax: The taxable sales amount refers to the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services and transferring real estate, etc.'?", and the prompt P0 is "The tax theme includes tax base, tax item, tax rate, tax subject, tax location, tax time point, tax preference, tax collection range, tax calculation, tax collection management."
[0004] As a kind of prompt engineering method, the hard prompt can filter out the knowledge related to the task from the knowledge source, and then add the filtered knowledge to the prompt to increase the information content of the prompt. In this way, the specific content of the prompt can be optimized, and the quality of the prompt can be improved, so that the LLM can better understand the prompt and generate more accurate request results based on the prompt.
[0005] However, the knowledge source utilized by the hard prompt is usually large-scale general domain text, which comes from various fields and topics, including news, social media, encyclopedias, novels, papers, etc. Therefore, for a specific domain task request (such as task request A0), the prompt (such as prompt P0) used to describe information related to the specific domain is very limited. This leads to the hard prompt adding all the knowledge related to the specific domain to the prompts when processing different task requests in the same specific domain (i.e., having different content but the same prompt), thereby generating the same optimized prompt. However, the same optimized prompt cannot provide differentiated information for the LLM to better understand different tasks in the same specific domain, resulting in low accuracy of the request results generated by the LLM for different task requests in the same specific domain. SUMMARY
[0006] The present application provides a task request optimization method, system and related equipment, which can solve the problem that the prompt in different task requests in the same specific domain cannot provide differentiated information for the LLM to better understand different tasks in the same specific domain, resulting in low accuracy of the request results generated by the LLM for different task requests in the same specific domain.
[0007] In a first aspect, a task request optimization method is provided, which includes receiving a first task request and outputting an optimized first task request. The first task request includes first content and first prompt information. The first content is data to be processed, and the first prompt information is information related to a specific domain. The optimized first task request includes the first task request and second prompt information. The second prompt information is related to the same specific domain, and the second prompt information is different from the first prompt information.
[0008] The above-mentioned task request optimization method further includes receiving a second task request and outputting an optimized second task request. The second task request includes second content and the first prompt information mentioned above. The second content is data to be processed, and the second content is different from the first content mentioned above. The optimized second task request includes the second task request and third prompt information. The third prompt information is related to the same specific domain, and the third prompt information is different from the first prompt information. The third prompt information is different from the second prompt information mentioned above.
[0009] In the scheme, the second prompt information is carried in the optimized first task request, and the third prompt information is carried in the optimized second task request, so that different prompt information is added in different task requests in the same specific field. When the subsequent task requests carrying different prompt information are input into the large language model, the large language model can better understand the different tasks in the same specific field and provide differential information, so that the large language model can generate more accurate request results for different task requests in the same specific field, thereby improving the accuracy of the request results.
[0010] In some possible implementation manners, the second prompt information includes one or more sentences. The sentence is used to describe the knowledge in the domain knowledge graph. The domain knowledge graph is used to describe the knowledge in the specific field.
[0011] In the scheme, the domain knowledge graph for carrying the knowledge in the specific field is introduced, and the knowledge in the domain knowledge graph is added to the task request in the form of a sentence as prompt information, which improves the utilization rate of the domain knowledge graph and enriches the knowledge source of the prompt information. Moreover, compared with selecting information related to the specific field from general domain text as prompt information, the knowledge in the domain knowledge graph is more diverse and has higher quality, so that the technical scheme uses the knowledge in the domain knowledge graph as prompt information, which can improve the quality of the prompt information.
[0012] In some possible implementation manners, after receiving the first task request, the method further includes: sending a first vector, receiving a first sentence, a vector of the first sentence, and a first element label, and generating the optimized first task request based on the first sentence, the vector of the first sentence, and the first element label. The first vector is determined based on the first task request. The first sentence is used to describe the knowledge in the domain knowledge graph. The category label of the first sentence is the same as the category label of the first vector. The category label is used to indicate the entity in the domain knowledge graph. The first element label is an element label of the first sentence, and is used to indicate the concept in the domain knowledge graph.
[0013] Compared with directly using the knowledge of the entire domain knowledge graph in the form of a sentence as prompt information in the first task request, the scheme determines the first vector based on the first task request, and optimizes the first task request based on the first sentence and the vector of the first sentence having the same category label as the first vector and the element label, that is, only the knowledge (that is, the first sentence) related to the first task request is selected from the domain knowledge graph to optimize the first task request, so that the content of the effective information in the optimized first task request is improved.
[0014] In some possible implementation manners, the generating the optimized first task request based on the first statement, the vector of the first statement, and the first element label comprises: obtaining a first target statement according to the vector of the first task request and the vector of the first statement with the first element label being the first concept. Taking the first target statement and the first statement with the first element label not being the first concept as second prompt information. Combining the second prompt information with the first task request to obtain the optimized first task request. The first concept is a concept in the domain knowledge graph.
[0015] In the scheme, after obtaining the first statement, the first statement most relevant to the first task request is further screened from the first statements with the same element label, and the screened first statement is taken as the second prompt information, so that the length of the second prompt information is reduced while the content of effective information in the optimized first task request is further improved. Moreover, the second prompt information includes the first statement under each element label, so that the knowledge in different dimensions in the domain knowledge graph is retained in the second prompt information, and the knowledge in a specific field provided by the second prompt information is complete and comprehensive.
[0016] In some possible implementation manners, the ontology model of the domain knowledge graph comprises a first layer and a second layer. A concept in the second layer is a constituent element of a concept in the first layer. The category label is used to indicate an entity of the concept in the first layer. The element label is a concept in the second layer.
[0017] In a more specific implementation manner, the concept in the first layer comprises a category, and the concept in the second layer comprises one or more of a definition, an explanation, a case, and a constraint condition. The category is used to describe a collection of a group of things with similar characteristics; the definition is used to provide the meaning of the category; the explanation is used to provide the explanation information of the category; the case is used to provide the example of the category; and the constraint condition is used to indicate the range or constraint of the category.
[0018] In some possible implementation manners, after receiving the first task request, the method further comprises: sending a first vector, receiving a first statement, taking the first statement as the second prompt information, combining the second prompt information with the first task request to obtain the optimized first task request. The first vector is determined based on the first task request. The first statement is used to describe the knowledge in the domain knowledge graph. The category label of the first statement is the same as the category label of the first vector. The category label is used to indicate an entity in the domain knowledge graph.
[0019] Compared with directly taking the knowledge of the entire field knowledge graph in the form of a sentence as the prompt information in the first task request, the above scheme first determines the first vector based on the first task request, and then selects the first sentence with the same category label as the first vector as the second prompt information to optimize the first task request, that is, only the knowledge (that is, the first sentence) related to the first task request is selected from the field knowledge graph to optimize the first task request, so that the content of the effective information in the optimized first task request can be improved. Further, for the scenario that the number of first sentences is small, the technical scheme directly takes the first sentence as the second prompt information after obtaining the first sentence, so that the speed of obtaining the second prompt information can be improved, and the optimization efficiency of the first task request can be improved.
[0020] In some possible implementation manners, before the first vector is sent, the method further includes: receiving vectors of a plurality of sentences, and selecting the first vector from the vectors of the plurality of sentences according to the vector of the first task request. The vector of a sentence is obtained by converting the sentence. The sentence corresponding to the vector of the sentence is used to describe the knowledge in the field knowledge graph;
[0021] In the above scheme, the matching between the task request and the knowledge in the field knowledge graph is converted into the calculation between vectors, so that the most relevant knowledge in the field knowledge graph for the task request can be quickly locked, the matching speed is improved, and the entire optimization process of the task request is improved.
[0022] In a second aspect, a task request optimization system is provided, which includes a calculation unit and a combination unit.
[0023] The calculation unit is configured to receive a first task request. The first task request includes first content and first prompt information. The first content is data to be processed. The first prompt information is information related to a specific field.
[0024] The combination unit is configured to output an optimized first task request. The optimized first task request includes the first task request and second prompt information. The second prompt information is information related to the same specific field, and the second prompt information is different from the first prompt information.
[0025] The calculation unit is further configured to receive a second task request. The second task request includes second content and the first prompt information. The second content is data to be processed, and the second content is different from the first content.
[0026] The combination unit is further configured to output an optimized second task request. The optimized second task request includes the second task request and third prompt information. The third prompt information is information related to the same specific field. Furthermore, the third prompt information is different from the first prompt information, and the third prompt information is different from the second prompt information.
[0027] In some possible implementation manners, the second prompt information includes one or more sentences. The sentences are used to describe the knowledge in the domain knowledge graph.
[0028] In some possible implementation manners, the system further includes a transceiving unit and a combination unit.
[0029] The transceiving unit is configured to transmit the first vector after the computing unit receives the first task request. The first vector is determined based on the first task request.
[0030] The transceiving unit is further configured to receive the first sentence, the vector of the first sentence, and the first element label. The first sentence is used to describe the knowledge in the domain knowledge graph. The category label of the first sentence is the same as the category label of the first vector. The category label is used to indicate the entity in the domain knowledge graph. The first element label is the element label of the first sentence, and is used to indicate the concept in the domain knowledge graph.
[0031] The combination unit is configured to generate the optimized first task request based on the first sentence, the vector of the first sentence, and the first element label.
[0032] In some possible implementation manners, the combination unit is specifically configured to: obtain a first target sentence according to the vector of the first task request and the vector of the first sentence of the first concept; take the first sentence of the first concept and the first element label as the second prompt information; and combine the second prompt information with the first task request to obtain the optimized first task request. The first concept is a concept in the domain knowledge graph.
[0033] In some possible implementation manners, the ontology model of the domain knowledge graph includes a first layer and a second layer. The concept in the second layer is a constituent element of the concept in the first layer. The category label is used to indicate the entity of the concept in the first layer. The element label is the concept in the second layer.
[0034] In a more specific implementation manner, the concept in the first layer includes a category, and the concept in the second layer includes one or more of a definition, an explanation, a case, and a constraint condition. The category is used to describe a collection of a group of things with similar characteristics; the definition is used to provide the meaning of the category; the explanation is used to provide the explanation information of the category; the case is used to provide the example of the category; and the constraint condition is used to indicate the range or constraint of the category.
[0035] In some possible implementation manners, the system further includes a transceiving unit and a combination unit.
[0036] The transceiver is configured to transmit the first vector after the computing unit receives the first task request. The first vector is determined based on the first task request.
[0037] The transceiver is further configured to receive a first sentence. The first sentence is used to describe knowledge in the domain knowledge graph. The category label of the first sentence is the same as the category label of the first vector. The category label is used to indicate an entity in the domain knowledge graph.
[0038] The combination unit is configured to combine the first sentence as the second prompt information with the first task request to obtain the optimized first task request.
[0039] In some possible implementation manners, the system further includes a matching unit.
[0040] The matching unit is configured to receive vectors of a plurality of sentences before the transceiver transmits the first vector. The vector of a sentence is obtained by converting the sentence. The sentence corresponding to the vector of the sentence is used to describe knowledge in the domain knowledge graph.
[0041] The matching unit is further configured to select the first vector from the vectors of the plurality of sentences according to the vector of the first task request.
[0042] In a third aspect, a computing system is provided, including a task request optimization system and a large language model platform,
[0043] The task request optimization system is configured to perform the method of any one of the first aspect;
[0044] The large language model platform is configured to receive the optimized first task request from the task request optimization system, and obtain a first request result according to the optimized first task request.
[0045] In a fourth aspect, a chip system is provided, including a processor and a power supply circuit configured to supply power to the processor. The processor is configured to perform the method of any one of the first aspect.
[0046] In a fifth aspect, a computing device is provided, including a processor and a memory configured to store instructions. The processor is configured to execute the instructions. When the processor executes the instructions, the method of any one of the first aspect is implemented.
[0047] In a sixth aspect, a computing device cluster is provided, including at least one computing device. Each computing device includes a processor and a memory.
[0048] The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method of any one of the first aspect.
[0049] In a seventh aspect, a computer program product including instructions, which when executed by a computing device, cause the computing device to perform the method of any one of the first aspect.
[0050] In an eighth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium includes computer program instructions, which when executed by a computing device, cause the computing device to perform the method of any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0051] FIG. 1A is a schematic diagram of a knowledge graph according to an embodiment of the present application;
[0052] FIG. 1B is a schematic diagram of an ontology model of a knowledge graph according to an embodiment of the present application;
[0053] FIG. 2A is an architecture diagram of a task request optimization system according to an embodiment of the present application;
[0054] FIG. 2B is an architecture diagram of another task request optimization system according to an embodiment of the present application;
[0055] FIG. 3 is a flow diagram of a task request optimization method according to an embodiment of the present application;
[0056] FIG. 3A is a flow diagram of optimizing a first task request in a task request optimization method according to an embodiment of the present application;
[0057] FIG. 3B is a flow diagram of optimizing a second task request in a task request optimization method according to an embodiment of the present application;
[0058] FIG. 3C is a flow diagram of optimizing a first task request in another task request optimization method according to an embodiment of the present application;
[0059] FIG. 3D is a flow diagram of optimizing a second task request in another task request optimization method according to an embodiment of the present application;
[0060] FIG. 4 is a structural diagram of a computing device according to an embodiment of the present application;
[0061] FIG. 5 is a structural diagram of a computing device cluster according to an embodiment of the present application;
[0062] FIG. 6 is a structural diagram of another computing device cluster according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] With reference to the drawings, the technical solutions in the embodiments of the present application will be described below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0064] Before introducing the embodiments of the present application, the concepts and relationships of the field knowledge graph, the ontology model and the triple are introduced briefly.
[0065] (1) Field knowledge graph
[0066] The field knowledge graph is a structured knowledge representation method, which represents the knowledge in a specific field by describing the concepts, entities, attributes and relationships among them in the specific field. The concept is an abstraction and generalization of things in a specific field. The entity is a specific instance of the concept. The attribute is used to describe the characteristics of the entity under the concept. The knowledge refers to the information related to facts, concepts, rules or relationships. The field knowledge graph is presented in the form of a graph, in which the nodes represent entities or concepts, and the edges represent the relationships between entities, the relationships between concepts or the relationships between entities and concepts.
[0067] As an example, the field knowledge graph can be a tax knowledge graph. The tax knowledge graph is used to describe the entities, concepts, attributes and relationships among them in the tax field, so as to represent various tax-related information such as tax provisions, tax policies, tax processes, tax subjects, etc. Referring to FIG. 1A, FIG. 1A is a schematic diagram of a knowledge graph provided in an embodiment of the present application. For the sake of brevity of the description, FIG. 1A only shows part of the nodes and edges in the tax knowledge graph.
[0068] As shown in FIG. 1A, in the tax knowledge graph, the node “Tax base” and the node “is the direct amount basis for calculating the tax payable by the tax subject…” are connected by the edge “definition”, thereby representing the definition of the tax base in the tax field; the node “Tax base” and the node “Physical form” are connected by the edge “include”, thereby representing the related information of the tax base in the tax field; the node “Tax base” and the node “Article 3 of the Provisional Regulations of the People’s Republic of China on Real Estate Tax…” are connected by the edge “case”, thereby representing the tax provisions related to the tax base in the tax field.
[0069] (2) Ontology model
[0070] The ontology model is a formalized knowledge representation model, which provides a structured knowledge representation framework for the domain knowledge graph by defining the concepts, entities, attributes and the relationships among them in a specific domain, including the description of the concepts, the hierarchical structure among the concepts and the description of the attributes, and so on. The hierarchical structure among the concepts is used to describe the subordinate relationship between the concepts, and one or more concepts in the next layer are the constituent elements of a concept in the previous layer.
[0071] Continuing with the above (1) as an example of the tax knowledge graph, the ontology model of the tax knowledge graph is used to define the categories, concepts, attributes and the relationships among them in the tax domain. Referring to FIG. 1B, FIG. 1B is a schematic diagram of an ontology model of a knowledge graph provided by an embodiment of the present application.
[0072] As shown in FIG. 1B, the ontology model of the tax knowledge graph includes a first layer and a second layer, and the multiple concepts in the second layer are the constituent elements of the concepts in the first layer. Therefore, compared with the second layer, the first layer is a high layer, and the second layer is a low layer. Since the ontology model of the tax knowledge graph only has two layers, the first layer is the highest layer.
[0073] Specifically, the first layer includes one concept of “category”, and the second layer includes five concepts of “definition”, “explanation”, “case”, “constraint condition” and “other information”. The concepts of “definition”, “explanation”, “case”, “constraint condition” and “other information” are all elements constituting the concept of “category”. More specifically, the relationship between the concept of “category” and the concept of “definition” is “definition”, the relationship between the concept of “category” and the concept of “explanation” is “include”, the relationship between the concept of “category” and the concept of “case” is “case”, the relationship between the concept of “category” and the concept of “constraint condition” is “require”, and the relationship between the concept of “category” and the concept of “other information” is “have”.
[0074] Among them, the concept of “category” is used to describe a collection of things with similar characteristics. The concept of “definition” is used to provide the accurate meaning of the category, which can be obtained from laws, standards and term libraries, and can also be provided by experts in the tax domain. The “explanation” is used to provide the explanation information of the category, which can be obtained from books, encyclopedias and business specifications, and can also be provided by experts in the tax domain. The concept of “case” is a specific example of the category, which can be obtained from laws, standards and tax systems, and can also be provided by experts in the tax domain. The concept of “constraint condition” is used to indicate the scope or constraint of the category. The concept of “other information” includes information related to “category” but not belonging to the concepts of “definition”, “explanation”, “case” and “constraint condition”.
[0075] In combination with FIG. 1A and FIG. 1B, it can be known that: the nodes in the tax knowledge graph are entities of the concepts in the ontology model, and the edges in the tax knowledge graph cover the relationships between the concepts in the ontology model. Among them, the corresponding relationship between the concept to which the node (i.e., the entity) in the tax knowledge graph belongs and the relationship between the edge in the tax knowledge graph and the concept in the ontology model can be determined by a tax field expert.
[0076] For example, the node "tax base" and the node "tax amount calculation" are both entities of the concept "category"; the node "is a direct quantity basis for calculating the tax amount of the tax object …" and the node "the tax amount refers to the amount of tax that an enterprise shall pay according to the provisions of the tax law …" are both entities of the concept "definition"; the node "physical form" and the node "value-added tax" are both entities of the concept "explanation"; the node "Article 3 of the Regulations of the People's Republic of China on Real Estate Tax …" and the node "Article 22 of the Law of the People's Republic of China on Enterprise Income Tax …" are both entities of the concept "case". The edge "definition", the edge "include", and the edge "case" are all relationships between concepts in the ontology model, while the edge "belongs to", the edge "general calculation formula", and the edge "meaning" only describe the relationship between nodes.
[0077] (3) Triple
[0078] A triple is a basic unit in a field knowledge graph. A triple is composed of a subject, a predicate, and an object, and has a format of (subject, predicate, object), wherein the subject represents an entity, the object represents another entity, and the predicate represents the relationship between the subject and the object. Therefore, a triple can describe the relationship between entities, thereby representing the knowledge in a field knowledge graph.
[0079] Continuing with the above (1) tax knowledge graph in the field knowledge graph as an example, the triples of the tax knowledge graph are shown in Table 1 below. For the sake of brevity of the description, Table 1 only shows seven triples.
[0080] Table 1
[0081] (Continued)
[0082] To solve the problem that prompt information in different task requests in the same specific field cannot provide differentiated information for the large language model (LLM) to better understand different tasks in the same specific field, resulting in low accuracy of request results generated by the LLM for different task requests in the same specific field, the present application provides a task request optimization system. The system can receive a task request carrying content and prompt information, wherein the content is data to be processed, and the prompt information is information related to a specific field; and output an optimized task request, wherein the optimized task request includes the task request before optimization and target prompt information, the target prompt information is information related to the same specific field, and the target prompt information is different from the prompt information in the task request before optimization. The system is used to optimize different task requests in the same specific field respectively, obtain task requests carrying different target prompt information, that is, obtain different optimized task requests, so that different target prompt information in different optimized task requests can provide differentiated information for the LLM to better understand different tasks in the same specific field, so that the LLM can generate more accurate request results for different task requests in the same specific field, thereby improving the accuracy of the request results.
[0083] Referring to FIG. 2A, FIG. 2A is an architecture diagram of a task request optimization system according to an embodiment of the present application. As shown in FIG. 2A, the architecture includes a knowledge graph system 100, a vector storage system 200, a client 300, a task request optimization system 400, and a large language model platform 500. Furthermore, the knowledge graph system 100 and the vector storage system 200, the client 300 and the task request optimization system 400, the vector storage system 200 and the task request optimization system 400, the task request optimization system 400 and the large language model platform 500, and the client 300 and the large language model platform 500 can communicate through wired or wireless means.
[0084] The knowledge graph system 100 is used to store the domain knowledge graph (such as the tax knowledge graph in the domain knowledge graph (1) described above) and send the knowledge in the domain knowledge graph to the vector storage system 200. In a specific implementation, the knowledge graph system 100 stores the domain knowledge graph in the format of triples (such as Table 1 of the triples used to describe the tax knowledge graph in the triples (3) described above).
[0085] The vector storage system 200 is used to calculate the knowledge in the domain knowledge graph to obtain the vector of the knowledge, and send the knowledge and the vector of the knowledge to the task request optimization system 400.
[0086] The client 300 is configured to receive a task request input by a user, and send the task request to the task request optimization system 400. The task request carries content and prompt information. The content is data to be processed. The prompt information is information related to a specific field.
[0087] The task request optimization system 400 is configured to optimize the task request based on knowledge and a vector of the knowledge, to obtain an optimized task request, and send the optimized task request to the large language model platform 500. The optimized task request includes the task request before optimization and target prompt information. The target prompt information is information related to the same specific field, and is different from the prompt information in the task request before optimization. The process of optimizing the task request based on knowledge and a vector of the knowledge to obtain the optimized task request can be referred to the following FIG. 3A, FIG. 3B and related content.
[0088] The large language model platform 500 is configured to obtain a request result according to the optimized task request, and send the request result to the client 300.
[0089] In some possible implementation manners, the knowledge graph system 100, the vector storage system 200, the client 300, the task request optimization system 400 and the large language model platform 500 can be deployed on a computing device. The computing device is an electronic device for computing, processing and storing data, including a server, a supercomputer, a personal computer, a workstation, a mobile device and the like.
[0090] The knowledge graph system 100, the vector storage system 200, the client 300, the task request optimization system 400 and the large language model platform 500 can be deployed on different computing devices, or deployed on the same computing device. When the knowledge graph system 100, the vector storage system 200, the client 300, the task request optimization system 400 and the large language model platform 500 are deployed on different computing devices, at least two of the knowledge graph system 100, the vector storage system 200, the client 300, the task request optimization system 400 and the large language model platform 500 are deployed on different computing devices in the same computing device cluster, or deployed on different computing devices in different computing clusters. The computing device cluster can include a plurality of computing devices as described above. The specific deployment can be determined according to the actual application scenario, and the present application does not make specific limitation.
[0091] In a specific implementation manner, the client 300 can also be deployed on a terminal device. The terminal device is an electronic device for accessing a computing device, including a personal computer, a smart phone, a palm processing device, a tablet computer, a mobile notebook, an integrated palm computer, a smart conference device, a smart learning machine and the like.
[0092] Optionally, the client 300 can be a software, a plug-in or a console of a cloud platform.
[0093] When the client 300 is a software, the client 300 can be a standalone software specially used for optimizing task requests. A user can use the task request optimization system 400 in FIG. 2A by downloading and installing the task request optimization software.
[0094] When the client 300 is a plug-in, the client 300 can be built into an application tool. For example, as a task request optimization plug-in of a large language model platform 500, the task request optimization plug-in optimizes the task request input by a user and inputs the optimized task request into the large language model platform 500, so that the large language model in the large language model platform 500 can better understand the task request and generate more accurate request results. A user can use the task request optimization system 400 in FIG. 2A by upgrading the application tool.
[0095] When the client 300 is a console, the client 300 can access a cloud service providing a task request optimization function, including a web-based client, an application program client, an application programming interface (API) and the like. A user can use the task request optimization system 400 in FIG. 2A by purchasing the cloud service.
[0096] In some possible implementation manners, the knowledge graph system 100, the vector storage system 200 and the task request optimization system 400 each include a plurality of units. Exemplarily, referring to FIG. 2B, FIG. 2B is an architecture diagram of another task request optimization system provided by an embodiment of the present application.
[0097] The functions of the units in the knowledge graph system 100, the vector storage system 200 and the task request optimization system 400 will be described below in combination with FIG. 2B.
[0098] (I) Knowledge graph system 100
[0099] In some possible implementation manners, the knowledge graph system 100 includes a plurality of units. Exemplarily, in FIG. 2B, the knowledge graph system 100 includes a storage device 110 and a sending unit 120. The functions of the units in the knowledge graph system 100 will be described below.
[0100] The storage device 110 is configured to store the knowledge in the domain knowledge graph. The knowledge is in a non-sentence format (e.g., triplets, quadruplets, quintuplets, etc.). It should be noted that the knowledge in the non-sentence format in the domain knowledge graph can be stored in the same storage device 110 (as shown in FIG. 2B) or in different storage devices 110. The storage device 110 can be a file system, a storage system, a database, etc., and the present application does not make a specific limitation. In addition, as described above, the knowledge graph system 100 can be deployed in a single computing device or a cluster of computing devices. When the knowledge graph system 100 is deployed in a single computing device, the storage device 110 can be deployed in the memory of the computing device. When the knowledge graph system 100 is deployed in a cluster of computing devices, the storage device 110 can be deployed in the same or different computing devices as other units, and the present application does not make a specific limitation.
[0101] The sending unit 120 is configured to send the knowledge in the non-sentence format in the storage device 110 to the vector storage system 200.
[0102] It should be understood that the above (1) the units in the knowledge graph system 100 are described by taking the storage device 110 and the sending unit 120 of the knowledge graph system 100 in FIG. 2B as an example. In actual application, the knowledge graph system 100 can further include more or fewer units, and the present application does not make a specific limitation.
[0103] (2) Vector storage system 200
[0104] In some possible implementation manners, the vector storage system 200 includes a plurality of units. For example, in FIG. 2B, the vector storage system 200 includes an obtaining unit 210, a first conversion unit 220, a second conversion unit 230, and a storage device 240. The functions of the units in the vector storage system 200 are described below.
[0105] The obtaining unit 210 is configured to receive the knowledge in the non-sentence format from the knowledge graph system 100 and input the knowledge in the non-sentence format into the first conversion unit 220.
[0106] The first conversion unit 220 is configured to convert the non-sentence format of knowledge (e.g., triplets, quadruplets, quintuplets, etc.) into a sentence format. It can be understood that the non-sentence format of knowledge and the sentence format are different, but both can represent the knowledge. The process of converting the non-sentence format of knowledge into the sentence format can refer to the process of converting structured data (e.g., triplets) into text by using a natural language generation (NLG) model (e.g., a denoising sequence-to-sequence pre-training for natural language generation (BART) model).
[0107] Taking the triplets in Table 1 of the tax knowledge graph in the above (3) as an example of the non-sentence format of knowledge in the domain knowledge graph, the first conversion unit 220 converts the triplets in Table 1 to obtain the following sentences shown in Table 2. For the sake of brevity of the description, Table 2 only shows the sentences obtained by converting the first seven triplets in Table 1.
[0108] Table 2
[0109] It should be understood that the above process of converting triplets into sentences when the non-sentence format of knowledge is triplets is only an example and is not limited herein. In actual applications, when the non-sentence format of knowledge is not triplets, for example, the non-sentence format of knowledge is quadruplets or quintuplets, etc., the process of converting the non-sentence format of knowledge into the sentence format is similar to the above process of converting triplets into sentences. For the sake of brevity of the description, the details are not described herein.
[0110] The first conversion unit 220 is also configured to determine the class label and the element label of the knowledge in the sentence format (i.e., the sentence). The class label is used to indicate the entity of the concept in the highest layer of the ontology model of the domain knowledge graph, that is, the class label is used to indicate the entity in the domain knowledge graph. The element label is used to indicate the concept in the ontology model of the domain knowledge graph, that is, the element label is used to indicate the concept in the domain knowledge graph, and the concept indicated by the element label is different from the concept to which the entity indicated by the class label belongs.
[0111] The following will continue to take triplets as an example of the non-sentence format of knowledge in the domain knowledge graph to introduce the process of determining the class label and the element label of the sentence by the first conversion unit 220, including: (1) determining the class label of the sentence, and (2) determining the element label of the sentence.
[0112] (1) Determining the class label of the sentence
[0113] The first conversion unit 220 determines the category label of the sentence. Specifically, the first conversion unit 220 determines whether the subject (i.e., the entity) in the triple (referred to as triple A) corresponding to the sentence belongs to the highest layer in the ontology model. If yes, the first conversion unit 220 takes the subject in the triple A as the category label of the sentence; if not, the first conversion unit 220 finds another triple (referred to as triple B) with the subject in the triple A as the object, and then determines whether the subject (i.e., the entity) in the triple B belongs to the highest layer in the ontology model. If yes, the first conversion unit 220 takes the subject in the triple B as the category label of the sentence; if not, the first conversion unit 220 finds another triple (referred to as triple C) with the subject in the triple B as the object, and then determines whether the subject (i.e., the entity) in the triple C belongs to the highest layer in the ontology model. In this way, until the subject (i.e., the entity) in a triple belongs to the highest layer in the ontology model, the first conversion unit 220 takes the subject in the triple as the category label of the sentence.
[0114] In the above, the first conversion unit 220 determines whether the concept to which the subject (i.e., the entity) in a triple belongs is in the highest layer of the ontology model. Specifically, the first conversion unit 220 first determines the concept to which the subject belongs. Then, the first conversion unit 220 obtains the concept in the highest layer of the ontology model. Next, the first conversion unit 220 matches the concept to which the subject belongs with the concept in the highest layer. If the matching is successful, it indicates that the concept to which the subject belongs is in the highest layer of the ontology model; if the matching is not successful, it indicates that the concept to which the subject belongs is not in the highest layer of the ontology model.
[0115] The following takes the triples in Table 2 (including triple 1-triple 7) as triples, takes the sentences in Table 2 (including sentence 1-sentence 7) as sentences, and takes the ontology model of the tax knowledge graph (see FIG. IB) as the ontology model as examples to specifically introduce the process of the first conversion unit 220 determining the category label of the sentence in Table 2.
[0116] For sentence 1, as shown in Table 2, sentence 1 corresponds to triple 1. Since the subject “tax base” in triple 1 is the entity of the concept “category”, and the concept “category” is in the first layer of the ontology model, i.e., in the highest layer, the subject “tax base” in triple 1 is taken as the category label of sentence 1.
[0117] For sentence 2, as shown in Table 2, sentence 2 corresponds to triple 2. Since the subject in triple 2 is also “tax base”, the process of determining the category label of sentence 2 is similar to that of determining the category label of sentence 1. For the sake of brevity of the description, the process will not be described again.
[0118] For sentence 3, as shown in Table 2, sentence 3 corresponds to triple 3. Since the subject "physical form" in triple 3 is an entity of the concept "explanation", and the concept "explanation" is in the second layer in the ontology model, i.e. not in the highest layer, the triple with the subject "physical form" in triple 3 as the object is searched, and the result is triple 2. Since the subject "tax base" in triple 2 is an entity of the concept "category", and the concept "category" is in the first layer in the ontology model, i.e. in the highest layer, the subject "tax base" in triple 2 is taken as the category label of sentence 3.
[0119] For sentence 4, sentence 5 and sentence 6, since the subject in the triple corresponding to sentence 4, sentence 5 and sentence 6 is also "tax base", the process of determining the category label of sentence 4, sentence 5 or sentence 6 is similar to the process of determining the category label of sentence 1. For the sake of brevity of the specification, the process of determining the category label of sentence 4, sentence 5 or sentence 6 will not be described again.
[0120] For sentence 7, as shown in Table 2, sentence 7 corresponds to triple 7. Since the subject "tax amount calculation" in triple 7 is an entity of the concept "category", and the concept "category" is in the first layer in the ontology model, i.e. in the highest layer, the subject "tax amount calculation" in triple 7 is taken as the category label of sentence 7.
[0121] It should be understood that the process of determining the category label of other sentences in Table 2 can refer to the process of determining the category label of sentences 1-7 described above. For the sake of brevity of the specification, the process of determining the category label of other sentences in Table 2 will not be described again.
[0122] (2) Determining the element label of a sentence
[0123] The first conversion unit 220 determines the element label of a sentence, and the specific process is as follows: The first conversion unit 220 determines whether the predicate in the triple (referred to as triple D) corresponding to the sentence is used to describe the relationship between concepts in the ontology model. If yes, the concept to which the object (i.e. entity) in the triple D belongs is taken as the element label of the sentence; if no, the first conversion unit 220 determines whether the layer of the concept to which the object in the triple D belongs and the layer of the concept to which the subject belongs in the ontology model are the same. If the same, the first conversion unit 220 takes the concept to which the subject in the triple D belongs as the element label of the sentence; if different, the first conversion unit 220 takes the concept to which the object in the triple D belongs as the element label of the sentence.
[0124] The first conversion unit 220 determines whether the predicate in the triple D is a relationship between concepts in the ontology model, and the specific process is as follows: first, the first conversion unit 220 obtains the predicate in the triple D. Then, the first conversion unit 220 obtains the relationship between concepts in the ontology model. Next, the first conversion unit 220 matches the predicate with the relationship between concepts. If the matching is successful, it indicates that the predicate is the relationship between concepts in the ontology model; if the matching is unsuccessful, it indicates that the predicate is not the relationship between concepts in the ontology model.
[0125] The first conversion unit 220 determines whether the concept to which the object in the triple D belongs and the concept to which the subject belongs are in the same level in the ontology model, and the specific process is as follows: first, the first conversion unit 220 obtains the concept to which the object belongs and the concept to which the subject belongs, respectively. Then, the first conversion unit 220 obtains the concepts in each layer of the ontology model. Next, the first conversion unit 220 matches the concept to which the object belongs with the concepts in the Kth layer, and if the matching is successful, it indicates that the concept to which the object belongs is in the Kth layer of the ontology model, K∈N + . Then, the first conversion unit 220 matches the concept to which the subject belongs with the concepts in the Lth layer, and if the matching is successful, it indicates that the concept to which the subject belongs is in the Lth layer of the ontology model, L∈N + . Finally, the first conversion unit 220 compares the values of K and L. If K=L, it indicates that the concept to which the object belongs is in the same level in the ontology model as the concept to which the subject belongs; if K
[0126] The following continues to use the triples in Table 2 (including triple 1-triple 7) as triples and the sentences in Table 2 (including sentence 1-sentence 7) as sentences, and uses the ontology model of the tax knowledge graph (see FIG. 1B) as an example of the ontology model to specifically introduce the process of the first conversion unit 220 determining the element label of the sentence in Table 2. In the ontology model of the tax knowledge graph, the relationship between concepts includes the relationship “definition”, the relationship “includes”, the relationship “case”, the relationship “requirement”, and the relationship “has”.
[0127] For sentence 1, as shown in Table 2, sentence 1 corresponds to triple 1. Since the predicate “definition” in triple 1 is the relationship “definition” in the ontology model, the concept “definition” to which the object “is a direct quantity basis for calculating the tax objects to be taxed…” in triple 1 belongs is taken as the element label of sentence 1.
[0128] For the sentence 2, as shown in Table 2, the sentence 2 corresponds to the triple 2. Since the predicate “includes” in the triple 2 is the relation “includes” in the ontology model, the concept “interpretation” to which the object “physical form” in the triple 2 belongs is taken as the element label of the sentence 2.
[0129] For the sentence 3, as shown in Table 2, the sentence 3 corresponds to the triple 3. Since the predicate “meaning” in the triple 3 is not the relation in the ontology model for describing the relationship between concepts, it is determined whether the concept to which the object “physical form includes area…” in the triple 3 belongs and the concept to which the subject “physical form” in the triple 3 belongs are in the same level in the ontology model. Since the object “physical form includes area…” and the subject “physical form” are both entities of the concept “interpretation”, the concept to which the object “physical form includes area…” in the triple 3 belongs is in the same level in the ontology model as the concept to which the subject “physical form” in the triple 3 belongs, and thus the concept “interpretation” to which the subject “physical form” in the triple 3 belongs is taken as the element label of the sentence 3.
[0130] For the sentence 4, as shown in Table 2, the sentence 4 corresponds to the triple 4. Since the predicate “case” in the triple 4 is the relation “case” in the ontology model, the concept “case” to which the object “Article 3 of the Temporary Regulations on Real Estate Tax of the People’s Republic of China…” in the triple 4 belongs is taken as the element label of the sentence 4.
[0131] For the sentence 5, the sentence 6 and the sentence 7, since the predicates in the triples corresponding to the sentence 5, the sentence 6 and the sentence 7 are also “case”, the process of determining the element label of the sentence 4, the sentence 5 or the sentence 6 is similar to the process of determining the element label of the sentence 4, and for the sake of brevity of the specification, it will not be expanded here.
[0132] It should be understood that the process of determining the element label of the other sentences in Table 2 can refer to the process of determining the element label of the sentences 1-7 described above, and for the sake of brevity of the specification, it will not be expanded here.
[0133] In summary, the class labels of the sentences in Table 2 obtained in the above (1) determining the class label of the sentence, and the element labels of the sentences in Table 2 obtained in the above (2) determining the element label of the sentence, the correspondence between the sentences in Table 2 and their class labels, element labels is shown in Table 3 as follows. For the sake of brevity of the specification, Table 3 only shows the first seven sentences in Table 2 and their corresponding class labels and element labels, and the sentences are indicated by the sentence number.
[0134] Table 3
[0135] It should be understood that the process of determining the class label, element label of the sentence format knowledge based on the non-sentence format knowledge as the triplets is only as an example, which is not limited specifically herein. In actual applications, when the non-sentence format knowledge is not triplets, for example, the non-sentence format knowledge is quadruplets or quintuplets, etc., the process of determining the class label, element label of the sentence format knowledge based on the non-sentence format knowledge is similar to the process of determining the class label, element label of the sentence format knowledge based on the triplets, which is not described herein for the sake of brevity of the specification.
[0136] The first conversion unit 220 is further configured to input the sentence into the second conversion unit 230.
[0137] The second conversion unit 230 is configured to convert the sentence to obtain a vector of the sentence. The process of converting the sentence to obtain the vector of the sentence can refer to the process of obtaining a text by using a deep learning model such as a bidirectional encoder representations from transformers (BERT) or a universal sentence encoder (USE), and encoding the text into a high-dimensional vector according to semantic information in the text, which is not described herein for the sake of brevity of the specification.
[0138] It is continued to take the sentences (including sentence 1-sentence 7) in the above table 2 as examples of the sentences, and the vectors of the sentences in table 2 obtained by the second conversion unit 230 are shown in the following table 4. For the sake of brevity of the specification, table 4 only shows the correspondence between the first seven sentences in table 2 and the vectors thereof, and the sentences are indicated by the sentence serial numbers.
[0139] Table 4
[0140] It should be understood that the vectors of the sentences in the above table 4 are ten-bit binary numbers, which are only as an example, and in actual applications, the vectors of the sentences can also include more or less binary numbers, which are not limited specifically herein.
[0141] The second conversion unit 230 is further configured to input the vector of the sentence into the storage device 240.
[0142] The storage device 240 is configured to store the sentences and their category labels and element labels generated by the first conversion unit 220, and the vectors of the sentences generated by the second conversion unit 230. It should be noted that the sentences, the category labels of the sentences, the element labels of the sentences, and the vectors of the sentences generated by the second conversion unit 230 can be stored in the same storage device 240 (as shown in FIG. 2B) or in different storage devices 240. The storage device 240 can be a file system, a storage system, a database, or the like, and the present application does not make a specific limitation. Moreover, as described above, the vector storage system 200 can be deployed in a single computing device or a cluster of computing devices. When the vector storage system 200 is deployed in a single computing device, the storage device 240 can be deployed in the memory of the computing device. When the vector storage system 200 is deployed in a cluster of computing devices, the storage device 240 can be deployed in the same or different computing devices as other units, and the present application does not make a specific limitation.
[0143] In the storage device 240, the correspondence between the sentences, the category labels of the sentences, the element labels of the sentences, and the vectors of the sentences is shown in Table 5 below. For the sake of brevity of the description, Table 5 only shows the first seven sentences in Table 3 and their category labels and element labels, and only shows the vectors of the first seven sentences in Table 4, and the sentences are indicated by the sentence numbers.
[0144] Table 5
[0145] The acquisition unit 210 is further configured to send the vectors of the plurality of sentences in the storage device 240 to the task request optimization system 400. It can be understood that since the sentences represent the knowledge in the domain knowledge graph, the vectors of the sentences are also the vectors of the knowledge, and therefore, sending the vectors of the sentences to the task request optimization system 400 is equivalent to sending the vectors of the knowledge to the task request optimization system 400.
[0146] The acquisition unit 210 is further configured to receive the target vector from the task request optimization system 400, take the sentence in the storage device 240 that has the same category label as the target vector as the target sentence, and send the target sentence, the vector of the target sentence, and the element label of the target sentence (i.e., the target element label) to the task request optimization system 400. This process can be referred to the execution process of steps S306 and S307 in the process of optimizing the first task request in the task request optimization method described below in FIG. 3A. It can be understood that since the sentences represent the knowledge in the domain knowledge graph, sending the target sentence and the vector of the target sentence to the task request optimization system 400 is equivalent to sending the knowledge and the vector of the knowledge to the task request optimization system 400.
[0147] Alternatively, the obtaining unit 210 is further configured to receive a target vector from the task request optimization system 400, take the sentences in the storage device 240 that have the same category label as the target vector as target sentences, and send the target sentences to the task request optimization system 400. The process can refer to the execution process of steps S406 and S407 in the step of optimizing the first task request in another task request optimization method in FIG. 3C. It can be understood that, since the sentences represent the knowledge in the domain knowledge graph, sending the target sentences to the task request optimization system 400 is equivalent to sending the knowledge to the task request optimization system 400.
[0148] It should be understood that the units in the above (ii) vector storage system 200 are exemplarily described by taking the obtaining unit 210 to the second converting unit 230 of the vector storage system 200 in FIG. 2B, and in actual application, the vector storage system 200 can further include more or fewer units, which are not specifically limited in the present application.
[0149] (iii) Task request optimization system 400
[0150] In some possible implementation manners, the task request optimization system 400 includes a plurality of units. Exemplarily, in FIG. 2B, the vector storage system 200 includes a calculating unit 410, a matching unit 420, a transceiving unit 430, and a combining unit 440. The functions of the units in the task request optimization system 400 are described below.
[0151] The calculating unit 410 is configured to receive a task request from the client 300, convert the task request to obtain a vector of the task request, and input the vector of the task request into the matching unit 420 and the combining unit 440, respectively. The task request carries content and prompt information. The content is data to be processed. The prompt information is information related to a specific domain. The process of converting the task request to obtain the vector of the task request can refer to the execution process of the step S302 of optimizing the first task request in one task request optimization method in FIG. 3A, or can refer to the execution process of the step S402 of optimizing the first task request in another task request optimization method in FIG. 3C.
[0152] The matching unit 420 is configured to receive vectors of a plurality of sentences from the vector storage system 200, filter a target vector from the vectors of the plurality of sentences according to the vector of the task request, and input the target vector into the transceiving unit 430. The process of filtering the target vector from the vectors of the plurality of sentences according to the vector of the task request can refer to the execution process of the step S304 of optimizing the first task request in one task request optimization method in FIG. 3A, or can refer to the execution process of the step S404 of optimizing the first task request in another task request optimization method in FIG. 3C.
[0153] The transceiving unit 430 is configured to send the target vector to the vector storage system 200, receive the target sentence calculated by the vector storage system 200 according to the target vector, the vector of the target sentence, and the target element label, and input the target sentence, the vector of the target sentence, and the target element label to the combination unit 440.
[0154] Alternatively, the transceiving unit 430 is configured to send the target vector to the vector storage system 200, receive the target sentence calculated by the vector storage system 200 according to the target vector, and input the target sentence to the combination unit 440.
[0155] The combination unit 440 is configured to generate an optimized task request based on the target sentence, the vector of the target sentence, and the target element label. The specific functions of the combination unit 440 include:
[0156] The combination unit 440 is specifically configured to calculate the target sentence that meets the condition according to the vector of the task request and the vector of the target sentence that is the target concept of the target element label, and take the target sentence that meets the condition and the target sentence that is not the target concept of the target element label as the target prompt information. The process can be referred to the execution process of step S308 of optimizing the first task request in the task request optimization method in FIG. 3A.
[0157] The combination unit 440 is also specifically configured to combine the target prompt information with the task request to obtain an optimized task request, and send the optimized task request to the large language model platform 500. The process of combining the target prompt information with the task request to obtain the optimized task request can be referred to the execution process of step S309 of optimizing the first task request in the task request optimization method in FIG. 3A.
[0158] Alternatively, the combination unit 440 is configured to take the target sentence as the target prompt information, combine the target prompt information with the task request to obtain an optimized task request. The process can be referred to the execution process of step S408 of optimizing the first task request in another task request optimization method in FIG. 3C.
[0159] It should be understood that the units in the above (three) task request optimization system 400 are described by taking the computing unit 410 to the combination unit 440 of the task request optimization system 400 in FIG. 2B as an example. In actual application, the task request optimization system 400 can also include more or fewer units, which is not limited in the present application.
[0160] The sending unit 120 in the knowledge graph system 100, the obtaining unit 210, the first conversion unit 220 and the second conversion unit 230 in the vector storage system 200, and the computing unit 410, the matching unit 420, the transceiving unit 430 and the combining unit 440 in the task request optimization system 400 can be implemented by software or hardware. For example, the implementation of the matching unit 420 is described below. Similarly, the implementation of the sending unit 120, the obtaining unit 210, the first conversion unit 220, the second conversion unit 230, the computing unit 410, the transceiving unit 430 and the combining unit 440 can refer to the implementation of the matching unit 420.
[0161] As an example of the software function unit, the matching unit 420 can include code running on a computing instance. The computing instance can include at least one of a physical host (computing device), a virtual machine and a container. Further, the computing instance can be one or more. For example, the matching unit 420 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers running the code can be distributed in the same region, or in different regions. Further, the multiple hosts / virtual machines / containers running the code can be distributed in the same availability zone (AZ), or in different AZs, each AZ including one data center or multiple data centers in close geographical proximity. Generally, one region can include multiple AZs.
[0162] Similarly, the multiple hosts / virtual machines / containers running the code can be distributed in the same virtual private cloud (VPC), or in multiple VPCs. Generally, one VPC is set in one region, and a communication gateway needs to be set in each VPC for cross-region communication between two VPCs in the same region or between VPCs in different regions, and the interconnection between VPCs is realized through the communication gateway.
[0163] As an example of the hardware function unit, the matching unit 420 can include at least one computing device, such as a server, etc. Alternatively, the matching unit 420 can also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. Among them, the above-mentioned PLD can be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system on chip (SoC), an offload card, an acceleration card, or any combination thereof.
[0164] The plurality of computing devices included in the matching unit 420 can be distributed in the same region or in different regions. The plurality of computing devices included in the matching unit 420 can be distributed in the same AZ or in different AZs. Similarly, the plurality of computing devices included in the matching unit 420 can be distributed in the same VPC or in multiple VPCs. Among them, the plurality of computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offload cards, acceleration cards, etc.
[0165] It should be understood that the architecture of the task request optimization system in the above-mentioned FIG. 2A or FIG. 2B is described as an example with the knowledge graph system 100, the vector storage system 200, the client 300, and the large language model platform 500 in communication with the task request optimization system 400. In actual application, the number of the knowledge graph system 100, the vector storage system 200, the client 300, and the large language model platform 500 can be one or more, and the present application does not make specific limitations.
[0166] To sum up, the task request optimization system 400 provided by the application optimizes different task requests in the same specific field respectively, obtains task requests carrying different target prompt information, that is, different optimized task requests, and then uses the different target prompt information in the different optimized task requests to better understand the same specific field for the large language model platform 500 to provide different information for different tasks, so that the large language model platform 500 can generate more accurate request results for different task requests in the same specific field, thereby improving the accuracy of the request results.
[0167] The task request optimization system 400 provided by the embodiments of the application is introduced above in combination with FIG. 2A and FIG. 2B. Next, a flowchart of a task request optimization method provided by the embodiments of the application is introduced.
[0168] Referring to FIG. 3, FIG. 3 is a flowchart of a task request optimization method provided by the embodiments of the application. The task request optimization method provided by the application is applied to the architecture of the task request optimization system in FIG. 2A or FIG. 2B, including a client, a task request optimization system and a large language model platform. As shown in FIG. 3, the task request optimization method provided by the application includes:
[0169] S201: The client sends a first task request to the task request optimization system.
[0170] Correspondingly, the task request optimization system receives the first task request from the client.
[0171] The first task request carries a first content and a first prompt information. The first content is data to be processed. The first prompt information is information related to a specific field. The client can be the client 300 in FIG. 2A or FIG. 2B. The task request optimization system can be the task request optimization system 400 in FIG. 2A or FIG. 2B.
[0172] S202: The task request optimization system processes the first task request to obtain an optimized first task request.
[0173] The optimized first task request includes the first task request before optimization and a second prompt information. The second prompt information is information related to the same specific field, and the second prompt information is different from the first prompt information.
[0174] The process of the task request optimization system processing the first task request to obtain the optimized first task request can refer to the execution process of steps S302-S309 of optimizing the first task request in the task request optimization method in FIG. 3A, or can refer to the execution process of steps S402-S408 of optimizing the first task request in another task request optimization method in FIG. 3C. For the sake of brevity of the description, the details are not repeated here.
[0175] S203: The task request optimization system sends the optimized first task request to the large language model platform.
[0176] Correspondingly, the large language model platform receives the optimized first task request from the task request optimization system.
[0177] The large language model platform can be the large language model platform 500 in FIG. 2A or FIG. 2B.
[0178] S204: The large language model platform obtains a first request result according to the optimized first task request.
[0179] The process of the large language model platform obtaining the first request result according to the optimized first task request can refer to the execution process of step S311 of optimizing the first task request in the task request optimization method in FIG. 3A. For the sake of brevity of the description, the details are not repeated here.
[0180] S205: The large language model platform sends the first request result to the client.
[0181] Correspondingly, the client receives the first request result from the large language model platform.
[0182] S206: The client sends a second task request to the task request optimization system.
[0183] Correspondingly, the task request optimization system receives the second task request from the client.
[0184] The second task request carries a second content and a first prompt information. The second content is data to be processed, and the second content is different from the first content.
[0185] S207: The task request optimization system processes the second task request to obtain an optimized second task request.
[0186] The optimized second task request includes the second task request before optimization and a third prompt information. The third prompt information is information related to the same specific field, and the third prompt information is different from the first prompt information and the second prompt information.
[0187] The process of the task request optimization system processing the second task request to obtain the optimized second task request can refer to the execution process of steps S314-step S321 of optimizing the second task request in one task request optimization method in FIG. 3B, or can refer to the execution process of steps S413-step S419 of optimizing the second task request in another task request optimization method in FIG. 3D. For the sake of brevity of the description, the details are not repeated here.
[0188] S208: The task request optimization system sends the optimized second task request to the large language model platform.
[0189] Correspondingly, the large language model platform receives the optimized second task request from the task request optimization system.
[0190] S209: The large language model platform obtains a second request result according to the optimized second task request.
[0191] The process of the large language model platform obtaining the second request result according to the optimized second task request can refer to the execution process of step S323 of optimizing the second task request in one task request optimization method in FIG. 3B. For the sake of brevity of the description, the details are not repeated here.
[0192] S210: The large language model platform sends the second request result to the client.
[0193] Correspondingly, the client receives the second request result from the large language model platform.
[0194] In summary, the technical solution can add second prompt information in the first task request carrying the first content and the first prompt information, and add third prompt information in the second task request carrying the second content and the first prompt information. Therefore, the technical solution realizes adding different prompt information in different task requests in the same specific field. Subsequently, inputting the task requests carrying different prompt information into the large language model platform can provide differentiated information for the large language model platform to better understand different tasks in the same specific field, so that the large language model platform can generate more accurate request results for different task requests in the same specific field, thereby improving the accuracy of the request results.
[0195] Referring to FIG. 3A, FIG. 3A is a flow diagram of a task request optimization method provided by an embodiment of the present application for optimizing the first task request. The task request optimization method provided by the present application is applied to the architecture of the task request optimization system in FIG. 2A or FIG. 2B, which includes a client, a task request optimization system, a vector storage system, and a large language model platform. As shown in FIG. 3A, the task request optimization method provided by the present application includes:
[0196] S301: The client sends a first task request to a task request optimization system.
[0197] Correspondingly, the task request optimization system receives the first task request from the client.
[0198] The client can be the client 300 in FIG. 2A or FIG. 2B. The task request optimization system can be the task request optimization system 400 in FIG. 2A or FIG. 2B.
[0199] In some application scenarios, the first task request carries first content and first prompt information. The first content is data to be processed. The first prompt information is information related to a specific field. In the following, the tax field will be taken as an example of the specific field to introduce the specific content of the first task request.
[0200] Suppose the first task request A1 related to the tax field is: “Please confirm the tax subject of the text ‘Article 3 of the Provisional Regulations of the People’s Republic of China on Urban Maintenance and Construction Tax: The taxable sales amount refers to the total income obtained by the taxpayer in the taxable behaviors of selling goods, providing taxable services, and transferring real estate, etc.’. Among them, the tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.”
[0201] Therefore, the first content C1 in the first task request A1 is: “What is the tax subject of the text ‘Article 3 of the Provisional Regulations of the People’s Republic of China on Urban Maintenance and Construction Tax: The taxable sales amount refers to the total income obtained by the taxpayer in the taxable behaviors of selling goods, providing taxable services, and transferring real estate, etc.’.” It can be seen that the first content C1 is a question to be answered.
[0202] The first prompt information P1 in the first task request A1 is “The tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.” It can be seen that the first prompt information P1 is the scope of the tax subject.
[0203] It should be understood that the above-mentioned first task request A1 is only an example and is not specifically limited here. In actual applications, the content in the task request can also be numbers, pictures, tables, and the like.
[0204] S302: The task request optimization system converts the first task request to obtain a vector of the first task request.
[0205] In some possible implementation manners, the task request optimization system converts the first task request to obtain a vector of the first task request, so that the vector of the first task request contains semantic information of the first content and the first prompt information. The process can refer to a process of encoding a text into a high-dimensional vector according to semantic information in the text by using a deep learning model such as a BERT model or a USE model, which will not be described herein for the sake of brevity and conciseness of the description.
[0206] In a specific implementation manner, the deep learning model used by the task request optimization system to convert the first task request to obtain the vector of the first task request is the same as the deep learning model used by the vector storage system to convert the sentence to obtain the vector of the sentence. The vector storage system can be the vector storage system 200 in FIG. 2A or FIG. 2B.
[0207] Taking the first task request A1 in the step S301 as an example, the task request optimization system converts the first task request A1 to obtain a vector B1 of the first task request A1, and the vector B1 is specifically: 0011000111.
[0208] It should be noted that the vector B1 is a ten-bit binary number, which is only an example, and in actual application, the vector B1 can include more or fewer binary numbers, which is not limited in the present application. When the deep learning model used by the task request optimization system to convert the first task request to obtain the vector of the first task request is the same as the deep learning model used by the vector storage system to convert the sentence to obtain the vector of the sentence, the number of binary numbers in the vector B1 is the same as the number of binary numbers in the vector of the sentence.
[0209] S303: The vector storage system sends the vectors of the plurality of sentences to the task request optimization system.
[0210] Correspondingly, the task request optimization system receives the vectors of the plurality of sentences from the vector storage system.
[0211] Taking the tax field as an example, the vectors of the plurality of sentences received by the task request optimization system can be the vectors of the plurality of sentences in the table 5, including the vectors of the sentence 1 to the sentence 7.
[0212] It should be understood that the technical solution can execute the steps S301 to S302 first and then execute the step S303, or execute the step S303 first and then execute the steps S301 to S302.
[0213] S304: The task request optimization system screens a first vector from the vectors of the plurality of sentences according to the vector of the first task request.
[0214] In some possible implementation manners, the task request optimization system screens the first vector from the vectors of the plurality of sentences according to the vector of the first task request, including: the task request optimization system calculates a similarity between the vector of the first task request and the vector of each sentence, selects the vector of the sentence with the maximum similarity as the first vector, or selects the vector of the sentence with a similarity greater than or equal to a first similarity threshold as the first vector, or selects the first specified number of vectors of the sentences in descending order of similarity as the first vector. The first similarity threshold and the first specified number can be determined by a user. Therefore, the number of the first vector can be one or more.
[0215] The process of calculating the similarity between the vector of the first task request and the vector of each sentence can refer to the process of calculating the similarity between two vectors by using a similarity measurement method such as cosine similarity, Euclidean distance or Manhattan distance, which will not be described in detail herein for the sake of brevity.
[0216] It should be understood that the above implementation manner of selecting the first vector is only an example, and in actual application, the implementation manner of screening the first vector from the vectors of the plurality of sentences according to the vector of the first task request is within the protection scope of the present application.
[0217] The process of screening the first vector from the vectors of the plurality of sentences according to the vector of the first task request will be described in detail below by taking the vector B1 (0011000111) of the first task request A1 in the step S302 as the vector of the first task request and the vectors of the sentences in the above table 5 as the vectors of the sentences.
[0218] First, the similarity between the vector B1 and the vector of each sentence in the table 5 is calculated. The calculated similarities are shown in the following table 6. For the sake of brevity, the table 6 only shows the similarity between the vectors of the first seven sentences and the vector B1, and the sentences are indicated by the sentence serial numbers.
[0219] Table 6
[0220] For the sake of understanding, the similarities of the sentences 1-7 in the table 6 are used as all the similarities in the table 6 below.
[0221] If the vector of the sentence with the maximum similarity is selected as the first vector from all the similarities in the table 6, the first vector is the vector 0011000011 of the sentence 6 with the similarity of 93.66%.
[0222] If the vectors of the sentences with similarity greater than or equal to the first similarity threshold are selected as the first vector from all the similarities in Table 6, and the first similarity threshold is assumed to be 85.00%, the first vector includes the vector 0011000111 of the sentence 5 with a similarity of 85.43%, the vector 0011000011 of the sentence 6 with a similarity of 93.66%, and the vector 0111000011 of the sentence 7 with a similarity of 88.50%.
[0223] If the vectors of the first specified number of sentences are selected as the first vector in the order of all the similarities in Table 6 from large to small, and the first specified number is assumed to be 2, the first vector includes the vector 0011000011 of the sentence 6 with a similarity of 93.66%, and the vector 0111000011 of the sentence 7 with a similarity of 88.50%.
[0224] S305: The task request optimization system sends the first vector to the vector storage system.
[0225] Correspondingly, the vector storage system receives the first vector from the task request optimization system.
[0226] For ease of understanding, the first vector obtained by selecting the vector of the sentence with the largest similarity as the first vector in step S304 above will be taken as an example in the following description.
[0227] Continuing to take the first vector obtained according to the similarity in Table 6 in step S304 above as an example, the first vector received by the vector storage system is the vector 0011000011 of the sentence 6 with a similarity of 93.66% in Table 6.
[0228] S306: The vector storage system calculates the first sentence, the vector of the first sentence, and the first element label according to the first vector.
[0229] In some possible implementation manners, the vector storage system calculates the first sentence, the vector of the first sentence, and the first element label according to the first vector, including: the vector storage system matches the first vector with the vector of each sentence, and takes the category label of the vector of the sentence with which the matching is successful as a first category label; and then the vector storage system matches the first category label with the category label of each sentence, and takes the sentence with which the matching is successful as the first sentence, and further obtains the vector of the first sentence, and the element label of the first sentence (i.e., the first element label).
[0230] The following continues to take the first vector 0011000011 received by the vector storage system in the above step S305 as the first vector, takes the vector of the statement in the above table 5 as the vector of the statement, and specifically introduces the process of calculating the first statement, the vector of the first statement, and the first element label according to the first vector.
[0231] First, the vector storage system matches the first vector 0011000011 with the vector of each statement in table 5, and then finds that the first vector 0011000011 is the same as the vector 0011000011 of statement 6 in table 5 (i.e., a successful match). Therefore, the category label “tax base” of the vector 0011000011 of statement 6 is taken as the first category label.
[0232] Subsequently, the vector storage system matches the first category label “tax base” with each category label in table 5, and then finds that the category label “tax base” in table 5 is the statement sequence number of statement 1 to statement 6. Therefore, the statements indicated by statement 1 to statement 6 (see the above table 2) are taken as the first statement 1 to the first statement 6, and the vector of statement 1 to the vector of statement 6 is taken as the vector of the first statement 1 to the vector of the first statement 6, and the element label of statement 1 to the element label of statement 6 is taken as the first element label 1 to the first element label 6.
[0233] In summary, the specific content of the first statement 1 to the first statement 6, the specific content of the vector of the first statement 1 to the vector of the first statement 6, and the specific content of the first element label 1 to the first element label 6 are shown in the following table 7. For the sake of brevity of the description, only the statement sequence number is used to indicate the first statement in table 7, and the specific content of the first statement indicated by the statement sequence number can be referred to the above table 2.
[0234] Table 7
[0235] S307: The vector storage system sends the first statement, the vector of the first statement, and the first element label to the task request optimization system.
[0236] Correspondingly, the task request optimization system receives the first statement, the vector of the first statement, and the first element label from the vector storage system.
[0237] In a specific implementation, the vector storage system can send the first statement, the vector of the first statement, and the first element label to the task request optimization system in the form of a table. Continuing to take the first statement 1 to the first statement 6, the vector of the first statement 1 to the vector of the first statement 6, and the first element label 1 to the first element label 6 obtained according to the first category label “tax base” in the above step S306 as an example, the vector storage system can send the table 7 in the above step S306 to the task request optimization system.
[0238] In another specific implementation, the vector storage system can send the first statements, the vectors of the first statements, and the first element labels to the task request optimization system in the form of text (first statement, vector of first statement, first element label). Taking the first statements 1-6 obtained in step S306 above according to the first category label "tax base" as an example, the vectors of the first statements 1-6, and the first element labels 1-6, the vector storage system can send (statement 1, 0010000000, "definition"), (statement 2, 0010010001, "explain"), (statement 3, 0000100011, "explain"), (statement 4, 0011000001, "case"), (statement 5, 0011000000, "case"), (statement 6, 0011000011, "case") to the task request optimization system.
[0239] It should be understood that the vector storage system described above sends the first statements, the vectors of the first statements, and the first element labels to the task request optimization system in the form of a table or text only as an example, and in actual applications, the vector storage system can also send the first statements, the vectors of the first statements, and the first element labels to the task request optimization system in other forms, which are not limited here.
[0240] S308: The task request optimization system calculates a first target statement according to the vector of the first task request and the first element label being the vector of the first statement of the first concept, and takes the first target statement and the first statement of the first concept as the second prompt information.
[0241] In some possible implementations, the task request optimization system implements the process of calculating a first target statement according to the vector of the first task request and the first element label being the vector of the first statement of the first concept (referred to as a first initial vector), and taking the first target statement and the first statement of the first concept (referred to as a first initial statement) as the second prompt information, at least including the following steps:
[0242] Obtain the first initial vector. Specifically, first, the task request optimization system matches the first concept with each first element label. Wherein, the first concept is a concept in the ontology model of the domain knowledge graph, that is, the first concept is a concept in the domain knowledge graph, and the first concept is determined by the user. If the first element label is the first concept, it indicates that the matching is successful; if the first element label is not the first concept, it indicates that the matching is unsuccessful. Subsequently, the task request optimization system takes the vector of the first statement corresponding to the first element label matched successfully as the first initial vector. Therefore, the number of first initial vectors can be one or more.
[0243] The vector of the first task request is matched with the first initial vector, and a first target sentence is determined according to a matching result. Specifically, when the number of the first initial vectors is multiple, the task request optimization system calculates the similarity (i.e., the matching result) between the vector of the first task request and each first initial vector, selects the first sentence corresponding to the first initial vector with the maximum similarity as the first target sentence, or selects the first sentence corresponding to the first initial vector with the similarity greater than or equal to a second similarity threshold as the first target sentence, or selects the first sentences corresponding to the second specified number of first initial vectors in descending order of similarity as the first target sentences. The second similarity threshold and the second specified number can be determined by the user. Therefore, the number of the first target sentences can be one or more.
[0244] The first initial sentence is determined. Specifically, first, the task request optimization system matches the first concept with each first element label. If the first element label is not the first concept, it indicates that the matching is successful; if the first element label is the first concept, it indicates that the matching is unsuccessful. Subsequently, the task request optimization system takes the first sentence corresponding to the first element label with the successful matching as the first initial sentence. Therefore, the number of the first initial sentences can be one or more.
[0245] The first target sentence and the first initial sentence are taken as the second prompt information. Therefore, the second prompt information still represents the knowledge in the domain knowledge graph, i.e., the second prompt information is information related to a specific domain.
[0246] It should be understood that the above implementation manner of calculating the first target sentence according to the vector of the first task request and the first initial vector is only an example, and in actual application, any implementation manner of calculating the first target sentence according to the vector of the first task request and the first initial vector is within the protection scope of the present application.
[0247] The following continues to take the vector B1 (0011000111) of the first task request A1 in the above step S302 as the vector of the first task request, takes the first sentences in Table 7 in the above step S306 as the first sentences, takes the vectors of the first sentences in Table 7 as the vectors of the first sentences, and takes the first element labels in Table 7 as the first element labels as an example to specifically introduce the process of calculating the first target sentence according to the vector of the first task request and the first initial vector, and taking the first target sentence and the first initial sentence as the second prompt information.
[0248] It is assumed that the first concept is the concept “case” in the ontology model of the tax knowledge graph.
[0249] First, the first initial vectors are obtained. Specifically, the task request optimization system matches the concept "case" with each first element label in Table 7, thereby finding the first element labels 4, 5, and 6 that match the concept "case" in Table 7. Thus, the vector 0011000001 of the first sentence 4 corresponding to the first element label 4, the vector 0011000000 of the first sentence 5 corresponding to the first element label 5, and the vector 0011000011 of the first sentence 6 corresponding to the first element label 6 are taken as the first initial vectors.
[0250] Second, the vector of the first task request is matched with the first initial vectors, and the first target sentence is determined according to the matching result. Specifically, the task request optimization system calculates the similarity between the vector B1 and each first initial vector. The calculated similarities are shown in Table 8 below.
[0251] Table 8
[0252] If the first sentence corresponding to the first initial vector with the largest similarity is selected from all the similarities in Table 8 as the first target sentence, the first target sentence is the first sentence 6 corresponding to the first initial vector 0011000011 with a similarity of 92.31%.
[0253] If the first sentence corresponding to the first initial vector with a similarity greater than or equal to a second similarity threshold is selected from all the similarities in Table 8 as the first target sentence, and the second similarity threshold is assumed to be 80.00%, the first target sentence includes the first sentence 4 corresponding to the first initial vector 0011000001 with a similarity of 81.72%, the first sentence 5 corresponding to the first initial vector 0011000000 with a similarity of 84.85%, and the first sentence 6 corresponding to the first initial vector 0011000011 with a similarity of 92.31%.
[0254] If the first sentences corresponding to the second specified number of first initial vectors are selected in descending order of all the similarities in Table 8 as the first target sentences, and the second specified number is assumed to be 2, the first target sentences include the first sentence 5 corresponding to the first initial vector 0011000000 with a similarity of 84.85%, and the first sentence 6 corresponding to the first initial vector 0011000011 with a similarity of 92.31%.
[0255] For ease of understanding, the first target sentence obtained by selecting the first sentence corresponding to the first initial vector with the largest similarity as the first target sentence in step S308 above will be described below as an example.
[0256] Next, the first initial statement is determined. Specifically, the task request optimization system matches the concept "case" with each first element label in Table 7, thereby finding the first element label 1, the first element label 2, and the first element label 3 in Table 7 that match successfully. Therefore, the first statement 1 corresponding to the first element label 1, the first statement 2 corresponding to the first element label 2, and the first statement 3 corresponding to the first element label 3 are taken as the first initial statement.
[0257] Finally, the first target statement and the first initial statement are taken as the second prompt information. Specifically, the first target statement, the first statement 6, and the first initial statement, the first statement 1, the first statement 2, and the first statement 3, are all taken as the second prompt information P21.
[0258] S309: The task request optimization system combines the second prompt information with the first task request to obtain an optimized first task request.
[0259] In some possible implementations, the task request optimization system combines the second prompt information with the first task request to obtain an optimized first task request, including at least the following two implementation manners:
[0260] Implementation manner 1: The second prompt information is combined with the first task request based on a LangChain framework to obtain an optimized first task request.
[0261] Implementation manner 2: The second prompt information is combined with the first task request according to a specified requirement, and the combination result is taken as the optimized first task request.
[0262] In the implementation manner 1 of step S309, the LangChain framework is an application development framework of a large language model, which is used to design and optimize the prompt information in the task request. The LangChain framework provides a plurality of predefined prompt templates. Each prompt template in the plurality of predefined prompt templates includes specific keywords, syntax structures, and syntax rules. Therefore, the prompt information is designed and optimized using the prompt template, which not only maintains the consistency of the structure and format of the optimization results of the plurality of task requests, but also accelerates the optimization process of the task request.
[0263] In some possible implementations, the above-mentioned combination of the second prompt information with the first task request based on the LangChain framework to obtain an optimized first task request includes at least the following steps:
[0264] A target prompt template is selected from the plurality of predefined prompt templates. The target prompt template is determined by a user.
[0265] The role parameter (or system parameter, background parameter), first task request, second prompt information, and output constraint condition are used to fill in the keywords and syntax structures in the target prompt template to obtain a filling result. The role parameter is used to identify the user. The role parameter may be, for example, a manager, a business staff, an administrative staff, and the like. The role parameter may be determined according to the login information of the user on the client. The system parameter is used to identify a system, platform, or environment related to the task. The system parameter may be, for example, a technical system, an application system, an environmental system, and the like. The system parameter may be determined according to the login information of the user on the client or according to the semantic information (such as keywords) of the first task request. The background parameter is used to identify background information, historical context, or related events of the task. The background parameter may be, for example, historical information (such as historical events), geographical information (such as location, weather), and the like. The background parameter may be determined according to the semantic information (such as keywords, key sentences) of the first task request. The output constraint condition is used to define the format, total number of words, and the like of the request result. The format of the request result may be, for example, text, numbers, tables, and the like. The output constraint condition is determined by the user.
[0266] The filling result is optimized, evaluated, and analyzed to obtain a final result as the optimized first task request. The optimization of the filling result refers to adjusting the specific content of the filling result by using an algorithm such as a hyperparameter optimization algorithm (such as a Bayesian optimization algorithm) or an automatic feature engineering algorithm (such as a feature selection algorithm based on a genetic algorithm). The evaluation of the filling result refers to testing and evaluating the influence of the filling result on the performance of the large language model in an experimental environment. The analysis of the filling result refers to analyzing the role and effect of the filling result in the large language model. The process of optimizing, evaluating, and analyzing the filling result can refer to the process of optimizing, evaluating, and analyzing the filling result obtained by filling the keywords and syntax structures in the prompt template using the role parameter, task request, and output constraint condition in the LangChain framework. For the sake of brevity of the description, the process will not be described in detail here.
[0267] In implementation mode 2 of step S309, the specified requirement may be a serial mode, a parallel mode, an insertion mode, or a cross mode, and the like. The serial mode refers to connecting the first task request and the second prompt information in order, and taking the connected result as the optimized first task request. The parallel mode refers to placing the first task request and the second prompt information side by side, and taking the placed result as the optimized first task request. The insertion mode refers to inserting the second prompt information in the first task request, and taking the inserted result as the optimized first task request. The cross mode refers to alternately inserting the first task request and the second prompt information, and taking the cross-arranged result as the optimized first task request.
[0268] The process of combining the second prompt information with the first task request according to the specified requirement to obtain the combined result as the optimized first task request can refer to the process of performing string splicing operation on two texts by using a string join function to obtain a new text, or can refer to the process of combining two texts by using a text processing library such as a natural language toolkit (NLTK) or an industrial-strength natural language processing (Spacy) to obtain a new text. For the sake of brevity of the description, details are not described herein.
[0269] In a specific implementation, after the task request optimization system combines the second prompt information with the first task request according to the specified requirement to obtain the combined result, the combined result can be further reconstructed (such as modifying the arrangement order of specific contents in the combined result, deleting some specific contents in the combined result, adding new specific contents in the combined result, etc.), and the reconstructed result is taken as the optimized first task request, so that the structure of the optimized first task request is clearer, and the expression is more accurate and fluent. The process can refer to the process of processing a group of sentences to be recombined by using a text processing library such as NLTK or Spacy to obtain a new text. For the sake of brevity of the description, details are not described herein.
[0270] Taking the second prompt information P21 (including the first sentence 1, the first sentence 2, the first sentence 3, and the first sentence 6) obtained in the above example in step S308 as the second prompt information, and taking the first task request A1 in the above step S301 as the first task request as an example of the specified requirement in a serial manner, the first task request A1 is connected with the first sentence 1, the first sentence 2, the first sentence 3, and the first sentence 6 in sequence, and the connected result (i.e., the optimized first task request A1') is specifically as follows:
[0271] “Please confirm the tax subject of the text ‘Article 3 of the Provisional Regulations of the People's Republic of China on Urban Maintenance and Construction Tax: The taxable sales are the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services, and transferring real estate.’?
[0272] The tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.
[0273] The information related to the above text also includes:
[0274] The definition of tax base refers to the direct quantity basis for calculating the tax payable of the tax object. It solves the calculation problem of taxing the tax object and is the quantity of the tax object.
[0275] The tax base includes physical form. The meaning of physical form refers to the external characteristics and attributes of the tax object, including area, volume, capacity, weight, etc. Taking physical form as tax base is also called quantity-based taxation, which means calculating according to the natural unit of the tax object.
[0276] The case of tax base is Article 10 of the Value-Added Tax Law of the People's Republic of China: "The taxable sales are the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services and transferring real estate, etc."
[0277] It should be understood that the above-mentioned implementation mode 1 and implementation mode 2 of the first task request optimized based on the second prompt information and the first task request in step S309 are only as an example, and are not limited specifically here. In actual application, the implementation mode of the first task request optimized based on the second prompt information and the first task request is within the protection scope of the present application.
[0278] It should be understood that the above-mentioned step S308 and step S309 can be summarized as: generating the first task request optimized based on the first sentence, the vector of the first sentence and the first element label.
[0279] S310: The task request optimization system sends the first task request optimized to the large language model platform.
[0280] Correspondingly, the large language model platform receives the first task request optimized from the task request optimization system.
[0281] The large language model platform can be the large language model platform 500 in FIG. 2A or FIG. 2B.
[0282] Taking the first task request A1' optimized in the above-mentioned implementation mode 2 of step S309 as an example, the large language model platform receives the first task request A1' optimized.
[0283] S311: The large language model platform obtains the first request result according to the first task request optimized.
[0284] In some possible implementation manners, the large language model platform obtains a first request result according to the optimized first task request. This process can refer to a process of processing input text to obtain output text by using a large language model such as a generative pre-trained transformer (GPT), a bidirectional encoder representations from transformers (BERT), an eXtreme learning network (XLNet), or a text-to-text transfer transformer (T5), and the like, and details are not described herein for the sake of brevity.
[0285] Taking the optimized first task request A1' received by the large language model platform in the step S310 as an example, the first request result R11 obtained by the large language model platform according to the optimized first task request A1' is specifically: "The tax theme of the text 'Article 3 of the Provisional Regulations of the People's Republic of China on Urban Maintenance and Construction Tax: Taxable sales are all the income obtained by taxpayers in the taxable acts of selling goods, providing taxable services, and transferring real estate.' is tax base."
[0286] S312: The large language model platform sends the first request result to the client.
[0287] Correspondingly, the client receives the first request result from the large language model platform.
[0288] Taking the first request result R11 obtained by the large language model platform according to the optimized first task request A1' in the step S311 as an example, the client receives the first request result R11.
[0289] Referring to FIG. 3B, FIG. 3B is a flow diagram of optimizing a second task request in a task request optimization method according to an embodiment of the present application. The task request optimization method provided by the present application is applied to the architecture of the task request optimization system in FIG. 2A or FIG. 2B, and includes a client, a task request optimization system, a vector storage system, and a large language model platform. As shown in FIG. 3B, the task request optimization method provided by the present application includes the following steps:
[0290] S313: The client sends a second task request to the task request optimization system.
[0291] Correspondingly, the task request optimization system receives the second task request from the client.
[0292] In some application scenarios, the second task request carries the second content and the first prompt information. The second content is the data to be processed. Moreover, the second content is different from the first content, wherein the first content is the first content in step S301 of the foregoing task request optimization method in FIG. 3A. The following continues to take the tax field as an example of a specific field to introduce the specific content of the second task request.
[0293] Suppose that the second task request A2 related to the tax field is as follows:
[0294] “Please confirm the tax subject of the text ‘Value forms include taxable income, sales revenue, operating income, etc. Taking value form as tax base, also known as quantity-based taxation, that is, calculating according to the monetary value of the tax object.’?
[0295] Among them, the tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.”
[0296] Therefore, the second content C2 in the second task request A2 is “What is the tax subject of the text ‘Value forms include taxable income, sales revenue, operating income, etc. Taking value form as tax base, also known as quantity-based taxation, that is, calculating according to the monetary value of the tax object.’?”. It can be seen that the second content C2 is a question to be answered.
[0297] The first prompt information P1 in the second task request A2 is “The tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.” It can be seen that the first prompt information P1 is the scope of the tax subject.
[0298] S314: The task request optimization system converts the second task request to obtain a vector of the second task request.
[0299] The process that the task request optimization system converts the second task request to obtain a vector of the second task request, so that the vector of the second task request contains the semantic information of the second content and the first prompt information can refer to the process that the task request optimization system converts the first task request to obtain a vector of the first task request in step S302 described above. For the sake of brevity of the description, it will not be expanded here.
[0300] The following takes the second task request A2 in step S313 above as an example of the second task request. Then, the task request optimization system converts the second task request A2 to obtain a vector B2 of the second task request A2, which is 0000101111.
[0301] S315: The vector storage system sends the vector of the plurality of sentences to the task request optimization system.
[0302] Correspondingly, the task request optimization system receives the vector of the plurality of sentences from the vector storage system.
[0303] Continuing with the tax field as a specific field example, the vector of the plurality of sentences received by the task request optimization system can be the vector of the plurality of sentences in the aforementioned Table 5, including the vector of sentences 1-7.
[0304] It should be understood that the technical solution can either execute the aforementioned steps S313-S314 first, and then execute the aforementioned step S315, or execute the aforementioned step S315 first, and then execute the aforementioned steps S313-S314.
[0305] S316: The task request optimization system screens a second vector from the vector of the plurality of sentences according to the vector of the second task request.
[0306] The process of the task request optimization system screening a second vector from the vector of the plurality of sentences according to the vector of the second task request can refer to the process of the task request optimization system screening a first vector from the vector of the plurality of sentences according to the vector of the first task request in the aforementioned step S304, and for the sake of brevity of the description, will not be expanded here.
[0307] Continuing with the vector B2 (0000101111) of the second task request A2 in the aforementioned step S315 as the vector of the second task request, and the vector of the plurality of sentences in the aforementioned Table 5 as the vector of the plurality of sentences, the process of screening a second vector from the vector of the plurality of sentences according to the vector of the second task request will be specifically introduced below.
[0308] First, the similarity between the vector B2 and the vector of each sentence in Table 5 is calculated. The calculated similarity is shown in the following Table 9. For the sake of brevity of the description, Table 9 only shows the similarity between the vector of the first seven sentences and the vector B2, and the sentence is indicated by the sentence serial number.
[0309] Table 9
[0310] For the sake of understanding, the similarity of sentences 1-7 in Table 9 is used as all the similarities in Table 9 below.
[0311] If the vector of the sentence with the largest similarity is selected from all the similarities in Table 9 as the second vector, the second vector is the vector 0000100011 of sentence 3 with a similarity of 90.24%.
[0312] S317: The task request optimization system sends the second vector to the vector storage system.
[0313] Accordingly, the vector storage system receives the second vector from the task request optimization system.
[0314] Continuing with the second vector obtained from the similarity in Table 9 in step S316 above as an example, the second vector received by the vector storage system is the vector 0000100011 of statement 3 with a similarity of 90.24% in Table 9.
[0315] S318: The vector storage system calculates a second statement, a vector of the second statement, and a second element label according to the second vector.
[0316] The process of the vector storage system calculating a second statement, a vector of the second statement, and a second element label according to the second vector can refer to the process of the vector storage system calculating a first statement, a vector of the first statement, and a first element label according to the first vector in step S306 of the method of optimizing a first task request in the foregoing FIG. 3A, and will not be described in detail here for the sake of brevity of the description.
[0317] Continuing with the second vector 0000100011 received by the vector storage system in step S317 above as the second vector, and the vectors of the statements in Table 5 above as the vectors of the statements, the process of calculating a second statement, a vector of the second statement, and a second element label according to the second vector will be described in detail below.
[0318] First, the vector storage system matches the second vector 0000100011 with the vectors of the statements in Table 5, and finds that the second vector 0000100011 is identical to the vector 0000100011 of statement 3 in Table 5 (i.e., a match is successful). Therefore, the category label “tax base” of the vector 0000100011 of statement 3 is taken as a second category label.
[0319] Subsequently, the vector storage system matches the second category label “tax base” with each category label in Table 5, and finds that the category label “tax base” in Table 5 is in statements 1-6. Therefore, the statements indicated by statements 1-6 (see Table 2 above) are taken as second statements 1-6, the vectors of statements 1-6 are taken as the vectors of the second statements 1-6, and the element labels of statements 1-6 are taken as the second element labels 1-6.
[0320] In summary, the specific content of the second sentence 1-second sentence 6, the specific content of the vector of the second sentence 1-vector of the second sentence 6, and the specific content of the second element label 1-second element label 6 are shown in Table 10 as follows. For the sake of brevity of the description, only the second sentence is indicated by the sentence number in Table 10, and the specific content of the second sentence indicated by the sentence number can refer to the aforementioned Table 2.
[0321] Table 10
[0322] S319: The vector storage system sends the second sentence, the vector of the second sentence, and the second element label to the task request optimization system.
[0323] Correspondingly, the task request optimization system receives the second sentence, the vector of the second sentence, and the second element label from the vector storage system.
[0324] Taking the second sentence 1-second sentence 6 obtained according to the second category label “tax base” in the above step S318, the vector of the second sentence 1-vector of the second sentence 6, and the second element label 1-second element label 6 as an example, the vector storage system can send the second sentence 1-second sentence 6, the vector of the second sentence 1-vector of the second sentence 6, and the second element label 1-second element label 6 to the task request optimization system.
[0325] S320: The task request optimization system calculates a second target sentence according to the vector of the second task request and the vector of the second sentence of the second concept according to the second element label, and takes the second target sentence and the second sentence of the second concept according to the second element label as third prompt information.
[0326] The process that the task request optimization system calculates a second target sentence according to the vector of the second task request and the vector of the second sentence of the second concept according to the second element label (referred to as a second initial vector), and takes the second target sentence and the second sentence of the second concept according to the second element label (referred to as a second initial sentence) as third prompt information can refer to the process that the task request optimization system calculates a first target sentence according to the vector of the first task request and the vector of the first sentence of the first concept according to the first element label in the above step S308, and takes the first target sentence and the first sentence of the first concept according to the first element label as second prompt information, and for the sake of brevity of the description, it will not be expanded here. The third prompt information represents the knowledge in the domain knowledge graph, that is, the third prompt information is information related to a specific field.
[0327] The following continues the process of calculating the second target statement according to the second task request vector and the second initial vector, taking the vector B2 (0000101111) of the second task request A2 in the step S314 above as the second task request vector, taking the second statement in Table 10 in the step S318 above as the second statement, taking the vector of the second statement in Table 10 as the second statement vector, and taking the second element label in Table 10 as an example of the second element label, with specific introduction.
[0328] Suppose the second concept is the concept "case" in the ontology model of the tax knowledge graph.
[0329] First, the second initial vector is obtained. Specifically, the task request optimization system matches the concept "case" with each second element label in Table 10, thereby finding the second element label 4, the second element label 5, and the second element label 6 in Table 10 that match successfully. Therefore, the vector 0011000001 of the second statement 4 corresponding to the second element label 4, the vector 0011000000 of the second statement 5 corresponding to the second element label 5, and the vector 0011000011 of the second statement 6 corresponding to the second element label 6 are taken as the second initial vector.
[0330] Second, the second task request vector is matched with the second initial vector, and the second target statement is determined according to the matching result. Specifically, the task request optimization system calculates the similarity between the vector B2 and each second initial vector. The calculated similarity is shown in Table 11 below.
[0331] Table 11
[0332] If the second statement corresponding to the second initial vector with the largest similarity is selected from all the similarities in Table 11 as the second target statement, the second target statement is the second statement 5 corresponding to the second initial vector 0011000000 with a similarity of 79.19%.
[0333] Next, the second initial statement is determined. Specifically, the task request optimization system matches the concept "case" with each second element label in Table 10, thereby finding the second element label 1, the second element label 2, and the second element label 3 in Table 10 that match successfully. Therefore, the second statement 1 corresponding to the second element label 1, the second statement 2 corresponding to the second element label 2, and the second statement 3 corresponding to the second element label 3 are taken as the second initial statement.
[0334] Finally, the second target sentence and the second initial sentence are taken as the third prompt information. Specifically, the second target sentence, the first sentence 5, and the second initial sentences, the second sentence 1, the second sentence 2, and the second sentence 3, are all taken as the third prompt information P31.
[0335] S321: The task request optimization system combines the third prompt information with the second task request to obtain an optimized second task request.
[0336] The process of the task request optimization system combining the third prompt information with the second task request to obtain an optimized second task request can refer to the process of the task request optimization system combining the second prompt information with the first task request to obtain an optimized first task request in step S309 described above. For the sake of brevity of the description, it will not be expanded here.
[0337] Taking the third prompt information P31 (including the second sentence 1, the second sentence 2, the second sentence 3, and the second sentence 5) obtained in the example in step S320 described above as the third prompt information, and taking the second task request A2 in step S313 described above as the second task request, and taking the example of the specified requirements in a serial manner, the second task request A2 is connected with the second sentence 1, the second sentence 2, the second sentence 3, and the second sentence 5 in order, and the result after the connection (i.e., the optimized second task request A2') is specifically as follows:
[0338] "Please confirm the tax subject of the text 'Value forms include taxable income, sales revenue, business income, etc. Taking value form as tax base, also known as quantity-based taxation, which is calculated according to the monetary value of the tax object.'?
[0339] Among them, the tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation, and tax collection management.
[0340] The information related to the above text also includes:
[0341] The definition of tax base is the direct quantity basis for calculating the tax amount of the tax object. It solves the calculation problem of taxing the tax object, and is the quantity of the tax object.
[0342] The tax base includes physical form. Among them, the meaning of physical form is the external characteristics and attributes of the tax object, including area, volume, capacity, weight, etc. Taking physical form as tax base, also known as quantity-based taxation, which is calculated according to the natural unit of the tax object.
[0343] The case of tax base is Article 2 of the People's Republic of China Urban Maintenance and Construction Tax Law: "The urban maintenance and construction tax is based on the tax amount of the tax object."
[0344] It should be understood that the above steps S320 and S321 can be summarized as: generating an optimized second task request based on the second statement, the vector of the second statement, and the second element label.
[0345] S322: The task request optimization system sends the optimized second task request to the large language model platform.
[0346] Correspondingly, the large language model platform receives the optimized second task request from the task request optimization system.
[0347] Taking the optimized second task request A2' in the above step S321 as an example, the large language model platform receives the optimized second task request A2'.
[0348] S323: The large language model platform obtains a second request result according to the optimized second task request.
[0349] The process of the large language model platform obtaining the second request result according to the optimized second task request can refer to the process of the large language model platform obtaining the first request result according to the optimized first task request in the above step S311. For the sake of brevity of the description, it will not be expanded here.
[0350] Taking the optimized second task request A2' received by the large language model platform in the above step S322 as an example, the second request result R21 obtained by the large language model platform according to the optimized second task request A2' is specifically: "The tax subject of the text 'Value form includes taxable income, sales revenue, operating income, etc. Taking value form as tax base, also known as quantity-based taxation, that is, calculating according to the monetary value of the tax object.' is tax base or taxable amount calculation."
[0351] S324: The large language model platform sends the second request result to the client.
[0352] Correspondingly, the client receives the second request result from the large language model platform.
[0353] Taking the second request result R21 obtained by the large language model platform according to the optimized second task request A2' in the above step S323 as an example, the client receives the second request result R21.
[0354] It should be understood that the above only illustrates the process of optimizing the task request in the tax field based on the tax knowledge graph, and when optimizing the task request in other fields based on other field knowledge graphs (such as a movie knowledge graph), in the case that the ontology model of the other field knowledge graph is different from the ontology model of the tax field knowledge graph, the concepts, entities, attributes and their relationships in the other field can be first redefined by other field experts according to the ontology model of the tax field knowledge graph, then the knowledge of the other field knowledge graph is re-expressed according to the new concepts, entities, attributes and their relationships to obtain a new other field knowledge graph, and finally the task request in the other field is optimized based on the new other field knowledge graph.
[0355] In summary, by implementing the embodiments of the present application, the following advantages are achieved:
[0356] Firstly, the technical solution realizes adding different prompt information in different task requests in the same specific field. Subsequently, inputting the task request carrying different prompt information into the large language model platform can provide differentiated information for the large language model platform to better understand different tasks in the same specific field, so that the large language model platform can generate more accurate request results for different task requests in the same specific field, thereby improving the accuracy of the request results.
[0357] Secondly, the technical solution introduces a field knowledge graph for carrying knowledge in a specific field, and adds the knowledge in the field knowledge graph in the format of a sentence as prompt information to the task request, which not only improves the utilization rate of the field knowledge graph, but also enriches the knowledge source of the prompt information. Moreover, compared with selecting information related to the specific field from general field text as prompt information, the knowledge in the field knowledge graph is more diverse and has higher quality, so that the technical solution can improve the quality of the prompt information by using the knowledge in the field knowledge graph as the prompt information.
[0358] Thirdly, the technical solution converts the matching between the task request and the knowledge in the field knowledge graph into the calculation between vectors, which can quickly lock the most relevant knowledge in the field knowledge graph for the task request, improve the matching speed, and further improve the entire optimization process of the task request.
[0359] Fourthly, compared with directly using the knowledge of the entire field knowledge graph in the format of a sentence as the prompt information in the first task request, the technical solution first determines a first vector based on the first task request, and then optimizes the first task request based on the first sentence having the same category label as the first vector and the vector, the element label, which means that only the knowledge related to the first task request (i.e. the first sentence) is selected from the field knowledge graph for optimizing the first task request, so that the content of the effective information in the optimized first task request can be improved.
[0360] Further, for the scenario of a large number of first statements, the technical solution further screens the first statement most relevant to the first task request from the first statements with the same element label after obtaining the first statement, and takes the screened first statement as the second prompt information, so as to reduce the length of the second prompt information while further improving the content of effective information in the optimized first task request. Moreover, the technical solution also ensures that the second prompt information includes the first statement under each element label, so that the knowledge in different dimensions in the domain knowledge graph is retained in the second prompt information, and the knowledge in a specific field provided by the second prompt information is complete and comprehensive. For example, in the example of step S308 of optimizing the first task request in the task request optimization method in FIG. 3A, when the first statement with the first element label of "case" has thousands of statements, the first statement most relevant to the first task request A1 (such as one first statement, five first statements, or ten first statements) is screened from the first statement with the first element label of "case", and the screened first statement is taken together with the first statement with the first element label of "definition", the first statement with the first element label of "explanation", and the first statement with other first element labels and small quantity as the second prompt information P21, so as to reduce the length of the second prompt information P21, retain the knowledge in different dimensions in the tax field knowledge graph in the second prompt information P21, and make the knowledge in the tax field provided by the second prompt information P21 complete and comprehensive, thereby ensuring the content of effective information in the optimized first task request A1'.
[0361] Referring to FIG. 3C, FIG. 3C is a flow diagram of optimizing a first task request in another task request optimization method provided by an embodiment of the present application. The task request optimization method provided by the present application is applied to the architecture of the task request optimization system in FIG. 2A or FIG. 2B, including a client, a task request optimization system, a vector storage system, and a large language model platform. As shown in FIG. 3C, the task request optimization method provided by the present application includes:
[0362] S401: The client sends a first task request to the task request optimization system.
[0363] Correspondingly, the task request optimization system receives the first task request from the client.
[0364] The client can be the client 300 in FIG. 2A or FIG. 2B. The task request optimization system can be the task request optimization system 400 in FIG. 2A or FIG. 2B.
[0365] In some application scenarios, the first task request carries first content and first prompt information. The first content is data to be processed. The first prompt information is information related to a specific field. For example, the first task request can be the first task request A1 in step S301 of the method for optimizing a task request in FIG. 3A.
[0366] S402: The task request optimization system converts the first task request to obtain a vector of the first task request.
[0367] The task request optimization system converts the first task request to obtain a vector of the first task request, so that the vector of the first task request contains semantic information of the first content and the first prompt information. The process can refer to the process of converting the first task request to obtain a vector of the first task request in step S302 of the method for optimizing a task request in FIG. 3A. For the sake of brevity of the description, it will not be described here.
[0368] Taking the first task request A1 in step S401 as an example, the task request optimization system converts the first task request A1 to obtain a vector B1 of the first task request A1, which is 0011000111.
[0369] S403: The vector storage system sends vectors of a plurality of sentences to the task request optimization system.
[0370] Correspondingly, the task request optimization system receives vectors of a plurality of sentences from the vector storage system.
[0371] Referring to the example in step S303 of the method for optimizing a task request in FIG. 3A, the vectors of the sentences received by the task request optimization system can be the vectors of the sentences in Table 5, including the vectors of sentences 1-7.
[0372] It should be understood that the above steps S401-S402 can be performed first, and then the above step S403 can be performed. Alternatively, the above step S403 can be performed first, and then the above steps S401-S402 can be performed.
[0373] S404: The task request optimization system screens a first vector from the vectors of a plurality of sentences according to the vector of the first task request.
[0374] The process of filtering the first vector from the vectors of the plurality of sentences according to the vector of the first task request in the step S304 of optimizing the first task request in the method of optimizing a task request in FIG. 3A will not be described herein for the sake of brevity of the description.
[0375] Referring to the example in the step S304 of optimizing the first task request in the method of optimizing a task request in FIG. 3A, the vector of the sentence with the largest similarity is selected as the first vector, and the first vector is the vector 0011000011 of the sentence 6 with the similarity of 93.66% in the table 6.
[0376] The step S405 of sending the first vector to the vector storage system by the task request optimization system.
[0377] Accordingly, the vector storage system receives the first vector from the task request optimization system.
[0378] Continuing the example of the vector 0011000011 of the sentence 6 with the similarity of 93.66% in the table 6 as the first vector in the step S404, the first vector received by the vector storage system is the vector 0011000011 of the sentence 6 with the similarity of 93.66% in the table 6.
[0379] The step S406 of calculating the first sentence according to the first vector by the vector storage system.
[0380] In some possible implementation, the step of calculating the first sentence according to the first vector by the vector storage system includes: matching the first vector with the vector of each sentence, taking the category label of the vector of the sentence with the matching success as the first category label, and then matching the first category label with the category label of each sentence, taking the sentence with the matching success as the first sentence.
[0381] The process of calculating the first sentence according to the first vector will be described in detail below with the vector 0011000011 received by the vector storage system in the step S405 as the first vector and the vectors of the sentences in the table 5 as the vectors of the sentences.
[0382] First, the vector storage system matches the first vector 0011000011 with the vector of each sentence in the table 5, and the first vector 0011000011 is identical to the vector 0011000011 of the sentence 6 in the table 5 (i.e., the matching is successful). Therefore, the category label “tax base” of the vector 0011000011 of the sentence 6 is taken as the first category label.
[0383] Subsequently, the vector storage system matches the first category label "tax base" with each category label in Table 5, and finds that the category label in Table 5 is "tax base" with the sentence numbers of sentence 1-sentence 6. Therefore, the sentences (refer to the aforementioned Table 2) indicated by sentence 1-sentence 6 are taken as the first sentences 1-6.
[0384] In summary, the specific content of the first sentences 1-6 is shown in Table 12 as follows. For the sake of brevity of the description, only the sentence numbers are indicated in Table 12, and the specific content of the first sentences indicated by the sentence numbers can refer to the aforementioned Table 2.
[0385] Table 12
[0386] S407: The vector storage system sends the first sentences to the task request optimization system.
[0387] Correspondingly, the task request optimization system receives the first sentences from the vector storage system.
[0388] In a specific implementation, the vector storage system can send the first sentences to the task request optimization system in the form of a table. Taking the first sentences 1-6 obtained according to the first category label "tax base" in the aforementioned step S406 as an example, the vector storage system can send Table 12 in the aforementioned step S406 to the task request optimization system.
[0389] In another specific implementation, the vector storage system can send the first sentences to the task request optimization system in the form of text. Taking the first sentences 1-6 obtained according to the first category label "tax base" in the aforementioned step S406 as an example, the vector storage system can send sentence 1, sentence 2, sentence 3, sentence 4, sentence 5, and sentence 6 to the task request optimization system.
[0390] It should be understood that the vector storage system sends the first sentences to the task request optimization system in the form of a table or text only as an example, and in actual applications, the vector storage system can also send the first sentences to the task request optimization system in other forms, which are not limited here.
[0391] S408: The task request optimization system combines the first sentences as second prompt information with the first task request to obtain an optimized first task request.
[0392] The process that the task request optimization system combines the second prompt information with the first task request to obtain the optimized first task request can refer to the process that the task request optimization system combines the second prompt information with the first task request to obtain the optimized first task request in step S309 of the foregoing one task request optimization method of optimizing the first task request. For the sake of brevity of the description, the process will not be described here again.
[0393] Taking the first sentence 1-first sentence 6 obtained in the foregoing example in step S407 as the second prompt information P22 and taking the first task request A1 in step S401 as the first task request as an example of the specified requirement in a serial manner, the first task request A1 is connected with the first sentence 1, the first sentence 2, the first sentence 3, the first sentence 4, the first sentence 5 and the first sentence 6 in sequence, and the result after the connection (i.e., the optimized first task request A1”) is specifically as follows:
[0394] “Please confirm the tax subject of the text ‘Article 3 of the Provisional Regulations of the People’s Republic of China on Urban Maintenance and Construction Tax: taxable sales are the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services and transferring real estate.’?
[0395] The tax subject includes tax base, tax item, tax rate, tax subject, tax location, tax point, tax preference, tax collection range, tax amount calculation and tax collection management.
[0396] The information related to the foregoing text also includes:
[0397] The definition of the tax base is the direct quantity basis for calculating the tax amount of the tax object. It solves the calculation problem of taxing the tax object and is the quantity of the tax object.
[0398] The tax base includes physical form. The meaning of the physical form is the external characteristics and attributes of the tax object, including area, volume, capacity and weight. Taking the physical form as the tax base is also called quantity-based taxation, that is, calculating according to the natural unit of the tax object.
[0399] The case of the tax base is Article 3 of the Provisional Regulations of the People’s Republic of China on Real Estate Tax: real estate tax is calculated and paid according to the remaining value of the original value of the real estate after a reduction of 10% to 30%. The specific reduction range is determined by the people’s governments of provinces, autonomous regions and municipalities directly under the central government. If there is no original value of the real estate as a basis, the tax authority of the location of the real estate will make a determination based on similar real estate. If the real estate is rented, the rental income of the real estate will be the tax basis for calculating the real estate tax.
[0400] The case of the tax base is Article 2 of the Law of the People’s Republic of China on Urban Maintenance and Construction Tax: urban maintenance and construction tax is calculated based on the actual tax amount of the value-added tax and consumption tax paid by the taxpayer.
[0401] The case of the tax base is Article 10 of the Value-Added Tax Law of the People's Republic of China: "The taxable sales are the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services, and transferring real estate, etc."
[0402] S409: The task request optimization system sends the optimized first task request to the large language model platform.
[0403] Correspondingly, the large language model platform receives the optimized first task request from the task request optimization system.
[0404] Among them, the large language model platform can be the large language model platform 500 in FIG. 2A or FIG. 2B.
[0405] Taking the optimized first task request A1" in the above step S408 as an example, the large language model platform receives the optimized first task request A1".
[0406] S410: The large language model platform obtains a first request result according to the optimized first task request.
[0407] The process of the large language model platform obtaining a second request result according to the optimized second task request can refer to the process of the large language model platform obtaining a first request result according to the optimized first task request in step S311 of the above-mentioned task request optimization method in FIG. 3A. For the sake of brevity of the description, it will not be expanded here.
[0408] Taking the optimized first task request A1" received by the large language model platform in the above step S409 as an example, the first request result R12 obtained by the large language model platform according to the optimized first task request A1" is specifically: "The tax subject of the text 'Article 3 of the Provisional Regulations of the People's Republic of China on Urban Maintenance and Construction Tax: The taxable sales are the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services, and transferring real estate, etc.' is tax base."
[0409] S411: The large language model platform sends the first request result to the client.
[0410] Correspondingly, the client receives the first request result from the large language model platform.
[0411] Taking the first request result R12 obtained by the large language model platform according to the optimized first task request A1" in the above step S410 as an example, the client receives the first request result R12.
[0412] Referring to FIG. 3D, FIG. 3D is a flow diagram of optimizing a second task request in another task request optimization method provided by the embodiments of the present application. The task request optimization method provided by the present application is applied to the architecture of the task request optimization system in FIG. 2A or FIG. 2B, including a client, a task request optimization system, a vector storage system, and a large language model platform. As shown in FIG. 3D, the task request optimization method provided by the present application includes the following steps.
[0413] S412: The client sends a second task request to the task request optimization system.
[0414] Correspondingly, the task request optimization system receives the second task request from the client.
[0415] In some application scenarios, the second task request carries second content and first prompt information. The second content is data to be processed. Moreover, the second content is different from the first content, wherein the first content is the first content in step S401 of optimizing the first task request in the task request optimization method in FIG. 3C. For example, the second task request can be the second task request A2 in step S313 of optimizing the second task request in the task request optimization method in FIG. 3B.
[0416] S413: The task request optimization system converts the second task request to obtain a vector of the second task request.
[0417] The task request optimization system converts the second task request to obtain a vector of the second task request, so that the vector of the second task request contains semantic information of the second content and the first prompt information. The process can refer to the process of converting the first task request to obtain a vector of the first task request by the task request optimization system in step S302 of optimizing the first task request in the task request optimization method in FIG. 3A. For the sake of brevity of the description, it will not be expanded here.
[0418] Taking the second task request A2 in step S412 above as an example of the second task request, the task request optimization system converts the second task request A2 to obtain a vector B2 of the first task request A2, specifically: 0000101111.
[0419] S414: The vector storage system sends vectors of multiple sentences to the task request optimization system.
[0420] Correspondingly, the task request optimization system receives the vectors of the multiple sentences from the vector storage system.
[0421] Referring to the example in step S315 of optimizing the second task request in the task request optimization method in FIG. 3B, the vector of the sentence received by the task request optimization system can be the vector of the sentence in the aforementioned Table 5, including the vector of the sentence 1-sentence 7.
[0422] It should be understood that the above steps S412-S413 can be performed first, and then the above step S414 can be performed; or the above step S414 can be performed first, and then the above steps S412-S413 can be performed.
[0423] S415: The task request optimization system screens a second vector from the plurality of vectors of the sentence according to the vector of the second task request.
[0424] The process of screening the second vector from the plurality of vectors of the sentence according to the vector of the second task request by the task request optimization system can refer to the process of screening the first vector from the plurality of vectors of the sentence according to the vector of the first task request by the task request optimization system in step S304 of optimizing the first task request in the task request optimization method in FIG. 3A, and will not be described here for the sake of brevity of the description.
[0425] Referring to the example in step S316 of optimizing the second task request in the task request optimization method in FIG. 3B, the vector of the sentence with the largest similarity is selected as the second vector, and the second vector is the vector 0000100011 of the sentence 3 with a similarity of 90.24% in the aforementioned Table 9.
[0426] S416: The task request optimization system sends the second vector to the vector storage system.
[0427] Correspondingly, the vector storage system receives the second vector from the task request optimization system.
[0428] Continuing the example of taking the vector 0000100011 of the sentence 3 with a similarity of 90.24% in the aforementioned Table 9 as the second vector in the above step S415, the second vector received by the vector storage system is the vector 0000100011 of the sentence 3 with a similarity of 90.24% in Table 9.
[0429] S417: The vector storage system calculates a second sentence according to the second vector.
[0430] In some possible implementation manners, the process of calculating the second sentence according to the second vector by the vector storage system can refer to the process of calculating the first sentence according to the first vector by the vector storage system in step S406 of optimizing the first task request in the task request optimization method in FIG. 3C, and will not be described here for the sake of brevity of the description.
[0431] The following continues the second vector 0000100011 received by the vector storage system in the above step S416 as the second vector, and specifically describes the process of calculating the second statements according to the second vector, taking the vector of the statement in the above Table 5 as an example of the vector of the statement.
[0432] First, the vector storage system matches the second vector 0000100011 with the vector of each statement in Table 5, and then finds that the second vector 0000100011 is the same as the vector 0000100011 of statement 3 in Table 5 (i.e., a successful match). Therefore, the category label "tax base" of the vector 0000100011 of statement 3 is taken as the second category label.
[0433] Subsequently, the vector storage system matches the second category label "tax base" with each category label in Table 5, and then finds that the category label "tax base" in Table 5 is the statement sequence number of statement 1 - statement 6. Therefore, the statements indicated by statement 1 - statement 6 (see the above Table 2) are taken as the second statements 1 - second statements 6.
[0434] In summary, the specific content of the second statements 1 - second statements 6 is shown in the following Table 13. For the sake of brevity of the description, only the statement sequence number is used to indicate the second statements in Table 13, and the specific content of the second statements indicated by the statement sequence number can be referred to the above Table 2.
[0435] Table 13
[0436] S418: The vector storage system sends the second statements to the task request optimization system.
[0437] Correspondingly, the task request optimization system receives the second statements from the vector storage system.
[0438] Continuing the second statements 1 - second statements 6 obtained according to the second category label "tax base" in the above step S417 as an example, the vector storage system can send the second statements 1 - second statements 6 to the task request optimization system.
[0439] S419: The task request optimization system combines the second statements as the third prompt information with the second task request to obtain the optimized second task request.
[0440] The process of the task request optimization system combining the third prompt information with the second task request to obtain the optimized second task request can refer to the process of the task request optimization system combining the second prompt information with the first task request to obtain the optimized first task request in the step S309 of the method of optimizing the first task request in the above Figure 3A, and for the sake of brevity of the description, it will not be expanded here.
[0441] The second sentence 1-second sentence 6 obtained in the above example in step S4187 is continued as the third prompt information P32, the second task request A2 in the above step S412 is taken as the second task request, and the second task request A2 is connected with the second sentence 1, the second sentence 2, the second sentence 3, the second sentence 4, the second sentence 5 and the second sentence 6 in order as an example of the specified requirement in a serial manner, and the connection result (i.e. the optimized second task request A2”) is as follows:
[0442] "Please confirm the tax theme of the text 'Value form includes taxable income, sales revenue, business income, etc. Taking value form as tax base is also called quantity-based taxation, that is, calculating according to the monetary value of the tax object.'?
[0443] Among them, the tax theme includes tax base, tax item, tax rate, tax subject, tax location, tax time point, tax preference, tax collection range, tax amount calculation, and tax collection management.
[0444] The information related to the above text also includes:
[0445] The definition of tax base is the direct quantity basis for calculating the tax amount of the tax object. It solves the calculation problem of taxing the tax object, and is the quantity of the tax object.
[0446] The tax base includes physical form. Among them, the meaning of physical form is the external characteristics and attributes of the tax object, including area, volume, capacity, weight, etc. Taking physical form as tax base is also called quantity-based taxation, that is, calculating according to the natural unit of the tax object.
[0447] The case of tax base is Article 3 of the "Provisional Regulations of the People's Republic of China on Real Estate Tax": Real estate tax is calculated and paid according to the remaining value of the original value of real estate after a reduction of 10% to 30%. The specific reduction range is determined by the people's governments of provinces, autonomous regions and municipalities directly under the central government. If there is no real estate original value as a basis, it will be determined by the local tax authorities of the real estate. If the real estate is rented, the rental income of the real estate will be the tax basis for calculating the real estate tax.
[0448] The case of tax base is Article 2 of the "Urban Maintenance and Construction Tax Law of the People's Republic of China": Urban maintenance and construction tax is calculated based on the actual tax amount of value-added tax and consumption tax paid by the taxpayer.
[0449] The case of tax base is Article 10 of the "Value-Added Tax Law of the People's Republic of China": The taxable sales amount is the total income obtained by the taxpayer in the taxable acts of selling goods, providing taxable services and transferring real estate, etc.
[0450] S420: The task request optimization system sends the optimized second task request to the large language model platform.
[0451] Accordingly, the large language model platform receives the optimized second task request from the task request optimization system.
[0452] Continuing with the example of the optimized second task request A2 in step S419 above, the large language model platform receives the optimized second task request A2.
[0453] S421: The large language model platform obtains the result of the second request based on the optimized second task request.
[0454] The process by which the large language model platform obtains the result of the second request based on the optimized second task request can be referred to in step S311 of the task request optimization method in Figure 3A above, where the large language model platform obtains the result of the first request based on the optimized first task request. For the sake of brevity, this will not be elaborated here.
[0455] Continuing with the example of the optimized second task request A2” received by the large language model platform in step S420 above, the second request result R22 obtained by the large language model platform based on the optimized second task request A2” is specifically: “The tax subject of the text ‘Value forms include taxable income, sales revenue, operating revenue, etc. Using value forms as the tax base is also known as specific taxation, that is, calculating according to the monetary value of the taxable object.’ is the calculation of the tax base or tax payable.
[0456] S422: The large language model platform sends the second request result to the client.
[0457] Accordingly, the client receives the second request result from the large language model platform.
[0458] Continuing with the example of the second request result R22 obtained by the large language model platform in step S421 based on the optimized second task request A2", the client receives the second request result R22.
[0459] In summary, compared to directly using the knowledge of the entire domain knowledge graph in the form of sentences as prompt information in the first task request, this technical solution first determines the first vector based on the first task request, and then selects the first sentence with the same category label as the first vector as the second prompt information to optimize the first task request. That is, only the knowledge (i.e. the first sentence) related to the first task request is selected from the domain knowledge graph to optimize the first task request, which can improve the content of effective information in the optimized first task request.
[0460] Further, for the scenario of a small number of first sentences, the technical solution directly takes the first sentence as the second prompt information after obtaining the first sentence, which can improve the speed of obtaining the second prompt information, and further improve the optimization efficiency of the first task request.
[0461] The embodiments of the present application also provide a computing system, which comprises a task request optimization system and a large language model platform. The task request optimization system is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3, FIG. 3A, FIG. 3B, FIG. 3C or FIG. 3D. The large language model platform is configured to implement the steps performed by the large language model platform in the task request optimization method of the preceding FIG. 3, FIG. 3A, FIG. 3B, FIG. 3C or FIG. 3D.
[0462] The embodiments of the present application also provide a chip system, which comprises a processor and a power supply circuit. The power supply circuit is configured to supply power to the processor. The processor is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3, or the processor is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3A, or the processor is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3B, or the processor is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3C, or the processor is configured to implement the steps performed by the task request optimization system in the task request optimization method of the preceding FIG. 3D. For brevity, details are not repeated here. The processor can be implemented by a GPU, or by a DPU, NPU, XPU, SoC, offload card, acceleration card, etc.
[0463] Referring to FIG. 4, FIG. 4 is a structural schematic diagram of a computing device according to an embodiment of the present application. As shown in FIG. 4, the computing device 600 provided by the embodiments of the present application comprises a bus 401, a processor 402, a memory 403 and a communication interface 404. The processor 402, the memory 403 and the communication interface 404 communicate through the bus 401. The computing device 600 can be a server or a terminal device. It should be understood that the number of processors and memories in the computing device 600 is not limited by the present application.
[0464] The bus 401 can be a peripheral component interconnect Express (PCIe) bus or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), or the like. Among them, the unified bus is also referred to as a coherent bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one line is represented in FIG. 4, but it does not mean that there is only one bus or only one type of bus. The bus 401 can include a path for transmitting information between various components (for example, the memory 403, the processor 402, the communication interface 404) of the computing device 600.
[0465] The processor 402 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), an ASIC, a FPGA, a CPLD, an NPU, a SoC, an offload card, an acceleration card, or the like computing device.
[0466] The memory 403 can include a volatile memory, such as a random access memory (RAM) including a dynamic RAM (DRAM), a static RAM (SRAM), or the like. The processor 402 can further include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). In addition, the memory 403 can be implemented through a storage class memory (SCM), a phase change memory (PCM), or other types of storage media.
[0467] It is worth mentioning that the same type of storage medium can be configured in the same computing device to implement the memory 403 function, and two or more types of storage media can also be configured to implement the memory 403 function, and the present application does not limit this.
[0468] The memory 403 stores executable program code, and the processor 402 executes the executable program code to respectively implement the functions of the computing unit 410 and the combination unit 440 in the task request optimization system 400 in the foregoing FIG. 2B, so as to execute the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3, FIG. 3A, FIG. 3B, FIG. 3C or FIG. 3D. That is, the memory 403 has instructions for executing the task request optimization method.
[0469] The communication interface 404 uses a transceiver module such as but not limited to a network interface card and a transceiver to realize the communication between the computing device 600 and other computing devices or communication networks.
[0470] As a possible implementation manner, the computing device 600 can also include a chip system including a processor and a power supply circuit for performing power supply for the processor, and the processor is used to execute the operation steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3, or the processor is used to execute the operation steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A, or the processor is used to execute the operation steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B, or the processor is used to execute the operation steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3C, or the processor is used to execute the operation steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3D. For the sake of brevity, it will not be repeated here. Wherein, the processor can be implemented by GPU, and can also be implemented by DPU, NPU, XPU, SoC, offload card, acceleration card and other computing devices or AI chips.
[0471] As a possible implementation, the computing device 600 can include multiple types of processors 402, i.e., the computing device 600 is a heterogeneous device, for example, the computing device 600 includes a CPU and a GPU, and the operations performed by the task request optimization system in the foregoing task request optimization method of FIG. 3 can be performed by at least one of the processors 402, or the operations performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A can be performed, or the operations performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B can be performed, or the operations performed by the task request optimization system in the foregoing task request optimization method of FIG. 3C can be performed, or the operations performed by the task request optimization system in the foregoing task request optimization method of FIG. 3D can be performed. For brevity, details are not repeated here.
[0472] Referring to FIG. 5, FIG. 5 is a structural schematic diagram of a computing device cluster provided in an embodiment of the present application. The computing device cluster provided in an embodiment of the present application includes at least one computing device. The computing device can be a server, for example, a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a desktop computer, a notebook computer, or a terminal device such as a smart phone.
[0473] As shown in FIG. 5, the computing device cluster includes at least one computing device 600. The memory 403 in one or more computing devices 600 in the computing device cluster can store the same instructions for performing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3, or the instructions for performing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A, or the instructions for performing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B, or the instructions for performing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3C, or the instructions for performing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3D.
[0474] In some possible implementation, the memory 403 of one or more of the computing devices 600 in the computing device cluster can also respectively store partial instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3, or, the steps performed by the task request optimization system in the task request optimization method of FIG. 3A, or, the steps performed by the task request optimization system in the task request optimization method of FIG. 3B, or, the steps performed by the task request optimization system in the task request optimization method of FIG. 3C, or, the steps performed by the task request optimization system in the task request optimization method of FIG. 3D. In other words, the one or more computing devices 600 can collectively perform the instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3, or, the instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3A, or, the instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3B, or, the instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3C, or, the instructions for performing the steps performed by the task request optimization system in the task request optimization method of FIG. 3D.
[0475] It should be noted that the memory 403 in different computing devices 600 in the computing device cluster can store different instructions for respectively performing part of the functions of the task request optimization system 400 in FIG. 2B. That is, the instructions stored in the memory 403 in different computing devices 600 can implement the functions of one or more of the computing unit 410 and the matching unit 420.
[0476] Referring to FIG. 6, FIG. 6 is a structural schematic diagram of another computing device cluster provided by an embodiment of the present application. In some possible implementation, one or more computing devices in the computing device cluster can be connected through a network. The network can be a wide area network or a local area network, etc. As shown in FIG. 6, two computing devices 600A and 600B are connected through a network. Specifically, the computing devices are connected to the network through the communication interfaces in the computing devices. In this type of possible implementation, the memory 403 in the computing device 600A stores instructions for performing the functions of the computing unit 410. Meanwhile, the memory 403 in the computing device 600B stores instructions for performing the functions of the combining unit 440.
[0477] The connection manner between the computing device cluster shown in FIG. 6 can be that, considering that the task request method provided in the present application needs to receive a large number of task requests, the functions implemented by the computing unit 410 are transferred to the computing device 600A for execution.
[0478] It should be understood that the functions of the computing device 600A shown in FIG. 6 can also be completed by multiple computing devices 600. Similarly, the functions of the computing device 600B can also be completed by multiple computing devices 600.
[0479] The present application also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection manners of the computing device clusters described with reference to FIG. 5 and FIG. 6. The difference is that the memory 403 in one or more computing devices 600 in the computing device cluster can store the same instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A, or the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B.
[0480] In some possible implementations, the memory 403 of one or more computing devices 600 in the computing device cluster can also respectively store part of the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3, or part of the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A, or part of the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B, or part of the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3C, or part of the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3D. In other words, the combination of one or more computing devices 600 can collectively execute the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3, or the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3A, or the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3B, or the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3C, or the instructions for executing the steps performed by the task request optimization system in the foregoing task request optimization method of FIG. 3D.
[0481] It should be noted that the memories 403 in different computing devices 600 in the computing device cluster can store different instructions for respectively executing the functions of the aforementioned parts of the task request optimization system 400 in FIG. 2B. That is, the instructions stored in the memories 403 in different computing devices 600 can implement the functions of one or more of the computing unit 410 and the matching unit 420.
[0482] The embodiments of the present application further provide a computer program product containing instructions. The computer program product can be a software or program product containing instructions, which can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, the at least one computing device is caused to perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3A, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3B, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3C, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3D.
[0483] The embodiments of the present application further provide a computer readable storage medium. The computer readable storage medium can be any available medium that the computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), etc. The computer readable storage medium includes instructions instructing the computing device to perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3A, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3B, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3C, or perform the steps performed by the task request optimization system in the aforementioned task request optimization method in FIG. 3D.
[0484] It should be understood that in the embodiments of the present application, "when", "if" and "when" all refer to the device making corresponding processing under certain objective circumstances, not limited to time, and it is not required that the device must have a judgment action when implementing, nor does it mean that there are other limitations.
[0485] It should be understood that in the embodiments of the present application, "at the same time" does not necessarily require strict simultaneity, same part, even same second, or even same moment. When the moments of occurrence are slightly different, it can also be understood as "at the same time".
[0486] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the foregoing examples, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing examples, or make equivalent replacements for some of the technical features therein. Such modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for task request optimization, the method comprising: The method comprises: receiving a first task request, the first task request comprising first content and first prompt information, wherein the first content is data to be processed, and the first prompt information is information related to a specific field; outputting an optimized first task request, the optimized first task request comprising the first task request and second prompt information, the second prompt information being information related to the specific field, and the second prompt information being different from the first prompt information; receiving a second task request, the second task request comprising second content and the first prompt information, wherein the second content is data to be processed, and the second content is different from the first content; outputting an optimized second task request, the optimized second task request comprising the second task request and third prompt information, the third prompt information being information related to the specific field, the third prompt information being different from the first prompt information, and the third prompt information being different from the second prompt information.
2. The method of claim 1, wherein, The second prompt information comprises one or more sentences, and the sentences are used to describe knowledge in a domain knowledge graph, and the domain knowledge graph is used to describe knowledge of the specific field.
3. The method of claim 2, wherein, After receiving the first task request, the method further comprises: sending a first vector, wherein the first vector is determined based on the first task request; receiving a first sentence, a vector of the first sentence, and a first element label, wherein the first sentence is used to describe knowledge in the domain knowledge graph, a class label of the first sentence is the same as a class label of the first vector, the class label is used to indicate an entity in the domain knowledge graph, and the first element label is an element label of the first sentence, and the element label is used to indicate a concept in the domain knowledge graph; generating the optimized first task request based on the first sentence, the vector of the first sentence, and the first element label.
4. The method of claim 3, wherein, The generating of the optimized first task request based on the first sentence, the vector of the first sentence, and the first element label comprises: obtaining a first target sentence according to the vector of the first task request and the vector of the first sentence of the first concept, wherein the first concept is a concept in the domain knowledge graph; taking the first target sentence and the first sentence of the first concept other than the first element label as the second prompt information; combining the second prompt information with the first task request to obtain the optimized first task request.
5. The method according to claim 3 or 4, characterized in that, The ontology model of the domain knowledge graph comprises a first layer and a second layer, a concept in the second layer being a constituent element of a concept in the first layer, the class label being used to indicate an entity of the concept in the first layer, and the element label being a concept in the second layer.
6. The method of claim 5, wherein, The concept in the first layer includes a category, and the concept in the second layer includes one or more of a definition, an explanation, a case, and a constraint, wherein the category is used to describe a set of a group of things with similar characteristics, the definition is used to provide the meaning of the category, the explanation is used to provide the explanation information of the category, the case is used to provide the example of the category, and the constraint is used to indicate the range or constraint of the category.
7. The method of claim 2, wherein, After the first task request is received, the method further includes: sending a first vector, wherein the first vector is determined based on the first task request; receiving a first sentence, wherein the first sentence is used to describe knowledge in the domain knowledge graph, a category label of the first sentence is the same as a category label of the first vector, and the category label is used to indicate an entity in the domain knowledge graph; combining the first sentence as the second prompt information with the first task request to obtain the optimized first task request.
8. The method according to any one of claims 3 to 7, characterized in that, Before the first vector is sent, the method further includes: receiving vectors of a plurality of sentences, wherein the vector of the sentence is obtained by converting the sentence, and the sentence corresponding to the vector of the sentence is used to describe knowledge in the domain knowledge graph; selecting the first vector from the plurality of vectors of the sentences according to the vector of the first task request.
9. A task request optimization system, characterized by, comprising: a calculation unit and a combination unit, the calculation unit is configured to receive a first task request, the first task request comprising first content and first prompt information, wherein the first content is data to be processed, and the first prompt information is information related to a specific field; the combination unit is configured to output an optimized first task request, the optimized first task request comprising the first task request and second prompt information, the second prompt information being information related to the specific field, and the second prompt information being different from the first prompt information; the calculation unit is further configured to receive a second task request, the second task request comprising second content and the first prompt information, wherein the second content is data to be processed, and the second content is different from the first content; the combination unit is further configured to output an optimized second task request, the optimized second task request comprising the second task request and third prompt information, the third prompt information being information related to the specific field, the third prompt information being different from the first prompt information, and the third prompt information being different from the second prompt information.
10. The system of claim 9, wherein, The second prompt information comprises one or more sentences, and the sentences are used to describe knowledge in a domain knowledge graph, and the domain knowledge graph is used to describe knowledge of the specific field.
11. The system of claim 10, wherein, The system further comprises a transceiver unit and a combination unit, the transceiver unit is configured to send a first vector after the calculation unit receives a first task request, wherein the first vector is determined based on the first task request; The transceiving unit is further configured to receive a first sentence, a vector of the first sentence, and a first element label, where the first sentence is used to describe knowledge in the domain knowledge graph, a category label of the first sentence is the same as a category label of the first vector, the category label is used to indicate an entity in the domain knowledge graph, and the first element label is an element label of the first sentence, which is used to indicate a concept in the domain knowledge graph. The combination unit is configured to generate the optimized first task request based on the first sentence, the vector of the first sentence, and the first element label.
12. The system of claim 11, wherein, The combination unit is specifically configured to: obtain a first target sentence according to the vector of the first task request and the vector of the first sentence with the first element label being a first concept, where the first concept is a concept in the domain knowledge graph; take the first target sentence and the first sentence with the first element label not being the first concept as the second prompt information; combine the second prompt information with the first task request to obtain the optimized first task request.
13. The system of claim 11 or 12, wherein, The ontology model of the domain knowledge graph includes a first layer and a second layer, a concept in the second layer is a constituent element of a concept in the first layer, the category label is used to indicate an entity of the concept in the first layer, and the element label is a concept in the second layer.
14. The system of claim 13, wherein, The concept in the first layer includes a category, and the concept in the second layer includes one or more of a definition, an explanation, a case, and a constraint condition, where the category is used to describe a set of a group of things with similar characteristics, the definition is used to provide a meaning of the category, the explanation is used to provide explanation information of the category, the case is used to provide an example of the category, and the constraint condition is used to indicate a range or constraint of the category.
15. The method of claim 10, wherein, The system further includes a transceiving unit and a combination unit, The transceiving unit is configured to send a first vector after the computing unit receives a first task request, where the first vector is determined based on the first task request. The transceiving unit is further configured to receive a first sentence, where the first sentence is used to describe knowledge in the domain knowledge graph, and a category label of the first sentence is the same as a category label of the first vector, and the category label is used to indicate an entity in the domain knowledge graph. The combination unit is configured to take the first sentence as the second prompt information, and combine the second prompt information with the first task request to obtain the optimized first task request.
16. The system of any one of claims 11 to 15, wherein, The system further includes a matching unit, The matching unit is configured to receive a plurality of vectors of sentences before the transceiving unit sends a first vector, where the vector of the sentence is obtained by converting a sentence, and a sentence corresponding to the vector of the sentence is used to describe knowledge in the domain knowledge graph. The matching unit is further configured to filter the first vector from a plurality of vectors of the sentences according to a vector of the first task request.
17. A computing system, comprising: The system includes: a task request optimization system and a large language model platform, The task request optimization system is configured to perform the method of any one of claims 1-8. The large language model platform is configured to receive the optimized first task request from the task request optimization system and obtain a first request result according to the optimized first task request.
18. A chip system, characterized by The chip system includes a processor and a power supply circuit, the power supply circuit is configured to supply power to the processor, and the processor is configured to perform the operation steps of the method of any one of claims 1-8.
19. A computing device, comprising: The system includes a processor and a memory, the memory is configured to store instructions, and the processor is configured to execute the instructions, and when the processor executes the instructions, the method of any one of claims 1-8 is implemented.
20. A cluster of computing devices, characterized in that, The system includes at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute the instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method of any one of claims 1-8.
21. A computer program product comprising instructions, wherein: When the instructions are executed by the computing device, the computing device executes the method of any one of claims 1-8.
22. A computer-readable storage medium, characterized in that, The system includes computer program instructions, when the computer program instructions are executed by the computing device, the computing device executes the method of any one of claims 1-8.
Citation Information
Patent Citations
Prompt recommendation method and device based on atlas, equipment and medium
CN116821373A
LLMs cue word optimization-based power grid dispatching intelligent question-answering system and method
CN116860925A
Data processing method and related equipment
CN116910202A
Man-machine conversation control method and device, equipment and storage medium
CN117149981A
Data generation method using language model, computer device, and computer program
JP2023018624A