Enterprise question and answer method and system based on semantic comprehension and user characteristics
By introducing semantic understanding and user characteristics into the enterprise question and answer system, and using question vectors and user identity information to optimize the arrangement order of question and answer pairs, the problem that traditional systems cannot recognize user identity characteristics is solved, achieving higher retrieval accuracy and user experience.
Patent Information
- Application Number
- CN202510661518.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-08-15
AI Technical Summary
Traditional enterprise question and answer systems cannot effectively identify the correlation between user identity characteristics and business scenarios, resulting in the return results that do not meet user needs and are affected by the illusion of large language models. The fabrication of answers leads to the return results that are inconsistent with the actual content, reducing the user's acceptance.
By converting the question text entered by the user into a question vector, using the question and answer pairs stored in the first knowledge base, combining the user's identity information and the number of queries, the arrangement order of the question and answer pairs is generated, and the correlation between the obtained question and answer pair text and the user is optimized, and the retrieval accuracy is improved.
It improves the search efficiency and accuracy of the Q&A system, optimizes the user experience, and ensures that the returned content is more in line with the user's needs.
Smart Images

Figure CN120492591A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to an enterprise question-answering method and system based on semantic understanding and user characteristics. Background Art
[0002] A large amount of information is generated during the daily office work of an enterprise. With the continuous development of intelligence, this information can be stored in one or more online platforms for enterprise employees to obtain and query internal information.
[0003] Because enterprises generate a large amount of information and traditional query methods present a significant challenge, a growing number of companies are introducing question-answering systems to assist employees in accessing and retrieving internal information. Typical enterprise question-answering systems include generative question-answering systems based on large language models and retrieval-based question-answering systems based on content similarity matching. These systems generate answers to user questions using large language models or retrieve answers based on similarity between question content.
[0004] However, because different employees have varying needs and preferences for information content related to different business scenarios, traditional question-answering systems cannot effectively identify the correlation between user identity characteristics and business scenarios. This can lead to returned results that do not meet user needs. Alternatively, they can be affected by the hallucination phenomenon of large language models, which can fabricate answers and cause results that are inconsistent with the actual content. These factors prevent users from retrieving the content they need with high accuracy through question-answering systems, reducing their acceptance of these systems. Summary of the Invention
[0005] The embodiments of the present application provide an enterprise question-answering method and system based on semantic understanding and user characteristics, which can optimize the relevance between acquired content and users and improve the accuracy of retrieved content.
[0006] To achieve the above objectives, the present invention adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides an enterprise question-and-answer method based on semantic understanding and user characteristics, which is applied to an enterprise question-and-answer system based on semantic understanding and user characteristics. The method includes: in response to receiving a question text input by a user, converting the question text into a question vector; based on the question vector, determining multiple question-and-answer pairs to be selected in a first knowledge base, the first knowledge base is used to store question-and-answer pairs, and the question-and-answer pairs include question-and-answer pair texts; obtaining the user's first user identity information; based on the similarity between the first user identity information and each question-and-answer pair to be selected and the number of queries for each question-and-answer pair to be selected, generating a first arrangement order of multiple question-and-answer pairs to be selected; according to the first arrangement order, outputting the question-and-answer pair text corresponding to at least one of the multiple question-and-answer pairs to be selected.
[0008] Based on this solution, the order of the question-answer pairs to be selected can be determined based on the vector similarity between the text input by the user and the content in the knowledge base. Then, the final question-answer pair text can be determined based on the similarity between the user's identity information and the question-answer pairs to be selected, thereby optimizing the relevance of the obtained question-answer pair text to the user and improving the accuracy of the retrieved question-answer pair text.
[0009] In one possible implementation, the question-answer pair also includes a question-answer pair vector. Based on the question vector, multiple question-answer pairs to be selected are determined in the first knowledge base, including: obtaining the first vector similarity between the question vector and the question-answer pair vector; determining the second arrangement order of each question-answer pair according to the order of the first vector similarity from high to low; and determining the first N question-answer pairs in the second arrangement order as the question-answer pairs to be selected, where N is a positive integer greater than 1 and N is less than the number of question-answer pairs stored in the first knowledge base.
[0010] Based on this solution, vector similarity can be used to determine the order of similarity between the first knowledge base and the user input content, thereby obtaining a certain number of question-answer pairs to be selected and improving the accuracy of the retrieval content.
[0011] In another possible implementation, after determining the second arrangement order of each question-answer pair, the method further includes: obtaining an answer vector corresponding to the question-answer pair based on the question-answer pair vector; obtaining a second vector similarity, the second vector similarity including the similarity of the answer vectors between two different question-answer pairs; if the second vector similarity exceeds a preset threshold, deleting a question-answer pair with a lower first vector similarity in the second arrangement order.
[0012] Based on this solution, the parts of the question-answer pairs with the same answers can be screened to avoid the situation where there are multiple identical answer texts in the candidate question-answer pairs, thereby improving the diversity of the retrieval and avoiding the situation where the number of candidate question-answer pairs screened is insufficient.
[0013] In another possible implementation, based on the similarity between the first user identity information and each question-and-answer pair to be selected and the number of queries for each question-and-answer pair to be selected, a first arrangement order of multiple question-and-answer pairs to be selected is generated, including: converting the first user identity information into a first information vector; determining the third vector similarity between the first information vector and the question-and-answer pair vector of each question-and-answer pair to be selected; obtaining the number of queries and the number of evaluations corresponding to each question-and-answer pair to be selected, the number of evaluations including the number of likes and the number of dislikes; determining the quotient between the difference between the number of likes and the number of dislikes and the number of queries as the evaluation weight; determining the first arrangement order of multiple question-and-answer pairs to be selected according to the order of the sum of the first vector similarity, the third vector similarity and the evaluation weight of each question-and-answer pair to be selected from large to small.
[0014] Based on this solution, the question-answer pairs to be selected can be sorted by the vector similarity and evaluation weight between the vector corresponding to the first user identity information and the question-answer pair vector to determine the question-answer pair that better meets the user's needs and improve the user's experience of applying the question-answer method.
[0015] In another possible implementation, a first arrangement order of multiple question and answer pairs to be selected is generated based on the similarity between the first user identity information and each question and answer pair to be selected and the number of queries for each question and answer pair to be selected, and also includes: obtaining the second user identity information of the historical user who has queried the question and answer pair to be selected; determining the intersection and union between the first user identity information and the second user identity information corresponding to each historical user; determining the quotient of the sum of the quotient values of each intersection and each union and the sum of the number of queries and the first preset value as the business weight; determining the first arrangement order of multiple question and answer pairs to be selected according to the order of the sum of the first vector similarity, the third vector similarity, the business weight and the evaluation weight of each question and answer pair to be selected from large to small.
[0016] Based on this solution, the similarity between the identity information of the user and historical users can be introduced to sort the question-answer pairs, so that the final content is more consistent with the user's identity information, and the accuracy of answer retrieval based on the question text is improved.
[0017] In another possible implementation, before obtaining the user's first user identity information, the method also includes: if the user has not used the enterprise question and answer system, generating authentication prompt information, the authentication prompt information is used to prompt the user to bind identity information, the identity information includes the employee ID stored in the enterprise question and answer system and the employee identity corresponding to the employee ID; in response to receiving the employee ID input by the user, establishing a first mapping relationship between the user and the employee identity corresponding to the employee ID.
[0018] Based on this solution, the identity information of the user who uses this method for the first time to search can be bound, so that the candidate question-answer pairs retrieved can be sorted according to the user's identity information, thereby improving the efficiency of searching the first knowledge base.
[0019] In another possible implementation, obtaining the first user identity information of the user includes: obtaining identity information corresponding to the user based on the first mapping relationship; and determining the identity information as the first user identity information.
[0020] Based on this solution, the user's corresponding identity information can be obtained, and then the identity information can be used in subsequent steps to determine the similarity between the user and the candidate question-answer pair, thereby optimizing the user's experience in retrieving content.
[0021] In another possible implementation, in response to receiving a question text input by a user, before converting the question text into a question vector, the method also includes: in response to receiving an initialization instruction, obtaining a second knowledge base, the second knowledge base including knowledge information within the enterprise and / or knowledge information uploaded by the user; based on the semantics of at least one knowledge information in the second knowledge base, generating at least one question text corresponding to at least one knowledge information; based on the question text and the knowledge information corresponding to the question text, generating a question-answer pair text; converting the question-answer pair text into a question-answer pair vector; and storing the question-answer pair text and the question-answer pair vector in the first knowledge base.
[0022] Based on this solution, corresponding question texts can be generated for the obtained knowledge content, and corresponding question-answer pairs can be generated based on this, and a first knowledge base for retrieval can be constructed, so that users can use the first knowledge base that has generated the question text to determine question-answer pairs with a high degree of similarity to the question text, thereby improving retrieval efficiency and accuracy.
[0023] In another possible implementation, based on the semantics of at least one item of knowledge information in the second knowledge base, at least one question text corresponding to at least one item of knowledge information is generated, including: in response to receiving a prompt word text, obtaining the number of knowledge information to be selected and the text corresponding to the indication information to be selected, the prompt word text includes a list of knowledge information for generating question-answer pairs and the number of question texts corresponding to each item of knowledge information, and the knowledge information to be selected includes information located in the knowledge information list in the second knowledge base; obtaining the semantics of each item of knowledge information to be selected respectively; inferring the question method corresponding to the knowledge information to be selected based on the semantics of the knowledge information to be selected; and determining the inference result as the question text.
[0024] Based on this solution, multiple question texts corresponding to each piece of knowledge information can be generated based on the information in the prompt words, avoiding the low similarity between the question text and the question-answer pair due to the single question text, and the inability to match high-quality question-answer pairs, thereby improving the quality of the final output question-answer pair text and optimizing the user's questioning experience.
[0025] In another possible implementation, according to the first arrangement order, the question-answer pair text corresponding to at least one of the multiple question-answer pairs to be selected is output, including: outputting the question-answer pair text corresponding to the first question-answer pair to be selected in the first arrangement order.
[0026] Based on this solution, the question-answer pairs with the highest similarity to the question text entered by the user and the user's own identity information can be screened out, thereby improving the accuracy of the output question-answer pairs and optimizing the user experience.
[0027] In a second aspect, an embodiment of the present application further provides an enterprise question-answering system based on semantic understanding and user characteristics, including:
[0028] A receiving module is configured to receive a question text input by a user; a text conversion module is configured to convert the question text into a question vector in response to receiving the question text input by the user; a text matching module is configured to determine a plurality of question-answer pairs to be selected in a first knowledge base based on the question vector, the first knowledge base being used to store question-answer pairs, and the question-answer pairs including question-answer pair texts; an information calling module is configured to obtain the first user identity information of the user; the text matching module is further configured to generate a first arrangement order of a plurality of question-answer pairs to be selected based on the similarity between the first user identity information and each question-answer pair to be selected and the number of queries for each question-answer pair to be selected; an output module is configured to output the question-answer pair text corresponding to at least one question-answer pair to be selected from the plurality of question-answer pairs to be selected according to the first arrangement order.
[0029] In a third aspect, an embodiment of the present application further provides an electronic device comprising a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, the computer program code comprises computer instructions, and when the processor is used to execute the computer instructions, the electronic device executes a method as described in any one of the first aspects above.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a computer, the method of any one of the first aspects is implemented.
[0031] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A flowchart of an enterprise question-answering method based on semantic understanding and user characteristics provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a process for constructing a first knowledge base provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a process for searching a first knowledge base provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a process for obtaining identity information of a first user provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of a process for determining a first arrangement order of question-answer pairs to be selected provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of determining the union and intersection of user identity information provided in an embodiment of the present application;
[0038] Figure 7 A flowchart of a question-answering system outputting question-answer texts provided in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of an enterprise question-answering system based on semantic understanding and user characteristics provided for the implementation of this application;
[0040] Figure 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. To facilitate the clear description of the technical solutions in the embodiments of the present application, the first, second, etc. descriptions in the embodiments of the present application are only used for illustration and to distinguish the described objects. There is no order, nor does it represent a special limitation on the number of devices in the embodiments of the present application, and it does not constitute any limitation on the embodiments of the present application.
[0042] The embodiments of the present application provide an enterprise question-and-answer method and system based on semantic understanding and user features. By introducing semantic understanding functions and user feature similarity into the question-and-answer system, the question-and-answer system can determine the feature correlation between the obtained answers and the user's identity information, and thereby obtain answers that are highly relevant to the user, thereby improving the retrieval efficiency and retrieval accuracy of the question-and-answer system and optimizing the user experience of using the question-and-answer system.
[0043] Figure 1 A flowchart of an enterprise question-answering method based on semantic understanding and user characteristics provided in an embodiment of the present application.
[0044] The execution subject of each step in the enterprise question-and-answer method based on semantic understanding and user characteristics provided in the embodiment of the present application can be the enterprise question-and-answer system based on semantic understanding and user characteristics provided in the embodiment of the present application. Specifically, the enterprise question-and-answer system based on semantic understanding and user characteristics can be implemented through software and / or hardware and integrated into an electronic device, which can be a terminal device (such as a smart phone, a personal computer, etc.), or a server (such as a local server or a cloud server, or a server cluster, etc.), or a processor, chip, etc. The embodiment of the present application does not limit the type of electronic device integrated with the enterprise question-and-answer system based on semantic understanding and user characteristics. Figure 1 As shown, the enterprise question-answering method based on semantic understanding and user characteristics provided in the embodiment of the present application may include the following steps S100 to S500.
[0045] S100: In response to receiving a question text input by a user, convert the question text into a question vector.
[0046] When a user applies the question-and-answer method and system provided in the embodiments of the present application, they can use a portable terminal device, such as a smartphone, to communicate with the electronic device hosting the question-and-answer system and, based on the communication connection, send a question text to the question-and-answer system so that the question-and-answer system can receive the question text sent by the user. In some embodiments, the user can also directly control the electronic device hosting the question-and-answer system to directly input the question text into the question-and-answer system using the electronic device. The embodiments of the present application do not limit the method for inputting the question text into the question-and-answer system.
[0047] After obtaining the question text, the question-answering system can convert the question text into a question vector, so that the system can perform subsequent content matching processes based on the question vector. In an embodiment of the present application, the question-answering system can realize the process of converting the question text into a question vector based on the built-in vectorization tool. Exemplarily, the model built into the question-answering system can be a static word vector model (word embeddings, Word2Vec) or a dynamic context-aware model (bidirectional encoder representations from transformers, BERT), wherein the static word vector model can convert words into vectors of fixed length, and the dynamic context-aware model can obtain the vector representation of each sentence of the input.
[0048] In the embodiment of this application, when using the model to convert text into vectors, the static word vector model maps each word into a dense vector of fixed dimension, making semantically similar words closer in the vector space. The dynamic context-aware model, on the other hand, generates context-dependent word vectors, where the same word has different vectors in different sentences.
[0049] It should be understood that before the system applies the model to perform text vector conversion, the model needs to be constructed and trained to improve the model's response speed and accuracy to user input text and improve the efficiency of vector conversion.
[0050] The static word vector model can be trained by inputting internal corporate data, such as guidelines and forums. By using internal corporate data to predict context words by inputting central words, or vice versa, an index is established to identify word content and generate word vectors that match the context. When vectorizing question text, the question vector can be determined based on the word vectors corresponding to the words in the question text.
[0051] Dynamic context-aware models can employ an encoding and decoding mechanism. Initially, they are trained using large-scale general-purpose corpora, such as large-scale language data obtained from the internet, by masking portions of the content and allowing the model to make predictions. After training with the general-purpose corpus, internal enterprise data can be used to fine-tune the model's output and adjust its accuracy when converting question text.
[0052] It should be understood that the model used in the above-mentioned question-answering system and the model training process are only one feasible implementation method in the embodiment of this application. The embodiment of this application does not limit the model for realizing the conversion between text and vector in the question-answering system.
[0053] S200: Based on the question vector, determine a plurality of question-answer pairs to be selected in the first knowledge base.
[0054] The first knowledge base is used to store question-answer pairs, which may include question-answer pair text. A question-answer pair refers to a question-answer pair. For example, the question-answer pair text in the first knowledge base may be stored in the first knowledge base as a combination of question content and answer content. Each question content in the first knowledge base has a corresponding answer content. The first knowledge base may combine the question content and the answer content based on the corresponding relationship between the two and store them.
[0055] In some embodiments, because the same answer can correspond to different questioning methods, the same answer content can correspond to multiple question contents. If the first knowledge base uses a method of storing question and answer pairs by combining question content and answer content, multiple duplicate answer contents will be stored in the first knowledge base, increasing the storage medium burden of the first knowledge base. Therefore, in scenarios where the same answer corresponds to multiple questions and the first knowledge base stores a large amount of data, the first knowledge base can also store the question and answer text by separately storing the question content and answer content and adding a mapping relationship between the question and the answer to the question content. Therefore, when the question content is called, the question and answer text can be determined based on the mapping relationship between the question and the answer.
[0056] In an embodiment of the present application, the question-answer pairs stored in the first knowledge base may also include question-answer pair vectors. The storage method of the question-answer pair vectors is similar to the storage method of the question-answer pair texts. The vector corresponding to the question in the question-answer pair vectors can be stored together with the text corresponding to the question, and the vector corresponding to the answer can be stored together with the text corresponding to the answer. This application will not go into details here.
[0057] It's important to note that the vectorization tool used to convert question-answer text into question-answer pair vectors is the same as the one used to convert question text into question vectors. This ensures that when the question-answering system calculates vector similarity, the vectorized content is in the same dimension, avoiding the problem of low similarity between vectors corresponding to similar content caused by different vectorization tools converting the content separately.
[0058] After obtaining the question vector corresponding to the question text input by the user, the question-answering system can query the corresponding question-answer pair vector in the first knowledge base based on the question vector, so as to select question-answer pair texts with higher similarity in the first knowledge base, and answer the question text provided by the user based on the selected question-answer pair texts.
[0059] It should be understood that when the question-answering system selects a question-answer pair text, it determines the similarity between the question vector and the question-answer pair vector based on the vector cosine similarity between the question vector and the question-answer pair vector in the first knowledge base. In an embodiment of the present application, the similarity between the question vector and the question-answer pair vector can be determined based on the quotient between the product between the vectors and the product of the vector moduli. For example, the similarity between the question vector and the question-answer pair vector can be expressed as the following formula (1).
[0060]
[0061] Among them, Sim k [i] refers to the similarity between the question vector and the question-answer pair vector, V qus Refers to the problem vector, V k [i] refers to the question-answer pair vector.
[0062] Figure 2 A schematic diagram of a process for constructing a first knowledge base provided in an embodiment of the present application.
[0063] It should be understood that because the conventional knowledge base within an enterprise only includes the knowledge information within the enterprise and / or the knowledge information uploaded by users, the question-answering system cannot determine the question-answer pair corresponding to the question text input by the user based on the content in the knowledge base. Therefore, in the embodiment of the present application, the question-answering system can construct a first knowledge base before receiving the question text input by the user to provide a basis for the user to retrieve content through the question-answering system. Figure 2 As shown, the process of the question-answering system constructing the first knowledge base may include the following steps S101 to S105.
[0064] S101: In response to receiving an initialization instruction, obtaining a second knowledge base.
[0065] The second knowledge base includes internal enterprise knowledge information and / or user-uploaded knowledge information. The question-answering system can obtain the knowledge information in the second knowledge base that can be used to generate question-answer pairs by accessing the knowledge content in the second knowledge base. For example, the knowledge information stored in the second knowledge base can be the internal enterprise data used to train the vectorization tool in the aforementioned embodiment.
[0066] In an embodiment of the present application, after the question-answering system receives the initialization instruction input by the user, the question-answering system can obtain the corresponding content by reading the content in the second knowledge base, and then the system can generate the corresponding question text by understanding the content.
[0067] S102: Based on the semantics of at least one item of knowledge information in the second knowledge base, generate at least one question text corresponding to the at least one item of knowledge information.
[0068] When generating question text, the question-answering system can utilize a large language model to infer the content of knowledge information in the second knowledge base. Before inference, the system can receive prompt text to define the language model's inference task, input content, and output content. Specifically, the prompt text includes a list of knowledge information used to generate question-answer pairs and the number of question texts corresponding to each piece of knowledge information. The selected knowledge information includes information in the second knowledge base that is included in the knowledge information list. The list of knowledge information used to generate question-answer pairs constitutes the input content constraint, and the number of question texts corresponding to each piece of knowledge information constitutes the output content constraint.
[0069] For example, the prompt text may be "You are a question-answering system. I will provide you with the knowledge content of the original knowledge base, and you need to generate corresponding questions based on this knowledge content. The same knowledge point can be asked in different ways, and you can output the results of multiple question-answer pairs. The same answer can be output in at least k different ways of asking. The knowledge content of the original knowledge base is as follows: "XXX". Please output the results of the question-answer pair as required."
[0070] Among them, the "original knowledge base" is a list of knowledge information used to limit the input content of the model. In some embodiments, the knowledge information list may include all knowledge information in the second knowledge base; "output at least k different questioning methods for the same answer" and "please output the results of the question and answer pairs as required" are prompt words for limiting the output content of the model, which can be used to limit the number of question and answer pairs corresponding to each knowledge information generated by the model. k is a positive integer. For example, the specific value of k can be 3, 4, etc. The embodiment of this application does not impose any other restrictions on the value of k.
[0071] In some embodiments of the present application, the initialization instruction received by the system may be a prompt text. After receiving the prompt text, the question-answering system obtains the semantics of each item of candidate knowledge information and then, based on the semantics of the candidate knowledge information, infers and determines the question format corresponding to the candidate knowledge information. The number of question formats corresponding to each item of candidate knowledge information is greater than or equal to the number indicated in the prompt text.
[0072] After obtaining the inference results of the language model, the question-answering system can determine the inference results as the question text.
[0073] S103: Generate a question-answer pair text based on the question text and the knowledge information corresponding to the question text.
[0074] After obtaining the question text, the question-answering system can determine the question-answer pair text corresponding to each question-answer pair by establishing a mapping relationship between the question text and the knowledge information. It should be understood that the question-answering system can perform step S102 and this step simultaneously. The question-answering system can establish a mapping relationship between each question text and the knowledge information during the process of generating the question text using the language model. This allows the question-answer pair text to be generated in real time during the question text generation process, thereby improving the initialization efficiency of the question-answering system.
[0075] S104: Convert the question-answer pair text into a question-answer pair vector.
[0076] After obtaining the question-answer pair text, the question-answer system can use a vectorization tool that converts the question text into a question vector to convert the question-answer pair text into a question-answer pair vector. The embodiment of this application will not be described in detail here.
[0077] S105: Storing the question-answer pair text and the question-answer pair vector in the first knowledge base.
[0078] After obtaining the question-answer pair text and question-answer pair vector, the question-answer system can store the question-answer pair text and question-answer pair vector in the first knowledge base based on the storage method of the text and vector in the first knowledge base given in the aforementioned embodiment. The embodiments of this application will not be described here.
[0079] Figure 3 A schematic diagram of a process for searching a first knowledge base provided in an embodiment of the present application.
[0080] See also Figure 3 The question-answering system can obtain the cosine vector similarity based on formula (1) and the following steps S210 to S230, and use this to select multiple question-answer pair vectors with higher similarity to perform the subsequent answer screening process.
[0081] S210: Obtain the first vector similarity between the question vector and the question-answer pair vector.
[0082] After obtaining the question vector, the question-answering system can traverse the question-answer pair vectors in the first knowledge base, and perform operations on the traversed question-answer pair vectors and the question vector to obtain the first vector similarity.
[0083] In the embodiment of the present application, the first vector similarity refers to the cosine similarity between the question vector and any question-answer pair vector in the first knowledge base. The specific calculation method can be the above formula (1), so the first vector similarity can also be calculated using the Sim in formula (1). k [i] indicates.
[0084] In some embodiments, due to the limited amount of data in the first knowledge base, the process of calculating the first vector similarity of each question-answer pair vector through calculation may take a long time and require a large number of calls. Therefore, in embodiments of the present application, a sharded parallel approach can be adopted to shard the question-answer pairs in the first knowledge base, and then perform multi-threaded calculations to obtain the first vector similarity corresponding to each question-answer pair vector.
[0085] In another embodiment, during the process of storing question-answer pairs in the first knowledge base, the question-answering system may generate a corresponding mapping function based on the similarity between question-answer pair vectors, thereby grouping question-answer pairs with higher similarity. During the process of determining the first vector similarity, when the first vector similarity corresponding to a question-answer pair vector is obtained and exceeds a threshold, the question-answer pair vector with higher vector similarity to the question-answer vector is preferentially compared with the question vector, thereby obtaining a question-answer pair vector with higher similarity to the question vector.
[0086] In another embodiment, the question-answering system can also construct an index tree by recursively dividing the vector space of question-answer pair vectors in the first knowledge base, so that after obtaining the question vector, the question-answering system can retrieve question-answer pair vectors with a high similarity to the question vector through the index tree, and obtain their corresponding first vector similarities in turn.
[0087] It should be noted that the above-mentioned method of obtaining the first vector similarity is only a feasible implementation method in the embodiment of the present application. The embodiment of the present application does not limit the process of the question-answering system retrieving the first vector similarity in the first knowledge base.
[0088] S220: Determine a second arrangement order for each question-answer pair according to the order of the first vector similarities from high to low.
[0089] After obtaining the first vector similarity between the question-answer pair vector and the question vector, the question-answering system can sort each question-answer pair in descending order according to the first vector similarity, so that the system can subsequently determine multiple candidate question-answer pairs by arrangement order.
[0090] It should be noted that based on the above-mentioned method for obtaining first vector similarity, in some embodiments, the question-answering system does not obtain the first vector similarity corresponding to each question-answer pair vector in the first knowledge base. Furthermore, the second ranking order is merely a virtual ranking performed by the question-answering system on each question-answer pair based on the first vector similarity. When determining the second ranking order, the question-answering system may sort the question-answer pairs for which first vector similarity has been obtained. Therefore, the number of question-answer pairs in the second ranking order is less than or equal to the number of question-answer pairs in the first knowledge base.
[0091] Exemplarily, the question-answering system can determine the index of each question-answer pair having the first vector similarity by generating a corresponding list, so that when the question-answer pair is subsequently determined, the corresponding question-answer pair can be called in the first knowledge base through the index in the list.
[0092] Furthermore, because in some embodiments of the present application, there is a scenario where one answer content corresponds to multiple question contents, and in the process of obtaining the first vector similarity, the values of the first vector similarities of multiple question-answer pairs with the same answer content may be similar, and their sequences in the second arrangement order may also be similar, affecting the number of candidate question-answer pairs obtained by the question-answering system. For example, there is one answer content corresponding to three question contents, and the first vector similarities corresponding to these three question-answer pairs are respectively in the third, fifth, and sixth place in the second arrangement order. At this time, the answer content between at least two of the first five question-answer pairs in the second arrangement order is the same. Based on the answer content, the content between these two question-answer pairs is essentially the same, affecting the number of candidate question-answer pairs obtained by the question-answering system.
[0093] Therefore, after obtaining the second ranking, the question-answering system can remove duplicate content from similar content in the second ranking to improve the quality of the candidate question-answer pairs obtained by the question-answering system. Specifically, the question-answering system can remove duplicate content from the second ranking based on the similarity relationship between the corresponding answer vectors of the question-answer pairs in the second ranking.
[0094] First, the question-answering system can determine the answer vectors corresponding to the question-answer pairs in the second ranking order based on the question-answer pair vectors. It should be understood that because the question-answering system selects question-answer pairs with higher first vector similarity as candidate question-answer pairs, the system can determine the answer vectors only for question-answer pairs ranked higher in the second ranking order, thereby reducing the computational effort in subsequent operations and improving the speed of the screening process.
[0095] After obtaining the answer vector, the system can obtain the second vector similarity corresponding to each answer vector. In the embodiment of the present application, the second vector similarity includes the vector similarity of the answer vectors between two different question-answer pairs. The calculation process of the similarity between the answer vectors is similar to the calculation method in the above formula (1), that is, the second vector similarity is determined by the quotient of the product between the two answer vectors and the product of the modulo values of the two answer vectors. When the second vector similarity exceeds a preset threshold, a question-answer pair with a lower first vector similarity is deleted from the second sorting order.
[0096] Among them, because the purpose of calculating the similarity of the second vector is to delete the repeated question and answer pairs in the second arrangement order, the preset threshold can be set larger. For example, taking the two vectors being identical when the similarity is 1 as the benchmark, the preset threshold can be 0.95, 0.98, etc., to avoid the question and answer system from mistakenly deleting question and answer pairs.
[0097] In some embodiments, after the question-answering system deletes duplicate question-answer pairs, the number of checked question-answer pairs is less than the number of question-answer pairs to be selected. In this case, if the number of question-answer pairs to be selected is directly selected through the second sorting order after screening, duplicate answers may still be selected. Therefore, if the question-answering system screens out duplicate question-answer pairs and the number of screened question-answer pairs is less than the number of question-answer pairs to be selected, the system can select multiple vector pairs with higher first vector similarity in the second sorting order based on the number of question-answer pairs to be selected, compare them with the question-answer pairs that have been screened, obtain the second vector similarity and determine the question-answer pairs that need to be retained, until the number of screened question-answer pairs is greater than or equal to the number of question-answer pairs to be selected that the question-answering system needs to determine.
[0098] S230: Determine the first N question-answer pairs in the second ranking order as the question-answer pairs to be selected.
[0099] After obtaining the second ranking order, the question-answering system can determine a corresponding number of candidate question-answer pairs based on the ranking order of the question-answer pairs in the second ranking order. Where N is a positive integer greater than 1, and N is less than the number of question-answer pairs stored in the first knowledge base. For example, N can be a value such as 10 or 20 to ensure a high degree of vector similarity while maintaining a certain search breadth, avoiding the possibility of not detecting or retaining relevant content due to insufficient retrieval, thereby improving the accuracy of retrieval by the question-answering system.
[0100] Taking the question-and-answer system as an example, where ten candidate question-and-answer pairs are selected, the question-and-answer system can obtain the answer vectors of the first twenty question-and-answer pairs in the second ranking order, and sequentially calculate the second vector similarity between each answer vector and the other nineteen answer vectors, thereby obtaining the similarity between each answer vector and the other answer vectors. Based on the relationship between each second vector similarity and a preset threshold, the system can, when the second vector similarity is greater than the preset threshold, remove from the second ranking order the question-and-answer pair with the lower first vector similarity between the two answer vectors corresponding to the second vector similarity; and when the second vector similarity is less than the preset threshold, retain the two question-and-answer pairs in the second ranking order until the second vector similarity calculation is completed.
[0101] If after screening, the question-answering system deletes more than ten question-answer pairs, that is, the number of retained question-answer pairs is less than ten, the system can continue to select twenty question-answer pairs in the second arrangement order, and perform the second vector similarity determination process with the retained question-answer pairs, so that the number of question-answer pairs obtained by screening is greater than the number of question-answer pairs to be selected that the question-answering system needs to determine.
[0102] In some embodiments of the present application, the question-answering system may also avoid a situation where the number of question-answer pairs obtained after deduplication is less than the number of candidate question-answer pairs that need to be determined by increasing the number of answer vectors for question-answer pairs obtained for the first time in the second ranking order. Exemplarily, the number of question-answer pairs selected by the question-answering system for deduplication in the second ranking order may be greater than or equal to the product of the number of question texts generated by the question-answering system and the number of candidate question-answer pairs, to avoid a situation where the number of question-answer pairs after deduplication is less than the number of candidate question-answer pairs.
[0103] It should be understood that the above-mentioned deduplication method is only a feasible implementation method in the embodiment of the present application. In the embodiment of the present application, it is also possible to determine whether the answer contents corresponding to different question and answer pairs are the same based on the mapping relationship between the question content and the answer content in the retrieved question and answer pairs. The embodiment of the present application does not limit the deduplication method of the question and answer pairs in the second arrangement order.
[0104] S300: Obtain the first user identity information of the user.
[0105] In this embodiment of the present application, after determining candidate question-answer pairs, the question-answering system can use the first user identity information of the user who sent the question text to determine the similarity between the user and each candidate question-answer pair. The first user identity information of the user can be the user's employee identity, such as the user's department, business line, job function, and position title. This embodiment of the present application does not limit the content of the first user identity information.
[0106] When the question-answering system receives a question text sent by a user, it can determine the first user identity information corresponding to the user based on the method by which the user sent the question text to the system. Specifically, when the user sends the question text to the question-answering system using a portable electronic device, the system can send identity verification information to the portable electronic device to obtain the user's corresponding identifier, so that the system can query the database for the user's first user identity information based on the identifier; when the user directly inputs the question text into the system using the electronic device that hosts the question-answering system, the question-answering system can prompt the user to log in to the corresponding operating account before entering the question text to operate the question-answering system. The question-answering system can determine the user's first user identity information based on the identity information corresponding to the login account during the login process.
[0107] It should be noted that the first user identity information in the embodiments of the present application is stored in the Q&A system's database and is used to identify employees within the enterprise. The database used by the Q&A system to store the first user identity information can be managed by members within the enterprise and updated based on personnel changes within the enterprise. Accordingly, during the use of the Q&A system, the system can determine the first user identity information corresponding to the user currently using the system based on verification information sent when the user logs in or invokes the Q&A system.
[0108] The execution order of step S300 in the embodiment of the present application is merely an example, used to illustrate an execution process of the question-answering method in the embodiment of the present application. In actual execution, after receiving the user's question text, the question-answering system can obtain the user's identity information based on the internal database to obtain the corresponding first user identity information.
[0109] Figure 4 A schematic diagram of a process for obtaining the identity information of a first user provided in an embodiment of the present application.
[0110] In the embodiment of the present application, because the first user identity information corresponding to different users is different, and each user has a scenario where they use the question-answering system for the first time, the question-answering system needs to determine the number of times each user has used the system, and determine the way the question-answering system obtains identity information based on the number of times the system has been used. Figure 4 As shown, the method for the question-answering system to determine the first user identity information corresponding to the user includes the following steps S310 to S340.
[0111] S310: If the user has never used the enterprise question-and-answer system, an authentication prompt message is generated.
[0112] When a user uses a question-and-answer system, there may be a scenario where they are using the system for the first time. In this case, because the system has not yet established a relationship between the user and the first user's identity information, the system cannot synchronously determine the user's identity information during the process of receiving the question text. Therefore, in an embodiment of the present application, before obtaining the user's identity information, the system can determine whether the user has used the enterprise question-and-answer system before determining whether the system can directly obtain the corresponding user information based on the user.
[0113] In some embodiments, if the user has never used the enterprise Q&A system, the system may generate corresponding authentication prompt information after receiving the question text sent by the user. The authentication prompt information is used to prompt the user to bind identity information, which includes the employee ID stored in the enterprise Q&A system and the employee identity corresponding to the employee ID.
[0114] In embodiments of the present application, the Q&A system can determine whether a user has used the system in various ways. For example, the Q&A system can determine the number of times a target user has used the Q&A system based on the number of times the target user has sent question texts to the system, thereby determining whether the user has used the Q&A system. The target user refers to a user who is currently using the enterprise Q&A system.
[0115] Specifically, the system can establish a corresponding storage space for each user to record the number of question texts sent to the system. After the question-and-answer system receives the question text sent by the target user, the system can query the target user's storage space in the storage space corresponding to each user based on the target user, and add one to the number of question texts sent to the system in the storage space to record the number of times the user uses the question-and-answer system.
[0116] When the question-and-answer system detects that the storage space corresponding to the target user has not been established or the number of times the question text has been sent to the system is less than or equal to 1, the system can determine that the target user has not used the question-and-answer system to ask questions before, and the system can generate an authentication prompt message and send it to the customer.
[0117] When the question-answering system detects that the target user has sent question texts to the system more than once, the system can determine that the target user has used the question-answering system before entering the question text this time. The system can then execute step S340 to obtain the target user's identity information.
[0118] In some embodiments of the present application, when using an enterprise Q&A system, a target user may log in to the Q&A system using an account and password. For example, taking the example of a target user using a portable electronic device, the Q&A system may provide a login interface for the target user. The target user may enter their account and password to log in to the Q&A system and enter a question. The Q&A system may then bind the target user's identity information to the account and determine whether the target user has used the Q&A system before by recording the number of logins to the account.
[0119] The identity information corresponding to the target user's account and password. During the target user's account registration process, the question and answer system can compare and match the information in its own database by transmitting the employee ID and identity information such as the user's department, business line, job function and position title. When the matching content is the same, the corresponding employee ID and identity information will be bound to the account, so that when the target user logs in to the question and answer system using the account and password, the question and answer system can determine the corresponding identity information of the target user through the account binding relationship.
[0120] Furthermore, the question-and-answer system may also send an authentication prompt message to the target user when the target user logs into the system for the first time using an account and password, to prompt the user to bind the identity information.
[0121] In another embodiment of the present application, the question-and-answer system may also search the database for identity information that has been bound to the target user after receiving the question text input by the target user. If the target user does not have any bound identity information, the question-and-answer system may perform any of the above operations for binding the target user's identity information. If the target user has bound identity information, the question-and-answer system may directly perform the subsequent step S340 to obtain the identity information. In this way, it is possible to avoid the scenario where the target user has bound identity information but has not input a question text into the question-and-answer system, and the question-and-answer system may prompt the target user to bind the information again, thereby avoiding the situation where multiple binding verifications reduce the target user's user experience.
[0122] It should be noted that the above-mentioned question-and-answer system's verification and detection methods for whether the target user has used the system are several feasible implementation methods in this application. The embodiments of this application may also use other methods for the question-and-answer system to detect the target user, and this application does not impose any restrictions here.
[0123] S320: In response to receiving the employee identification input by the user, establishing a first mapping relationship between the user and the employee identity corresponding to the employee identification.
[0124] After receiving the authentication prompt information sent by the question-and-answer system, the target user can enter the corresponding content based on the content required by the authentication prompt information and send it to the question-and-answer system to establish a mapping relationship between the target user and the employee identity.
[0125] For example, the authentication prompt message may be "Please enter your employee ID for identity binding" to prompt the target user to enter the employee ID. After receiving the employee ID entered by the target user, the question-and-answer system can bind the employee identity corresponding to the employee ID through the employee ID, and then determine the target user's identity information such as the user department, business line, job function and position title from the employee identity.
[0126] In some embodiments of the present application, to prevent the target user from incorrectly binding their identity information, the Q&A system may prompt the target user to enter their employee ID and one or more of the employee identities corresponding to the employee ID to bind the target user's identity information. In this case, the authentication prompt may also read, "Please enter your employee ID and at least one of the corresponding department, business line, job function, and position title."
[0127] After receiving one or more of the employee ID and employee identity information entered by the target user, the system can read the information to determine whether the employee ID has been bound, or whether the identity information corresponding to the employee ID stored in the system database is the same as the information entered by the target user. If the employee ID is not bound and is the same as the information entered by the target user, the system can bind the target user to the identity information corresponding to the employee ID. When the target user transmits a question text to the system again, the system can determine the target user's identity information based on the bound information.
[0128] If the Q&A system detects that the target user's input has already been bound, it can generate a prompt to inform the target user that their employee ID and identity have already been bound. This prevents multiple target users from repeatedly binding the same employee ID and identity, ensuring that the identity information obtained by the Q&A system is accurate and that the final answer is more relevant to the target user.
[0129] S330: Based on the first mapping relationship, obtain the identity information corresponding to the user.
[0130] After determining or obtaining the first mapping relationship through the target user, the question-answering system can use the mapping relationship between employee identification and employee identity to determine the employee identity corresponding to the target user and the identity information contained therein, so that the question-answering system obtains the identity information corresponding to the target user.
[0131] In this embodiment of the present application, the target user's identity information may include at least one of the user's department, business line, job function, and job title. The user's department refers to the user's department within the enterprise, such as R&D, Sales, or Human Resources. The business line may refer to the business content involved with the target user, and the specific content of the business line may be related to the user's department. The job function may be the target user's specific job content. The job title is the title of the position assigned to the user by the enterprise.
[0132] It should be understood that the content included in the identity information in the above embodiment is only a feasible implementation method in the embodiment of this application. The identity information may also include more or less information, such as the project group to which the user belongs, the work location, etc. The embodiment of this application does not limit the specific content included in the identity information.
[0133] S340: Determine the identity information as the first user identity information.
[0134] After the question-and-answer system obtains the target user's identity information based on the first mapping relationship, it can determine the identity information as the first user's identity information. Similar to the identity information, the first user's identity information can include at least one of the target user's department, business line, job function, and position title. After determining the first user's identity information, the question-and-answer system can match candidate question-and-answer pairs selected by the question-and-answer system based on the first user's identity information. Using the first user's identity information, the system can determine the target user's information-seeking propensity, thereby improving the accuracy of answer acquisition.
[0135] S400: Generate a first ranking order of multiple candidate question-answer pairs based on the similarity between the first user identity information and each candidate question-answer pair and the number of queries for each candidate question-answer pair.
[0136] After obtaining the first user identity information of the target user, the question-and-answer system can determine the first arrangement order of the candidate question-and-answer pairs based on the similarity between the first user identity information and each candidate question-and-answer pair and the number of queries for each candidate question-and-answer pair, so as to select the question-and-answer pair that is closer to the needs of the target user from the candidate question-and-answer pairs as the output content.
[0137] In this embodiment of the present application, the similarity between the first user identity information and the candidate question-answer pair refers to the cosine similarity between the vector corresponding to the first user identity information and the question-answer pair vector corresponding to the candidate question-answer pair. For example, the similarity between the first user identity information and the candidate question-answer pair can be expressed as the following formula (2).
[0138]
[0139] Among them, Sim b1 [i] refers to the similarity between the vector corresponding to the first user identity information and the question-answer pair vector corresponding to the question-answer pair to be selected, V b1 Refers to the vector corresponding to the first user identity information, V k [i] refers to the question-answer pair vector corresponding to the candidate question-answer pair. It should be understood that the candidate question-answer pairs involved in formula (2) are obtained by the question-answer system from the question-answer pairs in the first knowledge base. Each candidate question-answer pair is similar to the content contained in the previous question-answer pair, so V is used in formula (2). k [i] refers to the question-answer pair vector corresponding to the question-answer pair to be selected.
[0140] Sim b1 The specific value of [i] is related to the relevance between the knowledge and content involved in the candidate question and answer pair and the first user identity information of the target user. The more relevant the knowledge and content involved in the candidate question and answer pair is to the description of the target user's department, business line, job function, job title, etc., the better the Sim b1 The larger the specific value of [i] is, the larger the value of [i]. Similarly, the question-answering system can determine the value of Simb1 The specific value of [i] is used to judge the similarity between each candidate question-answer pair and the target user’s identity information.
[0141] Figure 5 A schematic diagram of a process for determining a first arrangement order of question-answer pairs to be selected provided in an embodiment of the present application.
[0142] like Figure 5 As shown, in an embodiment of the present application, the way in which the question-answering system sorts the question-answer pairs to be selected may include the following steps.
[0143] S410: Convert the first user identity information into a first information vector.
[0144] After obtaining the first user's identity information, the question-answering system can convert the first user's identity information into a first information vector. It should be noted that the system uses the same vector conversion tool to convert the first user's identity information into the first information vector as the vector conversion tool used to convert the question text into the question vector in the aforementioned embodiment. Therefore, this application does not elaborate on the process of converting the first information vector.
[0145] S420: Determine a third vector similarity between the first information vector and the question-answer pair vector of each question-answer pair to be selected.
[0146] In an embodiment of the present application, after the question-answering system converts the first information vector, it can determine the third vector similarity corresponding to each candidate question-answer pair based on the cosine similarity between the first information vector and the question-answer pair vector corresponding to each candidate question-answer pair.
[0147] It should be understood that the third vector similarity determined by the question-answering system is the similarity between the vector corresponding to the first user identity information obtained according to the above formula (2) and the question-answer pair vector corresponding to the selected question-answer pair. In the process of determining the third vector similarity, the question-answering system can substitute the first information vector into V b1 , substitute the question-answer pair vector of each candidate question-answer pair into V k [i], and then obtain the third vector similarity that matches the number of question-answer pairs to be selected.
[0148] In some embodiments of the present application, the question-answering system may sort the candidate question-answer pairs based on the numerical values of the third vector similarities, and select one of the candidate question-answer pairs based on its own output requirements and output it to the user. For example, taking the example of the question-answering system outputting the answer text from a candidate question-answer pair, the question-answering system may output the answer text of the candidate question-answer pair with the highest third vector similarity, so that the output answer text is highly similar to the question entered by the target user and highly similar to the user's identity information, thereby improving the accuracy of the answer output by the question-answering system and enhancing the user's user experience.
[0149] In another embodiment of the present application, after obtaining the third vector similarity, the question-answering system may also combine the first vector similarity of each candidate question-answer pair to calculate the sum of the first vector similarity and the second vector similarity corresponding to each candidate question-answer pair, thereby comprehensively considering the similarity between the question text and the candidate question-answer pair and the similarity between the first user identity information and the candidate question-answer pair to screen the final output question-answer pairs. In this way, the final output answer text can be screened by combining the question text entered by the target user and its corresponding first user identity information, thereby improving the accuracy of the answer text output by the question-answering system.
[0150] S430: Obtain the number of queries and evaluations corresponding to each question-answer pair to be selected.
[0151] In an embodiment of the present application, the question-answering system can also evaluate the similarity between the first user identity information and the question-answer pair to be selected, or evaluate the similarity between the question text and the question-answer pair to be selected by introducing the query and evaluation times corresponding to each question-answer pair to be selected and combining them with the third vector similarity.
[0152] Among them, the number of queries refers to the number of times the question-answer pair is queried and the corresponding answer text is output within the preset time, and the number of evaluations refers to the number of times the user evaluates the answer text after obtaining the answer text within the preset time. Because there are users who do not evaluate the results obtained by the question-answering system after obtaining the answer text, the specific value of the number of evaluations may be less than or equal to the number of queries. It should be understood that the preset time can be a value such as one week, one month, two months, half a year, or one year, or it can be the time period from the activation of the question-answering system to the user entering the question text. The embodiment of the present application does not limit the specific value of the preset time.
[0153] Therefore, the question-answering system can determine the number of queries for each candidate question-answer pair by querying the number of outputs of the answer text corresponding to each candidate question-answer pair within a preset time.
[0154] Furthermore, after obtaining the answer text output by the question-and-answer system, the user can evaluate the answer text. The evaluation may include likes and dislikes, and correspondingly, the number of evaluations may include likes and dislikes. The area in the first knowledge base that stores the answer text can set the number of evaluations corresponding to each answer text. After obtaining the user's evaluation, the question-and-answer system can add one to the number of likes or dislikes in the number of evaluations corresponding to the answer text based on the evaluation content to record the number of evaluations corresponding to each question-and-answer pair. When the question-and-answer system obtains the number of evaluations for each question-and-answer pair to be selected, the system can read the corresponding number of evaluations in the first knowledge base based on the correspondence between the question-and-answer pair and the number of evaluations.
[0155] In some embodiments, after outputting the answer text and obtaining the evaluation, the question-and-answer system may also store the number of times the answer text is output and the evaluation content and number of evaluations corresponding to each question-and-answer pair in its own database, so that when the number of queries and the number of evaluations need to be obtained, the corresponding number of queries and the number of evaluations can be obtained by calling the content in its own database, thereby improving the response speed of the question-and-answer system.
[0156] S440: The quotient of the difference between the number of likes and the number of dislikes and the number of queries is determined as the evaluation weight.
[0157] After obtaining the number of evaluations, the Q&A system can obtain the number of likes and dislikes corresponding to the candidate Q&A pair. Furthermore, the evaluation weight of each candidate Q&A pair is determined based on the number of likes, dislikes, and corresponding query times. For example, the evaluation weight can be obtained as shown in the following formula (3).
[0158]
[0159] Here, Q represents the evaluation weight of each candidate question-answer pair, x represents the number of likes for the candidate question-answer pair, y represents the number of dislikes for the candidate question-answer pair, and M represents the number of queries for the candidate question-answer pair. The evaluation weight can be determined by taking the quotient between the difference between the number of likes and dislikes and the number of queries.
[0160] Furthermore, the difference between the number of likes and dislikes can have three scenarios: positive, 0, and negative. Accordingly, the evaluation weight can also have three scenarios: positive, 0, and negative. Based on the evaluation weight, the question-answering system can incorporate user evaluations to weight each candidate question-answer pair. When the evaluation weight is negative, the resulting value is lower, resulting in candidate question-answer pairs with more dislikes having lower similarity, reducing the probability of the question-answering system outputting poor-quality answer texts.
[0161] In some embodiments of the present application, because each question-and-answer pair is queried and output for the first time, when the question-and-answer system obtains the number of queries and the number of evaluations, there may be a scenario where the number of queries and the number of evaluations for the candidate question-and-answer pair are both 0. In this case, the question-and-answer system can set a default evaluation weight value for the candidate question-and-answer pair to avoid the scenario where the candidate question-and-answer pair cannot be selected due to the evaluation weight. For example, the default evaluation weight value can be 0.5, 0.3, 0.2, etc. The embodiments of the present application do not limit the specific value of the default evaluation weight value.
[0162] In another part of the embodiments, the question-answering system may also determine the evaluation weight of the candidate question-answering pairs whose query times and evaluation times are both 0 based on the average value of the evaluation weights determined for other candidate question-answering pairs. For example, the question-answering system selects ten question-answering pairs as candidate question-answering pairs, and the query times and evaluation times of one of the candidate question-answering pairs are both 0. At this time, the question-answering system can calculate the evaluation weights corresponding to the other nine candidate question-answering pairs after collecting the query times and evaluation times of the other candidate question-answering pairs, and then calculate the quotient of the sum of these evaluation weights and the number of evaluation weights, thereby obtaining the evaluation weight of the candidate question-answering pairs whose query times and evaluation times are both 0.
[0163] S450: Determine a first arrangement order of the plurality of candidate question-answer pairs according to the descending order of the sum of the first vector similarity, the third vector similarity and the evaluation weight of each candidate question-answer pair.
[0164] After obtaining the third similarity and evaluation weight, the question-answering system can calculate the sum value based on the first vector similarity obtained for each candidate question-answer pair in the above process and determine the first arrangement order of the candidate question-answer pairs based on the obtained sum value.
[0165] Exemplarily, the question-answering system may calculate the sum of the first vector similarity, the third vector similarity and the evaluation weight of each candidate question-answer pair, use the sum as the relevance of the candidate question-answer pair to the target user, and obtain a first ranking order based on the sum.
[0166] In some embodiments of the present application, in addition to introducing the similarity and evaluation weight between the first user identity information of the target user and the question and answer pairs to be selected as factors for determining the first ranking order of the question and answer pairs to be selected, the question and answer system can also determine the first ranking order of the question and answer pairs to be selected by increasing the similarity between the historical users who compared and retrieved the question and answer pairs and the target user, thereby optimizing the user experience, making it easier for them to obtain answers related to their own identity information, and improving the ranking accuracy of the question and answer pairs to be selected.
[0167] S460: Obtain the second user identity information of the historical user who has queried the question-answer pair to be selected.
[0168] When calculating the evaluation weight, the question-and-answer system may obtain the second user identity information of the historical user who queried for each candidate question-and-answer pair based on the number of queries it obtains for each candidate question-and-answer pair. The second user identity information serves the same purpose as the first user identity information, and the content categories contained in the second user identity information are also the same as those in the first user identity information. For example, if the first user identity information includes job functions and job titles, the second user identity information will also include job functions and job titles. This application does not elaborate on this.
[0169] S470: Determine the intersection and union between the first user identity information and the second user identity information corresponding to each historical user.
[0170] In an embodiment of the present application, after obtaining the second user identity information corresponding to the number of queries in each candidate question and answer pair, the question and answer system can determine the similarity between the target user and the historical user by determining the intersection and union of the first user identity information and the second user identity information.
[0171] After obtaining the above intersection and union, the question-answering system can determine the similarity between the identity information of the target user and the historical user based on the number of dimensions in the intersection and union. For example, the system can use the intersection and union to determine the similarity between the identity information of the target user and the historical user as shown in the following formula (4).
[0172]
[0173] Among them, Sim u [A, B] represents the similarity between the identity information of the target user and the historical user, Sim(UserA∩UserB) represents the number of information dimensions in the intersection of the first user identity information and the second user identity information, and Sim(UserA∪UserB) represents the number of information dimensions in the union of the first user identity information and the second user identity information. In the embodiment of the present application, the information dimension refers to each item of information in the first user identity information and the second user identity information. For example, when one item is included in the first user identity information and the second user identity information, such as department, business line, job function, job title, etc., the number of information dimensions is 1, and when four items are included in the first user identity information and the second user identity information, the number of information dimensions is 4.
[0174] Among them, when the identity information of the target user is exactly the same as that of the historical user, the corresponding values of Sim(UserA∩UserB) and Sim(UserA∪UserB) are the same. u The value of [A, B] can be 1. When the identity information of the target user is completely different from that of the historical user, Sim(UserA∩UserB) can be 0. u The value of [A, B] can also be 0.
[0175] Figure 6 A schematic diagram of determining the union and intersection of user identity information provided in an embodiment of the present application.
[0176] like Figure 6As shown, when storing the user's identity information, the question-and-answer system can store all the user's corresponding departments, business lines, job functions, job titles and other information in the database. The question-and-answer system can determine the content contained in the identity information by storing the mapping relationship between the identity information and the above information.
[0177] When determining the intersection and union between the first user identity information and the second user identity information corresponding to each historical user, the intersection and union can be determined through the mapping relationship between the first user identity information and the second user identity information and the content in the database. For example, if the target user is user A and the historical user is user B, and both the first user identity information and the second user identity information include information in four dimensions: department, business line, job function, and job title, the identity information corresponding to user A and user B is mapped to department a and business line a at the same time. User A is also mapped to job function a and job title a, while user B is mapped to job function b and job title b. At this point, the system can determine that the intersection value of the identity information between user A and user B is 2, and the corresponding union value of the identity information between user A and user B is 6. The similarity between the identity information of the target user and the historical user obtained in this way can be 1 / 3.
[0178] In some embodiments of the present application, the similarity between the identity information of a target user and a historical user can also be determined by the number of information dimensions in the intersection of the first user's identity information and the second user's identity information, and the number of information dimensions corresponding to the first user's identity information or the second user's identity information. For example, if both the first user's identity information and the second user's identity information include information in four dimensions: department, business line, job function, and position title, and if the intersection of the first user's identity information and the second user's identity information is two information dimensions, then the similarity between the identity information of the target user and the historical user can be 2 / 4, i.e., 1 / 2.
[0179] It should be understood that the above method of determining the similarity between the identity information of the target user and the historical user is only a feasible implementation method in the embodiment of the present application, and the embodiment of the present application does not limit the method of determining the similarity between the identity information of the target user and the historical user.
[0180] S480: Determine the quotient of the sum of the quotients of each intersection and each union and the sum of the number of queries and the first preset value as the service weight.
[0181] After obtaining the intersection and union of the identity information of the target user and the historical users, the question-and-answer system can determine the business weight based on the sum of the intersection and union quotients between the identity information of the target user and the historical users corresponding to each selected question-and-answer pair, and the quotient between the number of queries and the sum of the first preset value.
[0182] Exemplarily, the way in which the question-answering system obtains the business weight can be expressed as the following formula (5).
[0183]
[0184] Among them, Sim b2 [i] represents the business weight, Sim u [a, A] represents the similarity between the identity information of the target user and the historical users, n is the number of historical users who retrieved the question-answer pair to be selected, a is any historical user who retrieved the question-answer pair to be selected, A can represent the target user, It represents the sum of the similarities between the target user and the identity information of each historical user who retrieved the question-answer pair to be selected. In the embodiment of the present application, 1 is the first preset value.
[0185] It should be understood that if n is 0, it means that the candidate question-answer pair has not been retrieved and output, and the service weight value can be 0. In addition, in the embodiment of the present application, the number of queries for the candidate question-answer pair obtained by historical user retrieval can be used as the value of n. In this case, there may be repeated historical users, which can more comprehensively determine the service weight, avoid the situation where the same user retrieves the same candidate question-answer pair multiple times and excludes them, and improve the accuracy of the obtained service weight.
[0186] S490: Determine a first arrangement order of the plurality of candidate question-answer pairs according to the descending order of the sum of the first vector similarity, the third vector similarity, the business weight, and the evaluation weight of each candidate question-answer pair.
[0187] After obtaining the business weight, the question-and-answer system can calculate the sum value based on the first vector similarity, third vector similarity and evaluation weight obtained in the above process for each candidate question-and-answer pair and determine the first arrangement order of the candidate question-and-answer pairs based on the obtained sum value.
[0188] Exemplarily, the question-answering system may calculate the sum of the first vector similarity, third vector similarity, business weight, and evaluation weight for each candidate question-answer pair, use this sum as the relevance of the candidate question-answer pair to the target user, and derive a first ranking order based on the numerical value corresponding to this sum. In this embodiment of the present application, the candidate question-answer pairs may be ranked in descending order of the sum of the first vector similarity, third vector similarity, business weight, and evaluation weight to form the first ranking order.
[0189] S500: Outputting a question-answer pair text corresponding to at least one question-answer pair to be selected from a plurality of question-answer pairs to be selected according to the first arrangement order.
[0190] After determining the first ranking order, the Q&A system selects and outputs the Q&A text corresponding to at least one candidate Q&A pair in the first ranking order as a response to the user's question. For example, the Q&A system may output the Q&A text corresponding to the first candidate Q&A pair in the first ranking order as the Q&A system's response to the question text. This allows the user to receive content that is most similar to the question text entered by the user and the user's identity information, thereby improving the user's experience with the Q&A system.
[0191] In some embodiments of the present application, the question-answering system may also output multiple question-answer pairs to the user as responses to the question text entered by the user. For example, the question-answering system may output the question-answer pairs corresponding to the top three candidate question-answer pairs in the first ranking order as responses, thereby providing the user with multiple answers that are highly similar to the user's question content and identity information, thereby preventing the user from not receiving the corresponding answer when responding to a single question-answer pair.
[0192] Figure 7 A flowchart of a question-answering system outputting question-answer text is provided in an embodiment of the present application.
[0193] like Figure 7 As shown, in another embodiment of the present application, the question-answering system may also output other question-answering texts or terminate the retrieval process in response to the user's evaluation of the output question-answering texts.
[0194] For example, after the question-and-answer system sends the question-and-answer text corresponding to the first question-and-answer pair to be selected in the first sorting order to the user, if it receives a thumbs-up evaluation from the user, the question-and-answer system may output the question-and-answer text in the first sorting order that is below the question-and-answer text outputted previously, until the user inputs a thumbs-up evaluation or exits the system, thereby ending the question-and-answer process based on the question text input by the user this time.
[0195] In some embodiments, if the question-and-answer system always receives click information sent by the user, the system may output a prompt message after outputting all the question-and-answer texts corresponding to the retrieved question-and-answer pairs to be selected, to prompt the user that there is no question-and-answer text to be output.
[0196] Based on this solution, the order of the question and answer pairs to be selected can be determined based on the vector similarity between the question text input by the user and the question and answer pairs in the first knowledge base, and then the final question and answer pair text can be determined based on the similarity between the user's identity information and the question and answer pairs to be selected, thereby optimizing the relevance of the obtained question and answer pair text to the user and improving the accuracy of the retrieved question and answer pair text.
[0197] Figure 8 A schematic diagram of an enterprise question-answering system based on semantic understanding and user characteristics provided for the implementation of this application.
[0198] refer to Figure 8 As shown, corresponding to the embodiment of the enterprise question-answering method based on semantic understanding and user characteristics, the embodiment of the present application further provides an enterprise question-answering system 80 based on semantic understanding and user characteristics. The enterprise question-answering system 80 based on semantic understanding and user characteristics may include a receiving module 81, a text conversion module 82, a text matching module 83, an information calling module 84, and an output module 85, wherein:
[0199] The receiving module 81 is configured to receive a question text input by a user.
[0200] The text conversion module 82 is configured to convert the question text into a question vector in response to receiving a question text input by the user.
[0201] The text matching module 83 is configured to determine a plurality of question-answer pairs to be selected in a first knowledge base based on the question vector. The first knowledge base is used to store question-answer pairs, and the question-answer pairs include question-answer pair texts.
[0202] The information calling module 84 is configured to obtain the first user identity information of the user.
[0203] The text matching module 83 is further configured to generate a first ranking order of the plurality of candidate question-answer pairs based on the similarity between the first user identity information and each candidate question-answer pair and the number of queries for each candidate question-answer pair.
[0204] The output module 85 is configured to output the question-answer pair text corresponding to at least one of the multiple question-answer pairs to be selected according to the first arrangement order.
[0205] Figure 9 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0206] In some embodiments, the electronic device may include one or more processors and a memory coupled to the processor. The memory is configured to store one or more computer programs. The computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the enterprise question-and-answer method based on semantic understanding and user features described in the above embodiments.
[0207] like Figure 9 As shown, the electronic device 90 includes a processor 91 and a memory 92. Exemplarily, the electronic device 90 may further include a communication interface 93 and a communication bus 94.
[0208] The processor 91, the memory 92 and the communication interface 93 communicate with each other via a communication bus 94. The communication interface 93 is used to communicate with other devices such as clients or other servers.
[0209] In some embodiments, the processor 91 is configured to execute a computer program 95, specifically executing the steps in the aforementioned embodiment of the enterprise question-answering method based on semantic understanding and user characteristics. Specifically, the computer program 95 may include computer program code, which includes computer-executable instructions.
[0210] For example, the processor 91 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of the present application. The electronic device 90 may include one or more processors of the same type, such as one or more CPUs, or different types of processors, such as one or more CPUs and one or more ASICs.
[0211] In some embodiments, the memory 92 is used to store the computer program 95. The memory 92 may include a high-speed RAM memory, and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0212] The computer program 95 can be specifically called by the processor 91 to enable the electronic device 90 to perform the enterprise question-answering method operation based on semantic understanding and user characteristics.
[0213] Some embodiments of the present application also provide a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction runs on the electronic device 90, the electronic device 90 executes the enterprise question-and-answer method based on semantic understanding and user characteristics in the above embodiment.
[0214] The executable instructions can be specifically used to enable the electronic device 90 to perform enterprise question-answering method operations based on semantic understanding and user characteristics.
[0215] For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0216] The beneficial effects that can be achieved by the readable storage medium provided in some embodiments of the present application can be referred to the beneficial effects of the corresponding enterprise question-and-answer method based on semantic understanding and user characteristics provided above, and will not be repeated here.
[0217] The implementation methods described above are only specific implementation methods of the present application and are not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present application should be included in the scope of protection of the present application.
Claims
1. An enterprise question-answering method based on semantic understanding and user characteristics, characterized by: Applied to an enterprise question-answering system based on semantic understanding and user characteristics, the method includes: In response to receiving a question text input by a user, converting the question text into a question vector; Based on the question vector, determining a plurality of to-be-selected question-answer pairs in a first knowledge base, where the first knowledge base is used to store question-answer pairs, the question-answer pairs including question-answer pair texts; Obtaining first user identity information of the user; generating a first ranking order of the plurality of question-answer pairs to be selected based on a similarity between the first user identity information and each of the question-answer pairs to be selected and a number of queries for each of the question-answer pairs to be selected; According to the first arrangement order, the question-answer pair text corresponding to at least one of the multiple question-answer pairs to be selected is output.
2. The enterprise question-answering method according to claim 1, characterized in that: The question-answer pair further includes a question-answer pair vector, and determining a plurality of candidate question-answer pairs in the first knowledge base based on the question vector includes: Obtaining a first vector similarity between the question vector and the question-answer pair vector; Determining a second arrangement order of each of the question-answer pairs according to the order of the first vector similarities from high to low; The first N question-answer pairs in the second arrangement order are determined as the question-answer pairs to be selected, wherein N is a positive integer greater than 1 and is less than the number of the question-answer pairs stored in the first knowledge base.
3. The enterprise question-answering method according to claim 2, characterized in that: After determining the second arrangement order of each question-answer pair, the method further includes: Based on the question-answer pair vector, obtaining an answer vector corresponding to the question-answer pair; Obtaining a second vector similarity, where the second vector similarity includes a similarity between the answer vectors of two different question-answer pairs; If the second vector similarity exceeds a preset threshold, the question-answer pair with a lower first vector similarity is deleted from the second arrangement order.
4. The enterprise question-answering method according to claim 2, characterized in that: Generating a first arrangement order of the plurality of question-answer pairs to be selected based on the similarity between the first user identity information and each question-answer pair to be selected and the number of queries for each question-answer pair to be selected includes: converting the first user identity information into a first information vector; Determining a third vector similarity between the first information vector and the question-answer pair vector of each of the to-be-selected question-answer pairs; Obtain the query count and evaluation count corresponding to each of the candidate question-answer pairs, where the evaluation count includes the number of likes and dislikes; The quotient of the difference between the number of likes and the number of dislikes and the number of queries is determined as the evaluation weight; The first arrangement order of the multiple question-answer pairs to be selected is determined according to the descending order of the sum of the first vector similarity, the third vector similarity and the evaluation weight of each question-answer pair to be selected.
5. The enterprise question-answering method according to claim 4, characterized in that: Generating a first arrangement order of the plurality of candidate question-answer pairs based on the similarity between the first user identity information and each candidate question-answer pair and the number of queries for each candidate question-answer pair further includes: Obtaining the second user identity information of the historical user who queried the question-and-answer pair to be selected; Determine an intersection and a union between the first user identity information and the second user identity information corresponding to each of the historical users; Determine the quotient of the sum of the quotient values of each intersection and each union and the sum of the number of queries and a first preset value as a service weight; The first arrangement order of the multiple question-answer pairs to be selected is determined according to the descending order of the sum of the first vector similarity, the third vector similarity, the business weight and the evaluation weight of each question-answer pair to be selected.
6. The enterprise question-answering method according to claim 1, characterized in that: Before obtaining the first user identity information of the user, the method further includes: If the user has not used the enterprise Q&A system, authentication prompt information is generated, where the authentication prompt information is used to prompt the user to bind identity information, where the identity information includes the employee ID stored in the enterprise Q&A system and the employee identity corresponding to the employee ID; In response to receiving the employee identification input by the user, a first mapping relationship is established between the user and the employee identity corresponding to the employee identification.
7. The enterprise question-answering method according to claim 6, characterized in that: The obtaining the first user identity information of the user includes: Based on the first mapping relationship, obtaining the identity information corresponding to the user; The identity information is determined as the first user identity information.
8. The enterprise question-answering method according to claim 1, characterized in that: Before converting the question text into a question vector in response to receiving a question text input by the user, the method further includes: In response to receiving the initialization instruction, obtaining a second knowledge base, wherein the second knowledge base includes knowledge information within the enterprise and / or knowledge information uploaded by users; generating at least one question text corresponding to at least one item of knowledge information based on the semantics of at least one item of knowledge information in the second knowledge base; generating a question-answer pair text based on the question text and the knowledge information corresponding to the question text; Convert the question-answer pair text into a question-answer pair vector; The question-answer pair text and the question-answer pair vector are stored in the first knowledge base.
9. The enterprise question-answering method according to claim 8, characterized in that: The step of generating at least one question text corresponding to at least one piece of knowledge information based on the semantics of at least one piece of knowledge information in the second knowledge base includes: In response to receiving a prompt word text, obtaining the number of pieces of knowledge information to be selected and text corresponding to the selected indication information, wherein the prompt word text includes a list of knowledge information for generating question-answer pairs and the number of question texts corresponding to each piece of knowledge information, and the knowledge information to be selected includes information in the second knowledge base that is in the list of knowledge information; respectively obtaining the semantics of each item of the candidate knowledge information; Inferring the questioning method corresponding to the candidate knowledge information based on the semantics of the candidate knowledge information; The inference result is determined as the question text.
10. An electronic device, characterized in that: It includes a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor is used to execute the computer instructions, the electronic device executes the enterprise question-answering method based on semantic understanding and user characteristics as described in any one of claims 1 to 9.