Question recommendation model training method and question recommendation method

By encoding and similarity calculation of user information, question information and scenario information, the question recommendation model is trained, and the problem of insufficient recommendation in the existing technology is solved, and accurate question recommendation in the dynamic open world is achieved.

CN120179905APending Publication Date: 2025-06-20ZHEJIANG TONGYUAN ZHIHUI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510286683.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing recommendation algorithm is not suitable for the dynamic open world, resulting in insufficient accurate recommendations for the question.

Method used

By obtaining user information, question information and scene information, these information are encoded separately, the first similarity between the question and the scene and the second similarity between the question, scene, and users are calculated, and the question recommendation model is trained based on these similarities.

Benefits of technology

It has achieved accurate recommendations for questions in a dynamic open world, meeting the dynamic characteristics of the open world and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179905A_ABST
    Figure CN120179905A_ABST
Patent Text Reader

Abstract

The invention discloses a question recommendation model training method and a question recommendation method, which are applied to the field of question recommendation and comprise the following steps: acquiring user information, question information and scene information for training; coding the user information, the question information and the scene information to obtain respective corresponding coding vectors; respectively calculating a first similarity between the question and the scene and a second similarity among the question, the scene and the user according to the coding vectors; and training the question recommendation model according to the first similarity and the second similarity to obtain a trained question recommendation model. According to the method, correlation calculation among multiple objects is realized, the similarity between the question and the user can be changed according to a dynamic scene, the dynamic characteristic of the open world is met, and the method is suitable for question recommendation of interactive question answering in the open world.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of question recommendation, and particularly to a method for training a question recommendation model and a question recommendation method. Background Art

[0002] The open world in a game allows players to interact with the scene and characters. During the interaction process, there will be quiz questions for users to answer. According to different operation requirements (such as scene fit, relative difficulty of questions), a recommendation system is required to provide corresponding questions. Currently, the similarity metrics based on the recommendation algorithm are relatively static. Usually, the static similarity between the items to be recommended is compared to determine the recommended object. However, the scenes in the open world are dynamic. Therefore, the existing recommendation methods are not directly applicable to the dynamic open world.

[0003] In summary, how to provide an accurate question recommendation method for the dynamic open world is an urgent problem to be solved currently. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method and device for training a question recommendation model, a method and device for question recommendation, an electronic device, and a storage medium, which solve the problem that the existing recommendation algorithm in the prior art is not applicable to the dynamic open world, that is, the recommendation is not accurate enough.

[0005] To solve the above technical problems, the present invention provides a method for training a question recommendation model, including:

[0006] Obtain user information, question information, and scene information for training;

[0007] Encode the user information, question information, and scene information respectively to obtain their corresponding encoded vectors;

[0008] Calculate the first similarity between the question and the scene, and the second similarity among the question, the scene, and the user respectively according to the encoded vectors;

[0009] Train the question recommendation model according to the first similarity and the second similarity to obtain a trained question recommendation model.

[0010] Optionally, encoding the user information, question information, and scene information respectively to obtain their corresponding encoded vectors includes:

[0011] Directly encode the user information and the question information to obtain a user encoded vector and a question encoded vector;

[0012] Use an encoder to encode the scene information to obtain a scene encoded vector.

[0013] Optionally, the scenario information is encoded using an encoder to obtain a scenario encoding vector, including:

[0014] The fully-connected layer of the encoder is used to encode the game character attributes and the scenario description of the scenario information respectively to obtain a game character attribute encoding vector and a scenario description encoding vector;

[0015] The convolutional layer of the encoder is used to encode the scenario image of the scenario information to obtain a scenario image encoding vector;

[0016] The game character attribute encoding vector, the scenario description encoding vector, and the scenario image encoding vector are concatenated to obtain the scenario encoding vector.

[0017] Optionally, the first similarity between the question and the scenario, and the second similarity between the question, the scenario, and the user are calculated respectively according to the encoding vector, including:

[0018] The first similarity formula is expressed as:

[0019] ;

[0020] The second similarity formula is expressed as:

[0021] ;

[0022] Among them, represents the distance, that is, the first similarity; represents the question; represents the question encoding vector; represents the scenario; represents the scenario encoding vector; represents the difficulty, that is, the second similarity; represents the user encoding vector.

[0023] Optionally, the loss function during the training of the question recommendation model is:

[0024] ;

[0025] represents the user encoding vector; represents the question encoding vector; represents the scenario encoding vector; , , represent parameters; represents the distance, that is, the first similarity; represents the difficulty, that is, the second similarity; represents the encoder, represents the encoder parameters; Denote all users for training, Denote all questions for training; Denote all scenarios for training; Denote a preset target difficulty, Denote a preset target distance.

[0026] The present invention also provides a question recommendation method, including:

[0027] Obtain scenario information and user information in the current scenario;

[0028] Obtain a question recommendation model obtained by using the above-mentioned question recommendation model training method;

[0029] Input the scenario information and the user information into the question recommendation model, and output the recommended target question.

[0030] The present invention also provides a question recommendation model training device, including:

[0031] A training information acquisition module, configured to obtain user information, question information, and scenario information for training;

[0032] An encoding module, configured to encode the user information, the question information, and the scenario information respectively to obtain respective corresponding encoding vectors;

[0033] A similarity calculation module, configured to calculate a first similarity between a question and a scenario, and a second similarity among a question, a scenario, and a user respectively according to the encoding vectors;

[0034] A model training module, configured to train a question recommendation model according to the first similarity and the second similarity to obtain a trained question recommendation model.

[0035] The present invention also provides a question recommendation device, including:

[0036] A current information acquisition module, configured to obtain scenario information and user information in the current scenario;

[0037] A question recommendation model acquisition module, configured to obtain a question recommendation model obtained by using the above-mentioned question recommendation model training method;

[0038] A target question determination module, configured to input the scenario information and the user information into the question recommendation model, and output the recommended target question.

[0039] The present invention also provides an electronic device, including:

[0040] A memory, configured to store a computer program;

[0041] A processor, which is configured to implement the steps of the above-mentioned question recommendation model training method and / or question recommendation method when executing the computer program.

[0042] The present invention also provides a storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the steps of the above-mentioned question recommendation model training method and / or question recommendation method are implemented.

[0043] It can be seen that the present invention obtains user information, question information, and scenario information for training; encodes the user information, question information, and scenario information respectively to obtain their corresponding encoded vectors; calculates the first similarity between the question and the scenario, and the second similarity among the question, the scenario, and the user respectively according to the encoded vectors; trains the question recommendation model according to the first similarity and the second similarity to obtain a trained question recommendation model. The present invention realizes the correlation calculation between multiple objects, and the similarity between the question and the user can change according to the dynamic scenario, meeting the dynamic characteristics of the open world and being applicable to question recommendation for open world interactive answering.

[0044] In addition, the present invention also provides a question recommendation model training device, a question recommendation method and device, an electronic device, and a storage medium, which also have the above-mentioned beneficial effects. Description of the Drawings

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0046] Figure 1 It is a flowchart of a question recommendation model training method provided by an embodiment of the present invention;

[0047] Figure 2 It is an encoding example diagram provided by an embodiment of the present invention;

[0048] Figure 3 It is a model training example diagram provided by an embodiment of the present invention;

[0049] Figure 4 It is a flowchart of a question recommendation method provided by an embodiment of the present invention;

[0050] Figure 5 It is a process example diagram of a question recommendation method provided by an embodiment of the present invention;

[0051] Figure 6 Schematic diagram of a question recommendation model training device provided by an embodiment of the present invention;

[0052] Figure 7 Schematic diagram of a question recommendation device provided by an embodiment of the present invention;

[0053] Figure 8 Schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0055] The open world in a game enables players to interact with the scene and characters. During the interaction process, there will be quiz questions for users to answer. According to different operation requirements (such as scene fit and relative difficulty of questions), a recommendation system is required to provide corresponding questions. There are many existing recommendation algorithms and existing solutions, such as collaborative filtering, FM (Factorization Machines algorithm is a machine learning algorithm specifically used to process high-dimensional sparse data, widely used in recommendation systems, classification, and regression tasks), DeepFM (Factorization Machines algorithm), two-tower, matrix factorization, association rules, time series, etc. However, the similarity metrics based on the above-mentioned recommendation algorithms are relatively static. Usually, it is a static similarity between directly recommended items and is not directly applicable to the open world. Therefore, the present invention provides a recommendation model. For the specific question recommendation model training method, please refer to Figure 1 , Figure 1 Flowchart of a question recommendation model training method provided by an embodiment of the present invention. The method may include:

[0056] S101: Obtain user information, question information, and scene information for training.

[0057] In this embodiment, no specific content limitations are imposed on the user information, question information, and scene information. Users can set the specific content of each piece of information for model training according to actual needs. The question recommendation model in this embodiment is applied to an open-world quiz game. The user information is the player information of the open-world quiz game, the question information is the questions recommended by the open question-and-answer system to the players, and the scene information is the player scene in the open-world quiz game.

[0058] S102: Encode the user information, question information, and scenario information respectively to obtain their corresponding encoding vectors.

[0059] In this embodiment, the various information used for training is encoded. The purpose is to hope to obtain content that meets the relevance requirements through some search operations.

[0060] This embodiment does not limit the encoding method. In order to improve the training efficiency while ensuring the accuracy of model training, further, the above-mentioned encoding of the user information, question information, and scenario information respectively to obtain their corresponding encoding vectors may specifically include the following steps:

[0061] Step 21: Directly encode the user information and question information to obtain a user encoding vector and a question encoding vector;

[0062] Step 31: Use an encoder to encode the scenario information to obtain a scenario encoding vector.

[0063] Specifically, for the encoding methods of the user information, question information, and scenario information, reference can be made to Figure 2 . Figure 2 This is an encoding example diagram provided by an embodiment of the present invention. In this embodiment, the encoding methods for the user information and question information adopt a direct method, that is, directly set the encoding vectors of the user information and question information as vectors to be learned, without encoding through an encoder. The user encoding vector and the question encoding vector are respectively denoted as representing the dimension of the space. The encoding method of the scenario information adopts an indirect method, that is, through embedding by an encoder, and through a trainable encoder encode the scenario into the same space as the user and question.

[0064] This embodiment does not limit the indirect encoding method of the scenario information. In order to improve the accuracy of model training, further, the above-mentioned use of an encoder to encode the scenario information to obtain a scenario encoding vector may specifically include the following steps:

[0065] Step 311: Use the fully connected layer of the encoder to encode the game character attributes and scenario descriptions of the scenario information respectively to obtain a game character attribute encoding vector and a scenario description encoding vector;

[0066] Step 312: Use the convolutional layer of the encoder to encode the scenario image of the scenario information to obtain a scenario image encoding vector;

[0067] Step 313: Concatenate the game character attribute encoding vector, the scenario description encoding vector, and the scenario image encoding vector to obtain a scenario encoding vector.

[0068] Specifically, for the specific encoding method of the scenario information, reference can be made toFigure 2 The encoder has multiple inputs, including (1) the attribute information of game characters (NPCs, non-player characters), such as NPC gender, age, height, occupation, etc.; (2) the description information of the environment, such as the basic description of the constructed scene units, which is usually relatively rough, such as TV, grassland, podium, waterfall, etc.; (3) the image information of the environment, and convolutional layers are used for feature extraction (selecting U-net, which is a deep learning model specifically for image segmentation tasks and is especially widely used in the field of biomedical image processing) to obtain detailed environmental information. The specific encoding process is as described in steps 311 to 313 above. Among them, during the splicing process, specifically: the encoded vectors of game character attributes, scene descriptions, and scene images are spliced to obtain an encoded scene vector; or after splicing, the spliced vector is further encoded using the transform of the encoder (Transformer is a basic architecture that processes sequence data through self-attention mechanisms) to obtain a scene encoding vector.

[0069] S103: Calculate the first similarity between the question and the scene, and the second similarity among the question, the scene, and the user respectively according to the encoding vectors.

[0070] In this embodiment, the first similarity and the second similarity are calculated based on the user encoding vector, the scene encoding vector, and the question encoding vector obtained in step S102. Among them, the first similarity refers to the similarity between the question and the scene, which can be specifically calculated through the Euclidean distance between vectors, so the first similarity can also be referred to as the distance. The second similarity refers to the similarity among the question, the scene, and the user. Due to the interference of the scene, the difficulty of the same question for the same user in different scenes is also different. Usually, the difficulty is generally lower in the relevant scene (the scene can often provide some valuable auxiliary information), so the second similarity refers to the difficulty.

[0071] Furthermore, the above-mentioned steps of calculating the first similarity between the question and the scene, and the second similarity among the question, the scene, and the user respectively according to the encoding vectors may specifically include the following steps:

[0072] The formula for the first similarity is expressed as:

[0073] ;

[0074] The formula for the second similarity is expressed as:

[0075] ;

[0076] Among them, represents the distance, that is, the first similarity; represents the question; Represents the question encoding vector; Represents the scenario; Represents the scenario encoding vector; Represents the difficulty, i.e., the second similarity; Represents the user encoding vector.

[0077] Specifically, from the first similarity formula, it can be seen that the smaller the distance, the higher the similarity between the question and the scenario. It should be noted that the question is a multiple-choice question, that is, the question includes the stem and options. Therefore, the answer result of the question only has two values: right and wrong. Therefore, the second similarity, that is, the difficulty has an upper limit that is independent of the question vector (does not change with the change of the question vector), rather than being able to reach an infinitely large situation. Based on the above analysis, the specific definition of the difficulty is expressed by the above second similarity formula, that is, the difference between the distance of question-user and the distance of scenario-user. According to the triangle inequality of the norm (geometrically expressed as the difference between two sides is less than the third side), the upper limit of this difficulty H is dist(user,scene).

[0078] S104: Train the question recommendation model according to the first similarity and the second similarity to obtain the trained question recommendation model.

[0079] In this embodiment, the question recommendation model is trained based on the above first similarity and second similarity. To ensure the accuracy of model training, the loss function requires the following points at the same time: (1) The sizes of the user encoding vector, the question encoding vector, and the scenario encoding vector need to be restricted; (2) The similarity between the question and the scenario (i.e., the first similarity ) should be as accurate as possible; (3) The user-scenario-question ternary difficulty (i.e., the second similarity ) should be as accurate as possible. Therefore, the loss function of the question recommendation model during training is defined as:

[0080] ;

[0081] Represents the user encoding vector; Represents the question encoding vector; Represents the scenario encoding vector; , , Represents the parameter; Represents the distance, i.e., the first similarity; Represents the difficulty, i.e., the second similarity; Represents the encoder, Represents the encoder parameter; Represents all users for training, Represents all questions for training; Represents all scenarios for training; representing a preset target difficulty, representing a preset target distance.

[0082] Specifically, reference can be made to Figure 3 , Figure 3 , which is an example diagram of model training provided by an embodiment of the present invention. It can be understood that for model training, there is a supervision value, that is, the preset target difficulty in the loss function and the preset target distance . Specifically, the preset target distance can be manually marked, and the preset target difficulty can be obtained from the user's answering data. Since the answer results are only right or wrong, 0 and C (C>0) can be used as the possible values of the training target h (the predicted h after training is not 0 and C). When the supervision values (that is, and ) are both generated, training the entire model is to train the user encoding vector , the question encoding vector and the encoder to minimize the loss function L.

[0083] This embodiment can calculate respectively by using gradient descent. When the model training is completed, a question recommendation model based on the association relationship between users, questions, and scenarios can be obtained. Specifically, the corresponding relationship between the user encoding vector , the question encoding vector and the scenario encoding vector s, where the scenario encoding vector s is obtained from the encoder parameters obtained by model training, so as to recommend target questions to target users in the target scenario.

[0084] Applying the question recommendation model training method provided by the embodiment of the present invention, by obtaining user information, question information, and scenario information for training; encoding the user information, question information, and scenario information respectively to obtain their corresponding encoding vectors; calculating the first similarity between the question and the scenario, and the second similarity between the question, the scenario, and the user according to the encoding vectors; training the question recommendation model according to the first similarity and the second similarity to obtain a trained question recommendation model. The present invention realizes the correlation calculation between multiple objects, and the similarity between the question and the user can change according to the dynamic scenario, meeting the dynamic characteristics of the open world and being applicable to the question recommendation of open world interactive answering. Moreover, the calculation of difficulty solves the problem of the theoretical upper limit of difficulty, and there is no need to specifically constrain it through a penalty term. The difficulty design method fully reflects the idea that the difficulty of a question for a user is not constant, and the difficulty is described by the objective data of the possibility of answering wrong rather than the subjective difficulty description.

[0085] The present invention also provides a question recommendation method. For details, please refer to Figure 4 , Figure 4 which is a flowchart of a question recommendation method provided by an embodiment of the present invention. The method may include:

[0086] S201: Obtain the scene information and user information in the current scene.

[0087] It should be noted that the system pre - installs recommendation conditions, and the recommendation conditions are the difficulty level of the questions in the question recommendation model in the Q&A mode and the similarity between the questions and the scene. Under the recommendation conditions, based on the scene information and user information in the current scene, the most matching and appropriate questions are recommended. For example, when a user encounters an NPC player in a certain scene in the open world and triggers the Q&A mode according to the game mechanism, the recommendation terminal can obtain the scene information and user information in the current scene, and recommend the best questions at present based on the pre - installed recommendation conditions. It can be understood that the recommendation conditions in this embodiment can be modified according to the actual situation.

[0088] S202: Obtain the question recommendation model obtained by using the above - mentioned question recommendation model training method.

[0089] The purpose of this step is to obtain the question recommendation model obtained by using the question recommendation model training method.

[0090] S203: Input the scene information and user information into the question recommendation model, and output the recommended target questions.

[0091] In this embodiment, the scene information and user information obtained in step S201 are input into the question recommendation model, so that the question recommendation model encodes the scene information and user information to obtain a user encoding vector and a scene encoding vector, and searches in the question bank based on the user encoding vector and the scene encoding vector to determine the recommended target questions. Specifically, the user information can be directly encoded, and the trained encoder (i.e., the encoder obtained by the trained encoder parameters is used to encode the scene information to obtain a scene encoding vector. The scene information may include NPC attributes, scene descriptions, and scene screenshots.

[0092] Furthermore, the parameters of the question recommendation model, including the user encoding vector, the question encoding vector, and the scene encoder parameters, can be updated every once in a while (for example, once a day).

[0093] Applying the question recommendation method provided by the embodiments of the present invention, by obtaining the scene information and user information in the current scene; obtaining the question recommendation model obtained by using the above-mentioned question recommendation model training method; inputting the scene information and user information into the question recommendation model, and outputting the recommended target questions. The present invention realizes the correlation calculation between multiple objects, and the similarity between the questions and the user can be changed according to the dynamic scene, meeting the dynamic characteristics of the open world, and is applicable to the question recommendation for open world interactive answering. Applying this question recommendation model realizes the accurate recommendation of the best questions to users in various scenes, bringing a good user experience.

[0094] For the convenience of understanding the present invention, please specifically refer to Figure 5 , Figure 5 which is a flowchart example of a question recommendation method provided by an embodiment of the present invention, and specifically may include:

[0095] When a user encounters an NPC player in a certain scene in the open world, the question-and-answer mode will be triggered according to the game mechanism. The question-and-answer system will put forward the requirements for questions, mainly including two points: (1) the matching degree range between the question and the scene, that is, the distance; (2) the difficulty of the question in the current state (relative to the user-scene). The recommendation system will give appropriate questions according to the requirements first. The game end will send the user's ID (user identifier), NPC attributes, description information of the scene, and scene screenshot Figure 1 to the recommendation system, and the recommendation system will perform the following tasks: (1) obtain the user vector of the user according to the user's id; (2) use the scene encoder to encode the NPC attributes, description information of the scene, and scene screenshot into a scene vector; (3) screen out the questions that meet the difficulty conditions according to the question-scene correlation formula D and difficulty calculation formula H in the question bank, and submit the obtained questions to the game end.

[0096] Next, the question recommendation model training device provided by the embodiments of the present invention will be introduced. The question recommendation model training device described below can be correspondingly referred to the question recommendation model training method described above.

[0097] Please specifically refer to Figure 6 , Figure 6 which is a structural schematic diagram of a question recommendation model training device provided by an embodiment of the present invention, and may include:

[0098] A training information acquisition module 100, configured to acquire user information, question information, and scene information for training;

[0099] An encoding module 200, configured to encode the user information, question information, and scene information respectively to obtain their corresponding encoding vectors;

[0100] A similarity calculation module 300, configured to calculate a first similarity between a question and a scenario, and a second similarity among the question, the scenario, and the user respectively according to the encoding vectors;

[0101] A model training module 400, configured to train a question recommendation model according to the first similarity and the second similarity, and obtain a trained question recommendation model.

[0102] Based on the above embodiments, the encoding module 200 may include:

[0103] A direct encoding unit, configured to directly encode the user information and the question information to obtain a user encoding vector and a question encoding vector;

[0104] An indirect encoding unit, configured to encode the scenario information by using an encoder to obtain a scenario encoding vector.

[0105] Based on the above embodiments, the indirect encoding unit may include:

[0106] A first encoding subunit, configured to respectively encode the game character attributes and the scenario description of the scenario information by using the fully connected layer of the encoder to obtain a game character attribute encoding vector and a scenario description encoding vector;

[0107] A second encoding subunit, configured to encode the scenario image of the scenario information by using the convolutional layer of the encoder to obtain a scenario image encoding vector;

[0108] A splicing unit, configured to splice the game character attribute encoding vector, the scenario description encoding vector, and the scenario image encoding vector to obtain the scenario encoding vector.

[0109] Based on any of the above embodiments, the similarity calculation module 300 may include:

[0110] A first similarity calculation unit, configured to calculate the first similarity according to a first similarity formula, and the first similarity formula is expressed as:

[0111] ;

[0112] A second similarity calculation unit, configured to calculate the second similarity according to a second similarity formula, and the second similarity formula is expressed as:

[0113] ;

[0114] Wherein, represents a distance, that is, the first similarity; represents a question; Represents the question coding vector; Represents the scenario; Represents the scenario coding vector; Represents the difficulty, i.e., the second similarity; Represents the user coding vector.

[0115] Based on the above embodiments, the model training module 400 may include:

[0116] The loss function calculation unit is used to calculate the loss value of the question recommendation model during the training process according to the loss function, and the loss function is:

[0117] ;

[0118] Represents the user coding vector; Represents the question coding vector; Represents the scenario coding vector; 、 、 Represents a parameter; Represents the distance, i.e., the first similarity; Represents the difficulty, i.e., the second similarity; Represents the encoder, Represents the encoder parameter; Represents all users for training, Represents all questions for training; Represents all scenarios for training; Represents the preset target difficulty, Represents the preset target distance.

[0119] It should be noted that the modules and units in the above question recommendation model training device can be changed in order before and after without affecting the logic.

[0120] Applying the topic recommendation model training device provided by the embodiments of the present invention, through the training information acquisition module 100, which is used to acquire user information, topic information, and scenario information for training; the encoding module 200, which is used to encode the user information, topic information, and scenario information respectively to obtain their corresponding encoding vectors; the similarity calculation module 300, which is used to calculate the first similarity between the topic and the scenario, and the second similarity among the topic, scenario, and user respectively according to the encoding vectors; the model training module 400, which is used to train the topic recommendation model according to the first similarity and the second similarity to obtain a trained topic recommendation model. This device realizes the correlation calculation between multiple objects. The similarity between the topic and the user can change according to the dynamic scenario, meeting the dynamic characteristics of the open world and being applicable to topic recommendation for open world interactive answering. Moreover, the calculation of difficulty solves the problem of the theoretical upper limit of difficulty and does not require special constraints through penalty terms. The design method of difficulty fully reflects the idea that the difficulty of a topic for a user is not fixed, and the difficulty is described by the objective data of the possibility of answering wrongly rather than the subjective description of difficulty.

[0121] The topic recommendation device provided by the embodiments of the present invention will be introduced below. The topic recommendation device described below can be correspondingly referred to the topic recommendation method described above.

[0122] Specifically, please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a topic recommendation device provided by the embodiments of the present invention and may include:

[0123] The current information acquisition module 500, which is used to acquire scenario information and user information in the current scenario;

[0124] The topic recommendation model acquisition module 600, which is used to acquire the topic recommendation model obtained by using the above-mentioned topic recommendation model training method;

[0125] The target topic determination module 700, which is used to input the scenario information and the user information into the topic recommendation model and output the recommended target topic.

[0126] It should be noted that the order of the modules and units in the above-mentioned topic recommendation device can be changed before and after without affecting the logic.

[0127] Applying the topic recommendation device provided by the embodiments of the present invention, through the current information acquisition module 500, which is used to acquire the scene information and user information in the current scene; the topic recommendation model acquisition module 600, which is used to acquire the topic recommendation model obtained by using the above-mentioned topic recommendation model training method; the target topic determination module 700, which is used to input the scene information and the user information into the topic recommendation model and output the recommended target topic. This device realizes the correlation calculation between multiple objects, and the similarity between the topic and the user can change according to the dynamic scene, meeting the dynamic characteristics of the open world. It is applicable to the topic recommendation for open world interactive answering. Applying this topic recommendation model realizes the accurate recommendation of the best topics for users in various scenes, bringing a good user experience.

[0128] Next, the electronic device provided by the embodiments of the present invention will be introduced. The electronic device described below can be correspondingly referred to the above-mentioned topic recommendation model training method and / or topic recommendation method.

[0129] Please refer to Figure 8 , Figure 8 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present invention, may include:

[0130] A memory 10, which is used to store computer programs;

[0131] A processor 20, which is used to execute the computer program to implement the above-mentioned topic recommendation model training method and / or topic recommendation method.

[0132] The memory 10, the processor 20, and the communication interface 31 all complete the communication with each other through the communication bus 32.

[0133] In the embodiments of the present invention, the memory 10 is used to store one or more programs. The program may include program codes, and the program codes include computer operation instructions. In the embodiments of the present invention, the memory 10 may store programs for implementing the following functions:

[0134] Obtain user information, topic information, and scene information for training;

[0135] Encode the user information, topic information, and scene information respectively to obtain their corresponding encoded vectors;

[0136] Calculate the first similarity between the topic and the scene, and the second similarity among the topic, the scene, and the user respectively according to the encoded vectors;

[0137] Train the topic recommendation model according to the first similarity and the second similarity to obtain a trained topic recommendation model;

[0138] and / or;

[0139] Obtain the scene information and user information in the current scene;

[0140] Obtain the question recommendation model obtained by using the above-mentioned question recommendation model training method;

[0141] Input the scene information and user information into the question recommendation model, and output the recommended target questions.

[0142] In a possible implementation, the memory 10 may include a program storage area and a data storage area. Among them, the program storage area may store the operating system and application programs required for at least one function, etc.; the data storage area may store the data created during use.

[0143] In addition, the memory 10 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include NVRAM. The memory stores the operating system and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof. Among them, the operation instructions may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0144] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic devices. The processor 20 may be a microprocessor or any conventional processor, etc. The processor 20 may call the program stored in the memory 10.

[0145] The communication interface 31 may be an interface of a communication module for connecting to other devices or systems.

[0146] Of course, it should be noted that Figure 8 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include more or fewer components than Figure 8 shown, or combine some components.

[0147] Next, the storage medium provided by the embodiment of the present invention will be introduced. The storage medium described below may be correspondingly referred to the above-mentioned question recommendation model training method and / or question recommendation method.

[0148] The present invention also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned question recommendation model training method and / or question recommendation method are implemented.

[0149] The storage medium may be a computer-readable storage medium, which may include: various media capable of storing program codes such as USB flash drives, external hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0150] The embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0151] Those skilled in the art can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0152] Finally, it should also be noted that in this article, relationships such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device.

[0153] The above has introduced in detail a method and device for training a question recommendation model, a question recommendation method and device, an electronic device, and a storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A topic recommendation model training method, characterized in that: include: Obtain user information, topic information, and scenario information for training; Encode the user information, topic information and scene information respectively to obtain corresponding encoding vectors; Calculating a first similarity between the topic and the scene, and a second similarity between the topic, the scene, and the user, respectively, according to the encoding vector; The topic recommendation model is trained according to the first similarity and the second similarity to obtain a trained topic recommendation model.

2. The topic recommendation model training method according to claim 1, characterized in that: The user information, the topic information and the scene information are encoded respectively to obtain the corresponding encoding vectors, including: Directly encode the user information and the topic information to obtain a user encoding vector and a topic encoding vector; The scene information is encoded using an encoder to obtain a scene encoding vector.

3. The topic recommendation model training method according to claim 2, characterized in that: The scene information is encoded by using an encoder to obtain a scene encoding vector, including: Encoding the game character attributes and the scene description of the scene information respectively using the fully connected layer of the encoder to obtain a game character attribute encoding vector and a scene description encoding vector; Encoding the scene image of the scene information using the convolutional layer of the encoder to obtain a scene image encoding vector; The game character attribute coding vector, the scene description coding vector and the scene image coding vector are concatenated to obtain the scene coding vector.

4. The topic recommendation model training method according to any one of claims 1 to 3, characterized in that: Calculating the first similarity between the topic and the scene, and the second similarity between the topic, the scene, and the user respectively according to the encoding vector, including: The first similarity formula is expressed as: ; The second similarity formula is expressed as: ; in, represents the distance, i.e. the first similarity; Indicates the topic; represents the title encoding vector; Indicates a scene; represents the scene encoding vector; Indicates difficulty, i.e., the second similarity; Represents the user encoding vector.

5. The topic recommendation model training method according to claim 1, characterized in that: The loss function of the topic recommendation model during training is: ; represents the user encoding vector; represents the title encoding vector; represents the scene encoding vector; , , Represents parameters; represents the distance, i.e. the first similarity; Indicates difficulty, i.e., the second similarity; represents the encoder, Represents encoder parameters; represents all users used for training, Represents all the questions used for training; represents all scenes used for training; Indicates the difficulty of the preset target, Indicates the preset target distance.

6. A topic recommendation method, characterized in that: include: Get the scene information and user information of the current scene; Obtaining a topic recommendation model obtained by using the topic recommendation model training method described in any one of claims 1 to 5; The scenario information and the user information are input into the topic recommendation model, and a recommended target topic is output.

7. A topic recommendation model training device, characterized in that: include: A training information acquisition module is used to obtain user information, topic information and scenario information for training; An encoding module, used to encode the user information, topic information and scene information respectively to obtain corresponding encoding vectors; A similarity calculation module, used to calculate a first similarity between the topic and the scene, and a second similarity between the topic, the scene and the user according to the encoding vector; The model training module is used to train the topic recommendation model according to the first similarity and the second similarity to obtain a trained topic recommendation model.

8. A topic recommendation device, characterized in that: include: The current information acquisition module is used to obtain the scene information and user information of the current scene; A topic recommendation model acquisition module, used to obtain a topic recommendation model obtained by using the topic recommendation model training method according to any one of claims 1 to 5; The target topic determination module is used to input the scenario information and the user information into the topic recommendation model and output a recommended target topic.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the topic recommendation model training method and / or topic recommendation method as described in any one of claims 1 to 6 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores computer executable instructions, which, when loaded and executed by a processor, implement the steps of the topic recommendation model training method and / or topic recommendation method as described in any one of claims 1 to 6.