Method, device and equipment for generating automatic reply model for psychological problems

By training and labeling dialogue data between those seeking help and mental health counselors, an automatic response model for psychological problems is generated, which solves the problem of insufficient personalized responses in existing technologies and improves response efficiency and user experience.

CN115132353BActive Publication Date: 2025-11-28PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210845973.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2025-11-28
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

Existing technologies are unable to provide targeted responses to the psychological problems of those seeking help, resulting in a poor user experience.

Method used

By acquiring dialogue data between the client and the counselor, a basic GPT language model is trained to generate a pre-trained model. Then, the client's identity information is used to tag the response statements to generate an automatic response model for psychological problems.

Benefits of technology

It enables personalized responses to the psychological problems of those seeking help, improves response efficiency, and frees up the resources of psychological counselors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115132353B_ABST
    Figure CN115132353B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for generating a psychological problem automatic reply model and an equipment, relates to the technical field of psychological problem reply, and can solve the problem that the psychological problem of a seeker cannot be replied to specifically. The method comprises the following steps: acquiring a first sentence described by a seeker and a second sentence in which a psychological consultant replies to the first sentence; training a basic GPT language model by using the first sentence to obtain the second sentence, and generating a pre-training GPT language model; marking a marked reply sentence for solving the psychological problem of the seeker in the second sentence, training the pre-training GPT language model by using the first identity information of the seeker and the first sentence to obtain the marked reply sentence, and generating a psychological problem automatic reply model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of psychological problem answering, and particularly relates to a psychological problem automatic answering model generation method, device and equipment. BACKGROUND

[0002] With the rapid development of Internet technology and application, it has become more and more common for psychological consultants or psychological consultation agencies to provide psychological consultation services through the network. One of the psychological consultation services is that a helper sends a description of his / her psychological problem to a psychological consultant through the network, and the psychological consultant replies to the description of the helper. However, the resources of the psychological consultant cannot meet the increasing demand for psychological help.

[0003] Since many psychological problems described by the helpers are similar, the prior art establishes a psychological help problem similarity model based on a text matching method in natural language technology, and helps the helpers solve their psychological problems by recommending similar problem answers to the helpers. However, the existing solution has the problem of insufficient individualization of the answer, that is, it cannot reply to the psychological problem of an individual, and the user experience is insufficient, that is, the helper only gets an answer to a similar psychological problem, and lacks a targeted service experience. SUMMARY

[0004] Therefore, the present application provides a psychological problem automatic answering model generation method, device and equipment, which relates to the technical field of psychological problem answering, and can solve the problem that the psychological problem of a helper cannot be replied to.

[0005] According to one aspect of the present application, a psychological problem automatic answering model generation method is provided, which comprises the following steps:

[0006] obtaining a first sentence segment described by a helper and a second sentence segment replied by a psychological consultant to the first sentence segment;

[0007] training a basic GPT language model using the first sentence segment to obtain the second sentence segment, and generating a pre-training GPT language model;

[0008] labeling a marked answer sentence in the second sentence segment that solves the psychological problem of the helper, training the pre-training GPT language model using the first identity information of the helper and the first sentence segment to obtain the marked answer sentence, and generating a psychological problem automatic answering model.

[0009] Preferably, the method further comprises the following steps:

[0010] obtaining second identity information of a target helper and a third sentence segment described by the target helper;

[0011] inputting the second identity information and the third language segment into the psychological question automatic answering model to obtain a target answering result.

[0012] Preferably, the inputting the second identity information and the third language segment into the psychological question automatic answering model to obtain a target answering result comprises:

[0013] inputting the second identity information and the third language segment into the psychological question automatic answering model;

[0014] The psychological question automatic answering model outputs a first sub-target answering result of answering a first target sentence of the third language segment according to the second identity information and the first target sentence;

[0015] The psychological question automatic answering model outputs a second sub-target answering result of answering a second target sentence of the third language segment according to the second identity information, the first target sentence, the first sub-target answering result and the second target sentence;

[0016] Until all target sentences of the third language segment are answered, the corresponding sub-target answering results of the all target sentences are summarized to obtain a target answering result.

[0017] Preferably, the training the basic GPT language model by using the first language segment to obtain the second language segment comprises:

[0018] training the basic GPT language model by using a first sentence of the first language segment to obtain a first sub-answer sentence in the second language segment answering the first sentence;

[0019] training the basic GPT language model by using the first sentence, the first sub-answer sentence and a second sentence of the first language segment to obtain a second sub-answer sentence in the second language segment answering the second sentence;

[0020] Until all sentences of the second language segment are trained.

[0021] Preferably, the training the pre-trained GPT language model by using the first identity information of the seeker and the first language segment to obtain the marked answer sentence comprises:

[0022] determining whether the first sub-answer sentence is the marked answer sentence;

[0023] If the first sub-answer sentence is the marked answer sentence, inputting the first identity information of the seeker and the first sentence into the pre-trained GPT language model to obtain the marked answer sentence;

[0024] if the first sub-reply sentence is not the marked reply sentence, determining whether the second sub-reply sentence is the marked reply sentence;

[0025] if the second sub-reply sentence is the marked reply sentence, inputting the first identity information, the first sentence, the first reply sentence and the second sentence into the pre-trained GPT language model to obtain the marked reply sentence;

[0026] until all the marked reply sentences are obtained.

[0027] Preferably, after the target reply result is obtained, the method further comprises:

[0028] the target seeker performs a satisfaction evaluation on the target reply result.

[0029] According to another aspect of the present application, a device for generating an automatic reply model for psychological problems is provided, and the device comprises:

[0030] a first acquisition module configured to acquire a first sentence described by a seeker and a second sentence in which a psychological consultant replies to the first sentence;

[0031] a training module configured to train a basic GPT language model using the first sentence to obtain the second sentence, and generate a pre-trained GPT language model;

[0032] a generating module configured to mark a reply sentence in the second sentence that solves the psychological problem of the seeker, train the pre-trained GPT language model using the first identity information of the seeker and the first sentence to obtain the reply sentence, and generate an automatic reply model for psychological problems.

[0033] Preferably, the device further comprises:

[0034] a second acquisition module configured to acquire second identity information of a target seeker and a third sentence described by the target seeker;

[0035] a reply module configured to input the second identity information and the third sentence into the automatic reply model for psychological problems to obtain a target reply result.

[0036] According to still another aspect of the present application, a non-volatile readable storage medium having a computer program stored thereon is provided, and the program is executed by a processor to implement the above-mentioned method for generating an automatic reply model for psychological problems.

[0037] According to still another aspect of the present application, a computer device is provided, comprising a non-volatile readable storage medium, a processor, and a computer program stored on the non-volatile readable storage medium and executable on the processor, wherein the processor implements the above-mentioned method for generating a psychological problem automatic reply model when executing the program.

[0038] By the above technical solution, the present application discloses a method, device and equipment for generating a psychological problem automatic reply model. The present application first acquires a first sentence described by a helper and a second sentence in which a psychological consultant replies to the first sentence; a basic GPT language model is trained by using the first sentence to obtain the second sentence, thereby generating a pre-training GPT language model; a marked reply sentence for solving the psychological problem of the helper is marked in the second sentence, and the pre-training GPT language model is trained by using the first identity information of the helper and the first sentence to obtain the marked reply sentence, thereby generating a psychological problem automatic reply model. Through the technical solution in the present application, the problem reply to the helper is automatically generated by the psychological problem automatic reply model, which solves the problem of insufficient resources of psychological consultants, liberates manpower, and because a large amount of data cannot be marked completely, the psychological problem automatic reply model is obtained based on two stages of data training. In the first stage, the pre-training GPT language model is obtained by training a large amount of unmarked data, and in the second stage, the data for solving the psychological problem of the helper is marked, and the psychological problem automatic reply model is obtained by training the marked data, so that the obtained psychological problem can solve the problem of insufficient individualization of problem reply and insufficient user experience, thereby improving the reply efficiency.

[0039] The above description is only a summary of the technical solution of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0040] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0041] Figure 1 A flowchart of a method for generating a psychological problem automatic reply model provided by an embodiment of the present application is shown;

[0042] Figure 2 A flowchart of another method for generating a psychological problem automatic reply model provided by an embodiment of the present application is shown;

[0043] Figure 3A structural schematic diagram of a generation device of a psychological problem automatic reply model provided by an embodiment of the present application is shown in the figure.

[0044] Figure 4 A structural schematic diagram of a generation device of another psychological problem automatic reply model provided by an embodiment of the present application is shown in the figure.

[0045] Figure 5 A flowchart for generating a pre-trained GPT language model provided by an embodiment of the present application is shown in the figure.

[0046] Figure 6 A flowchart for generating a psychological problem automatic reply model provided by an embodiment of the present application is shown in the figure.

[0047] Figure 7 A flowchart for applying a psychological problem automatic reply model provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0048] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0049] In view of the current problems, an embodiment of the present application provides a generation method of a psychological problem automatic reply model, as shown in the figure. Figure 1 The method comprises the following steps.

[0050] 101. Obtain a first sentence segment described by a seeker and a second sentence segment replied by a psychological consultant.

[0051] For this embodiment, the obtaining manner can include some question and answer forums, background question and answer data of various psychological consultation platforms, hospital psychological consultation medical records, etc., which are not limited herein, and the first sentence segment and the second sentence segment involve various psychological consultation topics. Among them, the dialogue manner of the seeker and the psychological consultant can be that the seeker speaks one sentence and the psychological consultant replies one sentence, and finally all the sentences described by the seeker form the first sentence segment and all the sentences replied by the psychological consultant form the second sentence segment.

[0052] For example, the first sentence segment and the second sentence segment can be expressed as A=(S1, R1, S2, R2, S3, R3, S4, R4, …, S n-1 , R n-1 , S n , R n ), wherein S represents the words of the seeker, R represents the words of the psychological consultant, R n represents the reply to S n , S1, S2... S n-1 form the words of the seeker, R1, R2... Rn The counselor is composed of words.

[0053] 102. Training the basic GPT language model with the first language segment to obtain a second language segment to generate a pre-trained GPT language model.

[0054] The basic GPT (Generative Pre-trained Transformer) language model is obtained from large-scale training of Chinese dialogue text. The pre-trained GPT language model is obtained by further training the basic GPT language model. It is an unsupervised form. Specifically, the basic GPT language model uses the Decoder structure of Transformer, and makes some modifications to the Transformer Decoder. The original Decoder contains two Multi-Head Attention structures, and the basic GPT language model only retains the Mask Multi-Head Attention.

[0055] For this embodiment, as an implementation, the second language segment described by the counselor is taken as the training target, and the purpose is to enable the pre-trained model to focus on the context of the psychological problem counseling related topic.

[0056] 103. Marking the marked reply sentences that solve the psychological problems of the helper in the second language segment, training the pre-trained GPT language model with the first identity information and the first language segment of the helper to obtain the marked reply sentences, and generating a psychological problem automatic reply model.

[0057] The pre-trained GPT language model obtained by training in step 102 of the embodiment uses the second language segment without marking. On the one hand, the amount of marked data is too small, and the accuracy of model training is not high. On the other hand, it is not realistic to mark a large amount of data.

[0058] For this embodiment, as an implementation, after obtaining the pre-trained GPT language model by training the basic GPT language model with the second language segment without marking as the target, the marked reply sentences that solve the psychological problems of the helper in the second language segment are marked. The psychological problem automatic reply model obtained by training the pre-trained GPT language model with the marked reply sentences as the target is a supervised form, which can solve the problem of insufficient individualization of reply.

[0059] The application discloses a method, device and equipment for generating a psychological problem automatic reply model. The application first acquires a first sentence described by a helper and a second sentence in which a psychological consultant replies to the first sentence; a basic GPT language model is trained by using the first sentence to obtain the second sentence, and a pre-training GPT language model is generated; a marked reply sentence for solving the psychological problem of the helper is marked in the second sentence, the pre-training GPT language model is trained by using the first identity information of the helper and the first sentence to obtain the marked reply sentence, and a psychological problem automatic reply model is generated. Through the technical solution in the application, the problem reply to the helper is automatically generated by the psychological problem automatic reply model, the problem of insufficient resources of the psychological consultant is solved, and the manpower is liberated. Meanwhile, because a large amount of data cannot be marked completely, the psychological problem automatic reply model is obtained based on two stages of data training. In the first stage, the pre-training GPT language model is obtained by training a large amount of unmarked data. In the second stage, the data for solving the psychological problem of the helper is marked, and the psychological problem automatic reply model is obtained by training the marked data, so that the obtained psychological problem can solve the problems of insufficient individualization of problem reply and insufficient user experience, and the reply efficiency is improved.

[0060] Further, as a refinement and expansion of the above embodiment, in order to completely describe the specific implementation process in the embodiment, another method for generating a psychological problem automatic reply model is provided, as shown in Figure 2 The method comprises the following steps.

[0061] 201. Acquire a first sentence described by a helper and a second sentence in which a psychological consultant replies to the first sentence.

[0062] For the embodiment, the specific implementation manner is the same as that in step 101, and thus will not be described here.

[0063] 202. Train a basic GPT language model by using the first sentence to obtain the second sentence, and generate a pre-training GPT language model.

[0064] For the embodiment, the training of the basic GPT language model by using the first sentence to obtain the second sentence comprises the following steps: training the basic GPT language model by using the first sentence of the first sentence to obtain a first sub-reply sentence in the second sentence for replying to the first sentence; training the basic GPT language model by using the first sentence, the first sub-reply sentence and the second sentence of the first sentence to obtain a second sub-reply sentence in the second sentence for replying to the second sentence; and the training is performed until all sentences of the second sentence are trained.

[0065] In the embodiment, the first sentence does not need to be manually processed for sentence segmentation, and the model can perform sentence segmentation on the first sentence only by inputting the first sentence into the basic GPT language model.

[0066] Specifically, as shown in Figure 5 For example, a piece of training data D=(S1, R1, S2, R2, S3, R3, S4, R4, S5, R5) is taken, where S1 is the first statement of the first segment, R1 is the first sub-reply statement in the second segment that replies to the first statement, S2 is the second statement of the first segment, R2 is the second sub-reply statement in the second segment that replies to the second statement, and all the statements in the second segment are from R1 to R5.

[0067] S1 is input into the basic GPT language model to obtain R1, S1, R1, S2 are input into the basic GPT language model to obtain R2, S1, R1, S2, R2, S3 are input into the basic GPT language model to obtain R3, S1, R1, S2, R2, S3, R3, S4 are input into the basic GPT language model to obtain R4, and S1, R1, S2, R2, S3, R3, S4, R4, S5 are input into the basic GPT language model to obtain R5. This piece of data is trained on the basic GPT language model once, and the same method is used to train the basic GPT language model multiple times using multiple pieces of data, and then a pre-trained GPT language model is generated.

[0068] 203, mark the marked reply statement in the second segment that solves the psychological problem of the helper, determine whether the first sub-reply statement is the marked reply statement, if the first sub-reply statement is the marked reply statement, input the first identity information of the helper and the first statement into the pre-trained GPT language model to obtain the marked reply statement.

[0069] Wherein, the first identity information of the helper includes the identity information of the helper in each dimension, such as age, gender, occupation, education level, religious belief, whether it is the first time to seek help, etc., which can be recorded as: I=(I1, I2, I3, I4, I5...I M ).

[0070] For this embodiment, specifically, as shown in Figure 6 For a piece of training data D=(S1, R1, S2, R2, S3, R3, S4, R4, S5, R5), mark the statement in the second segment that solves the psychological problem of the helper as a marked reply statement to obtain D*=(S1, R1, S2, R2, S3, R3*, S4, R4, S5, R5*), where S1 is the first statement of the first segment, R1 is the first sub-reply statement in the second segment that replies to the first statement, and the first sub-reply statement is not a marked reply statement in this embodiment step. Then, the content in step 204 of the embodiment is implemented.

[0071] 204、If the first sub-reply statement is not a marked reply statement, determine whether the second sub-reply statement is a marked reply statement, if the second sub-reply statement is a marked reply statement, input the first identity information, the first statement, the first reply statement and the second statement into the pre-trained GPT language model to obtain a marked reply statement, until all marked reply statements are obtained, and generate an automatic reply model for psychological problems.

[0072] For this embodiment, as an implementation, S2 is the second statement of the first sentence, R2 is the second sub-reply statement in the second sentence that replies to the second statement, for the example given in embodiment step 203, the second sub-reply statement is not a marked reply statement, then continue to determine that the third sub-reply statement is a marked reply statement R3*, so input the first identity information, the first statement, the first sub-reply statement, the second statement, the second sub-reply statement and the third statement S3 in the first sentence into the pre-trained GPT language model to obtain the marked reply statement R3*, continue to determine that the fourth sub-reply statement R4 is not a marked reply statement, and the fifth sub-reply statement R5* is a marked reply statement, so input the first identity information, the first statement, the first sub-reply statement, the second statement, the second sub-reply statement, the third statement, the third sub-reply statement, the fourth statement, the fourth sub-reply statement and the fifth statement S5 in the first sentence into the pre-trained GPT language model to obtain the fifth sub-reply statement R5*, this data trains the pre-trained GPT language model once, using the same method, using multiple data to train the pre-trained GPT language model multiple times, and then generating an automatic reply model for psychological problems.

[0073] 205、Obtain the second identity information of the target helper, and the third sentence segment narrated by the target helper, input the second identity information and the third sentence segment into the automatic reply model for psychological problems to obtain a target reply result.

[0074] Among them, the second identity information of the embodiment is the identity information of the target helper, and the first identity information of the embodiment step 203 is the identity information of the helper for training.

[0075] For this embodiment, as an implementation manner, the second identity information and the third language segment are input into the psychological question automatic reply model to obtain a target reply result, including: inputting the second identity information and the third language segment into the psychological question automatic reply model; the psychological question automatic reply model outputs a first sub-target reply result of replying to a first target sentence according to the second identity information and the first target sentence of the third language segment; the psychological question automatic reply model outputs a second sub-target reply result of replying to a second target sentence according to the second identity information, the first target sentence, the first sub-target reply result and the second target sentence of the third language segment; until all target sentences of the third language segment are replied to, the corresponding sub-target reply results of all target sentences are summarized to obtain the target reply result.

[0076] Wherein, the third language segment does not need to be manually processed, as long as the third language segment is input into the psychological question automatic reply model, the model will process the third language segment, as shown in Figure 7 The third language segment B=(S1, R1, S2, R2, S3, R3), S1 is the first target sentence of the third language segment, R1 is the first sub-target reply result of replying to the first target sentence, S2 is the second target sentence of the third language segment, R2 is the second sub-target reply result of replying to the second target sentence, S3 is the third target sentence of the third language segment, R3 is the third sub-target reply result of replying to the third target sentence, and all target sentences in the third language segment are S1, S2 and S3, that is, all target sentences of the third language segment are replied to, the first sub-target reply result, the second sub-target reply result and the third sub-target reply result are summarized to obtain the target reply result.

[0077] 206, the target seeker performs a satisfaction evaluation on the target reply result.

[0078] For this embodiment, through the evaluation result of the target seeker performing the satisfaction evaluation on the target reply result, the accuracy of the psychological question automatic reply model can be verified, if the evaluation result does not reach a qualified threshold, a large amount of data is continuously acquired to train the model, so as to obtain a psychological question automatic reply model with higher accuracy.

[0079] The application discloses a method and device for generating a psychological problem automatic reply model and an equipment. The application first acquires a first sentence described by a helper and a second sentence in which a psychological consultant replies to the first sentence; a basic GPT language model is trained by using the first sentence to obtain the second sentence, and a pre-training GPT language model is generated; a marked reply sentence for solving the psychological problem of the helper is marked in the second sentence, the pre-training GPT language model is trained by using the first identity information of the helper and the first sentence to obtain the marked reply sentence, and a psychological problem automatic reply model is generated. Through the technical scheme in the application, the problem reply of the helper is automatically generated by the psychological problem automatic reply model, the problem of insufficient resources of the psychological consultant is solved, and the manpower is liberated. Meanwhile, the psychological problem automatic reply model is obtained based on two stages of data training, the pre-training GPT language model is obtained by training a large amount of unmarked data in the first stage, the data for solving the psychological problem of the helper is marked in the second stage, and the psychological problem automatic reply model is obtained by training the marked data, so that the obtained psychological problem can solve the problems of insufficient individualization of the problem reply and insufficient user experience, and the reply efficiency is improved.

[0080] Further, as a specific implementation of the method shown in Figure 1 and Figure 2 The application embodiment provides a device for generating a psychological problem automatic reply model, as shown in Figure 3 The device comprises a first acquisition module 31, a training module 32 and a generation module 33.

[0081] The first acquisition module 31 is used for acquiring the first sentence described by the helper and the second sentence in which the psychological consultant replies to the first sentence.

[0082] The training module 32 is used for training the basic GPT language model by using the first sentence to obtain the second sentence, and generating the pre-training GPT language model.

[0083] The generation module 33 is used for marking the reply sentence for solving the psychological problem of the helper in the second sentence, training the pre-training GPT language model by using the first identity information of the helper and the first sentence to obtain the reply sentence, and generating the psychological problem automatic reply model.

[0084] In a specific application scenario, a device for generating a psychological problem automatic reply model, as shown in Figure 4 The device further comprises a second acquisition module 34, which is specifically used for acquiring the second identity information of a target helper and a third sentence described by the target helper.

[0085] In a specific application scenario, a device for generating a psychological problem automatic reply model, as shown in Figure 4As shown, the reply module 35 can specifically include a first output unit 351, a second output unit 352, and a summary unit 353.

[0086] Correspondingly, in order to input the second identity information and the third language segment into the psychological question automatic reply model to obtain the target reply result, the method can specifically include the following steps: Figure 4 As shown, the reply module 35 can specifically include a first output unit 351, a second output unit 352, and a summary unit 353.

[0087] The first output unit 351 can be used for inputting the second identity information and the third language segment into the psychological question automatic reply model, and the psychological question automatic reply model outputs a first sub-target reply result of replying to a first target sentence according to the second identity information and the first target sentence of the third language segment.

[0088] The second output unit 352 can be used for the psychological question automatic reply model to output a second sub-target reply result of replying to a second target sentence according to the second identity information, the first target sentence, the first sub-target reply result, and the second target sentence of the third language segment.

[0089] The summary unit 353 can be used for summarizing the corresponding sub-target reply results of all target sentences to obtain the target reply result until the reply to all target sentences of the third language segment is completed.

[0090] In a specific application scenario, in order to train the basic GPT language model by using the first language segment to obtain the second language segment, the method can specifically include the following steps: Figure 4 As shown, the training module 32 can specifically include a first training unit 321, a second training unit 322, and a first end unit 323.

[0091] The first training unit 321 can be used for training the basic GPT language model by using a first sentence of the first language segment to obtain a first sub-reply sentence in the second language segment that replies to the first sentence.

[0092] The second training unit 322 can be used for training the basic GPT language model by using the first sentence, the first sub-reply sentence, and a second sentence of the first language segment to obtain a second sub-reply sentence in the second language segment that replies to the second sentence.

[0093] The first end unit 323 can be used for training all sentences of the second language segment until the training is completed.

[0094] In a specific application scenario, in order to train the pre-trained GPT language model by using the first identity information of the seeker and the first language segment to obtain the marked reply sentence, the method can specifically include the following steps: Figure 4As shown, the generation module 33 may specifically include: a first determining unit 331, a first input unit 332, a second determining unit 333, a second input unit 334, and a second ending unit 335;

[0095] The first determining unit 331 can be used to determine whether the first sub-response statement is a marked response statement;

[0096] The first input unit 332 can be used to input the first identity information of the person seeking help and the first statement into the pre-trained GPT language model to obtain the marked response statement if the first sub-response statement is a marked response statement;

[0097] The second determining unit 333 can be used to determine whether the second sub-response statement is a marked response statement if the first sub-response statement is not a marked response statement.

[0098] The second input unit 334 can be used to input the first identity information, the first statement, the first reply statement and the second statement into the pre-trained GPT language model to obtain the marked reply statement if the second sub-reply statement is a marked reply statement;

[0099] The second termination unit 335 can be used until all marked response statements are received.

[0100] In specific application scenarios, a device for generating an automatic response model for psychological problems, such as... Figure 4 As shown, it also includes: evaluation module 36, which can be used by the target help seeker to evaluate the satisfaction of the target response result.

[0101] It should be noted that other corresponding descriptions of the functional units involved in the automatic response model generation device for psychological problems provided in this embodiment can be found in [reference needed]. Figures 1 to 2 The corresponding description will not be repeated here.

[0102] Based on the above, Figures 1 to 2 Accordingly, this embodiment also provides a storage medium, which may be volatile or non-volatile, storing computer-readable instructions thereon. When these instructions are executed by a processor, they implement the above-described method. Figures 1 to 2 The method for generating the automatic response model for psychological problems is shown.

[0103] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a storage medium (such as a CD-ROM, USB flash drive, or portable hard drive) and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods of various implementation scenarios of this application.

[0104] Based on the above,Figures 1 to 2 The method and Figure 3 、 Figure 4 In order to achieve the above-mentioned purposes, the virtual device embodiment shown also provides a computer device, which comprises a storage medium and a processor; the storage medium is used for storing a computer program; and the processor is used for executing the computer program to realize the above-mentioned Figures 1 to 2 The method for generating the automatic reply model of the psychological question.

[0105] Optionally, the computer device can further comprise a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and the like. The user interface can comprise a display screen, an input unit such as a keyboard, and the like. Optionally, the user interface can further comprise a USB interface, a card reader interface, and the like. The network interface can optionally comprise a standard wired interface, a wireless interface (such as a WI-FI interface), and the like.

[0106] Those skilled in the art can understand that the structure of the computer device provided by the embodiment does not constitute a limitation on the entity device, and can comprise more or fewer components, or combine certain components, or different component arrangements.

[0107] The storage medium can further comprise an operating system and a network communication module. The operating system is a program for managing hardware and software resources of the computer device, and supports the running of an information processing program and other software and / or programs. The network communication module is used for realizing the communication between components in the storage medium, and the communication with other hardware and software in the information processing entity device.

[0108] Those skilled in the art can clearly understand from the above description of the embodiments that the application can be realized by means of software and necessary general hardware platforms, or by hardware.

[0109] Compared with the prior art, the application discloses a method and device for generating a psychological problem automatic reply model, and the method comprises the following steps: acquiring a first sentence described by a helper and a second sentence in which a psychological consultant replies to the first sentence; training a basic GPT language model by using the first sentence to obtain the second sentence and generate a pre-training GPT language model; marking a marked reply sentence for solving the psychological problem of the helper in the second sentence, training the pre-training GPT language model by using the first identity information of the helper and the first sentence to obtain the marked reply sentence, and generating a psychological problem automatic reply model. Through the technical solution in the application, the psychological problem automatic reply model is used to automatically generate a reply to the problem of the helper, the problem of insufficient resources of psychological consultants is solved, and human resources are liberated. Meanwhile, because a large amount of data cannot be marked completely, the psychological problem automatic reply model is obtained based on two stages of data training. In the first stage, the pre-training GPT language model is obtained by training a large amount of unmarked data. In the second stage, the data for solving the psychological problem of the helper is marked, and the psychological problem automatic reply model is obtained by training the marked data. The obtained psychological problem can solve the problems of insufficient personalized problem reply and insufficient user experience, and the reply efficiency is improved.

[0110] Those skilled in the art can understand that the drawings are only schematic diagrams of preferred implementation scenarios, and the modules or processes in the drawings are not necessarily required for implementing the application. Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed and located in one or more devices different from the implementation scenario. The modules of the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0111] The above application numbers are only for description, and do not represent the advantages and disadvantages of the implementation scenario. The above disclosure is only some specific implementation scenarios of the application, but the application is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the application.

Claims

1. A method for generating a model for automatically answering psychological questions, characterized by, The method comprises the following steps: obtaining a first language segment described by a seeker and a second language segment in which a psychological consultant replies to the first language segment; training a basic GPT language model by using the first language segment to obtain the second language segment, and generating a pre-training GPT language model; labeling a marked reply sentence in the second language segment that solves the psychological problem of the seeker, training the pre-training GPT language model by using the first identity information of the seeker and the first language segment to obtain the marked reply sentence, and generating an automatic reply model for a psychological problem; the step of training the basic GPT language model by using the first language segment to obtain the second language segment comprises the following steps: training the basic GPT language model by using a first sentence of the first language segment to obtain a first sub-reply sentence in the second language segment that replies to the first sentence; training the basic GPT language model by using the first sentence, the first sub-reply sentence and a second sentence of the first language segment to obtain a second sub-reply sentence in the second language segment that replies to the second sentence; training the basic GPT language model until all sentences of the second language segment are trained; the step of training the pre-training GPT language model by using the first identity information of the seeker and the first language segment to obtain the marked reply sentence comprises the following steps: determining whether the first sub-reply sentence is the marked reply sentence; if the first sub-reply sentence is the marked reply sentence, inputting the first identity information of the seeker and the first sentence into the pre-training GPT language model to obtain the marked reply sentence; if the first sub-reply sentence is not the marked reply sentence, determining whether the second sub-reply sentence is the marked reply sentence; if the second sub-reply sentence is the marked reply sentence, inputting the first identity information, the first sentence, the first reply sentence and the second sentence into the pre-training GPT language model to obtain the marked reply sentence; training the pre-training GPT language model until all the marked reply sentences are obtained.

2. The method of claim 1, wherein, The method further comprises the following steps: obtaining second identity information of a target seeker and a third language segment described by the target seeker; inputting the second identity information and the third language segment into the automatic reply model for a psychological problem to obtain a target reply result.

3. The method of claim 2, wherein, The step of inputting the second identity information and the third language segment into the automatic reply model for a psychological problem to obtain a target reply result comprises the following steps: inputting the second identity information and the third language segment into the automatic reply model for a psychological problem; the automatic reply model for a psychological problem outputs a first sub-target reply result that replies to a first target sentence of the third language segment according to the second identity information and the first target sentence; the automatic reply model for a psychological problem outputs a second sub-target reply result that replies to a second target sentence of the third language segment according to the second identity information, the first target sentence, the first sub-target reply result and the second target sentence; training the pre-training GPT language model until all target sentences of the third language segment are replied to, and obtaining a target reply result by summarizing corresponding sub-target reply results of all the target sentences.

4. The method of claim 2, wherein, After the target reply result is obtained, the method further comprises: The target seeker performs satisfaction evaluation on the target reply result.

5. A device for generating an automatic response model for psychological problems, characterized in that, Comprise: The first acquisition module is used for acquiring a first sentence described by a seeker and a second sentence in which a psychological consultant replies to the first sentence; The training module is used for training a basic GPT language model by using the first sentence to obtain the second sentence, and generating a pre-training GPT language model; The generation module is used for marking a reply sentence in the second sentence that solves the psychological problem of the seeker, training the pre-training GPT language model by using the first identity information of the seeker and the first sentence to obtain the reply sentence, and generating an automatic reply model for psychological problems; The training module comprises a first training unit, a second training unit and a first ending unit. The first training unit is used for training the basic GPT language model by using a first sentence of the first sentence to obtain a first sub-reply sentence in the second sentence that replies to the first sentence; The second training unit is used for training the basic GPT language model by using the first sentence, the first sub-reply sentence and a second sentence of the first sentence to obtain a second sub-reply sentence in the second sentence that replies to the second sentence; The first ending unit is used until the training of all sentences in the second sentence is completed. The generation module comprises a first determination unit, a first input unit, a second determination unit, a second input unit and a second ending unit. The first determination unit is used for determining whether the first sub-reply sentence is a marked reply sentence; The first input unit is used for inputting the first identity information of the seeker, the first sentence into the pre-training GPT language model to obtain the marked reply sentence if the first sub-reply sentence is the marked reply sentence; The second determination unit is used for determining whether the second sub-reply sentence is a marked reply sentence if the first sub-reply sentence is not the marked reply sentence; The second input unit is used for inputting the first identity information, the first sentence, the first reply sentence and the second sentence into the pre-training GPT language model to obtain the marked reply sentence if the second sub-reply sentence is the marked reply sentence; The second ending unit is used until all the marked reply sentences are obtained.

6. The apparatus of claim 5, wherein, The device further comprises: The second acquisition module is used for acquiring second identity information of a target seeker and a third sentence described by the target seeker; The reply module is used for inputting the second identity information and the third sentence into the automatic reply model for psychological problems to obtain a target reply result.

7. A storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the generation method of the automatic reply model for psychological problems in any one of claims 1 to 4.

8. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, The processor executes the program to implement the generation method of the automatic reply model for psychological problems in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Depression interview dialogue generation method based on pre-training language model

    CN113780012A

  • End-to-end generation type psychological counseling dialogue system

    CN114443819A