Method, device and storage medium for replying speech in online psychological consultation
By constructing a psychological counseling speech recommendation and matching model based on GPT and BERT, and integrating output to construct an improved model, the problem of repetition and response difficulties in online psychological counseling is solved, and the efficiency and quality of consultation is improved.
Patent Information
- Application Number
- CN202210681104.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-06-16
AI Technical Summary
In online psychological counseling, the repetition of psychological counselors wastes time and energy, and it is difficult to quickly respond to diverse mental health problems.
The psychological counseling speech recommendation model and matching model are constructed based on the GPT and BERT networks, and the improved model is constructed through the fusion of the output results of the two, which is used to respond to the consultation of the target psychological counselor online.
It improves the efficiency and quality of online psychological counseling, reduces the dependence on manual operations, and can select different models to obtain the best response statements according to actual conditions.
Smart Images

Figure CN114927221B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence and neural network technology. More specifically, the present application relates to a method, device and storage medium for responding to online psychological counseling. Background Art
[0002] The rapid development of society and economy is accompanied by a rapidly changing environment, which has a huge impact on people's psychology. Nowadays, mental health problems have become very common, such as anxiety, depression, irritability and other mental health problems. It is worth noting that more and more people are beginning to pay attention to mental health, and people are beginning to seek mental health services to alleviate mental health problems, the most common of which is psychological counseling.
[0003] The counselor's reply is very important. Generally speaking, in similar psychological problem scenarios and specific counseling strategies, counselors' reply words are similar, especially in online counseling. If you repeat the reply, it will waste a lot of time and energy. Summary of the invention
[0004] Based on the above technical problems, the present invention aims to construct a psychological counseling speech recommendation model and a psychological counseling speech matching model based on neural networks, and to construct an improved model by integrating the output results of the two models, and to use the improved model to respond to target psychological counseling customers.
[0005] A first aspect of the present invention provides a speech reply method applied to online psychological consultation, the method comprising:
[0006] Construct a psychological counseling speech recommendation model based on the GPT network;
[0007] Construct a psychological counseling speech matching model based on the BERT network;
[0008] Training the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0009] The output results of the trained psychological counseling script recommendation model and the trained psychological counseling script matching model are integrated to build a psychological counseling script improvement model;
[0010] According to the actual application situation, the trained psychological counseling speech recommendation model and psychological counseling speech matching model are used to respond to the target psychological counselors' consultations online, or the trained psychological counseling speech improvement model is used to respond to the target psychological counselors' consultations online.
[0011] In some embodiments of the present invention, the training of the psychological counseling speech recommendation model includes:
[0012] The psychological counseling speech recommendation model is trained in two stages, wherein the first stage adopts an unsupervised training method and the second stage adopts a supervised training method;
[0013] The first phase of the psychological counseling script recommendation model was trained based on a large corpus;
[0014] Based on the training results of the first phase, the psychological counseling dialogue recommendation model of the second phase is trained in combination with the online psychological counseling dialogue dataset.
[0015] In some embodiments of the present invention, according to actual application conditions, a trained psychological counseling speech recommendation model and a psychological counseling speech matching model are used to respond to the consultation of a target psychological counselor online, or a trained psychological counseling speech improvement model is used to respond to the consultation of a target psychological counselor online, including:
[0016] Obtaining consultation from a target psychological consultant, wherein the consultation from the target psychological consultant includes a plurality of consultation statements;
[0017] Inputting the current consultation sentence from the plurality of consultation sentences into the trained psychological consultation speech recommendation model, and if a first reply sentence with the highest probability is obtained, inputting the first reply sentence into the trained psychological consultation speech matching model to obtain a standard reply sentence matching the current consultation sentence, and using the standard reply sentence as the second reply sentence;
[0018] If the trained psychological counseling speech recommendation model outputs a result that there is no speech, inputting the current counseling sentence among the plurality of counseling sentences into the trained psychological counseling speech improvement model;
[0019] Based on the output results of the trained psychological counseling speech improvement model, the target psychological counselor's consultation is responded to online.
[0020] In some embodiments of the present invention, the online reply to the consultation of the target psychological consultant based on the output result of the trained psychological consultation speech improvement model includes:
[0021] If the confidence level of the trained psychological counseling speech improvement model output is higher than a preset threshold, a recommended reply list corresponding to the confidence level of the output is obtained;
[0022] A reply to the current consultation statement is determined according to the recommended reply list, and the determined reply to the current consultation statement is used as the third reply statement.
[0023] In some embodiments of the present invention, after determining the reply to the current consultation statement according to the recommended reply list, and using the determined reply to the current consultation statement as the third reply statement, it also includes: adding the third reply statement to the online psychological counseling dialogue data set to train a psychological counseling speech recommendation model to iteratively optimize the psychological counseling speech recommendation model.
[0024] In some embodiments of the present invention, inputting the first reply statement into the trained psychological counseling speech matching model to obtain a standard reply statement matching the current counseling statement, and using the standard reply statement as the second reply statement includes:
[0025] Inputting the first reply sentence into the trained psychological counseling speech matching model;
[0026] Determining whether the first reply sentence contains any words that do not conform to the specification;
[0027] If so, modify the non-compliant vocabulary to a standard vocabulary;
[0028] The sentence containing the standard vocabulary is used as a standard reply sentence matching the current consultation sentence and as a second reply sentence.
[0029] In some embodiments of the present invention, the method further includes: using a clustering algorithm to perform clustering during the process of training the psychological counseling speech recommendation model, and obtaining a psychological counseling response label based on the clustering result.
[0030] A second aspect of the present invention provides a speech reply device for online psychological consultation, the device comprising:
[0031] The first building module is used to build a psychological counseling speech recommendation model based on the GPT network;
[0032] The second building module is used to build a psychological counseling speech matching model based on the BERT network;
[0033] A training module, used for training the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0034] Improvement module, which is used to integrate the output results of the trained psychological counseling speech recommendation model and the psychological counseling speech matching model to build a psychological counseling speech improvement model;
[0035] The reply module is used to reply to the consultation of the target psychological consultant online by using the trained psychological counseling speech recommendation model and the psychological counseling speech matching model, or to reply to the consultation of the target psychological consultant online by using the trained psychological counseling speech improvement model according to the actual application situation.
[0036] A third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the following steps:
[0037] Construct a psychological counseling speech recommendation model based on the GPT network;
[0038] Construct a psychological counseling speech matching model based on the BERT network;
[0039] Training the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0040] The output results of the trained psychological counseling script recommendation model and the trained psychological counseling script matching model are integrated to build a psychological counseling script improvement model;
[0041] According to the actual application situation, the trained psychological counseling speech recommendation model and psychological counseling speech matching model are used to respond to the target psychological counselors' consultations online, or the trained psychological counseling speech improvement model is used to respond to the target psychological counselors' consultations online.
[0042] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0043] Construct a psychological counseling speech recommendation model based on the GPT network;
[0044] Construct a psychological counseling speech matching model based on the BERT network;
[0045] Training the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0046] The output results of the trained psychological counseling script recommendation model and the trained psychological counseling script matching model are integrated to build a psychological counseling script improvement model;
[0047] According to the actual application situation, the trained psychological counseling speech recommendation model and psychological counseling speech matching model are used to respond to the target psychological counselors' consultations online, or the trained psychological counseling speech improvement model is used to respond to the target psychological counselors' consultations online.
[0048] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:
[0049] This application constructs a psychological counseling speech improvement model by integrating the output results of a trained psychological counseling speech recommendation model and a trained psychological counseling speech matching model. According to the actual application situation, the trained psychological counseling speech recommendation model and the psychological counseling speech matching model are used to reply to the consultation of the target psychological counselor online, or the trained psychological counseling speech improvement model is used to reply to the consultation of the target psychological counselor online, which can help improve the speech of online consultation and improve the quality of psychological consultation. In particular, different models are selected according to the actual situation to obtain the best reply sentence, which reduces the dependence on manual operation, saves time, and improves the efficiency of online psychological consultation.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0052] Figure 1 A schematic diagram of the steps of a speech reply method applied to online psychological consultation in an exemplary embodiment of the present application is shown;
[0053] Figure 2 A schematic diagram of a partial working process of a speech reply method applied to online psychological consultation in an exemplary embodiment of the present application is shown;
[0054] Figure 3 A schematic diagram of the structure of a speech reply device applied to online psychological consultation in an exemplary embodiment of the present application is shown;
[0055] Figure 4 A schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application is shown;
[0056] Figure 5 A schematic diagram of a storage medium provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0057] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present application. It is obvious to those skilled in the art that the present application can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present application, some technical features known in the art are not described.
[0058] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of the features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0059] Now, exemplary embodiments according to the present application will be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments may be implemented in a variety of different forms and should not be construed as being limited to the embodiments described herein. The accompanying drawings are not drawn to scale, and certain details may be magnified and certain details may be omitted for the purpose of clear expression. The shapes of the various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are merely exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0060] The following is attached to the instruction manual Figure 1 -Attached Figure 5 Several embodiments are given to describe exemplary implementations according to the present application. It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementations of the present application are not limited in this regard. On the contrary, the implementations of the present application can be applied to any applicable scenario.
[0061] Embodiment 1:
[0062] This embodiment provides a method for replying to online psychological consultations. Figure 1 As shown, the method includes:
[0063] S1. Construct a psychological counseling speech recommendation model based on GPT network;
[0064] S2. Construct a psychological counseling speech matching model based on the BERT network;
[0065] S3, training the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0066] S4. Construct a psychological counseling speech improvement model by integrating the output results of the trained psychological counseling speech recommendation model and the trained psychological counseling speech matching model;
[0067] S5. According to the actual application situation, use the trained psychological counseling speech recommendation model and psychological counseling speech matching model to respond to the target psychological counselors' consultations online, or use the trained psychological counseling speech improvement model to respond to the target psychological counselors' consultations online.
[0068] In a specific implementation, training a psychological counseling script recommendation model includes: training the psychological counseling script recommendation model in two stages, wherein the first stage adopts an unsupervised training method and the second stage adopts a supervised training method; training the psychological counseling script recommendation model of the first stage based on a large corpus; and training the psychological counseling script recommendation model of the second stage based on the training results of the first stage and combining it with an online psychological counseling dialogue data set.
[0069] In a specific implementation method, according to the actual application situation, a trained psychological counseling speech recommendation model and a psychological counseling speech matching model are used to respond to the consultation of the target psychological counselor online, or a trained psychological counseling speech improvement model is used to respond to the consultation of the target psychological counselor online, including: obtaining the consultation of the target psychological counselor, wherein the consultation of the target psychological counselor includes multiple consultation sentences; inputting the current consultation sentence among the multiple consultation sentences into the trained psychological counseling speech recommendation model, if the first reply sentence with the highest probability is obtained, inputting the first reply sentence into the trained psychological counseling speech matching model to obtain a standard reply sentence matching the current consultation sentence, and using the standard reply sentence as the second reply sentence; if the output result of the trained psychological counseling speech recommendation model is no speech, inputting the current consultation sentence among the multiple consultation sentences into the trained psychological counseling speech improvement model; and responding to the consultation of the target psychological counselor online based on the output result of the trained psychological counseling speech improvement model.
[0070] In a specific implementation, the target psychological consultant's consultation is replied online based on the output result of the trained psychological counseling speech improvement model, including: if the confidence level of the output of the trained psychological counseling speech improvement model is higher than a preset threshold, a recommended reply list corresponding to the output confidence level is obtained; a reply to the current consultation statement is determined according to the recommended reply list, and the determined reply to the current consultation statement is used as the third reply statement.
[0071] In a specific implementation, preferably, after determining the reply to the current consultation statement according to the recommended reply list, and using the determined reply to the current consultation statement as the third reply statement, it also includes: adding the third reply statement to the online psychological counseling dialogue data set to train the psychological counseling speech recommendation model to iteratively optimize the psychological counseling speech recommendation model.
[0072] In a specific implementation, the first reply sentence is input into a trained psychological counseling speech matching model to obtain a standard reply sentence that matches the current counseling sentence, and the standard reply sentence is used as the second reply sentence, including: inputting the first reply sentence into a trained psychological counseling speech matching model; determining whether there are non-standard vocabulary in the first reply sentence; if so, modifying the non-standard vocabulary into standard vocabulary; using the sentence containing standard vocabulary as the standard reply sentence that matches the current counseling sentence, and as the second reply sentence.
[0073] In a specific implementation, the method further includes: using a clustering algorithm to perform clustering in the process of training the psychological counseling speech recommendation model, and obtaining psychological counseling reply labels based on the clustering results. Of course, the labels here also include "no speech" labels.
[0074] This application constructs a psychological counseling speech improvement model by integrating the output results of a trained psychological counseling speech recommendation model and a trained psychological counseling speech matching model. According to the actual application situation, the trained psychological counseling speech recommendation model and the psychological counseling speech matching model are used to reply to the consultation of the target psychological counselor online, or the trained psychological counseling speech improvement model is used to reply to the consultation of the target psychological counselor online, so as to help improve the speech of the online consultation reply and improve the quality of psychological counseling. In particular, different models are selected according to the actual situation to obtain the best reply sentence, which reduces the dependence on manual operation, saves time, and improves the efficiency of online psychological counseling.
[0075] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.
[0076] Embodiment 2:
[0077] This embodiment provides a method for responding to online psychological consultations, and the specific steps included in the method are described in detail as follows.
[0078] The first step is to build a psychological counseling script recommendation model based on the GPT network.
[0079] It should be noted that GPT, which stands for Generative Pre-trained Transformer, is a very powerful pre-trained language model proposed by OpenAI. This series of models can achieve amazing results in very complex natural language processing (NLP) tasks, such as article generation, code generation, machine translation, etc. The psychological counseling speech recommendation model based on the GPT network adheres to the idea of continuous stacking, including four parts: input, output, encoder, and decoder. The model continuously improves the scale and quality of the training corpus.
[0080] The second step is to build a psychological counseling speech matching model based on the BERT network.
[0081] BERT stands for Bidirectional Encoder Representation from Transformer. BERT is based on the autoencoder model. The psychological counseling speech matching model modifies the irregular words in a sentence into standard ones, including deleting, modifying or adding individual words. The psychological counseling speech matching model is more suitable for BERT structures such as the autoencoder model. In this application, for the responses to online psychological counseling, the psychological counseling speech recommendation model and the psychological counseling speech matching model are used at the same time, and the psychological counseling speech improvement model can be used alone. Therefore, it can meet the needs of different application scenarios or situations.
[0082] The third step is to train the psychological counseling speech recommendation model and the psychological counseling speech matching model.
[0083] Specifically, the psychological counseling script recommendation model is trained in two stages, where the first stage uses unsupervised training and the second stage uses supervised training; the first stage psychological counseling script recommendation model is trained based on a large corpus; based on the training results of the first stage, the second stage psychological counseling script recommendation model is trained in combination with an online psychological counseling dialogue dataset. The large corpus contains a massive amount of data, and the online psychological counseling dialogue dataset includes a large number of online psychological counseling dialogues and historical texts commonly used in face-to-face psychological counseling.
[0084] In the training process, clustering algorithms are used for clustering. In the clustering results, clustered speech with more than m speech words in the cluster is selected, and in each cluster speech, the speech with the closest distance to other speech words in the same cluster (that is, the text similarity between each two psychological counseling speech words is used as the distance between the two speech words) is selected as the speech representative of the cluster. Finally, each selected cluster is used as a type of psychological counseling speech label, and each type of psychological counseling speech is represented by the selected speech with the closest distance to other speech words in the same cluster, that is, a total of N speech labels. Here, m and N are both greater than 0. Of course, the label here also includes the "no speech" label.
[0085] The fourth step is to integrate the output results of the trained psychological counseling script recommendation model and the trained psychological counseling script matching model to construct a psychological counseling script improvement model.
[0086] Here you can refer to Figure 2 , the output results of the trained psychological counseling speech recommendation model and the trained psychological counseling speech matching model are integrated to build a psychological counseling speech improvement model. The structure of the psychological counseling speech improvement model can choose the GPT network structure, but it is necessary to configure a multi-classification model so that the output result of the psychological counseling speech improvement model is a list of recommended replies corresponding to the confidence level. Figure 2 As shown, the psychological counseling script recommendation model relies on historical psychological counseling data during training, while the psychological counseling script matching model relies on the psychological counselor's reply utterances during training. The output results of the trained psychological counseling script recommendation model are input into the psychological counseling script matching model, that is, the output results of the psychological counseling script matching model are integrated to form an improved result, and then the data corresponding to the improved result is used to train the psychological counseling script improvement model.
[0087] The fifth step is to use the trained psychological counseling script recommendation model and psychological counseling script matching model to respond to the target psychological counselors' consultations online, or use the trained psychological counseling script improvement model to respond to the target psychological counselors' consultations online, according to the actual application situation.
[0088] In a specific implementation method, according to the actual application situation, a trained psychological counseling speech recommendation model and a psychological counseling speech matching model are used to reply to the consultation of the target psychological counselor online, or a trained psychological counseling speech improvement model is used to reply to the consultation of the target psychological counselor online, including: obtaining the consultation of the target psychological counselor, wherein the consultation of the target psychological counselor includes multiple consultation sentences; inputting the current consultation sentence in the multiple consultation sentences into the trained psychological counseling speech recommendation model, if the first reply sentence with the highest probability is obtained, the first reply sentence is input into the trained psychological counseling speech matching model to obtain a standard reply sentence matching the current consultation sentence, and the standard reply sentence is used as the second reply sentence; if the output result of the trained psychological counseling speech recommendation model is no speech, the current consultation sentence in the multiple consultation sentences is input into the trained psychological counseling speech improvement model; based on the output result of the trained psychological counseling speech improvement model, the consultation of the target psychological counselor is replied online. Therefore, this application can help improve the speech of online consultation and improve the quality of psychological consultation. In particular, different models are selected according to the actual situation to obtain the best reply sentence, which reduces the dependence on manual operation, saves time, and improves the efficiency of online psychological consultation.
[0089] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention.
[0090] Embodiment 3:
[0091] This embodiment provides a speech reply device for online psychological consultation, such as Figure 3 As shown, the device comprises:
[0092] The first construction module 301 is used to construct a psychological counseling speech recommendation model based on the GPT network;
[0093] The second construction module 302 is used to construct a psychological counseling speech matching model based on the BERT network;
[0094] A training module 303 is used to train the psychological counseling speech recommendation model and the psychological counseling speech matching model;
[0095] Improvement module 304, used to integrate the output results of the trained psychological counseling speech recommendation model and the psychological counseling speech matching model to construct a psychological counseling speech improvement model;
[0096] The reply module 305 is used to reply to the consultation of the target psychological consultant online by using the trained psychological counseling speech recommendation model and the psychological counseling speech matching model, or to reply to the consultation of the target psychological consultant online by using the trained psychological counseling speech improvement model according to the actual application situation.
[0097] It is understandable that the speech response device applied to online psychological counseling also includes a server and a corresponding online counseling application program, etc., which is not specifically limited here.
[0098] It should also be emphasized that the system provided in 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 of simulating, extending and expanding human intelligence, perceiving the environment, acquiring knowledge and using knowledge to obtain the best results using digital computers or machines controlled by digital computers. Basic artificial intelligence technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, robotics, biometrics, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0099] Please refer to the following Figure 4 , which shows a schematic diagram of a computer device provided by some embodiments of the present application. Figure 4 As shown, the computer device 2 includes: a processor 200, a memory 201, a bus 202 and a communication interface 203, and the processor 200, the communication interface 203 and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can be run on the processor 200, and when the processor 200 runs the computer program, it executes the speech response method for online psychological counseling provided in any of the aforementioned embodiments of the present application.
[0100] The memory 201 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0101] The bus 202 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs, and the processor 200 executes the programs after receiving the execution instruction. The speech reply method for online psychological counseling disclosed in any implementation of the above-mentioned embodiment of the present application may be applied to the processor 200, or implemented by the processor 200.
[0102] The processor 200 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 200. The above processor 200 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 201, and the processor 200 reads the information in the memory 201 and completes the steps of the above method in combination with its hardware.
[0103] The present application also provides a computer-readable storage medium corresponding to the speech reply method for online psychological counseling provided in the above embodiment. Figure 5 , Figure 5 The computer-readable storage medium shown is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is executed by a processor, the method for responding to conversations applied to online psychological counseling provided in any of the aforementioned embodiments will be executed.
[0104] In addition, examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0105] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the method for allocating channels for quantum key distribution in a space-division multiplexed optical network provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0106] The present application embodiment also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the speech response method applied to online psychological counseling provided in any of the aforementioned embodiments, including: constructing a psychological counseling speech recommendation model based on the GPT network; constructing a psychological counseling speech matching model based on the BERT network; training the psychological counseling speech recommendation model and the psychological counseling speech matching model; integrating the output results of the trained psychological counseling speech recommendation model and the trained psychological counseling speech matching model to construct a psychological counseling speech improvement model; according to actual application conditions, using the trained psychological counseling speech recommendation model and the psychological counseling speech matching model to respond to the consultation of the target psychological counselor online, or using the trained psychological counseling speech improvement model to respond to the consultation of the target psychological counselor online.
[0107] It should be noted that the algorithms and displays provided herein are not inherently related to any particular computer, virtual device or other device. Various general devices can also be used together with the teachings based thereon. According to the above description, it is obvious that the structure required for constructing such devices is constructed. In addition, the present application is not directed to any specific programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the above description of specific languages is to disclose the best implementation mode of the present application. In the specification provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this specification.
[0108] Similarly, it should be understood that in order to streamline the present application and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present application.
[0109] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition they can be divided into multiple submodules or subunits or subassemblies. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification and all processes or units of any method or device disclosed in this manner can be combined in any combination. Unless otherwise clearly stated, each feature disclosed in this specification can be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0110] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the creation device of the virtual machine according to the embodiment of the present application. The present application can also be implemented as a device or device program for executing part or all of the methods described herein. The program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0111] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A speech reply method applied to online psychological consultation, characterized in that: The method comprises: Construct a psychological counseling speech recommendation model based on the GPT network; Construct a psychological counseling speech matching model based on the BERT network; Training the psychological counseling speech recommendation model and the psychological counseling speech matching model; The output results of the trained psychological counseling script recommendation model and the trained psychological counseling script matching model are integrated to build a psychological counseling script improvement model; According to the actual application situation, the trained psychological counseling speech recommendation model and psychological counseling speech matching model are used to respond to the consultations of the target psychological counselors online, or the trained psychological counseling speech improvement model is used to respond to the consultations of the target psychological counselors online; According to the actual application situation, the trained psychological counseling speech recommendation model and the psychological counseling speech matching model are used to respond to the consultation of the target psychological counselor online, or the trained psychological counseling speech improvement model is used to respond to the consultation of the target psychological counselor online, including: Obtaining consultation from a target psychological consultant, wherein the consultation from the target psychological consultant includes a plurality of consultation statements; Inputting the current consultation sentence from the plurality of consultation sentences into the trained psychological consultation speech recommendation model, and if a first reply sentence with the highest probability is obtained, inputting the first reply sentence into the trained psychological consultation speech matching model to obtain a standard reply sentence matching the current consultation sentence, and using the standard reply sentence as the second reply sentence; If the trained psychological counseling speech recommendation model outputs a result that there is no speech, inputting the current counseling sentence among the plurality of counseling sentences into the trained psychological counseling speech improvement model; Based on the output results of the trained psychological counseling speech improvement model, the target psychological counselor's consultation is responded to online.
2. The speech reply method for online psychological consultation according to claim 1 is characterized in that: The training of the psychological counseling speech recommendation model includes: The psychological counseling speech recommendation model is trained in two stages, wherein the first stage adopts an unsupervised training method and the second stage adopts a supervised training method; The first phase of the psychological counseling script recommendation model was trained based on a large corpus; Based on the training results of the first phase, the psychological counseling dialogue recommendation model of the second phase is trained in combination with the online psychological counseling dialogue dataset.
3. The speech reply method for online psychological consultation according to claim 1 is characterized in that: The online reply to the consultation of the target psychological consultant based on the output result of the trained psychological consultation speech improvement model includes: If the confidence level of the trained psychological counseling speech improvement model output is higher than a preset threshold, a recommended reply list corresponding to the confidence level of the output is obtained; A reply to the current consultation statement is determined according to the recommended reply list, and the determined reply to the current consultation statement is used as the third reply statement.
4. The speech reply method for online psychological consultation according to claim 3 is characterized in that: After determining the reply to the current consultation statement according to the recommended reply list, and using the determined reply to the current consultation statement as the third reply statement, it also includes: adding the third reply statement to the online psychological counseling dialogue data set to train the psychological counseling speech recommendation model to iteratively optimize the psychological counseling speech recommendation model.
5. The speech reply method for online psychological consultation according to claim 1 is characterized in that: Inputting the first reply statement into the trained psychological counseling speech matching model to obtain a standard reply statement matching the current counseling statement, and using the standard reply statement as the second reply statement, including: Inputting the first reply sentence into the trained psychological counseling speech matching model; Determining whether the first reply sentence contains any words that do not conform to the specification; If so, modify the non-compliant vocabulary to a standard vocabulary; The sentence containing the standard vocabulary is used as a standard reply sentence matching the current consultation sentence and as a second reply sentence.
6. The speech reply method for online psychological consultation according to claim 2 is characterized in that: The method also includes: using a clustering algorithm to perform clustering during the training of the psychological counseling speech recommendation model, and obtaining a psychological counseling response label based on the clustering result.
7. A speech reply device for online psychological consultation, characterized in that: The device comprises: The first building module is used to build a psychological counseling speech recommendation model based on the GPT network; The second building module is used to build a psychological counseling speech matching model based on the BERT network; A training module, used for training the psychological counseling speech recommendation model and the psychological counseling speech matching model; Improvement module, which is used to integrate the output results of the trained psychological counseling speech recommendation model and the psychological counseling speech matching model to build a psychological counseling speech improvement model; A reply module is used to reply to the consultation of the target psychological consultant online by using the trained psychological consultation speech recommendation model and the psychological consultation speech matching model, or to reply to the consultation of the target psychological consultant online by using the trained psychological consultation speech improvement model according to the actual application situation; According to the actual application situation, the trained psychological counseling speech recommendation model and the psychological counseling speech matching model are used to respond to the consultation of the target psychological counselor online, or the trained psychological counseling speech improvement model is used to respond to the consultation of the target psychological counselor online, including: Obtaining consultation from a target psychological consultant, wherein the consultation from the target psychological consultant includes a plurality of consultation statements; Inputting the current consultation sentence from the plurality of consultation sentences into the trained psychological consultation speech recommendation model, and if a first reply sentence with the highest probability is obtained, inputting the first reply sentence into the trained psychological consultation speech matching model to obtain a standard reply sentence matching the current consultation sentence, and using the standard reply sentence as the second reply sentence; If the trained psychological counseling speech recommendation model outputs a result that there is no speech, inputting the current counseling sentence among the plurality of counseling sentences into the trained psychological counseling speech improvement model; Based on the output results of the trained psychological counseling speech improvement model, the target psychological counselor's consultation is responded to online.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Customer service oriented verbal trick recommendation method and device
CN110059182A
Verbal skill recommendation method and device and related equipment
CN113434651A