Psychological consultation processing method and device, computer equipment and storage medium

By constructing a high-quality psychological counseling dialogue data set and fine-tuning training of the pre-trained model, the problem of insufficient quality and diversity of existing psychological counseling dialogue data is solved, and a high-performance psychological counseling dialogue model is generated, which significantly improves the user experience.

CN120032811APending Publication Date: 2025-05-23PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510204993.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing psychological counseling dialogue data are uneven and lack of diversity, which makes it difficult for the psychological counseling dialogue model to learn comprehensive and high-quality dialogue modes during the training process, affecting the model performance and reliability, resulting in poor user experience.

Method used

By obtaining psychological counseling dialogue data from different data sources, preprocessing the data, extracting psychological counseling problems and their sub-problem tags, building a user problem description text set, and batch input it into a large language model to generate dialogue text, combining the text and target data, building a high-quality psychological counseling dialogue data set, fine-tuning the pre-trained model, and generating a high-performance psychological counseling dialogue model.

Benefits of technology

By building a high-quality and diverse psychological counseling conversation dataset and generating a high-performance psychological counseling conversation model, the user's psychological counseling experience is significantly improved and the problem of insufficient quality and diversity of existing data is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120032811A_ABST
    Figure CN120032811A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence and the field of medical health, and discloses a psychological counseling processing method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining psychological counseling dialogue data of different data sources, and obtaining target psychological counseling dialogue data; based on the target psychological counseling dialogue data, extracting various psychological counseling questions and sub-question labels corresponding to the psychological counseling questions, and constructing a user question description text set; inputting each user question description text in the user question description text set into a large language model in batches to generate a corresponding psychological counseling dialogue text; combining all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set; performing fine tuning training on the pre-training model to generate a psychological counseling dialogue model, processing a psychological counseling request of a target user, and feeding back a processing result to the target user terminal; according to the invention, a high-performance psychological counseling dialogue model can be generated, and the psychological counseling experience of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence technology and medical health, and in particular to a psychological consultation processing method, device, computer equipment and computer-readable storage medium. Background Art

[0002] At present, with the rapid development of artificial intelligence technologies such as machine learning, deep learning, and big data, the field of psychological counseling services has ushered in unprecedented changes. Artificial intelligence technology, especially the emergence of large language models, with its excellent natural language understanding and generation capabilities, provides strong support for the performance improvement of psychological counseling models. Implementing psychological counseling services by building intelligent models has become a new trend in the development of the industry.

[0003] At present, large language models are trained with massive amounts of text data to generate natural and fluent conversation content, providing new possibilities for the development of psychological counseling dialogue models. Such large psychological counseling models are usually implemented by training existing psychological counseling dialogue data. Their goal is to simulate the dialogue process between psychological counselors and users, and provide users with efficient and convenient psychological counseling services.

[0004] However, existing psychological counseling dialogue data has significant limitations. Due to differences in the professional level and experience of psychological counselors, the quality of counseling responses in these data varies. Some counseling responses may lack professionalism, coherence or depth, and it is difficult to meet high-standard modeling requirements. In addition, the amount of high-quality psychological counseling dialogue data screened from existing psychological counseling dialogues is limited and lacks diversity. This data limitation makes it difficult for existing models to learn comprehensive and high-quality dialogue patterns during training, which affects the performance and reliability of the model and leads to poor user experience in psychological counseling processing.

[0005] In the healthcare field, the quality of psychological counseling dialogue data is crucial to improving the level of intelligence in psychological counseling services. However, differences in the professional level and experience of counselors result in uneven quality of counseling responses, which affects the availability of data. Insufficient data and quality issues limit the development and application of psychological counseling dialogue models in the healthcare field, making it difficult to meet the needs of intelligent psychological counseling services.

[0006] In the field of financial technology, the development of intelligent customer service and financial consulting models also relies on high-quality psychological consulting conversation data. In customer consultation in the financial field, psychological factors (such as investment anxiety, consumer psychology, etc.) have an important impact on the decision-making process, so high-quality psychological consulting conversation data is essential for optimizing customer service and improving user experience. However, due to the professionalism of financial consulting and the privacy of data, existing conversation data often cannot meet the needs of model training. The lack of data and quality issues have led to the model's performance in practical applications being less than ideal, and it is unable to fully understand the psychological needs of customers and provide accurate advice.

[0007] To sum up, how to provide a psychological counseling processing method, device, computer equipment and computer-readable storage medium that can generate a high-performance psychological counseling dialogue model by constructing a high-quality and diverse psychological counseling dialogue data set to enhance the user's psychological counseling experience is a problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0008] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a psychological counseling processing method, apparatus, computer equipment and computer-readable storage medium, aiming to solve the problem of how to generate a high-performance psychological counseling dialogue model by constructing a high-quality and diverse psychological counseling dialogue data set to enhance the user's psychological counseling experience.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] In a first aspect, the present invention provides a psychological consultation processing method, which includes:

[0011] Acquire psychological counseling dialogue data from different data sources, perform data preprocessing on the psychological counseling dialogue data, and obtain target psychological counseling dialogue data;

[0012] Based on the target psychological counseling dialogue data, extract various psychological counseling questions and their corresponding sub-question labels, and construct a user question description text set according to the user question description text in each sub-question label;

[0013] Inputting each of the user problem description texts in the user problem description text set into a large language model in batches to generate a psychological counseling dialogue text corresponding to each of the user problem description texts;

[0014] Merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set;

[0015] Using the psychological counseling dialogue data set to fine-tune the pre-trained model to generate a psychological counseling dialogue model;

[0016] Based on the psychological consultation dialogue model, the psychological consultation request of the target user is processed, and the processing result is fed back to the target user terminal.

[0017] In a second aspect, the present invention provides a psychological consultation processing device, which includes:

[0018] An acquisition module is used to acquire psychological counseling dialogue data from different data sources, perform data preprocessing on the psychological counseling dialogue data, and obtain target psychological counseling dialogue data;

[0019] An extraction module, for extracting various psychological counseling questions and their corresponding sub-question labels based on the target psychological counseling dialogue data, and constructing a user question description text set according to the user question description text in each sub-question label;

[0020] An input module, used to batch input each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts;

[0021] A merging module, used to merge all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set;

[0022] A fine-tuning module, used to use the psychological counseling dialogue data set to fine-tune the pre-trained model to generate a psychological counseling dialogue model;

[0023] The processing module is used to process the psychological consultation request of the target user based on the psychological consultation dialogue model, and feed back the processing result to the target user terminal.

[0024] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the psychological counseling processing method as described above when executing the computer program.

[0025] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the psychological counseling processing method as described above.

[0026] Compared with the prior art, the present invention provides a psychological counseling processing method, device, computer equipment and computer-readable storage medium, wherein, by acquiring psychological counseling dialogue data from different data sources, the psychological counseling dialogue data is preprocessed to obtain target psychological counseling dialogue data; based on the target psychological counseling dialogue data, various types of psychological counseling problems and their corresponding sub-problem labels are extracted, and a user problem description text set is constructed according to the user problem description text in each sub-problem label; each of the user problem description texts in the user problem description text set is batch-inputted into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts; all of the psychological counseling dialogue texts are merged with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set; the pre-trained model is fine-tuned and trained using the psychological counseling dialogue data set to generate a psychological counseling dialogue model; based on the psychological counseling dialogue model, the psychological counseling request of the target user is processed, and the processing result is fed back to the target user terminal; thus, the present invention can generate a high-performance psychological counseling dialogue model by constructing a high-quality and diverse psychological counseling dialogue data set, which can improve the user's psychological counseling experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 A schematic diagram of an application environment of a psychological consultation processing method provided by an embodiment of the present invention.

[0029] Figure 2 A flowchart of a psychological consultation processing method provided by one embodiment of the present invention.

[0030] Figure 3 A schematic diagram of program modules of a psychological consultation processing device provided by one embodiment of the present invention.

[0031] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention.

[0032] Figure 5 Another structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0035] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0036] As used in the present specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.

[0037] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0038] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0039] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0040] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.

[0041] A psychological consultation processing method provided by an embodiment of the present invention can be applied in Figure 1 In the application environment shown, the client and the server communicate through the network. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, personal digital assistants (PDAs) and other computer devices. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0042] See also Figure 2 An embodiment of the present invention provides a psychological consultation processing method, wherein the method comprises the following steps:

[0043] S100, obtaining psychological counseling dialogue data from different data sources, performing data preprocessing on the psychological counseling dialogue data, and obtaining target psychological counseling dialogue data;

[0044] S200, based on the target psychological counseling dialogue data, extracting various psychological counseling questions and their corresponding sub-question tags, and constructing a user question description text set according to the user question description text in each sub-question tag;

[0045] S300, inputting each of the user problem description texts in the user problem description text set into a large language model in batches to generate a psychological counseling dialogue text corresponding to each of the user problem description texts;

[0046] S400, merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set;

[0047] S500, fine-tuning the pre-trained model using the psychological counseling dialogue data set to generate a psychological counseling dialogue model;

[0048] S600: Based on the psychological consultation dialogue model, the psychological consultation request of the target user is processed, and the processing result is fed back to the target user terminal.

[0049] In specific implementation, the psychological counseling processing method of this embodiment constructs a high-quality and diverse psychological counseling dialogue data set through systematic steps, and uses the psychological counseling dialogue data set to fine-tune the pre-trained model, thereby generating a high-performance psychological counseling dialogue model, which significantly improves the user's psychological counseling experience. Specifically, the method first obtains psychological counseling dialogue data from multiple data sources, and ensures the quality and consistency of the data through data preprocessing (S100) to form target psychological counseling dialogue data. Subsequently, by extracting the psychological counseling questions and their sub-question labels in the target psychological counseling dialogue data (S200), and constructing a user question description text set based on the user question description text in these sub-question labels, the structured degree of the data is further enriched. Then, in S300, a large language model is used to generate diverse psychological counseling dialogue texts, which not only cover a variety of expressions of user questions, but also generate corresponding counselor replies, thereby significantly improving the scale and diversity of the data set. Then, by merging all the generated psychological counseling dialogue texts with the target psychological counseling dialogue data (S400), a comprehensive psychological counseling dialogue data set is constructed, which not only contains real data, but also incorporates high-quality generated data, further optimizing data distribution. In S500, the pre-trained model is fine-tuned using the psychological counseling dialogue dataset to generate a psychological counseling dialogue model optimized specifically for psychological counseling tasks. Finally, in S600, the user's psychological counseling request is processed based on the psychological counseling dialogue model, which can provide more accurate, professional and natural responses, thereby significantly improving the user's psychological counseling experience. Overall, this method effectively solves the problems of uneven quality and insufficient diversity of existing data through the combination of data enhancement and model optimization, and also provides an efficient, high-experience and personalized intelligent psychological counseling solution for the field of psychological counseling.

[0050] It can be understood that the psychological counseling processing method provided by the embodiment of the present invention can be applied to psychological counseling processing scenarios related to the medical health and financial technology fields. The following are specific application examples of the psychological counseling processing method of the present invention in the medical health and financial technology fields, which demonstrate how to improve user experience and solve practical problems through a high-performance psychological counseling dialogue model.

[0051] 1. Application examples in the medical and health field

[0052] Scenario description: In the healthcare field, patients often need psychological support to relieve anxiety and stress when facing chronic disease management or rehabilitation. Traditional psychological counseling may not be able to meet the needs of all patients due to limited resources, especially those who need long-term support.

[0053] Application examples:

[0054] A hospital provides a psychological consultation platform based on the present invention for patients with chronic diseases (such as diabetics). Patients can submit psychological consultation requests through mobile phone applications or hospital websites, for example: "I have not been able to control my blood sugar well recently, I feel very anxious, and I don't know what to do."

[0055] Data preprocessing and label extraction: After receiving the patient's psychological consultation request, the platform extracts key information through preprocessing and identifies the patient's psychological problem labels (such as "chronic disease anxiety").

[0056] Generate psychological counseling dialogue text: The platform inputs the patient's questions into a fine-tuned psychological counseling dialogue model to generate targeted response text, such as: "I understand your current anxiety. Poor blood sugar control can indeed make people feel stressed. You can try to record your daily diet and exercise to see if you can find the cause of your blood sugar fluctuations. At the same time, it is also important to maintain a regular schedule."

[0057] Feedback and Recording: The platform will feed back the generated responses to the patient and record the conversation content in order to follow up on the patient's mental state and provide further support.

[0058] In this way, patients can get psychological support at any time in their daily lives, reduce anxiety, better manage their condition, and improve their quality of life.

[0059] 2. Application examples in the field of financial technology

[0060] Scenario description: In the field of financial technology, users often face psychological pressure when making investment decisions or financial planning, especially concerns about risks and unfamiliarity with complex financial products. Traditional financial customer service mainly provides business consultation and lacks attention to the user's psychological state, causing users to feel uneasy or lack confidence in the decision-making process.

[0061] Application examples:

[0062] A financial technology company provides a psychological counseling platform based on the present invention to provide users with psychological support and investment advice. Users can submit psychological counseling requests through the platform, for example: "I want to invest in stocks recently, but the market is very volatile and I am worried."

[0063] Data preprocessing and label extraction: After receiving the user's request, the platform extracts key information through preprocessing and identifies the user's psychological problem labels (such as "investment anxiety").

[0064] Generate psychological counseling dialogue text: The platform inputs the user's questions into a fine-tuned psychological counseling dialogue model to generate targeted response text, such as: "I understand your concerns about market fluctuations. Investing does have risks, but you can reduce risks by diversifying your investments and holding for the long term. It is recommended that you start with stable funds and gradually become familiar with the market. If necessary, you can consult a professional financial advisor."

[0065] Feedback and Recording: The platform will feed back the generated responses to the user and record the content of the conversation so as to provide more accurate suggestions and support later.

[0066] In this way, users gain psychological support during the investment decision-making process, relieve anxiety, enhance decision-making confidence, and improve user experience.

[0067] The psychological counseling processing method of the present invention has broad application prospects in the fields of medical health and financial technology. Through a high-performance psychological counseling dialogue model, it can provide users with timely, professional and personalized psychological support, significantly improving the user experience. In the field of medical health, it helps to relieve patients' anxiety and improve the effect of chronic disease management; in the field of financial technology, it can enhance users' investment confidence and provide more comprehensive financial consulting services.

[0068] Furthermore, in one embodiment, the psychological counseling processing method, wherein the psychological counseling dialogue data includes counseling case data of an online psychological counseling platform and a public counseling data set in the psychological field, and the psychological counseling dialogue data is preprocessed to obtain target psychological counseling dialogue data, specifically comprising the steps of:

[0069] Performing text format conversion on the consulting case data to obtain target consulting case data;

[0070] Cleaning, formatting and annotating the consultation data set and the target consultation case data to obtain intermediate psychological consultation dialogue data;

[0071] The intermediate psychological counseling dialogue data is segmented into long texts, and the target psychological counseling dialogue data is obtained according to the segmentation results.

[0072] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0073] Step 1: Text format conversion

[0074] Description: Convert the text format of the consultation case data of the online psychological consultation platform to unify the data format.

[0075] Implementation process:

[0076] Data extraction: Obtain counseling case data from online psychological counseling platforms, which may be stored in HTML, JSON, XML or other non-standard formats.

[0077] Format conversion: Use text parsing tools to convert this data into a unified text format (such as plain text or standardized JSON format).

[0078] Remove irrelevant information: During the conversion process, remove irrelevant HTML tags, special characters, advertising content and extra spaces to ensure that the text content is clear and neat.

[0079] Save results: Save the converted text as target consulting case data for subsequent processing.

[0080] Step 2: Data cleaning, formatting and labeling

[0081] Description: Clean, format and annotate the public consultation datasets and target consultation case data in the field of psychology to obtain the intermediate psychological consultation dialogue data.

[0082] Implementation process:

[0083] Data merging: Merge publicly available consultation datasets in the field of psychology and target consultation case data to ensure the diversity of data sources.

[0084] Data cleaning: Remove duplicate conversation records, irrelevant conversation content (such as advertisements, invalid replies, etc.), and low-quality conversations (such as short and meaningless replies).

[0085] Formatting: Unify field names and data structures to ensure that all data has a consistent format.

[0086] Labeling: Label the cleaned data to mark the boundaries between user questions and consultant responses, as well as possible conversation topics or emotional tendencies.

[0087] Save results: Save the processed data as intermediate psychological counseling dialogue data to provide a basis for subsequent steps.

[0088] Step 3: Long text segmentation

[0089] Description: Segment the long text in the intermediate psychological consultation dialogue data to ensure the processability and consistency of the data.

[0090] Implementation process:

[0091] Text segmentation: Traverse the intermediate psychological counseling dialogue data and identify overly long text records (such as user questions or counselor responses exceeding a certain length).

[0092] Semantic segmentation: Split a long text into multiple shorter text paragraphs based on semantic segmentation points (such as period, question mark, exclamation mark, etc.).

[0093] Semantic integrity check: Ensure the semantic integrity of the segmented text paragraphs to avoid semantic breaks caused by segmentation.

[0094] Reorganization: The segmented text paragraphs are reorganized into dialogue pairs to form the target psychological counseling dialogue data.

[0095] Save results: Save the segmented data as target psychological counseling dialogue data for subsequent model training and application.

[0096] Through the above process, this embodiment can convert the original psychological counseling dialogue data into target psychological counseling dialogue data. This process ensures the quality, consistency and availability of the data, and provides a solid foundation for the subsequent psychological counseling dialogue model training and application.

[0097] Example description:

[0098] 1) Scenario description: In the field of medical health, patients often need psychological support during the medical treatment process, especially when facing chronic diseases, surgical anxiety or psychological pressure during rehabilitation. Psychological counseling can help patients relieve anxiety and enhance their confidence in treatment, but traditional psychological counseling resources are limited. Therefore, the development of an AI-based intelligent psychological counseling platform that can provide immediate psychological support is of great practical significance.

[0099] 2) Example background: A hospital launched an online mental health support service to provide psychological support to patients before and after surgery or during the management of chronic diseases. The service is based on an intelligent psychological consultation platform, which uses the psychological consultation processing method of the present invention to provide patients with high-quality psychological consultation dialogue support by preprocessing and optimizing dialogue data.

[0100] 3) Specific implementation process of data preprocessing

[0101] Step 1: Text format conversion

[0102] Description: Convert the text format of the consultation case data of the online psychological consultation platform to obtain the target consultation case data.

[0103] Implementation process:

[0104] Data collection: Consultation case data are collected from the hospital's online psychological counseling platform, which may be stored in HTML, JSON or other non-standard formats.

[0105] Format conversion: Use text parsing tools to convert this data into a unified text format (such as plain text or standardized JSON format).

[0106] Remove irrelevant information: Remove HTML tags, special characters, advertising content and extra spaces to ensure that the text content is clear and neat.

[0107] Save results: Save the converted text as target consulting case data.

[0108] Step 2: Data cleaning, formatting and labeling

[0109] Description: Clean, format and annotate the consultation dataset and target consultation case data to obtain the intermediate psychological consultation dialogue data.

[0110] Implementation process:

[0111] Data merging: Merge publicly available consultation datasets in the field of psychology with target consultation case data to ensure the diversity of data sources.

[0112] Data cleaning: Remove duplicate conversation records, irrelevant conversation content, and low-quality conversations.

[0113] Formatting: Unify field names and data structures to ensure that all data has a consistent format.

[0114] Labeling: Label the cleaned data to mark the boundaries between patient questions and counselor responses, as well as possible conversation topics or emotional tendencies.

[0115] Save results: Save the processed data as intermediate psychological counseling dialogue data.

[0116] Step 3: Long text segmentation

[0117] Description: Segment the long text in the intermediate psychological counseling dialogue data, and obtain the target psychological counseling dialogue data based on the segmentation results.

[0118] Implementation process:

[0119] Text segmentation: Traverse the intermediate psychological counseling dialogue data and identify text records that are too long.

[0120] Semantic segmentation: Split a long text into multiple shorter text paragraphs based on semantic segmentation points (such as period, question mark, exclamation mark, etc.).

[0121] Semantic integrity check: Ensure the semantic integrity of the segmented text paragraphs to avoid semantic breaks caused by segmentation.

[0122] Reorganization: The segmented text paragraphs are reorganized into dialogue pairs to form the target psychological counseling dialogue data.

[0123] Save results: Save the segmented data as target psychological counseling dialogue data.

[0124] 4) Actual application scenarios

[0125] Suppose a patient is about to undergo surgery for a broken hand. Before the surgery, he submits the following consultation request through the hospital's intelligent psychological consultation platform: "I am very afraid of the surgery. I don't know whether the surgery will be successful or whether the recovery after the surgery will be painful."

[0126] Through the above data preprocessing steps, the platform used the pre-trained psychological counseling dialogue model to generate the following response: "I understand your concerns about the surgery. The success rate of hand fracture surgery is very high, and our medical team will accompany you throughout the process. Although postoperative recovery takes some time, we will provide detailed rehabilitation guidance to help you recover as soon as possible."

[0127] This immediate psychological support not only relieved the patient's anxiety, but also strengthened his confidence in the surgery and improved the overall medical experience.

[0128] Through the above data preprocessing steps, the psychological counseling processing method of this embodiment can effectively construct a high-quality psychological counseling dialogue data set, providing strong support for psychological counseling scenarios in the medical and health field. This method not only improves the efficiency and quality of psychological counseling processing, but also provides patients with more personalized and professional psychological support, which has important practical application value.

[0129] Furthermore, in one embodiment, the psychological counseling processing method, wherein, based on the target psychological counseling dialogue data, extracting various psychological counseling questions and their corresponding sub-question tags, and constructing a user question description text set according to the user question description text in each sub-question tag, specifically comprises the steps of:

[0130] Using text classification technology, extracting various types of psychological counseling questions and their corresponding sub-question labels from the target psychological counseling dialogue data;

[0131] Filtering out the user question description text corresponding to each of the sub-question labels from the target psychological counseling dialogue data;

[0132] The user question description text set is constructed according to the user question description text in each of the sub-question tags.

[0133] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0134] Step 1: Extract psychological counseling questions and sub-question labels

[0135] Description: Use text classification technology to extract various psychological counseling questions and their corresponding sub-question labels from the target psychological counseling dialogue data.

[0136] Implementation process:

[0137] Data preparation: Load the target psychological counseling conversation data, which has been preprocessed and includes user questions and counselor responses.

[0138] Text classification model selection: Select a suitable text classification technology or model, such as a deep learning-based classifier (BERT, LSTM, etc.) or a traditional machine learning method (SVM, Naive Bayes, etc.).

[0139] Question classification: Use text classification models to classify user questions and identify the main categories of psychological counseling problems (such as anxiety, depression, interpersonal relationships, etc.).

[0140] Sub-question label extraction: For each main question category, further extract specific sub-question labels. For example, under the "anxiety" category, extract sub-question labels such as "work pressure", "social anxiety", etc.

[0141] Tag organization: The extracted question categories and sub-question tags are organized into a structured tag system for easy subsequent processing.

[0142] Step 2: Filter the user problem description text

[0143] Description: Filter out the user question description text corresponding to each sub-question label from the target psychological counseling dialogue data.

[0144] Implementation process:

[0145] Data matching: Match the extracted sub-question labels with the user question description text in the target psychological counseling conversation data.

[0146] Text filtering: Based on the matching results, filter out the user question description text corresponding to each sub-question label.

[0147] Deduplication: Deduplication is performed on the filtered user question description text to ensure that the user question description text under each sub-question label is diverse and representative.

[0148] Save results: Save the filtered user question description text by sub-question label classification.

[0149] Step 3: Build a text collection of user problem descriptions

[0150] Description: Build a user question description text set based on the user question description text in each sub-question label.

[0151] Implementation process:

[0152] Text sorting: Sort the user question description text under each sub-question label to ensure consistent text format.

[0153] Text set construction: Classify the sorted user problem description texts according to sub-problem labels to construct a user problem description text set.

[0154] Quality check: Perform quality check on the user problem description text set to ensure that the text content is complete, semantically clear, and consistent with the psychological counseling scenario.

[0155] Save text set: Save the constructed user problem description text set in a structured file format (such as JSON, CSV, etc.) for subsequent use.

[0156] Through the above process, this embodiment can systematically extract various psychological counseling questions and their sub-question labels from the target psychological counseling dialogue data, and construct a user question description text set based on the user question description text in these sub-question labels. This process not only provides high-quality input data for subsequent psychological counseling dialogue model training, but also improves the model's ability to understand and generate different types of psychological problems.

[0157] Furthermore, in one embodiment, the psychological counseling processing method, wherein the batch inputting of each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts, specifically comprises the steps of:

[0158] Traversing the user problem description text set, and extracting each user problem description text one by one;

[0159] Inputting the extracted user problem description texts in batches into the pre-trained large language model to generate corresponding psychological consultation dialogue texts;

[0160] A quality check is performed on each of the generated psychological counseling dialogue texts, and the psychological counseling dialogue texts that do not meet the quality requirements are eliminated.

[0161] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0162] Step 1: Traverse the user problem description text set

[0163] Description: Traverse the user problem description text set and extract each user problem description text one by one.

[0164] Implementation process:

[0165] Load text set: Load the user problem description text set from the storage and ensure that it is in a structured format (such as JSON, CSV, etc.).

[0166] Traverse the text set: Use a loop or iterator to traverse each user question description text in the text set one by one.

[0167] Extract text: Extract the text of each user question description and prepare it for input into the large language model.

[0168] Record index: During the extraction process, record the index or identifier of each text for subsequent processing and result matching.

[0169] Step 2: Batch input to large language model

[0170] Description: The extracted user question description texts are input into the pre-trained large language model in batches to generate the corresponding psychological counseling dialogue texts.

[0171] Implementation process:

[0172] Model preparation: Load a pre-trained large language model (such as GPT or other Transformer architecture models).

[0173] Batch input: Organize the extracted user problem description text into batch input form (such as 50 items per batch).

[0174] Generate dialogue text: call the model's generation interface, input the user's problem description text, and generate the psychological counseling dialogue text.

[0175] Save the generated results: associate the generated psychological counseling dialogue text with the corresponding user problem description text and save it as a temporary result.

[0176] Step 3: Quality testing and screening

[0177] Description: Perform quality inspection on each generated psychological counseling dialogue text and remove dialogue texts that do not meet quality requirements.

[0178] Implementation process:

[0179] Define quality standards: Set standards for quality inspection, such as the coherence and logic of the text, whether it contains professional content of psychological counseling, etc.

[0180] Quality testing: Use natural language processing technology (such as text similarity detection, keyword matching, etc.) to perform quality testing on the generated psychological counseling dialogue text.

[0181] Eliminate low-quality text: Based on the detection results, eliminate dialogue text that does not meet the quality requirements.

[0182] Save high-quality text: Save the conversation text that meets the quality requirements as the final result for subsequent construction of the psychological counseling conversation dataset.

[0183] Through the above process, this embodiment can efficiently generate high-quality psychological counseling dialogue texts from the user problem description text set. This process not only ensures the diversity and professionalism of the generated dialogues, but also improves the reliability of the generated content through quality detection and optimization mechanisms. Each psychological counseling dialogue text finally generated can be used to construct a high-quality psychological counseling dialogue dataset, provide support for the training of the psychological counseling dialogue model, and thus enhance the user's psychological counseling experience.

[0184] Furthermore, in one embodiment, the psychological counseling processing method, wherein the step of merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set, specifically comprises the steps of:

[0185] According to the actual distribution ratio of each type of psychological counseling problem, data is sampled from all the psychological counseling dialogue texts to generate a psychological counseling dialogue text set;

[0186] The psychological counseling dialogue text set is merged with the target psychological counseling dialogue data to construct the psychological counseling dialogue data set.

[0187] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0188] Step 1: Determine the actual distribution ratio of each type of psychological consultation problem

[0189] Description: Determine the true distribution ratio of various psychological counseling problems based on existing statistical research or actual data.

[0190] Implementation process:

[0191] Data research: Collect and analyze existing psychological counseling data to understand the actual distribution ratio of various psychological counseling problems (such as anxiety, depression, interpersonal relationships, etc.) among the population.

[0192] Determine the proportion: According to the survey results, determine the actual distribution ratio of each type of psychological counseling problem. For example: anxiety problems 30%, depression problems 25%, interpersonal relationship problems 20%, and other problems 25%.

[0193] Record proportions: Record these proportions as a basis for subsequent sampling.

[0194] Step 2: Sampling data from all psychological counseling conversation texts

[0195] Description: According to the actual distribution ratio of various psychological counseling problems, data is sampled from all psychological counseling dialogue texts to generate a psychological counseling dialogue text set.

[0196] Implementation process:

[0197] Classification statistics: Classify and count all psychological counseling dialogue texts to determine the number of texts for each type of psychological counseling problem.

[0198] Calculate the number of samples: According to the true distribution ratio, calculate the number of texts that need to be sampled for each type of psychological counseling problem. For example, if the total number of samples is 1,000, then: 300 for anxiety problems, 250 for depression problems, 200 for interpersonal relationship problems, and 250 for other problems.

[0199] Random sampling: Random sampling is conducted from the text corresponding to each type of psychological counseling problem to ensure the diversity and representativeness of the sampled data.

[0200] Generate text set: Integrate the sampled texts into a psychological counseling dialogue text set.

[0201] Step 3: Merge the psychological counseling dialogue text set with the target psychological counseling dialogue data

[0202] Description: Combine the sampled psychological counseling dialogue text set with the target psychological counseling dialogue data to construct a psychological counseling dialogue dataset.

[0203] Implementation process:

[0204] Data loading: Load the target psychological counseling dialogue data (these data have been preprocessed and are of high quality and representativeness).

[0205] Format alignment: Ensure that the format of the psychological counseling dialogue text set generated by sampling is consistent with the target psychological counseling dialogue data (such as field name, data structure, etc.).

[0206] Data merging: The sampled psychological counseling dialogue text set is merged with the target psychological counseling dialogue data to form a complete psychological counseling dialogue dataset.

[0207] Deduplication: Deduplication is performed on the merged data to prevent duplicate data from affecting the training effect of subsequent models.

[0208] Save the dataset: Save the merged psychological counseling dialogue dataset into a structured file format (such as JSON, CSV, etc.) for subsequent use.

[0209] Through the above process, this embodiment can systematically merge the psychological counseling dialogue text set generated by sampling in accordance with the real distribution ratio of all psychological counseling dialogue texts with the target psychological counseling dialogue data, and construct a high-quality psychological counseling dialogue data set that conforms to the real distribution. This process ensures the diversity and representativeness of the data, and provides a solid foundation for the subsequent psychological counseling dialogue model training.

[0210] Furthermore, in one embodiment, the psychological consultation processing method, wherein the use of the psychological consultation dialogue data set to fine-tune the pre-trained model to generate a psychological consultation dialogue model, specifically comprises the steps of:

[0211] Dividing the psychological counseling dialogue dataset according to a preset ratio to obtain a training set, a validation set, and a test set;

[0212] Using the training set to fine-tune the pre-trained model to obtain a trained model;

[0213] Using the validation set to adjust parameters of the trained model to obtain an adjusted model;

[0214] The performance of the adjusted model is evaluated using the test set, and when it is detected that the performance evaluation result meets the preset performance requirements, the psychological counseling dialogue model is obtained.

[0215] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0216] Step 1: Dataset Division

[0217] Description: Divide the psychological counseling dialogue dataset into training set, validation set and test set according to the preset ratio.

[0218] Implementation process:

[0219] Load dataset: Load the psychological counseling dialogue dataset from the storage and ensure that the dataset has been preprocessed and labeled.

[0220] Set the partition ratio: Set the partition ratio of the data set according to actual needs. The common ratio is: 80% for training set, 10% for validation set, and 10% for test set.

[0221] Random Split: Use a random split method (such as the train_test_split function) to divide the dataset into training, validation, and test sets to ensure that the data in each set is evenly distributed.

[0222] Save the division results: Save the divided data sets as training set, validation set and test set for subsequent use.

[0223] Step 2: Fine-tune training

[0224] Description: Use the training set to fine-tune the pre-trained model to obtain the trained model.

[0225] Implementation process:

[0226] Load pre-trained model: Select a pre-trained language model suitable for psychological counseling tasks (such as GPT, BERT or other Transformer architecture models) and load its pre-trained weights.

[0227] Configure the training environment: Set the hardware resources required for training (such as GPU or TPU) and configure the training parameters (such as learning rate, batch size, number of training rounds, etc.).

[0228] Training model: Use the training set to fine-tune the pre-trained model and update the model parameters through back-propagation.

[0229] Save trained model: Save the trained model weights as an intermediate model for subsequent verification and adjustment.

[0230] Step 3: Parameter Adjustment

[0231] Description: Use the validation set to adjust the parameters of the trained model to obtain the adjusted model.

[0232] Implementation process:

[0233] Load validation set: Load the divided validation set data.

[0234] Evaluate model performance: Use the validation set to evaluate the performance of the trained model and calculate key metrics (such as accuracy, recall, F1 score, perplexity, etc.).

[0235] Adjust parameters: According to the evaluation results of the validation set, adjust the model's hyperparameters (such as learning rate, regularization term, optimizer type, etc.) to optimize model performance.

[0236] Save adjusted model: Save the adjusted model weights as the final model for subsequent testing.

[0237] Step 4: Performance Evaluation

[0238] Description: Use the test set to evaluate the performance of the adjusted model. When it is detected that the performance evaluation result meets the preset performance requirements, a psychological consultation dialogue model is generated.

[0239] Implementation process:

[0240] Load test set: load the divided test set data.

[0241] Final evaluation: Use the test set to conduct a comprehensive performance evaluation of the adjusted model and calculate key metrics (such as accuracy, recall, F1 score, etc.).

[0242] Check performance requirements: Compare the performance evaluation results with the preset performance requirements (such as accuracy ≥ 90%, F1 score ≥ 85%).

[0243] Generate model: If the performance evaluation results meet the preset performance requirements, the adjusted model is saved as the final psychological counseling dialogue model.

[0244] Through the above process, this embodiment can systematically use the psychological counseling dialogue dataset to fine-tune the pre-trained model and generate a high-quality psychological counseling dialogue model. This process not only ensures the performance optimization of the model in the training, verification and testing stages, but also improves the stability of the model and user experience through strict evaluation standards, providing reliable technical support for practical applications.

[0245] Furthermore, in one embodiment, the psychological consultation processing method, wherein the psychological consultation request of the target user is processed based on the psychological consultation dialogue model, and the processing result is fed back to the target user terminal, specifically comprises the steps of:

[0246] Receiving the psychological consultation request of the target user, and parsing the psychological consultation request to obtain the psychological consultation text of the target user;

[0247] The psychological counseling text is used as input, a corresponding psychological counselor reply text is generated through the psychological counseling dialogue model, and the psychological counselor reply text is fed back to the target user terminal.

[0248] During specific implementation, the specific implementation process of the steps in this embodiment is roughly as follows:

[0249] Step 1: Receive and analyze user psychological consultation requests

[0250] Description: Receive the psychological consultation request from the target user, parse it, and extract the psychological consultation text.

[0251] Implementation process:

[0252] Request reception: Receive the target user's psychological consultation request through a user interface (such as a chat window, voice input device, etc.). The psychological consultation request can be in text form or voice form.

[0253] Format conversion: If the psychological consultation request is in voice form, use speech recognition technology (such as ASR) to convert the voice into text format.

[0254] Text parsing: Preprocess the text of the psychological consultation request, including removing redundant spaces, normalizing punctuation, etc., to ensure that the text format meets the model input requirements.

[0255] Extract key information: Use natural language processing technology (such as NLP) to parse text content and extract key information (such as the core content of user questions, emotional tendencies, etc.).

[0256] Save parsing results: Save the psychological counseling text obtained after parsing in a structured format for subsequent processing.

[0257] Step 2: Generate the psychological counselor's response text

[0258] Description: The psychological counseling text obtained after parsing is used as input, and the corresponding psychological counselor's reply text is generated through the psychological counseling dialogue model.

[0259] Implementation process:

[0260] Model loading: Load the trained psychological counseling dialogue model to ensure that the model is in a usable state.

[0261] Input preparation: Format the psychological counseling text obtained after parsing into the input format required by the model (such as JSON, string, etc.).

[0262] Call model: Input the input text into the psychological counseling dialogue model and call the model's generation interface.

[0263] Generate response: The model generates the counselor’s response text based on the input text.

[0264] Response optimization: Post-process the generated counselor response text to ensure the coherence and professionalism of the response. For example, text polishing techniques or keyword replacement can be used.

[0265] Step 3: Feedback to the counselor

[0266] Description: Feedback the generated psychological counselor's reply text to the target user's terminal device (target user terminal).

[0267] Implementation process:

[0268] Format conversion: If the target user's psychological consultation request is in voice form, the generated psychological counselor's reply text is converted into voice (through speech synthesis technology, such as TTS).

[0269] Reply display: The reply text or voice is fed back to the target user through the user interface of the target user terminal (such as a chat window, voice player, etc.).

[0270] Through the above process, this embodiment can realize the complete process from receiving the user's psychological consultation request to generating and feeding back the psychological counselor's response. This process not only ensures the efficient processing and professional response of the user's request, but also guarantees the user experience and service quality, and can provide users with high-quality psychological consultation services.

[0271] It can be seen from the above method embodiments that the psychological counseling processing method provided by the present invention includes: obtaining psychological counseling dialogue data from different data sources, performing data preprocessing on the psychological counseling dialogue data, and obtaining target psychological counseling dialogue data; based on the target psychological counseling dialogue data, extracting various types of psychological counseling problems and their corresponding sub-problem labels, and constructing a user problem description text set according to the user problem description text in each sub-problem label; batch inputting each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts; merging all of the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set; fine-tuning the pre-trained model using the psychological counseling dialogue data set to generate a psychological counseling dialogue model; based on the psychological counseling dialogue model, processing the psychological counseling request of the target user, and feeding back the processing result to the target user terminal. In this way, the method of the present invention can generate a high-performance psychological counseling dialogue model by constructing a high-quality and diverse psychological counseling dialogue data set, which can improve the user's psychological counseling experience.

[0272] It should be understood that, although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the embodiment or flowchart. The order of steps listed in the embodiment or flowchart is only one way of executing the order of many steps, and does not represent the only execution order. It should be noted that there is not necessarily a certain order between the above steps. A person of ordinary skill in the art can understand from the description of the embodiment of the present invention that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or they may be executed in exchange, etc. Moreover, at least a part of the steps in the embodiment or flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be executed in turn, alternately or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0273] Based on the above method embodiment, please refer to Figure 3Another embodiment of the present invention further provides a psychological consultation processing device, wherein the device comprises:

[0274] An acquisition module 11 is used to acquire psychological counseling dialogue data from different data sources, perform data preprocessing on the psychological counseling dialogue data, and obtain target psychological counseling dialogue data;

[0275] An extraction module 12 is used to extract various psychological counseling questions and their corresponding sub-question labels based on the target psychological counseling dialogue data, and to construct a user question description text set according to the user question description text in each sub-question label;

[0276] An input module 13, used for batch-inputting each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts;

[0277] A merging module 14 is used to merge all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set;

[0278] A fine-tuning module 15 is used to fine-tune the pre-trained model using the psychological counseling dialogue data set to generate a psychological counseling dialogue model;

[0279] The processing module 16 is used to process the psychological consultation request of the target user based on the psychological consultation dialogue model, and feed back the processing result to the target user terminal.

[0280] Furthermore, in one embodiment, the psychological counseling processing device, wherein the psychological counseling dialogue data includes counseling case data of an online psychological counseling platform and a public counseling data set in the psychological field, and the psychological counseling dialogue data is preprocessed to obtain target psychological counseling dialogue data, specifically including:

[0281] Performing text format conversion on the consulting case data to obtain target consulting case data;

[0282] Cleaning, formatting and annotating the consultation data set and the target consultation case data to obtain intermediate psychological consultation dialogue data;

[0283] The intermediate psychological counseling dialogue data is segmented into long texts, and the target psychological counseling dialogue data is obtained according to the segmentation results.

[0284] Furthermore, in one embodiment, the psychological counseling processing device, wherein, based on the target psychological counseling dialogue data, extracting various psychological counseling questions and their corresponding sub-question tags, and constructing a user question description text set according to the user question description text in each sub-question tag, specifically includes:

[0285] Using text classification technology, extracting various types of psychological counseling questions and their corresponding sub-question labels from the target psychological counseling dialogue data;

[0286] Filtering out the user question description text corresponding to each of the sub-question labels from the target psychological counseling dialogue data;

[0287] The user question description text set is constructed according to the user question description text in each of the sub-question tags.

[0288] Furthermore, in one embodiment, the psychological counseling processing device, wherein the batch inputting of each of the user problem description texts in the user problem description text set into a large language model to generate the psychological counseling dialogue text corresponding to each of the user problem description texts, specifically includes:

[0289] Traversing the user problem description text set, and extracting each user problem description text one by one;

[0290] Inputting the extracted user problem description texts in batches into the pre-trained large language model to generate corresponding psychological consultation dialogue texts;

[0291] The quality of each psychological counseling dialogue text generated is tested, and the psychological counseling dialogue texts that do not meet the quality requirements are eliminated.

[0292] Furthermore, in one embodiment, the psychological counseling processing device, wherein the step of merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set, specifically includes:

[0293] According to the actual distribution ratio of each type of psychological counseling problem, data is sampled from all the psychological counseling dialogue texts to generate a psychological counseling dialogue text set;

[0294] The psychological counseling dialogue text set is merged with the target psychological counseling dialogue data to construct the psychological counseling dialogue data set.

[0295] Furthermore, in one embodiment, the psychological consultation processing device, wherein the use of the psychological consultation dialogue data set to fine-tune the pre-trained model to generate the psychological consultation dialogue model specifically includes:

[0296] Dividing the psychological counseling dialogue dataset according to a preset ratio to obtain a training set, a validation set, and a test set;

[0297] Using the training set to fine-tune the pre-trained model to obtain a trained model;

[0298] Using the validation set to adjust parameters of the trained model to obtain an adjusted model;

[0299] The performance of the adjusted model is evaluated using the test set, and when it is detected that the performance evaluation result meets the preset performance requirements, the psychological counseling dialogue model is obtained.

[0300] Furthermore, in one embodiment, the psychological consultation processing device, wherein the psychological consultation request of the target user is processed based on the psychological consultation dialogue model, and the processing result is fed back to the target user terminal, specifically includes:

[0301] Receiving the psychological consultation request of the target user, and parsing the psychological consultation request to obtain the psychological consultation text of the target user;

[0302] The psychological counseling text is used as input, a corresponding psychological counselor reply text is generated through the psychological counseling dialogue model, and the psychological counselor reply text is fed back to the target user terminal.

[0303] It should be noted that in the embodiment of the device of the present invention, the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the aforementioned method embodiment part and will not be repeated here.

[0304] Based on the above method embodiment, another embodiment of the present invention further provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the functions or steps on the service side of the psychological counseling processing method in any of the above method embodiments are implemented.

[0305] Based on the above method embodiment, another embodiment of the present invention further provides a computer device, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the functions or steps on the client side of the psychological counseling processing method in any of the above method embodiments are implemented.

[0306] Those skilled in the art will understand that Figure 4 and Figure 5 The structural schematic diagram shown in the figure is only a schematic diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0307] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.

[0308] Among them, the memory includes a readable storage medium, an internal memory, etc. The internal memory can be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium can be the hard disk of a computer device, and in some other embodiments, it can also be an external storage device of the computer device. For example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device. Further, the memory can also include both the internal storage unit of the computer device and the external storage device. The memory is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of a computer program. The memory can also be used to temporarily store data that has been output or will be output.

[0309] Based on the above method embodiments, another embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the psychological counseling processing method in any one of the above method embodiments. The computer-readable storage medium can be non-volatile or volatile.

[0310] It should be noted that for the functions or steps that the above computer-readable storage medium or computer device can achieve, and the technical effects brought by the functions / steps, reference can be made to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0311] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM). The disclosed memory components or memories of the operating environments described herein are intended to comprise one or more of these and / or any other suitable types of memory.

[0312] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, in the embodiment of the device of the present invention, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0313] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0314] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0315] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0316] It should be noted that if software tools or components other than those of the Company appear in the embodiments of the present application, they are only used for illustration and do not represent actual use. The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A psychological consultation method, characterized in that: include: Acquire psychological counseling dialogue data from different data sources, perform data preprocessing on the psychological counseling dialogue data, and obtain target psychological counseling dialogue data; Based on the target psychological counseling dialogue data, extract various psychological counseling questions and their corresponding sub-question labels, and construct a user question description text set according to the user question description text in each sub-question label; Inputting each of the user problem description texts in the user problem description text set into a large language model in batches to generate a psychological counseling dialogue text corresponding to each of the user problem description texts; Merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set; Using the psychological counseling dialogue data set to fine-tune the pre-trained model to generate a psychological counseling dialogue model; Based on the psychological consultation dialogue model, the psychological consultation request of the target user is processed, and the processing result is fed back to the target user terminal.

2. The psychological consultation method according to claim 1, characterized in that: The psychological counseling dialogue data includes counseling case data of an online psychological counseling platform and a public counseling data set in the field of psychology. The psychological counseling dialogue data is preprocessed to obtain target psychological counseling dialogue data, including: Performing text format conversion on the consulting case data to obtain target consulting case data; Cleaning, formatting and annotating the consultation data set and the target consultation case data to obtain intermediate psychological consultation dialogue data; The intermediate psychological counseling dialogue data is segmented into long texts, and the target psychological counseling dialogue data is obtained according to the segmentation results.

3. The psychological consultation method according to claim 1, characterized in that: Based on the target psychological counseling dialogue data, extracting various psychological counseling questions and their corresponding sub-question labels, and constructing a user question description text set according to the user question description text in each sub-question label, including: Using text classification technology, extracting various types of psychological counseling questions and their corresponding sub-question labels from the target psychological counseling dialogue data; Filtering out the user question description text corresponding to each of the sub-question labels from the target psychological counseling dialogue data; The user question description text set is constructed according to the user question description text in each of the sub-question tags.

4. The psychological consultation method according to claim 1, characterized in that: The step of batch-inputting each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts includes: Traversing the user problem description text set, and extracting each user problem description text one by one; Inputting the extracted user problem description texts in batches into the pre-trained large language model to generate corresponding psychological consultation dialogue texts; A quality check is performed on each of the generated psychological counseling dialogue texts, and the psychological counseling dialogue texts that do not meet the quality requirements are eliminated.

5. The psychological consultation method according to claim 1, characterized in that: The step of merging all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set includes: According to the actual distribution ratio of each type of psychological counseling problem, data is sampled from all the psychological counseling dialogue texts to generate a psychological counseling dialogue text set; The psychological counseling dialogue text set is merged with the target psychological counseling dialogue data to construct the psychological counseling dialogue data set.

6. The psychological consultation method according to claim 1, characterized in that: The method of fine-tuning the pre-trained model using the psychological counseling dialogue data set to generate a psychological counseling dialogue model includes: Dividing the psychological counseling dialogue dataset according to a preset ratio to obtain a training set, a validation set, and a test set; Using the training set to fine-tune the pre-trained model to obtain a trained model; Using the validation set to adjust parameters of the trained model to obtain an adjusted model; The performance of the adjusted model is evaluated using the test set, and when it is detected that the performance evaluation result meets the preset performance requirements, the psychological counseling dialogue model is obtained.

7. The psychological consultation method according to any one of claims 1 to 6, characterized in that: The method of processing the psychological consultation request of the target user based on the psychological consultation dialogue model and feeding back the processing result to the target user terminal includes: Receiving the psychological consultation request of the target user, parsing the psychological consultation request, and obtaining the psychological consultation text of the target user; The psychological counseling text is used as input, a corresponding psychological counselor reply text is generated through the psychological counseling dialogue model, and the psychological counselor reply text is fed back to the target user terminal.

8. A psychological consultation processing device, characterized in that: include: An acquisition module is used to acquire psychological counseling dialogue data from different data sources, perform data preprocessing on the psychological counseling dialogue data, and obtain target psychological counseling dialogue data; An extraction module, for extracting various psychological counseling questions and their corresponding sub-question labels based on the target psychological counseling dialogue data, and constructing a user question description text set according to the user question description text in each sub-question label; An input module, used to batch input each of the user problem description texts in the user problem description text set into a large language model to generate a psychological counseling dialogue text corresponding to each of the user problem description texts; A merging module, used to merge all the psychological counseling dialogue texts with the target psychological counseling dialogue data to construct a psychological counseling dialogue data set; A fine-tuning module, used to use the psychological counseling dialogue data set to fine-tune the pre-trained model to generate a psychological counseling dialogue model; The processing module is used to process the psychological consultation request of the target user based on the psychological consultation dialogue model, and feed back the processing result to the target user terminal.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the psychological counseling processing method as described in any one of claims 1-7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the psychological counseling processing method as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Multi-agent dynamic task integrated allocation method and system

    CN120336035A