Virtual pet pluggable personality template generation system and method based on language model

Through a pluggable personality template generation system based on a language model, the problem of insufficient user long-term interaction adaptation in the virtual pet system is solved, a personalized and deeply customized virtual pet companionship experience is achieved, and emotional resonance and interaction quality are improved.

CN120806149APending Publication Date: 2025-10-17WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510911594.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-10-17

Smart Images

  • Figure CN120806149A_ABST
    Figure CN120806149A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual pet pluggable personality template generation system based on a language model, and the system dynamically generates a personalized virtual pet personality through a pluggable personality template library according to a user demand, an emotional state and long-term interaction data. The system supports a user to select various predefined templates or create personalized templates in a user-defined manner, and can adjust behaviors and dialogue styles of the virtual pet according to emotional changes of the user. According to the method, deep personalized accompanying experience can be provided for users of different age groups and different emotion requirements, and the method has a wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to artificial intelligence, natural language processing (NLP) and human-computer interaction technology, in particular to a virtual pet system which provides customized, emotional and all-age companionship functions by using large language models combined with pluggable personality templates. Through the system, users can have personalized and emotional interactive experiences with virtual pets, thereby enhancing the depth and long-term adaptability of emotional companionship. BACKGROUND

[0002] Virtual pet technology is one of the important applications in the field of artificial intelligence. Traditional virtual pets are mostly driven by pre-set scripts and lack flexible personalized adjustment capabilities. With the advancement of large language model technology, existing systems have gradually introduced higher intelligence, but still lack the ability to adapt to long-term interaction and the personalization of emotional style. SUMMARY

[0003] To solve the problem that existing virtual pet applications lack emotional resonance and tone adjustment, resulting in users not being able to obtain satisfactory emotional companionship experience, the present application provides a virtual pet pluggable personality template generation system and method based on a language model, which introduces a pluggable mechanism of personality templates to provide higher emotional resonance and adaptability for virtual pets, thereby improving the personalization and diversity of interactive experience.

[0004] According to one aspect of the present application, a virtual pet pluggable personality template generation system based on a language model is provided, comprising: a personality template library for storing a plurality of pre-defined or user-created virtual pet personality templates, each personality template containing at least one set of corresponding structured personality parameters; a personality parameter generator for extracting corresponding personality parameters from the personality template library based on template ID indexing according to the selected personality template, and constructing input prompts through pre-set principles; a context fusion module for receiving user input dialog content and generating composite input data through a fusion mechanism and a guarantee mechanism; a dialog generation module for driving a large language model to output personalized dialog responses in line with the target personality style based on the generated composite input data.

[0005] As a further technical solution, the personality template library is also used to execute the following instructions: input example dialog text, keyword preferences, label selection or pre-defined template initial parameters; perform word segmentation, part-of-speech tagging and sentiment analysis on the input content using natural language processing technology, extract lexical features and semantic patterns, and generate parameter frameworks combined with user-selected labels; The structured personality parameter set is stored in a personality template library in a JSON or relational database table structure, and each template corresponds to a unique identifier and a parameter version number.

[0006] As a further technical solution, the personality parameters include tone types, response styles, emotional characteristics, commonly used vocabularies, and interaction frequencies.

[0007] As a further technical solution, the personality parameter generator constructs input prompts according to the following preset principles: Parameter mapping principle: convert personality parameters into natural language instructions; Context adaptation principle: combine large language model prompt optimization technology, adjust the prompt structure through gradient descent algorithm, and ensure that the matching degree of tone and style instructions in the prompt with the personality template parameters is greater than or equal to a threshold value.

[0008] As a further technical solution, the personality parameter generator is also used to execute the following instructions: When the prompt contains all the core parameters of the template and is verified by the model pre-generation, the personality characteristics of the response content are highly matched by artificial annotation or clustering algorithm, and it is considered to be matched with the personality template.

[0009] As a further technical solution, the fusion mechanism includes: Semantic analysis: use a pre-trained model to perform sentiment analysis, intent recognition, and context entity extraction on user input text; Data splicing: splice the user input text, the parameter instructions of the current personality template, and the historical dialogue state vector according to a preset format to form a composite input data structure of "user input + personality template parameters + context features".

[0010] As a further technical solution, the ensuring mechanism includes: The composite input data contains real-time context features and template prior parameters, and the large language model learns the weight distribution of the two through end-to-end training, so that when generating a response: the real-time context feature weight is used to adapt to the current interaction context, and the template prior parameter weight is used to maintain personality consistency; Multi-round dialogue tracking is achieved by maintaining a dialogue state machine, continuously updating context features, and ensuring the coherence of personality expression in long-term interaction.

[0011] According to an aspect of the present application, a virtual pet pluggable personality template generation method based on a language model is provided, which includes: Store a plurality of predefined or user-created virtual pet personality templates, and each personality template contains at least one set of structured personality parameters corresponding thereto; According to the selected personality template, the corresponding personality parameters are extracted from the personality template library based on the template ID index, and the input prompt is constructed through a preset principle; Receiving the dialogue content input by the user, and generating composite input data through a fusion mechanism and a guarantee mechanism; Based on the generated composite input data, driving the large language model to output personalized dialogue responses in line with the target personality style.

[0012] According to an aspect of the present application, a virtual pet pluggable personality template generation device based on a language model is provided, comprising a memory and a processor, the memory storing program instructions executed by the processor, and the processor calling the program instructions to execute the virtual pet pluggable personality template generation method based on the language model.

[0013] According to an aspect of the present application, a non-transitory computer readable storage medium is provided, which stores computer instructions for executing the virtual pet pluggable personality template generation method based on the language model.

[0014] Compared with the prior art, the present application has the following advantages: 1. The virtual pet personality template generation system and method of the present application can realize personalized and deeply customized virtual pet companion experience by introducing a structured personality template library and a dynamic generation mechanism.

[0015] 2. The virtual pet personality template generation system and method of the present application can generate virtual pet behavior and reactions that meet individual requirements by analyzing users' emotional needs and long-term interaction data, thereby providing more considerate and demand-oriented emotional interaction. BRIEF DESCRIPTION OF DRAWINGS

[0016] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0017] Figure 1 A schematic diagram of a virtual pet pluggable personality template generation system based on a language model is provided for the embodiments of the present application.

[0018] Figure 2 A flowchart of a virtual pet pluggable personality template generation method based on a language model is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0019] The terms "comprise", "comprising", "include", "including", "have" and "having" and any variations thereof in the specification and in the claims are intended to cover both the express stated features or steps and also those that are equivalent or similar in that function, purpose or result, even if not expressly stated.

[0020] For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application. In addition, the technical features in each of the embodiments or in a single embodiment provided by the present application can be combined with each other in any manner to form new technical solutions, and the combination is not restricted by the order of steps and / or the mode of structural composition, but should be based on the fact that the technical solutions can be realized by those of ordinary skill in the art. When the combination of technical solutions appears to be contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, and is not within the scope of protection required by the present application.

[0021] The embodiments of the present application provide a virtual pet pluggable personality template generation system based on a language model, as shown in Figure 1 The system mainly includes four modules, namely, a personality template library, a personality parameter generator, a context fusion module and a dialogue generation module. The system can realize personalized and deep customized virtual pet companion experience by introducing a structured personality template library and a dynamic generation mechanism.

[0022] Specifically, the personality template library is used to store a plurality of predefined or user-created virtual pet personality templates, and each personality template includes at least one set of structured personality parameters corresponding thereto.

[0023] The personality template library includes predefined personality templates and user-defined templates, wherein the predefined templates at least include a gentle type, a humorous type, a teacher type, a listening type, a old friend type and a learning supervision type, and each personality template corresponds to different emotional tonality and expression style. The user can select and apply the corresponding personality template from the personality template library according to personal needs, or create a personalized personality template through a self-defined function. The user-defined template can inherit the parameter framework of the predefined template, or completely build a new parameter system.

[0024] The personality template supports user customization, including but not limited to: users can create new personality templates by inputting example conversations, providing keyword preferences, or selecting labels; the system automatically generates new personality templates based on user input example conversations and preferences, and users can adjust parameters such as emotional fluctuations, tone intensity, and humor level through slider adjustments, numerical inputs, or drop-down selections. Among them: (a) The personality parameters are expressed through quantitative data models, as follows: ① Tone type: use enumeration values (such as "mild", "lively", "serious") combined with tone intensity coefficients (0-1 numerical values); ② Response style: quantified through text feature vectors (such as short sentence proportion, emoji frequency, rhetorical type labels); ③ Emotional characteristics: build an emotional vector based on an emotional dictionary (such as happiness, anger, and intimacy scores in 0-100 dimensions); ④ Common vocabulary: establish a word frequency list and semantic category labels (such as high-frequency colloquial words and professional domain vocabulary); ⑤ Interaction frequency: defined as the probability of active response per unit time (such as a 30% response probability every 10 minutes).

[0025] (b) The data flow in the background is as follows: ① Input data: example conversation text input by the user, keyword preferences, label selection, or predefined template initial parameters; ② Processing process: use natural language processing (NLP) techniques to perform word segmentation, part-of-speech tagging, and sentiment analysis on example conversations, extract lexical features and semantic patterns, and generate parameter frameworks combined with user-selected labels; ③ Output results: structured personality parameter set, stored in the personality template library in JSON or relational database table structure, each template corresponding to a unique identifier (ID) and parameter version number.

[0026] Specifically, the personality parameter generator is used to extract the corresponding personality parameters from the personality template library based on the template ID index according to the selected personality template, and construct the input prompt (Prompt) through the following principles: ① Parameter mapping principle: convert personality parameters into natural language instructions, such as "use a light and humorous tone, include 1-2 double entendres in each response, and use appropriate emojis"; ② Context adaptation principle: combine large language model prompt optimization techniques (such as few-shot learning, parameter weighting), adjust the prompt structure through gradient descent algorithm to ensure that the tone and style instructions in the prompt match the personality template parameters by ≥ 90% (tested through pre-trained model validation set).

[0027] The personality parameter generator extracts the following personality parameters: according to the template ID, queries the database, and obtains the personality template parameters of the template, such as the "emotion characteristics (happiness degree 80, surprise degree 30)" and "response style (puns weight 0.6, emoji frequency high)" parameters of the "humorous type" template.

[0028] When extracting personality parameters, the matching standard is: when the prompt contains all the core parameters of the template (such as tone type, response style main feature) and the model pre-generation verification is passed, the personality characteristics of the response content are determined to be "highly matched" by artificial annotation or clustering algorithm, and it is considered to be matched with the personality template.

[0029] The personality parameter generator is based on the prompt optimization technology of large language model, which adjusts the tone, style and emotional fluctuation of the model generated response through optimization algorithm, so as to meet the personalized characteristics of the selected personality template; using natural language processing (NLP) technology, the emotional tendency and key elements are extracted from the user input dialogue, and the personalized template conforming to the situation is generated combined with these information.

[0030] Specifically, the context fusion module is used to receive the user input dialogue content and generate composite input data in the following way: (a) fusion mechanism: ① Semantic analysis: using pre-trained models such as BERT to analyze the emotional tendency of user input text (such as positive / negative / neutral emotion score), intent recognition (such as inquiry, confession, instruction) and context entity extraction (such as keywords, time, place); ② Data splicing: splicing user input text, current personality template parameter instruction (such as "humorous type template tone coefficient 0.7"), historical dialogue state vector (such as the emotional trend of the last 3 rounds of dialogue) according to the preset format, forming the composite input data structure of "user input + personality template parameter + context feature".

[0031] (b) ensure mechanism: ① The composite input data contains real-time context features (semantic, emotional, and intent of the user's current dialogue) and template prior parameters (personality inherent tone, style, and vocabulary constraints) at the same time. The large language model learns the weight distribution of the two through end-to-end training, so that when generating response: the context feature weight is used to adapt to the current interactive situation (such as responding to information needs when the user asks), and the personality template parameter weight is used to maintain personality consistency (such as always using the humorous type template pun style); ② Multi-round dialogue tracking is realized by maintaining dialogue state tracker, which continuously updates the context features to ensure the coherence of personality expression in long-term interaction.

[0032] The context fusion module performs semantic analysis on the user input text, identifies emotions, context and intent, and further adjusts the expression style of the personality template; the context fusion module supports context tracking based on multi-round dialogue, so that the virtual pet maintains individuality and consistency in long-term interaction; context tracking is realized by storing dialogue history vectors, and the history vectors contain semantic features and emotion labels of the last N rounds of dialogue (N≥3).

[0033] Specifically, the dialogue generation module is configured to drive the large language model to output an individualized dialogue response in line with the target personality style based on the generated composite input data.

[0034] The system of the present application example pays special attention to user data privacy, and supports users to view, delete or encrypt the storage of personality templates and interaction records at any time. The individualized data of each user is strictly protected to ensure security and privacy.

[0035] Based on the same inventive concept as the foregoing embodiments, the embodiments of the present application also provide a virtual pet pluggable personality template generation method based on a language model, as shown in Figure 2 The method comprises the following steps: Step 1, store a plurality of predefined or user-created virtual pet personality templates, and each personality template contains at least one set of corresponding structured personality parameters.

[0036] In the step 1, a plurality of predefined personality templates are stored, which supports users to select, apply or customize personality templates according to needs. Each template contains a set of parameters such as emotional tone, tone style, interaction frequency, etc., to ensure that the virtual pet shows appropriate individualized features in different situations.

[0037] Step 2, according to the selected personality template, extract the corresponding personality parameters from the personality template library based on the template ID index, and construct the input prompt through the preset principle.

[0038] In the step 2, the prompt matching the selected template is generated and delivered to the large language model to generate a dialogue response meeting the user's needs.

[0039] Step 3, the user interacts with the pet, and the user interacts with the virtual pet by inputting (voice or text).

[0040] Step 4, receive the user input dialogue content, and generate composite input data through the fusion mechanism and the assurance mechanism.

[0041] In the step 4, the user input dialogue content is received, combined with the current emotional state, historical data and template parameters, and the response style is adjusted through intelligent algorithms to ensure that the virtual pet can naturally and smoothly carry out individualized dialogue.

[0042] Step 5, based on the generated composite input data, driving a large language model to output a personalized dialogue response conforming to the target personality style.

[0043] In the step 5, a large language model is used to generate a personalized dialogue response conforming to the user's needs and emotional state.

[0044] The method of the embodiment of the application can realize personalized and deeply customized virtual pet companion experience by introducing a structured personality template library and a dynamic generation mechanism. Moreover, by analyzing the emotional needs and long-term interaction data of the user, virtual pet behaviors and reactions conforming to the personalized requirements are generated, thereby providing more considerate and demand-conforming emotional interaction.

[0045] Based on the same inventive concept as the foregoing embodiments, the embodiment of the application also provides a virtual pet pluggable personality template generation device based on a language model, comprising a memory and a processor, the memory stores program instructions executed by the processor, and the processor invokes the program instructions to execute the virtual pet pluggable personality template generation method based on a language model.

[0046] In the embodiment of the application, the memory can be a non-volatile memory such as a hard disk (HDD) or a solid-state drive (SSD), etc., and can also be a volatile memory such as a random-access memory (RAM). The memory can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory in the embodiment of the application can also be a circuit or other any device capable of realizing a storage function, used for storing program instructions and / or data.

[0047] In the embodiment of the application, the processor can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can realize or execute the disclosed methods, steps and logic block diagrams in the embodiment of the application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiment of the application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0048] According to an aspect of the specification of the present application, a non-transitory computer readable storage medium is provided, which stores computer instructions for enabling the computer to perform the language model-based virtual pet pluggable personality template generation method, the steps of which are as follows: a plurality of predefined or user-created virtual pet personality templates are stored, each personality template containing at least one set of corresponding structured personality parameters; According to the selected personality template, the corresponding personality parameters are extracted from the personality template library based on the template ID index, and the input prompt is constructed through a preset principle; Receiving user input dialog content, and generating composite input data through fusion mechanism and ensuring mechanism; Based on the generated composite input data, driving the large language model to output personalized dialog response conforming to the target personality style.

[0049] In summary, the present application provides a virtual pet personality template generation system and method based on a large language model, which dynamically generates personalized virtual pet personalities through a pluggable personality template library according to user needs, emotional states and long-term interaction data; supports user selection of multiple predefined templates or self-defined personalized templates, and can adjust the behavior and dialogue style of the virtual pet according to the emotional changes of the user. The present application can provide a deep personalized companion experience for users of different age groups and emotional needs, and has a wide application prospect.

[0050] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the present application.

Claims

1. A system for generating pluggable personality templates for virtual pets based on a language model, characterized in that: include: A personality template library, used to store multiple predefined or user-created virtual pet personality templates, each personality template containing at least one set of structured personality parameters corresponding thereto; A personality parameter generator is used to extract corresponding personality parameters from the personality template library based on the template ID index according to the selected personality template, and to construct input prompts according to preset principles; The context fusion module is used to receive the conversation content input by the user and generate composite input data through the fusion mechanism and the assurance mechanism; The dialogue generation module is used to drive the large language model to output personalized dialogue responses that match the target personality style based on the generated composite input data.

2. A virtual pet pluggable personality template generation system based on a language model according to claim 1, characterized in that: The personality template library is also used to execute the following instructions: Enter sample conversation text, keyword preferences, tag selections, or predefined template initial parameters; Use natural language processing technology to perform word segmentation, part-of-speech tagging, and sentiment analysis on the input content, extract lexical features and semantic patterns, and generate a parameter framework based on user-selected tags; The structured personality parameter set is stored in the personality template library in JSON or relational database table structure. Each template corresponds to a unique identifier and parameter version number.

3. A virtual pet pluggable personality template generation system based on a language model according to claim 2, characterized in that: The personality parameters include tone type, response style, emotional characteristics, common vocabulary and interaction frequency.

4. The system for generating a virtual pet pluggable personality template based on a language model according to claim 1, wherein: The personality parameter generator constructs the input prompts according to the following preset principles: Parameter mapping principle: convert personality parameters into natural language instructions; Contextual adaptation principle: Combined with large language model prompt optimization technology, the prompt structure is adjusted through the gradient descent algorithm to ensure that the tone and style instructions in the prompt match the personality template parameters greater than or equal to the threshold.

5. A system for generating a pluggable personality template for a virtual pet based on a language model according to claim 4, characterized in that: The personality parameter generator is further used to execute the following instructions: When the prompt contains all the core parameters of the template and is verified by the model pre-generation, and the personality characteristics of the response content are determined to be highly matched through manual annotation or clustering algorithm, it is considered to match the personality template.

6. The system for generating a virtual pet pluggable personality template based on a language model according to claim 1, characterized in that: The fusion mechanism includes: Semantic analysis: Use pre-trained models to perform sentiment analysis, intent recognition, and contextual entity extraction on user input text; Data splicing: The user input text, the parameter instructions of the current personality template, and the historical dialogue state vector are spliced ​​according to the preset format to form a composite input data structure of "user input + personality template parameters + context features".

7. A virtual pet pluggable personality template generation system based on a language model according to claim 6, characterized in that: The ensuring mechanism includes: The composite input data contains both real-time context features and template prior parameters. The large language model learns the weight distribution of the two through end-to-end training. When generating a response, the real-time context feature weights are used to adapt to the current interaction context, and the template prior parameter weights are used to maintain personality consistency. Multi-round dialogue tracking is achieved by maintaining a dialogue state machine, continuously updating context features, and ensuring the consistency of personality expression in long-term interactions.

8. A method for generating a pluggable personality template for a virtual pet based on a language model, characterized in that: include: Storing a plurality of predefined or user-created virtual pet personality templates, each personality template comprising at least one set of structured personality parameters corresponding thereto; According to the selected personality template, the corresponding personality parameters are extracted from the personality template library based on the template ID index, and the input prompt is constructed according to the preset principle; Receive the dialogue content input by the user and generate composite input data through fusion and assurance mechanisms; Based on the generated composite input data, the large language model is driven to output personalized dialogue responses that match the target personality style.

9. A device for generating pluggable personality templates for virtual pets based on a language model, characterized in that: The method comprises a memory and a processor, wherein the memory stores program instructions executed by the processor, and the processor calls the program instructions to execute the method for generating a pluggable personality template of a virtual pet based on a language model as claimed in claim 8.

10. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method for generating a pluggable personality template of a virtual pet based on a language model according to claim 8.