Human-computer interaction method and device, electronic equipment and storage medium
By obtaining the correlation labels input by users and using large language models and knowledge graphs, the problem of unmatched user descriptions in human-computer interaction is solved, achieving high-precision interaction effect.
Patent Information
- Application Number
- CN202510746668.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-05
AI Technical Summary
Existing human-computer interaction methods cannot be converted into model-understandable vocabulary when the user describes not matching in the synonym library, resulting in low session accuracy.
By obtaining the associated tags of user input information, using a large language model for mapping, and combining the preset knowledge graph, the query content is dynamically adjusted to achieve accurate understanding of user needs.
It improves the accuracy of human-computer interaction, can accurately understand the user's natural language expression, dynamically adjust the inquiry content, and gradually obtain the user's detailed needs.
Smart Images

Figure CN120596632A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology applications, and in particular to a human-computer interaction method, device, electronic equipment and storage medium. Background Art
[0002] With the development of artificial intelligence (AI) technology, knowledge graphs and large language models are increasingly being applied to conversational scenarios, enabling more people to enjoy intelligent conversation services. However, existing methods often rely on hard matching with synonyms. If a user's description doesn't match an item in the synonym database, it can't be converted into vocabulary that the model can understand, resulting in inability to conduct conversations and low precision in human-computer interaction. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to a first aspect of the present invention, a human-computer interaction method is provided, the method comprising the following steps:
[0005] S100: Obtaining the initial inquiry content input by the user.
[0006] S200, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k≥1.
[0007] S300, using a large language model to map the currently received query input information and the corresponding k associated tags, obtain the mapping tag corresponding to the currently received query input information and add it to the current combined tag set; the initial value of the current combined tag set is a null value.
[0008] S400: Based on the current combined tag set and a preset knowledge graph, a tag associated with the current combined tag set is obtained as the current query tag.
[0009] S500, if the current query operation meets the preset termination condition, output the corresponding query output information based on the current combination tag set; otherwise, generate the corresponding query question based on the current query tag and output the query question; the query question includes at least two features for the user to select.
[0010] S600, obtain the answer information of the user to the query question. If the answer information includes the feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and use the received answer information as the currently received query input information, execute S200. If the answer information indicates that the user has not selected any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S400.
[0011] According to a second aspect of the present invention, a human-computer interaction device is provided, comprising: an operation interface and a processor, wherein the operation interface is configured for a user to input query input information; and the processor is configured to execute a computer program to implement the following steps:
[0012] S10: Obtain the initial inquiry content input by the user.
[0013] S20, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k≥1.
[0014] S30, using the large language model to map the currently received query input information and the corresponding k associated tags, obtain the mapping tag corresponding to the currently received query input information and add it to the current combined tag set; the initial value of the current combined tag set is a null value.
[0015] S40: Based on the current combined tag set and the preset knowledge graph, a tag associated with the current combined tag set is obtained as the current query tag.
[0016] S50, if the current query operation meets the preset termination condition, output the corresponding query output information based on the current combination tag set; otherwise, generate the corresponding query question based on the current query tag and output the query question; the query question includes at least two features for the user to select.
[0017] S60, obtain the answer information of the user to the query question. If the answer information includes a feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and use the received answer information as the currently received query input information, and execute S20. If the answer information indicates that the user did not select any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S40. According to the third aspect of the present invention, an electronic device is provided, including a processor and a memory; the processor is used to execute the steps of the method described in the first aspect of the present invention by calling a program or instruction stored in the memory.
[0018] According to a fourth aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing a program or instructions for enabling a computer to execute the steps of the method according to the first aspect of the present invention.
[0019] The present invention has at least the following beneficial effects:
[0020] The human-computer interaction method provided by an embodiment of the present invention first obtains k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information based on the currently received query input information; then, the currently received query input information and the corresponding k associated tags are mapped using a large language model to obtain a mapping tag corresponding to the currently received query input information; then, the mapping tag corresponding to the currently received query input information is added to the current combined tag set, and based on the current combined tag set and a preset knowledge graph, a tag associated with the current combined tag set is obtained as the current query tag; if the current query operation meets the preset termination condition, the corresponding query output information is output based on the current combined tag set; otherwise, the corresponding query question is generated based on the current query tag and the query question is output; when the answer information of the user to the query question is received, the received answer information is used as the currently received query input information to perform the next interactive operation. The human-computer interaction method provided by the present invention is a guided interactive inquiry method, which can accurately understand the user's natural language expression, dynamically adjust the inquiry content, gradually obtain the user's detailed needs, and improve the accuracy of human-computer interaction.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is a flowchart of a human-computer interaction method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0026] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be performed in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. A process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. A process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0027] An embodiment of the present invention provides a human-computer interaction method, and one application scenario of the method may be a dialogue scenario. In a specific exemplary embodiment, the method may be a traditional Chinese medicine consultation scenario.
[0028] The method may include Figure 1 Steps shown:
[0029] S100: Obtaining the initial inquiry content input by the user.
[0030] In an embodiment of the present invention, a user may enter an initial query in a text box on a corresponding operation interface. The corresponding operation interface may be an operation interface of a device installed with a computer program capable of executing the human-computer interaction method of the present invention. The user may enter the desired query through text input, voice input, or other input methods. For example, the user may enter "I have had frequent headaches recently and I don't know what the cause is" in the text box.
[0031] S200, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k≥1.
[0032] In the embodiment of the present invention, k may be set based on actual needs. In a non-limiting exemplary embodiment, 5≤k≤10.
[0033] In an exemplary embodiment of the present invention, a feature may be a manifestation of a person's physical condition, such as a TCM symptom. The preset feature term knowledge base may be a TCM symptom knowledge base, which may be constructed based on an existing TCM symptom term corpus. Any method for constructing a preset TCM symptom term knowledge base based on an existing TCM symptom term corpus falls within the scope of protection of the present invention. In an embodiment of the present invention, the preset feature term knowledge base stores a vector corresponding to each feature term.
[0034] Furthermore, in the embodiment of the present invention, k associated feature terms can be obtained by the following steps:
[0035] S201, obtaining the similarity S between the currently received query input information and the i-th feature term in the preset feature term knowledge base i , we get the similarity set S = {S1, S2, ..., S i ,……,S n}; the value of i ranges from 1 to n, where n is the number of feature terms in the preset feature term knowledge base.
[0036] It is known to those skilled in the art that S i The similarity between the vector corresponding to the currently received query input information and the vector corresponding to the i-th feature term in the preset feature term knowledge base can be converted into a corresponding vector through a word embedding model.
[0037] In the embodiment of the present invention, the similarity may be cosine similarity. It is known to those skilled in the art that any method for obtaining the cosine similarity between two vectors falls within the scope of protection of the present invention.
[0038] S202, sort S in descending order to obtain a sorted similarity set SR.
[0039] S203: Taking the feature terms corresponding to the first k similarities in the SR as the k associated feature terms.
[0040] In this embodiment of the present invention, the k associated feature terms can be obtained using a retrieval-enhanced generative model. This model combines the advantages of information retrieval and generative models, improving the accuracy and relevance of tag retrieval. For example, for the user input "I have frequent headaches recently," the model might retrieve associated tags such as "headache," "dizziness," and "abnormal blood pressure."
[0041] S300: Mapping the currently received query input information to the corresponding k associated tags using the large language model to obtain a mapping tag corresponding to the currently received query input information and adding the mapping tag corresponding to the currently received query input information to the current combined tag set. The initial value of the current combined tag set is null.
[0042] In an embodiment of the present invention, the large language model may be a trained large language model. In one exemplary embodiment, the large language model may be a Yayi large model. The large language model may be trained using existing training methods. Specifically, the currently received query input information and the corresponding k associated labels may be input into the large language model to obtain corresponding mapped labels.
[0043] In this embodiment of the present invention, a large language model is used to map query input information to associated tags, enabling a more accurate understanding of the user's description and converting it into a format that conforms to the knowledge base tags. For example, a user input of "I have had a lot of headaches recently" would be mapped to the "headache" tag.
[0044] S400: Based on the current combined tag set and a preset knowledge graph, a tag associated with the current combined tag set is obtained as the current query tag.
[0045] In an embodiment of the present invention, a knowledge graph may be composed of first to fourth type nodes, wherein the first type nodes are state nodes representing a state, the second type nodes are feature nodes representing a characteristic of a state, the third type nodes are attribute nodes representing an attribute of a state, and the fourth type nodes are region nodes representing an area to which the state belongs. There are association relationships between the first type nodes and the second type nodes, between the first type nodes and the third type nodes, between the first type nodes and the fourth type nodes, and between the second type nodes and the second type nodes, and the nodes with association relationships are connected by connecting lines. The association relationship between the first type nodes and the second type nodes indicates that the state corresponding to the first type nodes has the characteristics corresponding to the second type nodes, the association relationship between the first type nodes and the third type nodes indicates that the state corresponding to the first type nodes may have the attributes corresponding to the third type nodes, and the association relationship between the first type nodes and the fourth type nodes indicates that the state corresponding to the first type nodes may occur in the area corresponding to the fourth type nodes. The relationships between the second type nodes may include mutually exclusive relationships and coexistence relationships.
[0046] In a specific embodiment of the present invention, the knowledge graph may be a Traditional Chinese Medicine (TCM) knowledge graph. The first type of node may represent an abnormal bodily condition, such as a disease. The second type of node may represent symptoms. The third type of node may represent the nature of the disease. The fourth type of node may represent the location of the disease. In this embodiment of the present invention, the nature of the disease may include deficiency, excess, cold, heat, and normal state.
[0047] In an embodiment of the present invention, the TCM symptom knowledge graph can be constructed and updated based on the latest TCM research results and clinical data.
[0048] In an embodiment of the present invention, the edge weight between two nodes with a connection relationship can be initialized, and the bias value of the feature node can be initialized. The edge weight can be determined according to the degree of association between the corresponding two nodes. When the knowledge graph is a traditional Chinese medicine knowledge graph, the edge weight can be initialized based on clinical data. For example, the initial weight value of the edge weight between general symptoms and diseases can be set to 1. Some symptoms are more important in specific diseases, so their weight value can be set to 5. The edge weight between two feature nodes with a mutually exclusive relationship, such as the "dry mouth" and "not dry mouth" nodes, can be represented by -1, and the edge weight between two feature nodes with a coexistence relationship, such as the "irritability" and "impatient and irritable" nodes, can be represented by +1.
[0049] In an embodiment of the present invention, the bias value of a feature node can be determined based on the order in which the features appear in the dialogue scene. For example, in a TCM diagnosis scenario, the bias value of each symptom can be set according to the priority order of TCM consultation (such as the order in the TCM consultation song). The bias value corresponding to any feature node is bias = log 10(V), where V is the value corresponding to the feature node, and its value range is [1, 10]. Taking the logarithm of the value is to reduce the impact of the bias value and ensure the importance of other factors in the priority calculation.
[0050] In an embodiment of the present invention, the initial values of the priorities of all nodes in the knowledge graph are set to 0.
[0051] Furthermore, S400 may specifically include the following steps:
[0052] S401, obtaining the input information of the current input.
[0053] In an embodiment of the present invention, the input information includes a feature description or includes both a feature description and an attribute description, i.e., includes only the feature description or includes both the feature description and the attribute description. The attribute description includes the attribute selected by the user. For example, if the attribute description is "coldness," it indicates that the attribute selected by the user is "coldness."
[0054] The feature description is determined based on the current combined tag set. The feature description includes the first feature description or the first feature description and the second feature description, that is, the feature description may include only the first feature description or the first feature description and the second feature description at the same time, wherein the first feature description is the feature selected by the user and the second feature description is the feature not selected by the user. For example, if the input feature description is "headache, no panic", then the first feature description is "headache" and the second feature description is "panic".
[0055] In an embodiment of the present invention, when the dialogue scenario is a traditional Chinese medicine diagnosis scenario, the attribute description can be obtained based on the user's tongue image information, and the user's tongue image information can be obtained through a tongue image scanning device or through the user's known medical knowledge.
[0056] S402, based on the input information currently input, sets the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier, as the first feature node, sets the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier, as the second feature node, and sets the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier.
[0057] In the embodiment of the present invention, the first identifier and the second identifier may be different identifiers, and the specific identifiers may be limited based on actual needs, and the present invention does not make any special limitations.
[0058] S403: For any state node i in the current knowledge graph, based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node, obtain the priority PS corresponding to the state node i. i .
[0059] Furthermore, in an embodiment of the present invention, PS i The following conditions are met:
[0060] PS i =(∑ f1(i) j1=1 w ds ij1 -∑ f2(i) j2=1 w ds ij2 ) / ∑ h(i) j=1 w ds ij ×λ1+(∑ z(i) r=1 w dn ir ) / (∑ g(i) s=1 w dn is )
[0061] ×λ2.
[0062] Among them, the value of i ranges from 1 to m, m is the number of state nodes in the knowledge graph, and w ds ij1 is the edge weight between state node i and the j1th first feature node connected to state node i, j1 ranges from 1 to f1(i), f1(i) is the number of first feature nodes connected to state node i, w ds ij2 is the edge weight between state node i and the j2th second feature node connected to state node i, j2 ranges from 1 to f2(i), f2(i) is the number of second feature nodes connected to state node i, w ds ij is the edge weight between state node i and the jth feature node among the feature nodes connected to state node i, j ranges from 1 to h(i), h(i) is the number of feature nodes connected to state node i, w dn ir is the edge weight between state node i and the rth attribute node among the attribute nodes connected to state node i and identified as the first identifier, r ranges from 1 to z(i), z(i) is the number of attribute nodes connected to state node i and identified as the first identifier, w dn isis the edge weight between state node i and the sth attribute node among the attribute nodes connected to state node i, the value of s is 1 to g(i), g(i) is the number of attribute nodes connected to state node i, λ1 is the first preset coefficient, and λ2 is the second preset coefficient.
[0063] Those skilled in the art know that if the input information does not include the second feature description and the attribute description, the number of the second feature nodes is 0, and the number of the attribute nodes with the first identifier is 0.
[0064] Furthermore, w ds ij1 The following conditions are met: If 0≤w ds-init ij1 ≤1,w ds ij1 =1, if w ds-init ij1 >1,w ds ij1 =w ds-init ij1 ;w ds ij2 The following conditions are met: If 0≤w ds-init ij2 ≤1,w ds ij2 =0, if w ds-init ij2 >1,w ds ij2 =w ds-init ij2 .
[0065] Among them, w ds-init ij1 w ds ij1 The corresponding initial weight, w ds-init ij2 w ds ij2 Since the first user's description may be inaccurate, by increasing the weight of the first feature node with a lower initial weight and reducing the weight of the second feature node with a lower initial weight, a higher error tolerance rate can be achieved.
[0066] In the embodiment of the present invention, λ1>λ2, and λ1+λ2=1, which may be empirical values. In an exemplary embodiment, λ1=0.9, λ2=0.1.
[0067] In this embodiment of the present invention, the priority of each state node can be dynamically calculated based on the features selected and not selected by the user, thereby more accurately reflecting the actual state of the first user. In addition, since the attributes of the state are taken into account, the information obtained can be more comprehensive and accurate.
[0068] S404: For any third feature node u in the current knowledge graph, the priority PF corresponding to the third feature node u is obtained based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is the feature node in the knowledge graph except the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes.
[0069] Furthermore, PF u The following conditions are met:
[0070] PF u =∑ y1(u) q1=1 ((1-log 10 (path1+1)×w ds-init uq1 ×PS 3 uq1 )+∑ y2(u) q2=1 ((1-log 10 (path2+1)
[0071] ×w ss-init uq2 )+bias u ; path1 is the first preset path length, path2 is the second preset path length, w ds -init uq1 is the initial edge weight between the third feature node u and the q1th state node among the state nodes connected to it, the value of q1 ranges from 1 to y1(u), y1(u) is the number of state nodes connected to the third feature node u, PS uq1 is the priority corresponding to the q1th state node, w ss-init uq2 is the initial edge weight between the third feature node u and the q2th first feature node connected to it, q2 ranges from 1 to y2(u), y2(u) is the number of first feature nodes connected to the third feature node u, bias u is the bias value corresponding to the third feature node u.
[0072] In the embodiment of the present invention, the priority of a feature node takes into account the priority of the state node connected thereto, the weight of the first feature node connected thereto, and the bias value, so that the obtained priority can be more accurate.
[0073] In the embodiment of the present invention, path1 and path2 may be empirical values to ensure that the calculation result is as accurate as possible. In an exemplary embodiment, path1=2, path2=1.
[0074] S405, obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the current query label, and max() means taking the maximum value.
[0075] In this embodiment of the present invention, the current query tag is obtained based on a combined tag set formed from tags after multiple queries. This allows for dynamic adjustment of tag priorities, ensuring that each query is based on the latest correlation analysis results. For example, if the user inputs "headache," the calculations described above may increase the priority of the "abnormal blood pressure" tag in this round of calculations. This means that the highest-priority feature node, i.e., the symptom "abnormal blood pressure," may be obtained. In this case, "abnormal blood pressure" can be used as the current query tag, i.e., the question to be asked next.
[0076] S500: If the current query operation meets the preset termination condition, the corresponding query output information is output based on the current combination tag set; otherwise, the corresponding query question is generated based on the current query tag and the query question is output.
[0077] In an embodiment of the present invention, the preset termination condition may be any one of the following conditions:
[0078] Condition 1: Receive the query termination instruction input by the user.
[0079] Condition 2: The number of tags in the current combined tag set reaches the preset value, that is, the number of query rounds reaches the preset value.
[0080] In the embodiment of the present invention, the preset value can be set based on actual needs, for example, it can be set to 15-20.
[0081] Condition 3: The number of tags in the current combined tag set is less than a preset value, but corresponding interaction results can be obtained based on the tags in the current combined tag set.
[0082] In an embodiment of the present invention, being able to obtain corresponding interaction results based on the tags in the current combined tag set means that based on the tags in the current combined tag set, corresponding states can be obtained based on a preset knowledge graph. Specifically, in the preset knowledge graph, if the ratio of the number of tags in the current combined tag set to the number of feature nodes corresponding to the corresponding state nodes is greater than a preset ratio, the state corresponding to the first node is used as the corresponding interaction result. The state node corresponding to the current combined tag set is a state node that is connected to nodes corresponding to all tags in the current combined tag set, and the feature node corresponding to the state node corresponding to the current combined tag set is a feature node connected to the state node. In an illustrative embodiment, the interaction results that can be obtained based on the tags in the current combined tag set may be "liver yang headache" or the like.
[0083] In an embodiment of the present invention, the preset ratio may be set to 0.9.
[0084] In embodiments of the present invention, the query output information may be a detailed answer to the user's question, a suggested solution, or other forms of output. This is not particularly limited in the present invention and may be configured based on actual needs. For example, the query output information may be, "Based on your description and the results of multiple rounds of interaction, we recommend that you seek medical attention to check for liver yang headaches and consider relevant treatment."
[0085] In the embodiment of the present invention, the inquiry question is intended to guide the user to further provide specific information, thereby helping the system to better understand the user's needs or problems. The inquiry question can be output in text form or language form.
[0086] In an embodiment of the present invention, the query question includes at least two features for the user to select. Taking the query question "headache" as an example, the generated query question may be "Is your headache persistent or paroxysmal?", where the features may include persistent headache and paroxysmal headache.
[0087] In embodiments of the present invention, any method for generating a corresponding query question based on a current query tag falls within the scope of protection of the present invention. In one exemplary embodiment, the query question may be automatically generated based on a large language model. In another exemplary embodiment, the query question may be generated based on a preset generation rule. The preset generation rule may be set based on actual needs.
[0088] S600, obtain the answer information of the user to the query question. If the answer information includes the feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and execute S200. If the answer information indicates that the user has not selected any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S400.
[0089] In an embodiment of the present invention, the query question is "Is your headache persistent or paroxysmal?" If the user's answer is "My headache is persistent", this description is used as new input information, and paroxysmal headache is added to the current combined label set.
[0090] In an embodiment of the present invention, the user's answer information will further enrich the query system's understanding of the question and provide more information for subsequent analysis. For example, the user answers "I feel dizzy when I have a headache."
[0091] The human-computer interaction method provided by the embodiment of the present invention has at least the following advantages:
[0092] (1) By introducing a large language model, it is possible to quickly understand and process the user's natural language description. Compared with traditional manual inquiry methods, it can shorten the inquiry time and improve the inquiry efficiency.
[0093] (2) Combined with the knowledge graph, it can better match the features of user input, thereby providing more accurate interactive content.
[0094] Based on the same inventive concept, an embodiment of the present invention provides a human-computer interaction device, comprising: an operation interface and a processor, wherein the operation interface is used for a user to input query input information; and the processor is used to execute a computer program to implement the following steps:
[0095] S10: Obtain the initial inquiry content input by the user.
[0096] S20, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k≥1.
[0097] S30, using the large language model to map the currently received query input information and the corresponding k associated tags, obtain the mapping tag corresponding to the currently received query input information and add it to the current combined tag set; the initial value of the current combined tag set is a null value.
[0098] S40: Based on the current combined tag set and the preset knowledge graph, a tag associated with the current combined tag set is obtained as the current query tag.
[0099] S50, if the current query operation meets the preset termination condition, output the corresponding query output information based on the current combination tag set; otherwise, generate the corresponding query question based on the current query tag and output the query question; the query question includes at least two features for the user to select.
[0100] S60, obtain the answer information of the user to the query question. If the answer information includes the feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and use the received answer information as the currently received query input information, execute S20. If the answer information indicates that the user has not selected any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S40.
[0101] Furthermore, k related symptom terms are obtained through the following steps:
[0102] S21, obtaining the similarity S between the currently received query input information and the i-th feature term in the preset feature term knowledge base i , we get the similarity set S = {S1, S2, ..., S i ,……,S n}; the value of i ranges from 1 to n, where n is the number of feature terms in the preset feature term knowledge base.
[0103] S22, sort S in descending order to obtain a sorted similarity set SR.
[0104] S23, taking the feature terms corresponding to the first k similarities in the SR as the k associated feature terms.
[0105] The device can be used to perform Figure 1 Therefore, for the functions that can be realized by each functional module of the device, please refer to Figure 1 The description of the illustrated embodiment is omitted for brevity.
[0106] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0107] An embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.
[0108] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved. This is not limited herein.
[0109] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A human-computer interaction method, characterized in that: The method comprises the following steps: S100, obtaining the initial inquiry content input by the user; S200, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k ≥ 1; S300: Mapping the currently received query input information and the corresponding k associated tags using the large language model to obtain the mapping tag corresponding to the currently received query input information and adding it to the current combined tag set; the initial value of the current combined tag set is null; S400, based on the current combined tag set and the preset knowledge graph, obtaining a tag associated with the current combined tag set as the current query tag; S500: If the current query operation satisfies a preset termination condition, output corresponding query output information based on the current combined tag set; otherwise, generate a corresponding query question based on the current query tag and output the query question; the query question includes at least two features for the user to select; S600, obtain the answer information of the user to the query question. If the answer information includes the feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and use the received answer information as the currently received query input information, execute S200. If the answer information indicates that the user has not selected any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S400.
2. The method according to claim 1, characterized in that The k associated symptom terms are obtained through the following steps: S201, obtaining the similarity S between the currently received query input information and the i-th feature term in the preset feature term knowledge base i , we get the similarity set S = {S1, S2, ..., S i ,……,S n }; the value of i ranges from 1 to n, where n is the number of feature terms in the preset feature term knowledge base; S202, sort S in descending order to obtain a sorted similarity set SR; S203: Taking the feature terms corresponding to the first k similarities in the SR as the k associated feature terms.
3. The method according to claim 1, characterized in that The k associated feature terms are obtained through a retrieval enhanced generation model.
4. The method according to claim 1, wherein The preset termination condition is any one of the following conditions: Condition 1: Receive the query termination instruction input by the user; Condition 2: The number of tags in the current combined tag set reaches the preset value; Condition 3: The number of tags in the current combined tag set is less than a preset value, but corresponding interaction results can be obtained based on the tags in the current combined tag set.
5. The method according to claim 4, characterized in that The preset knowledge graph is composed of first to fourth type nodes, wherein the first type nodes are state nodes representing the state, the second type nodes are feature nodes representing the characteristics of the state, the third type nodes are attribute nodes representing the attributes of the state, and the fourth type nodes are region nodes representing the region to which the state belongs.
6. The method according to claim 1, wherein The inquiry question is output in text form or voice form.
7. A human-computer interaction device, characterized in that: The device includes: an operation interface and a processor, wherein the operation interface is used for a user to input query input information; and the processor is used to execute a computer program to implement the following steps: S10, obtaining the initial query content input by the user; S20, based on the currently received query input information, obtain k feature terms related to the currently received query input information from a preset feature term knowledge base as k associated tags corresponding to the currently received query input information; the initial value of the currently received query input information is the initial query content; k ≥ 1; S30, using the large language model to map the currently received query input information and the corresponding k associated tags, obtain the mapping tag corresponding to the currently received query input information and add it to the current combined tag set; the initial value of the current combined tag set is a null value; S40, based on the current combined tag set and the preset knowledge graph, obtaining a tag associated with the current combined tag set as the current query tag; S50, if the current query operation satisfies a preset termination condition, outputting corresponding query output information based on the current combined tag set; otherwise, generating a corresponding query question based on the current query tag and outputting the query question; the query question includes at least two features for the user to select; S60, obtain the answer information of the user to the query question. If the answer information includes the feature description selected by the user, use the feature description selected by the user as the currently received query input information, add the features not selected by the user in the query question to the current combination tag set, and use the received answer information as the currently received query input information, execute S20. If the answer information indicates that the user has not selected any feature in the query question, add the features corresponding to the query question to the current combination tag, and execute S40.
8. The device according to claim 7, characterized in that The k associated symptom terms are obtained through the following steps: S21, obtaining the similarity S between the currently received query input information and the i-th feature term in the preset feature term knowledge base i , we get the similarity set S = {S1, S2, ..., S i ,……,S n }; the value of i ranges from 1 to n, where n is the number of feature terms in the preset feature term knowledge base; S22, sort S in descending order to obtain the sorted similarity set SR; S23, taking the feature terms corresponding to the first k similarities in the SR as the k associated feature terms.
9. An electronic device, characterized in that: including processor and memory; The processor is configured to execute the steps of the method according to any one of claims 1 to 6 by calling the program or instructions stored in the memory.
10. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium is used to store a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Knowledge base sharing method and device, computer equipment and storage medium
CN113590840A
Online medical question and answer method
CN113764112A
Large language model intelligent inquiry dialogue method, system and device and medium
CN117093679A
Guided inquiry method and system based on large language model, electronic equipment and storage medium
CN119581065A
Knowledge understanding and answer generation method and device for language service
CN120087462A
