Replay generation method and device based on artificial intelligence, computer equipment and medium

By adopting an artificial intelligence-based reply generation method in the robot psychological counseling system, using the psychological counseling dialogue feature prediction model and content generation model, the problem of lack of personalization and accuracy of reply content in the existing system is solved, and a high-accuracy personalized reply generation is achieved.

CN119621897APending Publication Date: 2025-03-14PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411689898.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing robot psychological counseling system lacks personalization and targeted response content, and the response accuracy is low.

Method used

Using an artificial intelligence-based reply generation method, we use to judge the user's consultation request, display the inquiry information and receive the user's reply content. Use the psychological counseling dialogue feature prediction model and personal basic information to generate target psychological counseling dialogue prompt information, and respond to and generate it through the psychological counseling dialogue content generation model.

Benefits of technology

It realizes the generation of targeted and personalized reply to psychological counseling content, improves the accuracy of the reply and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621897A_ABST
    Figure CN119621897A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, relates to an artificial intelligence-based reply generation method and device, computer equipment and a storage medium, is applied to the field of digital medical treatment, and comprises the following steps: judging whether a consultation request triggered by a user in a preset interface is received or not; if yes, displaying the inquiry information, and receiving reply content which is input by the user and corresponds to the inquiry information; predicting the reply content and the inquiry information based on a psychological counseling dialogue feature prediction model to obtain psychological counseling dialogue features; generating target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information of the user; processing the reply content, the reply content and the target psychological counseling dialogue prompt information based on a psychological counseling dialogue content generation model to obtain a psychological counseling content reply; and displaying the psychological consultation content reply. Based on the use of the model, the psychological counseling content reply with pertinence and individuation can be automatically and accurately generated for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence development technology and the field of digital medicine, and in particular to an artificial intelligence-based response generation method, apparatus, computer equipment and storage medium. Background Art

[0002] In today's society, with the rapid advancement of science and technology and the booming economy, people's pace of life is accelerating, job competition is intensifying, and family responsibilities are also increasing. At the same time, the continuous improvement of social expectations has made the sources of stress faced by individuals more diverse and complex. These factors work together to cause many people to be in a state of high pressure for a long time, with significantly increased psychological pressure, and then frequently feel negative emotions such as anxiety and fatigue.

[0003] In recent years, mental health issues have become a social phenomenon that cannot be ignored. Statistics show that the incidence of mental problems is rising year by year, which has a profound impact on individuals' daily lives, work performance and even family relationships. This trend has attracted widespread attention from all walks of life. More and more people have begun to realize the importance of mental health and are actively seeking effective psychological intervention methods to alleviate psychological distress.

[0004] In this context, psychological counseling services, as a form of professional psychological support, have gradually become an important way to help people cope with psychological stress and improve their mental health. At present, the industry has begun to explore the use of technical means to provide more convenient and efficient psychological counseling services. Among them, robot psychological counseling based on dialogue, as an emerging service model, has gradually been favored by users due to its advantages such as immediacy, convenience and scalability.

[0005] However, although robot psychological counseling has achieved remarkable results in improving work efficiency and service coverage, there are still some problems in its actual application. Specifically, most current robot psychological counseling systems use general response templates to handle users' consultation questions, resulting in a lack of personalization and pertinence in the response content. In addition, due to the lack of in-depth understanding of the user's specific situation and psychological state, the accuracy of the robot's response needs to be improved. Summary of the invention

[0006] The purpose of the embodiments of the present application is to propose an artificial intelligence-based response generation method, device, computer equipment and storage medium to solve the technical problems of existing robot psychological counseling methods, such as the lack of personalization and pertinence in the response content and the low accuracy of the response.

[0007] In order to solve the above technical problems, the embodiment of the present application provides a reply generation method based on artificial intelligence, which adopts the following technical solution:

[0008] Determine whether a consultation request triggered by a user in a preset interface is received;

[0009] If yes, display the preset inquiry information, and receive the reply content corresponding to the inquiry information input by the user;

[0010] Based on a preset psychological counseling dialogue feature prediction model, the reply content and the inquiry information are predicted and processed to obtain corresponding psychological counseling dialogue features;

[0011] Obtaining basic personal information of the user;

[0012] Generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information;

[0013] Based on a preset psychological counseling dialogue content generation model, a response generation process is performed on the response content, the response content and the target psychological counseling dialogue prompt information to obtain a corresponding psychological counseling content response;

[0014] The response to the psychological consultation content is displayed in the preset interface.

[0015] Furthermore, the step of predicting the reply content and the inquiry information based on the preset psychological counseling dialogue feature prediction model to obtain the corresponding psychological counseling dialogue features specifically includes:

[0016] Concatenate the query information with the reply content to obtain a corresponding concatenated text;

[0017] Inputting the concatenated text into the psychological counseling dialogue feature prediction model;

[0018] The concatenated text is predicted and processed by the psychological counseling dialogue feature prediction model, and the corresponding dialogue content length, emotional style label and strategy label are output;

[0019] Integrate the conversation content length, the emotional style label, and the strategy label to obtain corresponding integrated features;

[0020] The integration feature is used as the psychological counseling dialogue feature.

[0021] Furthermore, the step of generating corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information specifically includes:

[0022] Get preset psychological counseling dialogue prompt templates;

[0023] Filling the psychological consultation dialogue feature into the corresponding first placeholder position in the psychological consultation dialogue prompt template to obtain a first psychological consultation dialogue prompt template;

[0024] Filling the personal basic information into the corresponding second placeholder position in the first psychological consultation dialogue prompt template to obtain a second psychological consultation dialogue prompt template;

[0025] The second psychological counseling dialogue prompt template is used as the target psychological counseling dialogue prompt information.

[0026] Furthermore, the step of displaying the psychological consultation content reply in the preset interface specifically includes:

[0027] Optimizing the psychological counseling content response based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response;

[0028] Determining a display position corresponding to the target psychological consultation content response in the preset interface;

[0029] The target psychological counseling content response is displayed in the display location.

[0030] Furthermore, the step of optimizing the psychological counseling content response based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response specifically includes:

[0031] Removing irrelevant information from the psychological consultation content reply to obtain a corresponding first content reply;

[0032] Adjusting the format of the first content reply to obtain a corresponding second content reply;

[0033] Performing language optimization processing on the second content reply to obtain a corresponding third content reply;

[0034] The target psychological counseling content response is generated based on the third content response.

[0035] Furthermore, before the step of predicting the reply content and the inquiry information based on the preset psychological counseling dialogue feature prediction model to obtain the corresponding psychological counseling dialogue features, it also includes:

[0036] Obtaining the marked first psychological consultation dialogue data;

[0037] Preprocessing the first psychological counseling dialogue data to obtain dialogue sample data;

[0038] Dividing the conversation sample data into a training set and a validation set;

[0039] Call the pre-trained language model;

[0040] Training the pre-trained language model based on the training set to obtain a corresponding first initial model;

[0041] Fine-tune the first initial model based on the validation set to obtain a second initial model that meets preset performance requirements;

[0042] The second initial model is used as the psychological counseling dialogue feature prediction model.

[0043] Furthermore, before the step of performing reply generation processing on the reply content, the reply content and the target psychological counseling dialogue prompt information based on the preset psychological counseling dialogue content generation model to obtain the corresponding psychological counseling content reply, it also includes:

[0044] Obtain pre-constructed second psychological consultation dialogue data;

[0045] Acquire a designated psychological counseling dialogue prompt template corresponding to each round of dialogue in the second psychological counseling dialogue data;

[0046] Constructing a corresponding training data set based on the second psychological counseling dialogue data and the specified psychological counseling dialogue prompt template;

[0047] Call the pre-trained large language model;

[0048] Based on the training data set, the large language model is fine-tuned using the LORA algorithm to obtain a specified large language model that meets the preset processing requirements;

[0049] The designated large language model is used as the psychological counseling dialogue content generation model.

[0050] In order to solve the above technical problems, the embodiment of the present application further provides a reply generation device based on artificial intelligence, which adopts the following technical solution:

[0051] A judgment module, used to judge whether a consultation request triggered by a user in a preset interface is received;

[0052] A receiving module, used for displaying preset inquiry information and receiving a reply content corresponding to the inquiry information input by the user;

[0053] A prediction module, used to predict the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features;

[0054] A first acquisition module, used to acquire the basic personal information of the user;

[0055] A first generating module, configured to generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information;

[0056] A second generation module is used to perform a reply generation process on the reply content, the reply content and the target psychological counseling dialogue prompt information based on a preset psychological counseling dialogue content generation model to obtain a corresponding psychological counseling content reply;

[0057] A display module is used to display the response to the psychological consultation content in the preset interface.

[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0059] Determine whether a consultation request triggered by a user in a preset interface is received;

[0060] If yes, display the preset inquiry information, and receive the reply content corresponding to the inquiry information input by the user;

[0061] Based on a preset psychological counseling dialogue feature prediction model, the reply content and the inquiry information are predicted and processed to obtain corresponding psychological counseling dialogue features;

[0062] Obtaining basic personal information of the user;

[0063] Generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information;

[0064] Based on a preset psychological counseling dialogue content generation model, a response generation process is performed on the response content, the response content and the target psychological counseling dialogue prompt information to obtain a corresponding psychological counseling content response;

[0065] The response to the psychological consultation content is displayed in the preset interface.

[0066] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0067] Determine whether a consultation request triggered by a user in a preset interface is received;

[0068] If yes, display the preset inquiry information, and receive the reply content corresponding to the inquiry information input by the user;

[0069] Based on a preset psychological counseling dialogue feature prediction model, the reply content and the inquiry information are predicted and processed to obtain corresponding psychological counseling dialogue features;

[0070] Obtaining basic personal information of the user;

[0071] Generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information;

[0072] Based on a preset psychological counseling dialogue content generation model, a response generation process is performed on the response content, the response content and the target psychological counseling dialogue prompt information to obtain a corresponding psychological counseling content response;

[0073] The response to the psychological consultation content is displayed in the preset interface.

[0074] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0075] The present application first determines whether a consultation request triggered by a user in a preset interface is received; if so, displays the preset inquiry information, and receives the reply content corresponding to the inquiry information input by the user; then predicts and processes the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features; then obtains the user's personal basic information; and generates corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue features and the personal basic information; subsequently, based on the preset psychological counseling dialogue content generation model, performs reply generation processing on the reply content, the reply content and the target psychological counseling dialogue prompt information to obtain corresponding psychological counseling content reply; finally, displays the psychological counseling content reply in the preset interface. After receiving the consultation request triggered by the user in the preset interface, the present application receives the reply content corresponding to the inquiry information input by the user, and predicts the reply content and the inquiry information based on the psychological counseling dialogue feature prediction model to obtain the psychological counseling dialogue features, and then intelligently generates the corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue features and the user's personal basic information, and then performs reply generation processing on the reply content, reply content and target psychological counseling dialogue prompt information based on the use of the psychological counseling dialogue content generation model, so that targeted and personalized psychological counseling content replies can be automatically and accurately generated for the user, thereby improving the accuracy of the generated psychological counseling content replies and helping to improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0077] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0078] Figure 2 A flowchart of an embodiment of an artificial intelligence-based reply generation method according to the present application;

[0079] Figure 3 is a structural schematic diagram of an embodiment of an artificial intelligence-based reply generation device according to the present application;

[0080] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0081] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0082] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0083] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0084] like Figure 1As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0085] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0086] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0087] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .

[0088] It should be noted that the artificial intelligence-based reply generation method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the artificial intelligence-based reply generation device is generally set in the server / terminal device.

[0089] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0090] Continue to refer Figure 2, showing a flow chart of an embodiment of the artificial intelligence-based reply generation method according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The artificial intelligence-based reply generation method provided in the embodiment of the present application can be applied to any scenario where reply generation is required, and the artificial intelligence-based reply generation method can be applied to products in these scenarios, for example, reply generation in the field of digital medicine. The artificial intelligence-based reply generation method comprises the following steps:

[0091] Step S201, determining whether a consultation request triggered by a user in a preset interface is received.

[0092] In this embodiment, the electronic device (e.g. Figure 1 The server / terminal device shown in the figure) can obtain the consultation request through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future. The executor of the present application may be an intelligent psychological counseling dialogue system, or simply referred to as the system. The above-mentioned preset interface may be a pre-developed front-end page for processing dialogues with users for psychological counseling. Users can trigger the corresponding consultation request by clicking the psychological counseling button in the front-end page.

[0093] Step S202: If yes, display the preset inquiry information, and receive the reply content corresponding to the inquiry information input by the user.

[0094] In this embodiment, the information content of the inquiry information is not specifically limited and can be set according to actual business needs, for example, it can include: "Is there anything I can help you with? Tell me about it." The inquiry information can be displayed on the preset interface, and the user can be waited for to reply, and then the reply content corresponding to the inquiry information input by the user can be received.

[0095] Step S203: predicting the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features.

[0096] In the present embodiment, the above-mentioned specific implementation process of predicting the reply content and the inquiry information based on the preset psychological counseling dialogue feature prediction model to obtain the corresponding psychological counseling dialogue features will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here. Among them, the psychological counseling dialogue feature prediction model can be applied to construct a psychological counseling dialogue prompt template. The input of the psychological counseling dialogue feature prediction model is the dialogue history (i.e., inquiry information) and the current user's reply. The model will predict the current psychological counseling dialogue status and output the psychological counseling dialogue features. In addition, the construction process of the above-mentioned psychological counseling dialogue feature prediction model will also be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.

[0097] Step S204: Obtain the basic personal information of the user.

[0098] In this embodiment, the user's basic personal information can be collected by filling out a form or asking a question in a dialogue, etc. The user's basic personal information may include information such as age, gender, occupation, and education level.

[0099] Step S205: Generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information.

[0100] In this embodiment, the specific implementation process of generating the corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information will be described in further detail in subsequent specific embodiments of the present application, and will not be elaborated on here.

[0101] Step S206, based on a preset psychological counseling dialogue content generation model, a reply generation process is performed on the reply content, the reply content and the target psychological counseling dialogue prompt information to obtain a corresponding psychological counseling content reply.

[0102] In this embodiment, the corresponding designated spliced ​​text is obtained by splicing the reply content, the reply content and the target psychological counseling dialogue prompt information, and then the designated spliced ​​text is input into the above-mentioned psychological counseling dialogue content generation model, so that the input designated spliced ​​text is processed by the psychological counseling dialogue content generation model to generate a reply, and output the corresponding psychological counseling content reply. Among them, the construction process of the above-mentioned psychological counseling dialogue content generation model will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.

[0103] Step S207, displaying the psychological consultation content reply in the preset interface.

[0104] In this embodiment, the specific implementation process of displaying the psychological consultation content response in the preset interface will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated in detail here.

[0105] The present application first determines whether a consultation request triggered by a user in a preset interface is received; if so, displays the preset inquiry information, and receives the reply content corresponding to the inquiry information input by the user; then predicts and processes the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features; then obtains the user's personal basic information; and generates corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue features and the personal basic information; subsequently, based on the preset psychological counseling dialogue content generation model, performs reply generation processing on the reply content, the reply content and the target psychological counseling dialogue prompt information to obtain corresponding psychological counseling content reply; finally, displays the psychological counseling content reply in the preset interface. After receiving the consultation request triggered by the user in the preset interface, the present application receives the reply content corresponding to the inquiry information input by the user, and predicts the reply content and the inquiry information based on the psychological counseling dialogue feature prediction model to obtain the psychological counseling dialogue features, and then intelligently generates the corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue features and the user's personal basic information, and then performs reply generation processing on the reply content, reply content and target psychological counseling dialogue prompt information based on the use of the psychological counseling dialogue content generation model, so that targeted and personalized psychological counseling content replies can be automatically and accurately generated for the user, thereby improving the accuracy of the generated psychological counseling content replies and helping to improve the user experience.

[0106] In some optional implementations, step S203 includes the following steps:

[0107] The inquiry information and the reply content are concatenated to obtain a corresponding concatenated text.

[0108] In this embodiment, the above inquiry information and the user's reply content are spliced ​​into a complete text, namely, a spliced ​​text, and used as the input of the psychological counseling dialogue feature prediction model.

[0109] The concatenated text is input into the psychological counseling dialogue feature prediction model.

[0110] In this embodiment, the prepared concatenated text can be input into the psychological counseling dialogue feature prediction model.

[0111] The concatenated text is predicted and processed by the psychological counseling dialogue feature prediction model to output the corresponding dialogue content length, emotional style label and strategy label.

[0112] In this embodiment, the psychological counseling dialogue feature prediction model performs predictive processing on the input concatenated text, thereby outputting multiple predicted features of the next psychological counseling dialogue, including the length of the dialogue content, emotional style labels, strategy labels, etc.

[0113] The conversation content length, the emotional style label and the strategy label are integrated to obtain corresponding integrated features.

[0114] In this embodiment, the integrated features include the conversation content length, the emotional style label, and the strategy label.

[0115] The integration feature is used as the psychological counseling dialogue feature.

[0116] The present application inputs the spliced ​​text obtained by splicing the inquiry information and the reply content into the psychological counseling dialogue feature prediction model, and then predicts the spliced ​​text based on the psychological counseling dialogue feature prediction model, and further integrates the output dialogue content length, emotional style label and strategy label, so as to quickly and accurately obtain the corresponding psychological counseling dialogue features, thereby ensuring the accuracy and content diversity of the obtained psychological counseling dialogue features.

[0117] In some optional implementations of this embodiment, step S205 includes the following steps:

[0118] Get pre-set counseling conversation prompt templates.

[0119] In this embodiment, a pre-built psychological counseling dialogue prompt template can be loaded from a memory or a database. The above-mentioned psychological counseling dialogue prompt template may at least include a placeholder corresponding to the dialogue feature and a placeholder corresponding to the basic personal information. Specifically, in order to generate a personalized and moderately long psychological counseling content response, a psychological counseling dialogue prompt template is pre-built. The psychological counseling dialogue prompt template is composed of a fixed format, and the psychological counseling dialogue prompt template contains a variety of features of the dialogue content to be generated by the model, such as the length of the dialogue content (e.g., long, medium, short), the emotional style label of the dialogue content (e.g., empathy, gentleness, objectivity, etc.), the strategy label of the dialogue content (e.g., giving advice, explaining, providing information, etc.), etc.; and the user's basic personal information, such as age, gender, occupation, education, etc. The above-mentioned user personal information and psychological counseling dialogue features are highly correlated with the content of the psychological counseling dialogue.

[0120] The psychological counseling dialogue feature is filled into the corresponding first placeholder position in the psychological counseling dialogue prompt template to obtain a first psychological counseling dialogue prompt template.

[0121] In this embodiment, the predicted psychological counseling dialogue features may be filled into the corresponding first placeholder position in the above-mentioned psychological counseling dialogue prompt template.

[0122] The personal basic information is filled into the corresponding second placeholder position in the first psychological counseling dialogue prompt template to obtain a second psychological counseling dialogue prompt template.

[0123] In this embodiment, the acquired personal basic information can be filled into the corresponding second placeholder position in the first psychological counseling dialogue prompt template.

[0124] The second psychological counseling dialogue prompt template is used as the target psychological counseling dialogue prompt information.

[0125] The present application obtains a preset psychological counseling dialogue prompt template, and then fills the psychological counseling dialogue features into the corresponding first placeholder position in the psychological counseling dialogue prompt template, and fills the personal basic information into the corresponding second placeholder position in the first psychological counseling dialogue prompt template, so as to quickly and accurately construct the corresponding target psychological counseling dialogue prompt information, improve the construction efficiency of the target psychological counseling dialogue prompt information, ensure the accuracy of the obtained target psychological counseling dialogue prompt information, and facilitate the subsequent provision of accurate data input for the psychological counseling dialogue content generation model based on the obtained target psychological counseling dialogue prompt information.

[0126] In some optional implementations, step S207 includes the following steps:

[0127] The psychological counseling content response is optimized based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response.

[0128] In this embodiment, the above-mentioned specific implementation process of optimizing the psychological counseling content response based on the preset content optimization strategy to obtain the corresponding target psychological counseling content response will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated in detail here.

[0129] A display position corresponding to the target psychological counseling content response is determined in the preset interface.

[0130] In this embodiment, there is no specific limitation on the selection of the above display position, which can be set according to actual business needs or user's personal preferences. For example, the center position of the interface of the preset interface can be used.

[0131] The target psychological counseling content response is displayed in the display location.

[0132] In this embodiment, the generated target psychological counseling content reply can be placed in the display position in the above-mentioned preset interface.

[0133] After generating a psychological counseling content reply based on a preset psychological counseling dialogue content generation model, this application will intelligently optimize the psychological counseling content reply based on a preset content optimization strategy to obtain a target psychological counseling content reply, thereby improving the quality and readability of the generated target psychological counseling content reply. Subsequently, a display position corresponding to the target psychological counseling content reply is determined in the preset interface, and the target psychological counseling content reply is displayed in the display position, thereby improving the display intelligence of the target psychological counseling content reply and improving the user experience.

[0134] In some optional implementations, the optimizing process of the psychological counseling content reply based on a preset content optimization strategy to obtain a corresponding target psychological counseling content reply includes the following steps:

[0135] The psychological consultation content reply is processed by removing irrelevant information to obtain a corresponding first content reply.

[0136] In this embodiment, the above-mentioned removal of irrelevant information processing includes identifying and deleting redundant words, and eliminating irrelevant topics. Among them, identifying and deleting redundant words includes: checking whether there are repeated and meaningless words or phrases in the generated reply, such as modal particles such as "um" and "ah", and repeated sentence structures. These redundant information may reduce the readability of the reply and are deleted. Eliminating irrelevant topics includes: ensuring that the generated reply is closely centered around the user's question and the topic of psychological counseling. If the reply contains information that is irrelevant to the user's question, it should be deleted or replaced with content related to the topic.

[0137] The first content reply is formatted to obtain a corresponding second content reply.

[0138] In this embodiment, the above-mentioned format adjustment processing includes paragraph division, sentence structure optimization and list display. Among them, paragraph division includes: dividing the reply into appropriate paragraphs according to its content and logical structure. Each paragraph should revolve around a central idea to facilitate user understanding and reading. Sentence structure optimization includes: checking and optimizing the sentence structure in the reply to make it more concise and clear. Avoid using overly complex or lengthy sentences to avoid causing reading difficulties for users. Using list display includes: if the reply contains multiple points or suggestions, it can be displayed in the form of a list. This helps users quickly grasp the core content of the reply.

[0139] The second content reply is language optimized to obtain a corresponding third content reply.

[0140] In this embodiment, language optimization processing includes vocabulary selection, grammar checking, and tone adjustment. Among them, vocabulary selection includes: selecting accurate, concise and easy-to-understand words to express the content of the reply. Avoid using overly professional or obscure terms to avoid increasing the reading difficulty of the user. Grammar checking includes: grammar checking the reply to ensure that the sentence structure is complete and the grammar is correct. This helps to improve the accuracy and readability of the reply. Tone adjustment includes: adjusting the tone and style of the reply according to the emotional style label and strategy label of the psychological counseling dialogue. For example, if the label indicates that empathy and tenderness need to be shown, softer and more considerate language should be used in the reply.

[0141] The target psychological counseling content response is generated based on the third content response.

[0142] In this embodiment, the third content reply may be directly used as the target psychological counseling content reply.

[0143] This application can quickly and accurately optimize the responses to psychological counseling content by removing irrelevant information, adjusting the format, and optimizing the language of the responses to psychological counseling content, thereby improving the quality and readability of the generated target psychological counseling content responses.

[0144] In some optional implementations of this embodiment, before step S203, the electronic device may further perform the following steps:

[0145] Obtain the labeled first psychological consultation dialogue data.

[0146] In this embodiment, a large amount of labeled psychological counseling dialogue data is collected in advance, including dialogue content and corresponding feature tags.

[0147] The first psychological counseling dialogue data is preprocessed to obtain dialogue sample data.

[0148] In this embodiment, the data quality of the obtained conversation sample data can be ensured by performing a cleaning process on the data to remove irrelevant information.

[0149] The conversation sample data is divided into a training set and a validation set.

[0150] In this embodiment, the conversation sample data can be divided into a training set and a validation set by using a preset division ratio, wherein the numerical value of the division ratio is not specifically limited, for example, 8:2 can be used.

[0151] Call the pre-trained language model.

[0152] In this embodiment, the above-mentioned pre-trained language model can specifically adopt the BERT model. By using the BERT network structure, the pre-trained BERT model weights are loaded. And according to the characteristics of the psychological counseling dialogue data, the model input and output formats are designed.

[0153] The pre-trained language model is trained based on the training set to obtain a corresponding first initial model.

[0154] In this embodiment, the pre-trained language model is trained using a training set, and the model parameters are adjusted to optimize the feature prediction performance, thereby obtaining a corresponding first initial model.

[0155] The first initial model is fine-tuned and trained based on the validation set to obtain a second initial model that meets preset performance requirements.

[0156] In this embodiment, based on the obtained first initial model, the model fine-tuning training is performed by using the validation set to improve the prediction accuracy of the first initial model. The training process of the model is monitored, and hyperparameters such as the learning rate and batch size are adjusted to ensure that the model performance is steadily improved, thereby obtaining a second initial model that meets the performance requirements, namely, a psychological counseling dialogue feature prediction model.

[0157] Specifically, the psychological counseling dialogue features are obtained through the above-mentioned psychological counseling dialogue feature prediction model. The input of the dialogue feature prediction model is the history of psychological counseling dialogues, and the output of the model is the label for the next round of psychological counselor dialogue content, namely, length (length of dialogue content), empathy (emotional style label of dialogue content), and advice (strategy label of dialogue content). The above-mentioned dialogue features are marked for each round of multiple dialogues between a psychological counselor and a user. By collecting a large number of existing psychological counseling dialogues between psychological counselors and users, the labeled data of the above-mentioned psychological counseling dialogue features are used as training data to train the corresponding multiple psychological counseling dialogue feature prediction models. The network structure of the model is a BERT network (Bidirectional Encoder Representations from Transformers), which has a strong natural language understanding ability. A multi-layer fully connected layer is added to the output end of the model, and finally a softmax layer is added to predict different psychological counseling dialogue features. Based on the pre-trained BERT network, the constructed training data set is used to perform model fine-tuning training to obtain the final psychological counseling dialogue feature prediction model.

[0158] The second initial model is used as the psychological counseling dialogue feature prediction model.

[0159] The present application obtains conversation sample data by preprocessing the acquired first psychological counseling conversation data, and divides the conversation sample data into a training set and a validation set, and then trains the pre-trained language model based on the use of the training set to obtain a first initial model, and fine-tunes the first initial model based on the use of the validation set, so as to efficiently and accurately construct a psychological counseling conversation feature prediction model that meets performance requirements, thereby improving the construction efficiency of the psychological counseling conversation feature prediction model and ensuring the prediction effect of the obtained psychological counseling conversation feature prediction model.

[0160] In some optional implementations of this embodiment, before step S206, the electronic device may further perform the following steps:

[0161] Get pre-constructed second counseling conversation data.

[0162] In this embodiment, a large amount of second psychological counseling dialogue data is collected in advance, including dialogue history, the reply content of the current user and the reply content of the psychological counselor.

[0163] Obtain a designated psychological counseling dialogue prompt template corresponding to each round of dialogue in the second psychological counseling dialogue data.

[0164] In this embodiment, the above-mentioned designated psychological consultation dialogue prompt template is generated by manual marking according to actual business needs.

[0165] A corresponding training data set is constructed based on the second psychological counseling dialogue data and the specified psychological counseling dialogue prompt template.

[0166] In this embodiment, the conversation history, the current user's reply content and the specified psychological counseling conversation prompt template are used as input, and the psychological counselor's reply content is used as output to construct a corresponding training data set.

[0167] Call the pre-trained large language model.

[0168] In this embodiment, there is no specific limitation on the selection of the large language model. For example, GPT can be used and the corresponding model weights can be loaded.

[0169] Based on the training data set, the large language model is fine-tuned and trained using the LORA algorithm to obtain a specified large language model that meets preset processing requirements.

[0170] In this embodiment, based on the pre-trained large language model, the constructed training data set is used and the LORA (Low-Rank Adaptation) technology is applied to fine-tune the large language model, and finally a psychological counseling dialogue content generation model that meets the processing requirements is trained. Among them, LORA is an efficient parameter fine-tuning method. When the model is trained using the LORA method, most of the weights of the base large model are first frozen, and then fine-tuned on a relatively small number of trainable low-rank matrices.

[0171] The input of the psychological counseling dialogue content generation model is the dialogue history, the current user's reply content, and the current psychological counseling dialogue prompt template. The model will generate psychological counseling reply content that meets the requirements and is of moderate length and personalized based on the psychological counseling dialogue prompt template. In addition, for the above training data set, the input data in the training data set is the dialogue history of each round of dialogue between the psychological counselor and the user, the current user's reply content, and the current psychological counseling dialogue prompt template constructed by manual labeling. The output data in the training data set is the next dialogue content reply of the psychological counselor.

[0172] The designated large language model is used as the psychological counseling dialogue content generation model.

[0173] The present application constructs a training data set based on the pre-constructed second psychological counseling dialogue data and the designated psychological counseling dialogue prompt template corresponding to each round of dialogue in the acquired second psychological counseling dialogue data, and then uses the LORA algorithm to fine-tune the large language model based on the obtained training data set, so as to efficiently and accurately construct a psychological counseling dialogue content generation model that meets the processing requirements, improve the construction efficiency of the psychological counseling dialogue content generation model, and ensure the prediction effect of the obtained psychological counseling dialogue content generation model.

[0174] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.

[0175] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.

[0176] In addition, the present application automatically constructs a dialogue prompt template based on the user's personal information and psychological counseling dialogue characteristics, and inputs the dialogue-generated prompt template and dialogue history into the psychological counseling dialogue generation model to generate moderately long, personalized psychological counseling response content for the user, thereby improving the user experience and professional ability of the psychological counseling dialogue.

[0177] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0178] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned product conversion data, the above-mentioned product conversion data can also be stored in a node of a blockchain.

[0179] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0180] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0181] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0183] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0184] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a reply generation device based on artificial intelligence, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0185] like Figure 3 As shown, the artificial intelligence-based reply generation device 300 described in this embodiment includes: a judgment module 301, a receiving module 302, a prediction module 303, a first acquisition module 304, a first generation module 305, a second generation module 306 and a display module 307. Among them:

[0186] The judgment module 301 is used to judge whether a consultation request triggered by a user in a preset interface is received;

[0187] The receiving module 302 is used to display the preset inquiry information and receive the reply content corresponding to the inquiry information input by the user;

[0188] Prediction module 303, used to predict the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features;

[0189] The first acquisition module 304 is used to acquire the basic personal information of the user;

[0190] The first generating module 305 is used to generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information;

[0191] The second generation module 306 is used to perform a reply generation process on the reply content, the reply content and the target psychological counseling dialogue prompt information based on a preset psychological counseling dialogue content generation model to obtain a corresponding psychological counseling content reply;

[0192] The display module 307 is used to display the psychological consultation content reply in the preset interface.

[0193] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0194] In some optional implementations of this embodiment, the prediction module 303 includes:

[0195] A splicing submodule, used to splice the inquiry information with the reply content to obtain a corresponding spliced ​​text;

[0196] An input submodule, used for inputting the concatenated text into the psychological counseling dialogue feature prediction model;

[0197] A prediction submodule, used to perform prediction processing on the concatenated text by using the psychological counseling dialogue feature prediction model, and output the corresponding dialogue content length, emotional style label and strategy label;

[0198] An integration submodule, used for integrating the conversation content length, the emotional style label and the strategy label to obtain corresponding integrated features;

[0199] The first determination submodule is used to use the integrated feature as the psychological counseling dialogue feature.

[0200] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0201] In some optional implementations of this embodiment, the first generating module 305 includes:

[0202] The acquisition submodule is used to obtain the preset psychological consultation dialogue prompt template;

[0203] A first filling submodule is used to fill the psychological consultation dialogue feature into the corresponding first placeholder position in the psychological consultation dialogue prompt template to obtain a first psychological consultation dialogue prompt template;

[0204] A second filling submodule is used to fill the personal basic information into the corresponding second placeholder position in the first psychological consultation dialogue prompt template to obtain a second psychological consultation dialogue prompt template;

[0205] The second determining submodule is used to use the second psychological counseling dialogue prompt template as the target psychological counseling dialogue prompt information.

[0206] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0207] In some optional implementations of this embodiment, the display module 307 includes:

[0208] An optimization submodule, used to optimize the psychological counseling content response based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response;

[0209] A third determination submodule is used to determine a display position corresponding to the target psychological consultation content reply in the preset interface;

[0210] The display submodule is used to display the target psychological consultation content reply in the display position.

[0211] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0212] In some optional implementations of this embodiment, the optimization submodule includes:

[0213] A first processing unit is used to remove irrelevant information from the psychological consultation content reply to obtain a corresponding first content reply;

[0214] A second processing unit, configured to adjust the format of the first content reply to obtain a corresponding second content reply;

[0215] A third processing unit, configured to perform language optimization processing on the second content reply to obtain a corresponding third content reply;

[0216] A generating unit is used to generate the target psychological counseling content response based on the third content response.

[0217] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0218] In some optional implementations of this embodiment, the artificial intelligence-based reply generation device further includes:

[0219] A second acquisition module is used to acquire the marked first psychological consultation dialogue data;

[0220] A preprocessing module, used for preprocessing the first psychological counseling dialogue data to obtain dialogue sample data;

[0221] A division module, used for dividing the conversation sample data into a training set and a validation set;

[0222] The first calling module is used to call the pre-trained language model;

[0223] A training module, used for training the pre-trained language model based on the training set to obtain a corresponding first initial model;

[0224] A first fine-tuning module is used to fine-tune the first initial model based on the verification set to obtain a second initial model that meets preset performance requirements;

[0225] The first determination module is used to use the second initial model as the psychological counseling dialogue feature prediction model.

[0226] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0227] In some optional implementations of this embodiment, the artificial intelligence-based reply generation device further includes:

[0228] A third acquisition module is used to acquire pre-constructed second psychological consultation dialogue data;

[0229] A third generating module is used to obtain a designated psychological counseling dialogue prompt template corresponding to each round of dialogue in the second psychological counseling dialogue data;

[0230] A construction module, used to construct a corresponding training data set based on the second psychological counseling dialogue data and the specified psychological counseling dialogue prompt template;

[0231] The second calling module is used to call the pre-trained large language model;

[0232] A second fine-tuning module is used to fine-tune the large language model using the LORA algorithm based on the training data set to obtain a specified large language model that meets the preset processing requirements;

[0233] The second determination module is used to use the designated large language model as the psychological counseling dialogue content generation model.

[0234] In this embodiment, the operations performed by the above modules or units respectively correspond one-to-one to the steps of the artificial intelligence-based reply generation method in the aforementioned implementation mode, and will not be repeated here.

[0235] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4This is a basic structural block diagram of the computer device in this embodiment.

[0236] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0237] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0238] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the reply generation method based on artificial intelligence, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0239] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the artificial intelligence-based reply generation method.

[0240] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0241] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned artificial intelligence-based reply generation method.

[0242] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0243] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A reply generation method based on artificial intelligence, characterized in that: The steps include: Determine whether a consultation request triggered by a user in a preset interface is received; If yes, display the preset inquiry information, and receive the reply content corresponding to the inquiry information input by the user; Based on a preset psychological counseling dialogue feature prediction model, the reply content and the inquiry information are predicted and processed to obtain corresponding psychological counseling dialogue features; Obtaining basic personal information of the user; Generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information; Based on a preset psychological counseling dialogue content generation model, a response generation process is performed on the response content, the response content and the target psychological counseling dialogue prompt information to obtain a corresponding psychological counseling content response; The response to the psychological consultation content is displayed in the preset interface.

2. The artificial intelligence-based reply generation method according to claim 1, characterized in that: The step of predicting the reply content and the inquiry information based on the preset psychological counseling dialogue feature prediction model to obtain the corresponding psychological counseling dialogue features specifically includes: Concatenate the query information with the reply content to obtain a corresponding concatenated text; Inputting the concatenated text into the psychological counseling dialogue feature prediction model; The concatenated text is predicted and processed by the psychological counseling dialogue feature prediction model, and the corresponding dialogue content length, emotional style label and strategy label are output; Integrate the conversation content length, the emotional style label, and the strategy label to obtain corresponding integrated features; The integration feature is used as the psychological counseling dialogue feature.

3. The artificial intelligence-based reply generation method according to claim 1, characterized in that: The step of generating corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information specifically includes: Get preset psychological counseling dialogue prompt templates; Filling the psychological consultation dialogue feature into the corresponding first placeholder position in the psychological consultation dialogue prompt template to obtain a first psychological consultation dialogue prompt template; Filling the personal basic information into the corresponding second placeholder position in the first psychological consultation dialogue prompt template to obtain a second psychological consultation dialogue prompt template; The second psychological counseling dialogue prompt template is used as the target psychological counseling dialogue prompt information.

4. The artificial intelligence-based reply generation method according to claim 1, characterized in that: The step of displaying the psychological consultation content reply in the preset interface specifically includes: Optimizing the psychological counseling content response based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response; Determining a display position corresponding to the target psychological consultation content response in the preset interface; The target psychological counseling content response is displayed in the display location.

5. The artificial intelligence-based reply generation method according to claim 4, characterized in that: The step of optimizing the psychological counseling content response based on a preset content optimization strategy to obtain a corresponding target psychological counseling content response specifically includes: Removing irrelevant information from the psychological consultation content reply to obtain a corresponding first content reply; Adjusting the format of the first content reply to obtain a corresponding second content reply; Performing language optimization processing on the second content reply to obtain a corresponding third content reply; The target psychological counseling content response is generated based on the third content response.

6. The artificial intelligence-based reply generation method according to claim 1, characterized in that: Before the step of predicting the reply content and the inquiry information based on the preset psychological counseling dialogue feature prediction model to obtain the corresponding psychological counseling dialogue features, the method further includes: Obtaining the marked first psychological consultation dialogue data; Preprocessing the first psychological counseling dialogue data to obtain dialogue sample data; Dividing the conversation sample data into a training set and a validation set; Call the pre-trained language model; Training the pre-trained language model based on the training set to obtain a corresponding first initial model; Fine-tune the first initial model based on the validation set to obtain a second initial model that meets preset performance requirements; The second initial model is used as the psychological counseling dialogue feature prediction model.

7. The artificial intelligence-based reply generation method according to claim 1, characterized in that: Before the step of performing reply generation processing on the reply content, the reply content and the target psychological counseling dialogue prompt information based on the preset psychological counseling dialogue content generation model to obtain the corresponding psychological counseling content reply, the step further includes: Obtain pre-constructed second psychological consultation dialogue data; Acquire a designated psychological counseling dialogue prompt template corresponding to each round of dialogue in the second psychological counseling dialogue data; Constructing a corresponding training data set based on the second psychological counseling dialogue data and the specified psychological counseling dialogue prompt template; Call the pre-trained large language model; Based on the training data set, the large language model is fine-tuned using the LORA algorithm to obtain a specified large language model that meets the preset processing requirements; The designated large language model is used as the psychological counseling dialogue content generation model.

8. A reply generation device based on artificial intelligence, characterized in that: include: A judgment module, used to judge whether a consultation request triggered by a user in a preset interface is received; A receiving module, used for displaying preset inquiry information and receiving a reply content corresponding to the inquiry information input by the user; A prediction module, used to predict the reply content and the inquiry information based on a preset psychological counseling dialogue feature prediction model to obtain corresponding psychological counseling dialogue features; A first acquisition module, used to acquire the basic personal information of the user; A first generating module, configured to generate corresponding target psychological counseling dialogue prompt information based on the psychological counseling dialogue characteristics and the personal basic information; A second generation module is used to perform a reply generation process on the reply content, the reply content and the target psychological counseling dialogue prompt information based on a preset psychological counseling dialogue content generation model to obtain a corresponding psychological counseling content reply; A display module is used to display the response to the psychological consultation content in the preset interface.

9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the artificial intelligence-based reply generation method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the artificial intelligence-based reply generation method as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Knowledge question and answer method and device based on large model fine tuning and storage medium

    CN120106230A