An automatic evaluation method and system for large model question answering system

By extracting user characteristics and matching the emotional tendency lexicon, the problem that the existing question and answer system does not consider user characteristics is solved, and user satisfaction is improved.

CN118245349BActive Publication Date: 2024-08-23BEIJING UNIVERSAL MEDICAL RESCUE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410447734.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2024-08-23
Estimated Expiration
2044-04-15

AI Technical Summary

Technical Problem

Existing question and answer systems fail to consider user characteristics, resulting in output answers that may offend users.

Method used

By obtaining user information, extracting user characteristics, and determining the target user group and emotional tendency vocabulary based on the pre-established user vocabulary, matching the answer materials output by the question and answer model, and using the weight and matching degree of the emotional tendency words to score.

Benefits of technology

Improves user satisfaction and makes the output answers more in line with the user's preferences and emotional tendencies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118245349B
    Figure CN118245349B
Patent Text Reader

Abstract

The present invention relates to an automatic evaluation method and system for a large-model question-and-answer system. By extracting features from user information, external users currently performing question-and-answering are divided into corresponding user groups, and a corresponding sentiment tendency word library is obtained. When conducting question-and-answering, the answer material output by the language model is matched with the sentiment tendency words in the sentiment tendency word library. When the answer material contains corresponding sentiment tendency words in the sentiment tendency word library, multiple answer materials are scored using the weights of the sentiment tendency words and the matching degree of the answer material. The present application scores the answer material output by the model not only based on the matching degree of the answer, but also based on the user's sentiment tendency to the answer material, so that the answer finally output can increase the user's satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an automatic evaluation method and system for a large model question-answering system. Background Art

[0002] Existing question-answering systems determine relevant answers from a large set of texts based on user questions. These answers are generally matched to the user's questions. The corresponding answers are output based on the degree of match with the user's question text.

[0003] However, in the above question-answering method, the question-answering system only outputs a single answer based on the user's question text, that is, it only outputs the answer with the highest matching degree. This matching method does not take user characteristics into consideration. Since different user groups have different preferences for different entities, the answer may cause users to be disgusted. Summary of the invention

[0004] In view of this, an object of the present invention is to provide an automatic evaluation method and system for a large-model question-answering system, so as to solve the problem in the prior art that users are easily dissatisfied with the answers output by the question-answering system.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] An automatic evaluation method for a large model question answering system of the present invention comprises:

[0007] Acquire multiple answer materials output by the question-answering model and the matching degrees of the multiple answer materials, and acquire user information of the external user, wherein the multiple answer materials are generated by the question-answering model based on the question text input by the external user;

[0008] Extracting user features from the user information;

[0009] Determining the target user group of the external users and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words;

[0010] Matching the multiple answer materials with the sentiment tendency word library of the target user group;

[0011] When there are sentiment tendency words matching the sentiment tendency word library in the plurality of answer materials, the plurality of answer materials are scored based on the matching degrees of the plurality of answer materials and the sentiment tendency words.

[0012] In one embodiment of the present application, obtaining multiple answer materials output by the question-answering model and the matching degree of the multiple answer materials includes:

[0013] Get the user's question text;

[0014] Extracting keywords from the question text and converting the keywords into query vectors;

[0015] The query vector is matched with a pre-built knowledge base to obtain multiple answer materials with the highest matching degree and the matching degree of multiple answer materials, wherein the knowledge base includes multiple question and answer templates, the question and answer templates.

[0016] In one embodiment of the present application, the method for constructing the user vocabulary includes:

[0017] Acquire historical question-and-answer data and user information of multiple users, wherein the historical question-and-answer data includes one or more question-and-answer pairs of the multiple users, each question-and-answer pair including a question text, an answer text, and a re-question text;

[0018] Clustering multiple users based on user features in the user information to obtain multiple user groups and historical question and answer data of the multiple user groups;

[0019] Performing sentiment annotation on the re-question text corresponding to each user group to obtain the sentiment state of the re-question text, and using the sentiment state of the re-question text as the sentiment state of the corresponding answer text, wherein the sentiment state is divided into positive, negative and neutral;

[0020] Perform entity extraction on multiple answer texts to obtain multiple entity words;

[0021] The i-th entity word whose occurrence frequency exceeds the preset frequency threshold is taken as the target word W i , and based on all the words containing the target word W i The emotional state of the answer text determines the target word W i The weight of

[0022] The target words are screened based on the weights of the target words to obtain sentiment-oriented words, and a user vocabulary is constructed based on the sentiment-oriented words of multiple user groups and the weights of the sentiment-oriented words.

[0023] In one embodiment of the present application, based on all the i The emotional state of the answer text determines the target word W i The weights include:

[0024] The target word W i The emotional state of the t-th answer text is assigned to the corresponding target word Wi , get the target word W i The emotional state value Among them, the target word W i When the emotional state is positive, Target word W i When the emotional state is classified as negative, Target word W i When the emotional state is divided into neutral,

[0025] Based on the target word W i All emotional state values Calculate the target word W i Weight The target word W i Weight The mathematical expression is:

[0026]

[0027] Where n is the number of words containing the target word W i The number of answer texts.

[0028] In an embodiment of the present application, the target words are screened based on the weight of the target words to obtain sentiment tendency words, including:

[0029] Comparing the weight of the target word with a preset filtering range;

[0030] The target words whose weight values ​​are greater than the upper limit of the preset filtering range and whose weight values ​​are less than the lower limit of the preset filtering range are taken as sentiment tendency words.

[0031] In one embodiment of the present application, determining the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics includes:

[0032] Determine the user group corresponding to each characteristic factor of the user feature and the sentiment tendency word library of the user group from the pre-established user word library;

[0033] The sentiment tendency word libraries of all user groups are merged to obtain the sentiment tendency word library of the target user group.

[0034] In one embodiment of the present application, matching the multiple answer materials with the emotional tendency word library of the target user group includes:

[0035] Perform word segmentation on the multiple answer materials to obtain multiple words;

[0036] The multiple words are matched with the sentiment tendency word library of the target user group to obtain the sentiment tendency words of the external users in the multiple answer materials.

[0037] In an embodiment of the present application, scoring the multiple answer materials based on the matching degree of the multiple answer materials and the sentiment tendency words includes:

[0038] Determine the sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ), where M(W′ i )=1; when the emotional state is negative, M(W′ i )=-1; when the emotional state is neutral, M(W′ i )=0;

[0039] Based on the sentiment word W′ i The weight G(W′ i ), sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ) and the matching degree of the multiple answer materials to score the multiple answer materials, and the mathematical expression of the score S(A) is:

[0040] S(A)=α×MD(A)+β×∑G(W′ i )×M(W′ i )

[0041] In the formula, α is the first weight, β is the second weight, and MD(A) is the matching degree of answer material A.

[0042] In one embodiment of the present application, it also includes:

[0043] Taboo words are added to the sentiment tendency word library of multiple user groups, and the weights of the taboo words are set.

[0044] The present application also provides an automatic evaluation system for a large model question answering system, comprising:

[0045] An acquisition module, used to acquire multiple answer materials output by the question-answering model and the matching degree of the multiple answer materials, and to acquire user information of an external user, wherein the multiple answer materials are generated by the question-answering model based on the question text input by the external user;

[0046] A feature extraction module, used to extract user features from the user information;

[0047] A classification module, used to determine the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words;

[0048] A matching module, used for matching the plurality of answer materials with the sentiment tendency word library of the target user group;

[0049] A scoring module is used to score the multiple answer materials based on the matching degree of the multiple answer materials and the sentiment tendency words when there are sentiment tendency words matching the sentiment tendency word library in the multiple answer materials.

[0050] The beneficial effects of the present invention are as follows: an automatic evaluation method and system of a large-model question-and-answer system of the present invention extracts features from user information, thereby dividing the external users currently executing the question and answer into corresponding user groups and obtaining corresponding sentiment tendency vocabulary. When conducting question and answer, the answer material output by the language model is matched with the sentiment tendency words in the sentiment tendency vocabulary. When there are corresponding sentiment tendency words in the sentiment tendency vocabulary in the answer material, the weights of the sentiment tendency words and the matching degree of the answer material are used to score multiple answer materials. The present application scores the answer material output by the model not only based on the matching degree of the answer, but also based on the user's sentiment tendency to the answer material, so that the final output answer can increase the user's satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0052] Figure 1 A flowchart of an automatic evaluation method for a large model question answering system in one embodiment of the present invention;

[0053] Figure 2 A schematic diagram of a triple knowledge graph in an embodiment of the present application;

[0054] Figure 3 It is a structural diagram of an automatic evaluation system of a large model question answering system in one embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0056] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.

[0057] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.

[0058] Figure 1 is a flow chart of an automatic evaluation method for a large model question answering system shown in an embodiment of the present application. Figure 1 As shown: including the steps:

[0059] S110, obtaining a plurality of answer materials output by the question-answering model and the matching degree of the plurality of answer materials, and obtaining user information of the external user, wherein the plurality of answer materials are generated by the question-answering model based on the question text input by the external user;

[0060] The question-answering model in this application is built based on a knowledge base. When the question-answering model receives a question text input by an external user, it matches the question text with the structured data in the industry knowledge base to obtain multiple answer materials with the highest matching degree and the matching degree of multiple answer materials.

[0061] The user information of external users is obtained during the registration stage. When registering, users will enter personal information such as age, gender, occupation, etc. The above user information contains user characteristics.

[0062] Specifically, in this application, the following method is used to obtain multiple answer materials output by the question-answering model and the matching degree of the multiple answer materials:

[0063] S111, obtaining the user's question text; the question text is text or voice input by an external user. When the voice is input, the automatic speech recognition (Automatic Speech Recognition, ASR) technology is used to convert the voice into text, and then perform subsequent processing.

[0064] S112, extracting keywords from the question text and converting the keywords into query vectors;

[0065] When extracting keywords, the question text is first segmented, and then keywords are extracted according to the triple structure.

[0066] For example, an external user inputs "What is the process of the equity card service?", and the word segmentation algorithm obtains "equity card", "service", "process", and "what". The keywords are extracted to obtain "equity card", "service", and "process".

[0067] The present application performs vector conversion based on table lookup. Specifically, in order to retain the position information of each keyword. The present application first converts the keywords into word vectors, and extracts the position codes of multiple keywords based on an exponential function. The word vector is multiplied by the first parameter matrix W1 to obtain a word vector matrix; the position code is multiplied by the second parameter matrix W2 to obtain a position matrix; finally, the position matrix and the word vector matrix are fused (can be added) to obtain a fusion matrix. Finally, the fusion matrix is ​​multiplied by the third parameter matrix W3 to obtain the encoding result. The encoding result contains both the word vector of each word and the position information of each word, so the semantic information of the question text can be retained. Finally, the encoding result is converted into a query vector by table lookup mapping, thereby converting the semantic information into a vector that can be recognized by the system.

[0068] For example, the question text entered by the user is: "Rights Card Service Process", which can be decomposed into three words: "Rights Card, Service, Process" through the word segmentation algorithm. On the one hand, the above words are converted into word vectors by looking up the table, and on the other hand, the position codes of the above three words are extracted. 0+sin0 、e 1+sin1..., and then multiply them with the first parameter matrix W1([0.1, 0.2, 0.3][0.1, 0.2, 0.3][0.1, 0.2, 0.3][0, 0, 0][0, 0, 0] and the second parameter matrix W2([0.1, 0.2, 0.3][0.1, 0.2, 0.3][0.1, 0.2, 0.3][0, 0, 0][0, 0, 0] to obtain the word vector matrix and the position matrix; the word vector matrix and the position matrix are added to obtain the fusion matrix, and the fusion matrix is ​​multiplied with the third parameter matrix W3([0.1, 0.2, 0.3][0.1, 0.2, 0.3][0.1, 0.2, 0.3][0, 0, 0][0, 0, 0] to obtain the encoding result, and finally the query vector of the encoding result is obtained by looking up the table.

[0069] In the above process, the key to converting the question text into a query vector is the three parameter matrices; the above parameter matrices are trained by the following method:

[0070] (1) obtaining a question training text, wherein the question training text is pre-labeled with a true result of a query vector;

[0071] (2) dividing the problem training text into a training set, a validation set, and a test set;

[0072] (3) Initializing the first parameter matrix, the second parameter matrix and the third parameter matrix, extracting a current question training text from the training set, and converting the current question training text into a current query vector based on a pre-constructed encoder; specifically, the process of converting the current question training text into a current query vector based on the pre-constructed encoder is the same as the process described above and will not be repeated here.

[0073] (4) calculating a loss value between the current query vector and a true result of the query vector, and generating a back propagation signal based on the loss value to update the first parameter matrix, the second parameter matrix, and the third parameter matrix;

[0074] (5) extracting the next question training text from the training set as the current question training text, and returning to the encoder based on the pre-constructed structure to convert the current question training text into the current query vector; until a termination training condition is reached, wherein the termination training condition includes that the loss value no longer decreases and / or a specified number of training times is reached;

[0075] (6) The trained first parameter matrix, the second parameter matrix, and the third parameter matrix are verified based on the verification set, and the trained first parameter matrix, the second parameter matrix, and the third parameter matrix are verified based on the test set. After verification and testing, the first parameter matrix, the second parameter matrix, and the third parameter matrix are obtained.

[0076] The present application continuously adjusts the first parameter matrix, the second parameter matrix and the third parameter matrix through an iterative training method, so that the query vector converted by the encoder is a true result. The true result can be a customized result or can be annotated according to the existing vector conversion data.

[0077] S113, matching the query vector with a pre-built knowledge base to obtain a plurality of answer materials with the highest matching degree and the matching degree of the plurality of answer materials, wherein the knowledge base includes a plurality of question and answer templates, the question and answer templates.

[0078] Among them, the knowledge base in this application is constructed based on triples.

[0079] Specifically, first collect industry text materials, or video, picture, and audio materials;

[0080] For text materials, the text materials are segmented to obtain multiple text segments;

[0081] Then, triples are extracted from multiple text fragments, and the structure of triples is entity-relation-entity;

[0082] Connect the same entities as nodes to obtain a triple knowledge graph;

[0083] A language model is called to generate multiple questions based on multiple text fragments, and a knowledge base is constructed based on the multiple questions and the corresponding text fragments, or multiple questions are constructed according to a triple knowledge graph, and a knowledge base is constructed based on the multiple questions and the corresponding text fragments.

[0084] Call the LLM model and input: "Please generate m questions based on the following paragraph: [paragraph content], and separate them with ";"." You can get multiple question texts.

[0085] For example:

[0086] Q: What are the indications for enteric-coated aspirin tablets?

[0087] A: Inhibition of platelet aggregation, prevention of recurrence of myocardial infarction, ....

[0088] Q: What is the drug for preventing recurrence of myocardial infarction?

[0089] A: Enteric-coated aspirin tablets,...

[0090] Q: Which documents contain relevant information about enteric-coated aspirin tablets?

[0091] A: "Chinese Practical Medicine", "Modern Drugs and Clinical Practice",...

[0092] Q: What are the contraindications for the use of enteric-coated aspirin tablets?

[0093] A: Kidney failure, liver failure, ...

[0094] Q: Which drugs should not be used by pregnant women?

[0095] A: Enteric-coated aspirin tablets,...

[0096] After obtaining the question text, the computer needs to recognize and match the text later. Therefore, the text needs to be converted into a computer-recognizable encoding form. Specifically, it includes:

[0097] Q (question) and A (answer) are segmented and keywords are extracted using the industry segmentation table.

[0098] Use the encoding table to convert the keywords separated from Q (question) and A (answer) into word vectors and merge them into vector Cv[Qv, Av]

[0099] Get data {"question":"question","answer":"answer","source paragraph":"paragraph content","query vector":"vector Cv[Qv,Av]"}

[0100] Using the entity extraction algorithm and industry vocabulary, we extract entities from the above content and get the following content:

[0101] {"question":"What is the role of aspirin?","answer":"It can inhibit the aggregation of platelets.","Source paragraph":"Enteric-coated aspirin tablets are a commonly used drug that can mainly inhibit the aggregation of platelets. Currently, enteric-coated aspirin tablets are mainly used to prevent the recurrence of myocardial infarction or secondary prevention of stroke, and can reduce the risk of myocardial infarction in patients with some cardiovascular risk factors.","Source":"Modern Drugs and Clinic","China Practical Medicine","Involved people, places, things":"Enteric-coated aspirin tablets, inhibition of platelet aggregation, recurrence of myocardial infarction, secondary prevention of stroke"}

[0102] Finally, the constructed data is stored in the industry text library: {"question":"question","answer":"answer","source paragraph":"paragraph content","source":"[book name],[material name]","people, places, things involved":"entity 1, entity 2, entity 3","query vector":"vector Cv[Qv, Av]"}.

[0103] In addition, we can construct questions through triple graphs. Figure 2is a schematic diagram of a triple knowledge graph in an embodiment of the present application. The triple knowledge graph constructed in the present application is as follows Figure 2 shown.

[0104] The following is an example of a question generated using the triple knowledge graph:

[0105] Q: What are the indications for enteric-coated aspirin tablets?

[0106] A: Inhibition of platelet aggregation, prevention of recurrence of myocardial infarction, ....

[0107] Q: What is the drug for preventing recurrence of myocardial infarction?

[0108] A: Enteric-coated aspirin tablets,...

[0109] Q: Which documents contain relevant information about enteric-coated aspirin tablets?

[0110] A: "Chinese Practical Medicine", "Modern Drugs and Clinical Practice",...

[0111] Q: What are the contraindications for the use of enteric-coated aspirin tablets?

[0112] A: Kidney failure, liver failure, ...

[0113] Q: Which drugs should not be used by pregnant women?

[0114] A: Enteric-coated aspirin tablets,...

[0115] Finally, the questions are manually checked and verified, and associated with the segmentation source, inappropriate content is eliminated, and finally a QA question set is generated, thereby building a knowledge base.

[0116] For video, picture, and audio materials, after obtaining the video, picture, and audio materials, the video, picture, and audio materials are summarized through the existing model to obtain a summary text, and feature extraction is performed on the video, picture, and audio materials to obtain material features.

[0117] The material features and text summary are converted into the first feature vector and the second feature vector, and then fused to obtain a composite vector; the composite vector contains the semantic information and feature information of the material. Then the composite vector is mixed into the annotated object to obtain a mixed data set, and the annotated information is the question label and the answer label;

[0118] By clustering the mixed data set, the synthetic vector can be quickly labeled with QA. Finally, the synthetic vector with QA annotation can be stored in the knowledge base.

[0119] S120, extracting user features from the user information;

[0120] User characteristics are features in user information that can be used to divide groups, such as age, gender, occupation, etc.

[0121] S130, determining the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words;

[0122] The user word library of the present application is pre-established, and the user word library contains sentiment tendency words corresponding to multiple user groups, and the tendency weights used to reflect the sentiment tendency words of the user groups. The value range of the tendency weights is from -1 to 1.

[0123] Specifically, the user vocabulary is constructed through the following process:

[0124] S131, obtaining historical question-and-answer data and user information of multiple users, wherein the historical question-and-answer data includes one or more question-and-answer pairs of the multiple users, each question-and-answer pair including a question text, an answer text, and a re-question text;

[0125] Among them, this application builds a user vocabulary based on the user's historical question and answer data. The historical question and answer data is constructed with the text of multiple rounds of dialogue, including at least a question text, an answer text, and a re-question text, for example:

[0126] User: I want to know how to apply for a rights card. (Question text)

[0127] System reply: xxxxx (answer text)

[0128] User: What I want to know is about **** (ask the text again)

[0129] In the above-mentioned multi-round dialogues, whether the user is satisfied with the corresponding answer text can be reflected by the re-question text.

[0130] S132, clustering the multiple users based on the user features in the user information to obtain multiple user groups and historical question and answer data of the multiple user groups;

[0131] Among them, user characteristics include age, occupation, gender, nationality, etc. This application clusters users of different age groups, different occupations, different genders and different nationalities, forming multiple user groups that execute the historical question-and-answer process, thereby reflecting the emotional tendencies of different user groups towards the answer text.

[0132] S133, performing sentiment annotation on the re-question text corresponding to each user group to obtain the sentiment state of the re-question text, and using the sentiment state of the re-question text as the sentiment state of the corresponding answer text, wherein the sentiment state is divided into positive, negative and neutral;

[0133] In this application, an algorithm can be used for automatic annotation, such as annotation using a training sentiment judgment model. Manual annotation can also be used. After annotation, this application transfers the sentiment tendency of the question text to the answer text to serve as the user's satisfaction with the answer text.

[0134] S134, performing entity extraction on the multiple answer texts to obtain multiple entity words;

[0135] This embodiment performs entity extraction based on an entity extraction algorithm; entity words that affect the emotional tendency of the answer text are extracted, thereby clustering the emotional state in the entity words therein.

[0136] S135, taking the i-th entity word whose occurrence frequency exceeds the preset frequency threshold as the target word W i , and based on all the words containing the target word W i The emotional state of the answer text determines the target word W i The weight of

[0137] This application obtains entities commonly used by user groups through frequency filtering, and uses entities commonly used by user groups as representative words. For example, when a certain industry group is discussing, the high-frequency words "assessment", "performance", "error correction", etc., and the high-frequency words used to describe a certain industry group, such as "high salary" and "hair loss", all of the above entities have a certain degree of emotional tendency. This application is based on the inclusion of the target word W i The emotional state of the answer text determines the target word W i The weight of

[0138] Specifically include:

[0139] S13501, including the target word W i The emotional state of the t-th answer text is assigned to the corresponding target word W i , get the target word W i The emotional state value Among them, the target word W i When the emotional state is positive, Target word W i When the emotional state is classified as negative, Target word W i When the emotional state is divided into neutral,

[0140] S13502, based on the target word Wi All emotional state values Calculate the target word W i Weight The target word W i Weight The mathematical expression is:

[0141]

[0142] Where n is the number of words containing the target word W i The number of answer texts.

[0143] In this application, the emotional state of the answer text annotation is used as the emotional state of each entity. For example, "XXX profession has good treatment but high pressure", "XXX profession has XX problems", "XXX profession has good development prospects", the emotional states of these three answer texts containing the entity "XXX profession" are 0, -1, and 1 respectively. Correspondingly, the target word "XXX profession" is expressed by the formula Calculation shows that the user group's sentiment towards "XXX occupation" is neutral.

[0144] The final calculated result of the weights of multiple entities in the corpus is between -1 and 1, where -1 to -0.2 represents a negative emotional state, -0.2 to 0.2 represents a neutral emotional state, and 0.2 to 1 represents a positive emotional state.

[0145] S136, screening the target words based on the weights of the target words to obtain sentiment tendency words, and constructing a user vocabulary based on the sentiment tendency words of multiple user groups and the weights of the sentiment tendency words.

[0146] In order to construct a word library with sentiment tendency, this application also removes target words that represent neutral sentiment state, including:

[0147] Comparing the weight of the target word with a preset filtering range;

[0148] The target words whose weight values ​​are greater than the upper limit of the preset filtering range and whose weight values ​​are less than the lower limit of the preset filtering range are taken as sentiment tendency words.

[0149] The filtering range of the present application may be -0.2 to 0.2, and the present application retains target words with weights less than -0.2 and greater than 0.2 as sentiment tendency words. Sentiment tendency words reflect the degree of sentiment tendency of user groups towards various entities.

[0150] Finally, the sentiment words are converted into word vectors by table lookup and stored in the vocabulary.

[0151] After obtaining the user vocabulary, the sentiment tendency vocabulary corresponding to the external user can be determined, including:

[0152] Determine the user group corresponding to each characteristic factor of the user feature and the sentiment tendency word library of the user group from the pre-established user word library;

[0153] The sentiment tendency word libraries of all user groups are merged to obtain the sentiment tendency word library of the target user group.

[0154] This application merges all the corresponding word libraries that meet the identity parameters of the external user to obtain the emotional tendency word library of the target user group. For example, if the identity parameters of the external user are male, 35 years old, and programmer, then the word libraries corresponding to the male group, the 30-40 years old group, and the programmer group are merged to obtain the emotional tendency word library of the target group.

[0155] S140, matching the multiple answer materials with the emotional tendency word library of the target user group;

[0156] Among them, if the multiple answer materials output contain sentiment-oriented words of the target user group, then the description status of the sentiment-oriented words in the answer materials may affect the user's satisfaction with the answer.

[0157] For example, if the user's emotional state towards "assessment" is negative, but the answer material describes "assessment" in a positive way, it may cause the user to be disgusted.

[0158] Specifically, matching the multiple answer materials with the emotional tendency word library of the target user group includes:

[0159] Perform word segmentation on the multiple answer materials to obtain multiple words;

[0160] The multiple words are matched with the sentiment tendency word library of the target user group to obtain the sentiment tendency words of the external users in the multiple answer materials.

[0161] In this embodiment, a word segmentation algorithm is first used to segment multiple answer materials, and entity extraction is performed to obtain multiple words. Then, after being converted into word vectors through table lookup, they are matched with the vectors of sentiment tendency words in the sentiment tendency word library of the target user group. This application can use the cosine similarity matching method to match sentiment tendency words whose matching degree exceeds a preset threshold. The sentiment tendency words in multiple answer materials are obtained.

[0162] S150, when there are sentiment tendency words matching the sentiment tendency word library in the multiple answer materials, scoring the multiple answer materials based on the matching degree of the multiple answer materials and the sentiment tendency words.

[0163] Finally, if there are sentiment words corresponding to external users in the answer material, then the sentiment inclination of the sentiment words in the answer material is determined. If the sentiment state of the sentiment words in the answer material is consistent with that of the external user, then the score of the answer material is increased, otherwise it is reduced. Specifically, it includes:

[0164] S151, determine the sentiment tendency word W′ i The sentiment state M(W′) in multiple answer materials i ), where M(W′ i )=1; when the emotional state is negative, M(W′ i )=-1; when the emotional state is neutral, M(W′ i )=0;

[0165] Among them, for the sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ) is consistent with the method in the previous article. The emotional tendency word W′ can be trained by training the model i The emotional state of the answer text is annotated, and the emotional state of the answer text is used as the emotional tendency word W′ i emotional state.

[0166] Since sentiment words are essentially entities, we can also determine the sentiment words W′ by extracting keywords. i The sentiment state M(W′) in multiple answer materials i ). For example, the sentiment word W′ i In the answer text, there are positive adjectives, such as the sentiment word W′ i “Good”, “very good”, “dedicated”, “ideal”, etc., represent sentiment tendency words W′ i In the answer material, it is a positive emotional state. If it is a negative or neutral adjective, then the corresponding word is the emotional tendency word W′. i Negative or neutral emotional state in the answer material.

[0167] The emotional state of an adjective can be determined by consulting a dictionary.

[0168] S152, based on sentiment word W′ i The weight G(W′ i ), sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ) and the matching degree of the multiple answer materials to score the multiple answer materials, and the mathematical expression of the score S(A) is:

[0169] S(A)=α×MD(A)+β×∑G(W' i )×M(W' i )

[0170] In the formula, α is the first weight, β is the second weight, and MD(A) is the matching degree of answer material A.

[0171] The above formula is for the sentiment word W' i The generated score and the matching degree are weighted summed, where if the user's sentiment tendency word W' i If the attitude of the answer material is positive or negative (the user's attitude towards the corresponding entity is positive or negative), and the attitude in the answer material is consistent, the score of the answer material will increase, and the increase will increase with the intensity of the user's emotion. On the contrary, if the attitudes of the two are opposite, the score of the answer material will decrease, and the decrease will increase with the intensity of the user's emotion.

[0172] In one embodiment of the present application, it also includes:

[0173] Taboo words are added to the sentiment tendency word library of multiple user groups, and the weights of the taboo words are set.

[0174] In the present application, for a specific group, there are taboo words. The present application adds them to the sentiment tendency word library and sets the weight to MAX, so as to avoid outputting answers with taboo words to the user.

[0175] For example, corresponding taboo words can be added to a user group of a specific ethnic group to prevent the output question and answer text from causing adverse effects.

[0176] The present invention discloses an automatic evaluation method for a large-model question-and-answer system, which extracts features from user information, thereby dividing the external users currently performing question-and-answering into corresponding user groups and obtaining corresponding sentiment tendency vocabulary. When conducting question-and-answering, the answer material output by the language model is matched with the sentiment tendency words in the sentiment tendency vocabulary. When there are corresponding sentiment tendency words in the sentiment tendency vocabulary in the answer material, the weights of the sentiment tendency words and the matching degree of the answer material are used to score multiple answer materials. The present application scores the answer material output by the model not only based on the matching degree of the answer, but also based on the user's sentiment tendency to the answer material, so that the final output answer can increase the user's satisfaction.

[0177] like Figure 3 As shown, the present application also provides an automatic evaluation system for a large model question answering system, including:

[0178] An acquisition module, used to acquire multiple answer materials output by the question-answering model and the matching degree of the multiple answer materials, and to acquire user information of an external user, wherein the multiple answer materials are generated by the question-answering model based on the question text input by the external user;

[0179] A feature extraction module, used to extract user features from the user information;

[0180] A classification module, used to determine the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words;

[0181] A matching module, used for matching the plurality of answer materials with the sentiment tendency word library of the target user group;

[0182] A scoring module is used to score the multiple answer materials based on the matching degree of the multiple answer materials and the sentiment tendency words when there are sentiment tendency words matching the sentiment tendency word library in the multiple answer materials.

[0183] An automatic evaluation system for a large-model question-and-answer system of the present invention extracts features from user information, thereby dividing the external users currently executing the question and answer into corresponding user groups and obtaining corresponding sentiment tendency vocabulary. When conducting question and answer, the answer material output by the language model is matched with the sentiment tendency words in the sentiment tendency vocabulary. When there are corresponding sentiment tendency words in the sentiment tendency vocabulary in the answer material, the weights of the sentiment tendency words and the matching degree of the answer material are used to score multiple answer materials. The present application scores the answer material output by the model not only based on the matching degree of the answer, but also based on the user's sentiment tendency to the answer material, so that the final output answer can increase the user's satisfaction.

[0184] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any one of the methods in this embodiment is implemented, wherein the method is the execution logic of this device.

[0185] This embodiment also provides an electronic terminal, including: a processor and a memory;

[0186] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes any one of the methods in this embodiment.

[0187] The computer-readable storage medium in this embodiment can be understood by ordinary technicians in this field: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0188] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes each step of the above method.

[0189] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0190] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0191] In the above-mentioned embodiments, although the present invention has been described in conjunction with the specific embodiments of the present invention, many replacements, modifications and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. The embodiments of the present invention are intended to cover all such replacements, modifications and variations falling within the broad scope of the appended claims.

[0192] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. An automatic evaluation method for a large model question answering system, characterized in that: include: Acquire multiple answer materials output by the question-answering model and the matching degrees of the multiple answer materials, and acquire user information of the external user, wherein the multiple answer materials are generated by the question-answering model based on the question text input by the external user; Extracting user features from the user information; Based on the user characteristics, the target user group of the external user and the emotional tendency word library of the target user group are determined from a pre-established user word library, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words; the method for constructing the user word library includes: obtaining historical question and answer data and user information of multiple users, wherein the historical question and answer data includes one or more groups of question and answer pairs of multiple users, and each group of question and answer pairs includes a question text, an answer text and a re-question text; clustering multiple users based on the user characteristics in the user information to obtain multiple user groups and historical question and answer data of multiple user groups; emotionally annotating the re-question text corresponding to each user group to obtain the emotional state of the re-question text, and using the emotional state of the re-question text as the emotional state of the corresponding answer text, wherein the emotional state is divided into positive, negative and neutral; performing entity extraction on multiple answer texts to obtain multiple entity words; using the i-th entity word whose occurrence frequency exceeds a preset frequency threshold as the target word W i , and based on all the words containing the target word W i The emotional state of the answer text determines the target word W i weight; based on the weight of the target word, the target word is screened to obtain the sentiment tendency word, and a user word library is constructed based on the sentiment tendency words of multiple user groups and the weights of the sentiment tendency words; based on all the words containing the target word W i The emotional state of the answer text determines the target word W i The weight of the target word W i The emotional state of the t-th answer text is assigned to the corresponding target word W i , get the target word W i The emotional state value Among them, the target word W i When the emotional state is positive, Target word W i When the emotional state is classified as negative, Target word W i When the emotional state is classified as neutral, Based on the target word W i All emotional state values Calculate the target word W i Weight The target word W i Weight The mathematical expression is: Where n is the number of words containing the target word W i The number of answer texts; determining the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, including: determining the user group and the emotional tendency word library of the user group corresponding to each characteristic factor of the user characteristics from the pre-established user word library; merging the emotional tendency word libraries of all user groups to obtain the emotional tendency word library of the target user group; Matching the multiple answer materials with the sentiment tendency word library of the target user group; When there are sentiment tendency words matching the sentiment tendency word library in the multiple answer materials, the multiple answer materials are scored based on the matching degree of the multiple answer materials and the sentiment tendency words; the multiple answer materials are scored based on the matching degree of the multiple answer materials and the sentiment tendency words, including: determining the sentiment tendency word W′ i The sentiment state M(W′) in multiple answer materials i ), where M(W′ i )=1; when the emotional state is negative, M(W′ i )=-1; when the emotional state is neutral, M(W′ i )=0; based on sentiment word W′ i The weight G(W′ i ), sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ) and the matching degree of the multiple answer materials to score the multiple answer materials, and the mathematical expression of the score S(A) is: S(A)=α×MD(A)+β×ΣG(W′ i )×M(W′ i ) In the formula, α is the first weight, β is the second weight, and MD(A) is the matching degree of answer material A.

2. The automatic evaluation method of a large model question answering system according to claim 1, characterized in that: Get multiple answer materials output by the question-answering model and the matching degree of multiple answer materials, including: Get the user's question text; Extracting keywords from the question text and converting the keywords into query vectors; The query vector is matched with a pre-built knowledge base to obtain a plurality of answer materials with the highest matching degree and the matching degree of the plurality of answer materials, wherein the knowledge base includes a plurality of question and answer templates.

3. The automatic evaluation method of a large model question answering system according to claim 1, characterized in that: The target word is screened based on the weight of the target word to obtain sentiment tendency words, including: Comparing the weight of the target word with a preset filtering range; The target words whose weight values ​​are greater than the upper limit of the preset filtering range and whose weight values ​​are less than the lower limit of the preset filtering range are taken as sentiment tendency words.

4. The automatic evaluation method of a large model question answering system according to claim 1, characterized in that: Matching the multiple answer materials with the emotional tendency word library of the target user group includes: Perform word segmentation on the multiple answer materials to obtain multiple words; The multiple words are matched with the sentiment tendency word library of the target user group to obtain the sentiment tendency words of the external users in the multiple answer materials.

5. The automatic evaluation method of a large model question answering system according to claim 1, characterized in that: Also includes: Taboo words are added to the sentiment tendency word library of multiple user groups, and the weights of the taboo words are set.

6. An automatic evaluation system for a large model question answering system, characterized in that: include: An acquisition module, used to acquire multiple answer materials output by the question-answering model and the matching degree of the multiple answer materials, and to acquire user information of an external user, wherein the multiple answer materials are generated by the question-answering model based on the question text input by the external user; A feature extraction module, used to extract user features from the user information; A classification module is used to determine the target user group of the external user and the emotional tendency word library of the target user group from a pre-established user word library based on the user characteristics, wherein the user word library includes emotional tendency word libraries of multiple user groups, and the emotional tendency word library includes multiple emotional tendency words and weights of multiple emotional tendency words; a method for constructing the user word library comprises: obtaining historical question and answer data and user information of multiple users, wherein the historical question and answer data includes one or more groups of question and answer pairs of multiple users, and each group of question and answer pairs includes a question text, an answer text, and a re-question text; clustering multiple users based on the user characteristics in the user information to obtain multiple user groups and historical question and answer data of multiple user groups; The sentiment annotation is performed on the re-question text corresponding to each user group to obtain the sentiment state of the re-question text, and the sentiment state of the re-question text is used as the sentiment state of the corresponding answer text, wherein the sentiment state is divided into positive, negative and neutral; entity extraction is performed on multiple answer texts to obtain multiple entity words; the i-th entity word whose occurrence frequency exceeds the preset frequency threshold is used as the target word W i , and based on all the words containing the target word W i The emotional state of the answer text determines the target word W i weight; based on the weight of the target word, the target word is screened to obtain the sentiment tendency word, and a user word library is constructed based on the sentiment tendency words of multiple user groups and the weights of the sentiment tendency words; based on all the words containing the target word W i The emotional state of the answer text determines the target word W i The weight of the target word W i The emotional state of the t-th answer text is assigned to the corresponding target word W i , get the target word W i The emotional state value Among them, the target word W i When the emotional state is positive, Target word W i When the emotional state is classified as negative, Target word W i When the emotional state is classified as neutral, Based on the target word W i All emotional state values Calculate the target word W i Weight The target word W i Weight The mathematical expression is: Where n is the number of words containing the target word W i The number of answer texts; determining the target user group of the external user and the emotional tendency word library of the target user group from the pre-established user word library based on the user characteristics, including: determining the user group and the emotional tendency word library of the user group corresponding to each characteristic factor of the user characteristics from the pre-established user word library; merging the emotional tendency word libraries of all user groups to obtain the emotional tendency word library of the target user group; A matching module, used for matching the plurality of answer materials with the sentiment tendency word library of the target user group; A scoring module is used to score the multiple answer materials based on the matching degree of the multiple answer materials and the emotional tendency words when there are emotional tendency words matching the emotional tendency word library in the multiple answer materials; scoring the multiple answer materials based on the matching degree of the multiple answer materials and the emotional tendency words, including: determining the emotional tendency word W′ i The sentiment state M(W′) in multiple answer materials i ), where M(W′ i )=1; when the emotional state is negative, M(W′ i )=-1; when the emotional state is neutral, M(W′ i )=0; based on sentiment word W′ i The weight G(W′ i ), sentiment word W′ i The sentiment state M(W′) in multiple answer materials i ) and the matching degree of the multiple answer materials to score the multiple answer materials, and the mathematical expression of the score S(A) is: S(A)=α×MD(A)+β×ΣG(W′ i )×M(W′ i ) In the formula, α is the first weight, β is the second weight, and MD(A) is the matching degree of answer material A.