Auxiliary psychological counseling method and system based on natural language recognition
Through natural language recognition technology, analyzing the client's audio records, building a psychological portrait, and matching a suitable psychological counselor, it solves the problem of difficulty in accurately judging the client's emotional state in the existing technology, and improves the pertinence and effectiveness of psychological counseling.
Patent Information
- Application Number
- CN202510034442.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing psychological counseling methods are difficult to accurately judge the client's current emotional state, which makes psychological counseling services not meeting the client's actual needs and it is difficult to establish a trust relationship.
The auxiliary psychological counseling method based on natural language recognition is adopted. By obtaining the client's audio records, using speech recognition and emotion analysis techniques, analyzing the client's emotional state and psychological problems, building a psychological portrait, and using a collaborative filtering algorithm to match suitable psychological counselors.
It realizes accurate judgment of the client's emotional state, provides more targeted psychological counseling services, and improves the client's acceptance of psychological counseling and the consultation effect.
Smart Images

Figure CN119889593A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of psychological counseling, and in particular to an auxiliary psychological counseling method and system based on natural language recognition. Background Art
[0002] Psychological counseling is a specialized assistance activity that provides psychological support and advice related to individuals, groups or organizations through professional counselors. The goal of psychological counseling is to help people solve various psychological problems, including but not limited to emotional distress (such as anxiety, depression and stress), interpersonal relationship problems, personal development challenges, life transitions and decision-making difficulties. Psychological counselors can provide specific strategies and techniques to help people solve the problems they face, such as how to deal with stress, how to improve interpersonal relationships, etc. For those who are experiencing difficulties or stress, psychological counseling can provide the necessary psychological support to help them maintain a positive and optimistic attitude when facing difficulties.
[0003] Natural Language Processing (NLP) is an important branch of computer science and artificial intelligence. It studies how to enable computers to understand, generate and process human natural language. Natural language processing covers a series of tasks from basic vocabulary and syntax understanding to complex sentiment analysis, machine translation and dialogue systems. The auxiliary psychological counseling method based on natural language recognition is a method of using natural language processing technology to assist psychological counseling. Through language analysis, some basic information of the visitor can be quickly obtained to provide reference for subsequent counseling.
[0004] However, it is difficult to accurately judge the client's current specific emotional state with the existing methods, which may result in the psychological counseling services provided not meeting the client's actual needs. It is also difficult to accurately judge their needs and the degree of willingness to accept services based on their emotional situation. Since it is impossible to accurately judge emotions, it is difficult for clients to truly feel respected and cared for. At the same time, many clients have a certain resistance to psychological counseling itself, which may bring certain difficulties to establishing a trusting relationship between counselors and clients.
[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0006] In view of the problems in the related technology, the present invention proposes an auxiliary psychological counseling method and system based on natural language recognition to overcome the above-mentioned technical problems existing in the existing related technology.
[0007] To this end, the specific technical solution adopted by the present invention is as follows: According to one aspect of the present invention, there is provided an auxiliary psychological consultation method based on natural language recognition, the auxiliary psychological consultation method based on natural language recognition comprising the following steps: S1. Obtain the audio recording of the interactive interview with the visitor and extract the visitor's main psychological problems from the audio recording; S2. Analyze the client’s emotional state and determine the client’s willingness for psychological counseling; S3. Build a psychological portrait of the visitor based on the results of emotional state analysis, and use collaborative filtering algorithm to match the visitor with a psychological counselor; S4. Develop adjustment plans based on the client’s main psychological problems and predict the effectiveness of psychological counseling; S5. Establish a remote psychological counseling platform to provide remote psychological counseling services.
[0008] Furthermore, obtaining the audio recording of the interactive interview with the visitor and extracting the visitor's main psychological problems from the audio recording includes the following steps: S11. Obtain audio records of interactive interviews with visitors in real time and convert the audio records into a standard text format using speech recognition technology; S12. Use the BERT language model to perform real-time semantic understanding and keyword extraction of interview text content; S13. Construct a knowledge graph containing various psychological problems and attribute relationships, and perform keyword matching to preliminarily determine the psychological problems of the visitor; S14, asking additional questions in natural language, and performing speech recognition and text conversion on the newly added audio recordings; S15. Use the BERT language model to perform semantic understanding and keyword extraction on the newly added interview text content; S16. Match the newly added keywords in the knowledge graph, merge the matching results of the two keywords, and finally determine the main psychological problems of the visitor.
[0009] Further, analyzing the client's emotional state and judging the client's willingness for psychological counseling includes the following steps: S21, using a short-time energy difference algorithm to calculate the energy difference between adjacent frames in the audio recording to estimate the visitor's speech speed change characteristics; S22. Use spectral envelope technology to calculate the frequency domain characteristics in the audio recording to estimate the visitor's intonation characteristics; S23, perform sentiment analysis and sentiment feature extraction on the interview text content to predict the visitor's tone change characteristics; S24, respectively assigning weights to the speech speed change feature, the intonation change feature, and the tone change feature; S25, merging the weights of each change feature in a summation manner to obtain a comprehensive evaluation value; S26. Compare the comprehensive evaluation value with a preset threshold value to determine the visitor's emotional state.
[0010] Further, using a short-time energy difference algorithm to calculate the energy difference between adjacent frames in the audio recording to estimate the visitor's speech speed change characteristics includes the following steps: S211, performing bandpass filtering on each frame of audio signal in the audio recording to obtain a power value at the Mel frequency, and then composing the power values into a dimensional vector to represent power spectrum distribution; S212, calculating the mean power spectrum by using a frame-by-frame weighted dynamic update method; S213, calculating the difference between the mean power spectrum of the current frame and the previous frame, and if the difference is less than a preset threshold, continuing to update the mean power spectrum, otherwise keeping the mean power spectrum the same as the previous frame; S214, defining a short-time energy difference between the current frame and the mean power spectrum, and estimating the visitor's speech speed change characteristics based on the short-time energy difference.
[0011] Further, using the spectral envelope technique to calculate the frequency domain characteristics in the audio recording to estimate the visitor's intonation variation characteristics includes the following steps: S221, using a Hamming window to perform windowing processing on the audio record, performing a dot multiplication of each frame of audio signal with the Hamming window to obtain a windowed audio; S222, performing DFT transformation on the windowed audio and calculating the amplitude spectrum of the windowed audio to obtain gene frequency distribution at different frequencies; S223, searching for local maximum values one by one in the fundamental frequency period, and performing linear interpolation on the obtained local maximum value sequence to obtain a step spectrum envelope; S224, performing Mel-scale stretching on the step spectrum envelope to obtain a Mel-scale envelope function, and calculating Mel-frequency cepstrum coefficients according to the Mel-scale envelope function; S225, performing an inverse DFT transform on the Mel frequency cepstrum coefficients, and inversely transforming the Mel frequency cepstrum coefficients into a spectrum envelope in Hz; S226. Using Durbin's recursive algorithm to solve the LPC coefficients, then solving the LPC spectrum envelope based on the LPC coefficients, and inferring the visitor's intonation variation characteristics based on the LPC spectrum envelope.
[0012] Furthermore, weighting the speech rate change feature, the intonation change feature and the tone change feature respectively includes the following steps: S241. Based on the speech speed change characteristics, intonation change characteristics and tone change characteristics, corresponding indicator matrices are established respectively to ensure that each sample has corresponding characteristic indicators; S242, normalizing each indicator matrix, mapping the value range of each characteristic indicator to a unified interval, and obtaining a standard matrix; S243, converting the standard matrix into a similarity matrix, and obtaining the transitive closure of the similarity matrix using the square method; S244, determining a horizontal cut set according to the value distribution of the transitive closure, and classifying the samples in the similarity matrix; S245, calculating the information contribution rate of each characteristic indicator to the overall classification result, and preliminarily obtaining the relative weight ratio of each characteristic indicator; S246. Introduce standard deviation to correct the error caused by mutual information, define the importance of feature indicators, and normalize the importance of each feature indicator to obtain weight distribution.
[0013] Furthermore, the standard deviation is calculated as: In the formula, represents the mean; N represents the total number of samples; represents standard deviation; X i Indicates i The random variable of the row.
[0014] Furthermore, comparing the comprehensive evaluation value with a preset threshold value to determine the visitor's emotional state includes the following steps: S261. If the comprehensive evaluation value is higher than the preset threshold, it is determined that the client's emotional state is positive and he / she is willing to seek psychological counseling, and positive response support is provided to encourage him / her to continue seeking psychological counseling; S262. If the comprehensive evaluation value is lower than the preset threshold, it is determined that the visitor's emotional state is negative and he / she does not have the willingness for psychological consultation, and measures to comfort and relieve the emotions are taken; S263. If the client's emotional state is beyond the professional scope of the psychological counselor, support from a medical institution is required and referral recommendations should be provided.
[0015] Furthermore, constructing a psychological profile of the visitor based on the emotional state analysis results and matching the visitor with a psychological counselor using a collaborative filtering algorithm includes the following steps: S31. Collect and encode the visitor’s emotional state and major psychological problems to form a comprehensive psychological portrait; S32. Collect professional information of psychological counselors, including professional background, qualification certification, years of experience, areas of psychological problems they are good at, and treatment methods; S33, encoding the professional information of the psychological counselor to form a feature vector; S34, using collaborative filtering algorithm to calculate the similarity between the client's psychological profile and the feature vector to evaluate the matching degree between the psychological counselor and the client; S35. Generate a recommendation list of psychological counselors with matching degree rankings and present it to the client so that the client can choose a matching psychological counselor.
[0016] According to another aspect of the present invention, there is also provided an auxiliary psychological counseling system based on natural language recognition, the auxiliary psychological counseling system based on natural language recognition comprising a psychological problem extraction module, an emotional state analysis module, a psychological counselor matching module, a program formulation module and a psychological counseling platform establishment module; The psychological problem extraction module is connected with the emotional state analysis module, the emotional state analysis module is connected with the psychological counselor matching module, the psychological counselor matching module is connected with the program formulation module, and the program formulation module is connected with the psychological counseling platform establishment module; A psychological problem extraction module is used to obtain the audio recording of the interactive interview with the visitor and extract the visitor's main psychological problems from the audio recording; Emotional state analysis module, used to analyze the emotional state of the visitor and determine the visitor's willingness for psychological consultation; The psychological counselor matching module is used to build a psychological profile of the visitor based on the results of emotional state analysis, and use collaborative filtering algorithms to match the visitor with a psychological counselor; The program formulation module is used to formulate adjustment plans based on the client's main psychological problems and predict the effect of psychological counseling; The psychological counseling platform establishment module is used to establish a remote psychological counseling platform to provide remote psychological counseling services.
[0017] The beneficial effects of the present invention are: 1. The present invention can avoid omission or misunderstanding of the visitor's oral content by obtaining a true and complete audio record of the visitor's interview, and provide an accurate and objective data source, so as to capture subtle information such as the visitor's emotional expression, voice tone changes and non-verbal signals, and analyze the visitor's speech through natural language processing technology, so as to help the psychological counselor to have a deeper understanding of the visitor's main psychological problems, and evaluate the severity and scope of the problems, and then provide more targeted intervention strategies and suggestions to improve the intervention and treatment effects.
[0018] 2. The present invention can capture the changes in the visitor's emotions and subtle details of expression by analyzing the visitor's tone, intonation and speaking speed, and accurately judge their needs and acceptance level based on their emotional state, rather than forcing consultation, thereby increasing the visitor's willingness to actively seek help, making the visitor feel respected and cared for, and facilitating the establishment of a foundation of trust. At the same time, it can better establish empathy with the visitor, give corresponding emotional feedback, enhance the visitor's sense of being understood, and improve the effect of psychological counseling.
[0019] 3. The present invention can comprehensively consider different aspects of the visitor's language expression characteristics by allocating weights to the three characteristics of tone, intonation and speaking speed. The characteristics of speech speed change reflect the visitor's sense of rhythm and urgency in the expression process, the characteristics of intonation change involve the changes in voice pitch and tone, and the characteristics of tone change are closer to the visitor's emotional expression. The weight allocation can ensure a comprehensive and objective analysis of these characteristics, and make it more systematic to consider the importance of different characteristics to emotional judgment, and guide intervention measures accordingly, thereby paying more attention to the emotional experience of the visitor.
[0020] 4. The present invention constructs a psychological portrait of the visitor through emotional state analysis, and matches this information with the professional expertise and experience of the psychological counselor, so as to achieve more personalized counselor matching. The collaborative filtering algorithm can provide counselor recommendations that better meet the needs of the visitor based on the common characteristics and preferences of the visitor and the psychological counselor, increase the matching degree and satisfaction between the visitor and the counselor, and thus provide more effective intervention and counseling. At the same time, effective matching can also reduce the mismatch between the visitor and the counselor, and avoid wasting time and resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a flow chart of an auxiliary psychological consultation method based on natural language recognition according to an embodiment of the present invention; Figure 2 It is a principle block diagram of an auxiliary psychological consultation system based on natural language recognition according to an embodiment of the present invention.
[0023] In the figure: 1. Psychological problem extraction module; 2. Emotional state analysis module; 3. Psychological counselor matching module; 4. Program formulation module; 5. Psychological counseling platform establishment module. DETAILED DESCRIPTION
[0024] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments. They can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementation methods and advantages of the present invention.
[0025] According to an embodiment of the present invention, a method and system for auxiliary psychological consultation based on natural language recognition are provided.
[0026] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to an embodiment of the present invention, the auxiliary psychological consultation method based on natural language recognition includes the following steps: S1. Obtain the audio recording of the interactive interview with the visitor and extract the visitor's main psychological problems from the audio recording.
[0027] The steps of obtaining the audio recording of the interactive interview with the visitor and extracting the visitor's main psychological problems from the audio recording include: S11. Obtain audio records of interactive interviews with visitors in real time, and convert the audio records into a standard text format using speech recognition technology.
[0028] It should be noted that before the interview, the visitor's explicit consent must be obtained and the purpose of the audio recording and text conversion must be informed, while ensuring the security and privacy of user data; only some anonymous clips of the interview are recorded and converted, and the anonymized audio and text data are stored in a secure server with strict access restrictions; the records and texts are only used for technical research and improvement, not for any commercial purpose or third-party sharing, and security technical means such as encrypted transmission and anonymization processing are adopted to ensure user privacy and data security.
[0029] S12. Use the BERT language model to perform real-time semantic understanding and keyword extraction on the interview text content.
[0030] It should be noted that BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model. BERT uses the Transformer structure and supports bidirectional contextual learning of text semantics. It learns language through a large amount of unsupervised pre-training to obtain rich semantic and pragmatic knowledge. BERT can be used for different NLP downstream tasks, such as classification, extraction, generation, etc., and it supports word-level and sentence-level prediction tasks, solving the problem of one-way learning of traditional language models.
[0031] S13. Construct a knowledge graph containing various psychological problems and attribute relationships, and perform keyword matching to preliminarily determine the psychological problems of the visitor.
[0032] It should be noted that the construction of a knowledge graph of psychological problems requires the participation of psychology experts to ensure the scientific nature and accuracy of the information; the knowledge graph is only used as a reference when judging psychological problems and cannot be used as the sole basis. A comprehensive assessment by a psychological counselor is also required; before using the knowledge graph, the visitor's consent must be obtained and personal privacy must be protected during the process; keyword matching may lead to misjudgment and needs to be combined with the visitor's complete description for judgment.
[0033] S14, asking additional questions in natural language, and performing speech recognition and text conversion on the newly added audio recordings; S15. Use the BERT language model to perform semantic understanding and keyword extraction on the newly added interview text content; S16. Match the newly added keywords in the knowledge graph, merge the matching results of the two keywords, and finally determine the main psychological problems of the visitor.
[0034] S2. Analyze the client’s emotional state and determine the client’s willingness for psychological counseling.
[0035] Among them, analyzing the emotional state of the visitor and judging the visitor's willingness for psychological consultation includes the following steps: S21. Calculate the energy difference between adjacent frames in the audio recording using a short-time energy difference algorithm to estimate the visitor's speech speed variation characteristics.
[0036] The method of calculating the energy difference between adjacent frames in the audio recording by using the short-time energy difference algorithm to estimate the speech speed variation characteristics of the visitor includes the following steps: S211, bandpass filtering is performed on each frame of audio signal in the audio recording to obtain power values at the Mel frequency, and then the power values are combined into a dimensional vector to represent power spectrum distribution.
[0037] It should be noted that the audio record is sampled to obtain each frame of audio signal; each frame of signal is bandpass filtered, and different frequency bands are selected. The Mel filter group is commonly used; the energy or power value within each Mel filter passband is calculated; the power values within all Mel filter passbands are combined into a vector, which is the Mel frequency power spectrum distribution feature vector of the frame of audio; the frequency distribution characteristics of the entire audio segment can be represented by a series of frame feature vectors.
[0038] S212, using a frame-by-frame weighted dynamic update method to calculate the mean power spectrum.
[0039] It should be noted that the frame-by-frame weighted dynamic update method is adopted to calculate the mean power spectrum instead of directly using the power spectrum of each frame as the feature vector. Each time the features of a new frame are calculated, different weights are given to the power spectra of the historical frames according to the distance between frames. The weights of recent frames are large and those of distant frames are small. Considering the time-varying nature of speech features, the use of mean features can smooth short-term changes and capture the changing trends of speech features well. Compared with fixed statistics, the dynamic mean is easier to use for continuous recognition tasks. While retaining the timing information, the robustness of the features is improved.
[0040] S213, calculating the difference between the mean power spectrum of the current frame and the previous frame, and if the difference is less than a preset threshold, continuing to update the mean power spectrum, otherwise keeping the mean power spectrum the same as the previous frame; S214, defining a short-time energy difference between the current frame and the mean power spectrum, and estimating the visitor's speech speed change characteristics based on the short-time energy difference.
[0041] It should be noted that the energy difference algorithm generally refers to a type of algorithm used for audio and video processing. It detects and extracts features in video or audio by calculating and comparing the difference in signal energy within a short signal frame. The principle of dividing the audio recording into frames and calculating the energy difference between adjacent frames to determine the change in speech speed is as follows: The energy of speech is positively correlated with the speaking speed. The faster the speaking speed, the louder the volume per unit time and the higher the energy. When the speaking speed changes, the energy difference between adjacent frames will also change accordingly. As the speaking speed increases, the energy difference between adjacent frames will increase; as the speaking speed slows down, the energy difference between adjacent frames will decrease.
[0042] S22. Use spectral envelope technology to calculate the frequency domain characteristics in the audio recording to estimate the visitor's intonation variation characteristics.
[0043] The method of calculating the frequency domain characteristics in the audio recording using the spectrum envelope technique to estimate the visitor's intonation variation characteristics includes the following steps: S221, using a Hamming window to perform windowing processing on the audio record, performing a dot product between each frame of audio signal and the Hamming window to obtain a windowed audio.
[0044] It should be noted that the Hamming window is a commonly used time domain window function. Compared with the rectangular window, the Hamming window can effectively reduce the spectrum leakage phenomenon. It uses cosine attenuation at both ends of the window, so that the signal tends to 0 at both ends of the window and the middle part tends to 1, with a smooth transition. It can more effectively suppress the side frequency components, which is beneficial to the signal frequency analysis.
[0045] S222, performing DFT transformation on the windowed audio and calculating the amplitude spectrum of the windowed audio to obtain gene frequency distribution at different frequencies.
[0046] It should be noted that DFT (Discrete Fourier Transform) is an important application of Fourier transform in discrete signal processing. DFT is used to convert a discrete time domain signal to a corresponding discrete frequency domain signal. It maps a discrete time sequence x[n] of length N to a discrete frequency sequence X[k] of length N.
[0047] S223, searching for local maximum values one by one in the fundamental frequency period, and performing linear interpolation on the obtained local maximum value sequence to obtain a step spectrum envelope; S224, performing Mel-scale stretching on the step spectrum envelope to obtain a Mel-scale envelope function, and calculating Mel-frequency cepstrum coefficients according to the Mel-scale envelope function.
[0048] It should be noted that the Mel frequency is a nonlinear frequency scale designed based on the human ear's perception of pitch, and it is closer to the perceptual characteristics of the human ear.
[0049] Mel Frequency Cepstral Coefficients (MFCC) is a method for extracting speech features. MFCC takes into account human ear perception and expresses speech features in a low dimension. It works well in applications such as speech recognition and speaker recognition. It makes full use of the energy distribution characteristics of speech signals at the Mel frequency.
[0050] S225, performing an inverse DFT transform on the Mel frequency cepstrum coefficients, and inversely transforming the Mel frequency cepstrum coefficients into a spectrum envelope in Hz; S226. Using Durbin's recursive algorithm to solve the LPC coefficients, then solving the LPC spectrum envelope based on the LPC coefficients, and inferring the visitor's intonation variation characteristics based on the LPC spectrum envelope.
[0051] It should be noted that the Durbin recursive algorithm is an efficient algorithm for calculating prediction coefficients in linear predictive coding (LPC) analysis.
[0052] It should be noted that the LPC spectrum envelope mainly reflects the changes in the position and amplitude of the resonance peaks of the speech signal. The high-frequency resonance peaks are mainly related to the pitch of the voice. When the pitch is high, the position of the high-frequency resonance peaks shifts toward high frequencies; when the pitch is low, the position of the high-frequency resonance peaks shifts toward low frequencies.
[0053] The high-frequency formant amplitude is related to the strength of the intonation: when the intonation is strong, the high-frequency formant amplitude increases; when the intonation is weak, the high-frequency formant amplitude decreases. By comparing the LPC spectrum envelopes of different speech segments, we can observe the changes in the position and amplitude of the formants in the high-frequency area. The changing trend of the high-frequency formant position and amplitude can preliminarily determine the high, low, strong and weak change characteristics of the intonation in this speech segment.
[0054] S23. Conduct sentiment analysis and sentiment feature extraction on the interview text content to predict the visitor’s tone change characteristics.
[0055] It should be noted that sentiment analysis and sentiment feature extraction of interview text content and prediction of visitor's tone change characteristics include: segmenting the interview text and identifying sentiment words; counting the frequency of positive and negative sentiment words; analyzing the frequency changes of sentiment words in different paragraphs or time periods; counting the proportion of positive words to determine the positivity of emotions; analyzing the rules of sentiment transmission and transformation in combination with the context; and combining various language features to predict the ups and downs of tone.
[0056] S24. Assign weights to the speech speed variation features, intonation variation features, and tone variation features respectively.
[0057] It should be noted that by analyzing the client's tone, intonation and speaking speed, it is possible to capture the client's emotional changes and subtle details of expression, and accurately judge their needs and degree of acceptance based on their emotional state, rather than forcing consultation, thereby increasing the client's willingness to actively seek help, making the client feel respected and cared for, and facilitating the establishment of a foundation of trust. At the same time, it is possible to better establish empathy with the client, give corresponding emotional feedback, enhance the client's sense of being understood, and improve the effectiveness of psychological counseling.
[0058] The weight allocation for the speech speed change feature, the intonation change feature and the tone change feature respectively includes the following steps: S241. Based on the speech speed change characteristics, intonation change characteristics and tone change characteristics, corresponding indicator matrices are established respectively to ensure that each sample has corresponding characteristic indicators; S242, normalizing each indicator matrix, mapping the value range of each characteristic indicator to a unified interval, and obtaining a standard matrix; S243, converting the standard matrix into a similarity matrix, and obtaining the transitive closure of the similarity matrix using the square method; S244, determining a horizontal cut set according to the value distribution of the transitive closure, and classifying the samples in the similarity matrix; S245, calculating the information contribution rate of each characteristic indicator to the overall classification result, and preliminarily obtaining the relative weight ratio of each characteristic indicator; S246. Introduce standard deviation to correct the error caused by mutual information, define the importance of feature indicators, and normalize the importance of each feature indicator to obtain weight distribution.
[0059] The calculation formula of standard deviation is: In the formula, represents the mean; N represents the total number of samples; represents standard deviation; X i Indicates i The random variable of the row.
[0060] It should be noted that the mutual information between each feature index and the classification label is calculated to represent the ability of the feature index to distinguish different categories. Considering the influence of sample size, it is necessary to introduce standard deviation to correct the mutual information, where the mutual information after standard deviation correction = mutual information / standard deviation.
[0061] It should be noted that the mutual information after standard deviation correction is defined as the importance of the feature index, and the importance of all feature indexes is normalized to obtain the weight of each feature index, where weight = importance / total importance.
[0062] S25. The weights of the various change features are combined in a summation manner to obtain a comprehensive evaluation value.
[0063] It should be noted that the steps of fusing the weights of the various change features in a summation manner to obtain a comprehensive evaluation value include the following steps: Determine the various change characteristics that need to be evaluated and their value ranges.
[0064] The calculated relative weight wi of each feature (the sum is 1 after normalization).
[0065] For each sample, the score scorei of the feature is given according to the actual value of the feature.
[0066] Multiply the score scorei of each feature by the weight wi of the feature to get the weighted score: Sum up the weighted scores of all features to get the comprehensive evaluation value of the sample: comprehensive evaluation value = weighted score 1 + weighted score 2 + ...
[0067] S26. Compare the comprehensive evaluation value with a preset threshold value to determine the visitor's emotional state.
[0068] It should be noted that setting a threshold includes: finding a certain percentage of the evaluation value distribution based on historical data statistics, such as the mean or median; subjectively setting a value based on actual needs and experience; the threshold should not be set too high or too low, and flexibility in judgment needs to be retained.
[0069] The process of comparing the comprehensive evaluation value with a preset threshold value and determining the visitor's emotional state includes the following steps: S261. If the comprehensive evaluation value is higher than the preset threshold, it is determined that the client's emotional state is positive and he / she is willing to seek psychological counseling, and positive response support is provided to encourage him / her to continue seeking psychological counseling; S262. If the comprehensive evaluation value is lower than the preset threshold, it is determined that the visitor's emotional state is negative and he / she does not have the willingness for psychological consultation, and measures to comfort and relieve the emotions are taken; S263. If the client's emotional state is beyond the professional scope of the psychological counselor, support from a medical institution is required and referral recommendations should be provided.
[0070] It should be noted that it is necessary to judge whether the emotional state is a serious emotional problem, such as clinical manifestations such as depression and anxiety; if it is a serious emotional problem, actively inform the visitor that the current situation is beyond the ability of the psychological counselor; explain the need to seek medical treatment from professional medical institutions such as psychiatry; provide reliable medical institutions as referral options, actively contact the medical institutions to make an appointment for the consultation, and inform the visitor of the specific information; before referral, you can briefly understand the basic situation of the visitor and provide basic psychological support and comfort.
[0071] S3. Build a psychological portrait of the client based on the results of emotional state analysis, and use collaborative filtering algorithm to match the client with a psychological counselor.
[0072] Among them, building a psychological portrait of the visitor based on the results of emotional state analysis and matching the visitor with a psychological counselor using a collaborative filtering algorithm includes the following steps: S31. Collect and encode the emotional state and main psychological problems of the visitor to form a comprehensive psychological portrait.
[0073] It should be noted that the emotional state and psychological problems of the visitors are encoded, for example, "01" represents positive, "02" represents negative, "A" represents anxiety, "B" represents depression, etc. The encoded emotional state and psychological problems are combined to form the psychological portrait code of the visitor, for example, "01A" represents positive but with anxiety tendency; the psychological portrait codes of different visitors are collected to form a psychological portrait coding data set.
[0074] S32. Collect professional information of psychological counselors, including professional background, qualification certification, years of experience, areas of psychological problems they are good at, and treatment methods; S33. Encode the professional information of the psychological counselor to form a feature vector.
[0075] S34. Use collaborative filtering algorithm to calculate the similarity between the client's psychological profile and feature vector to evaluate the degree of match between the psychological counselor and the client.
[0076] It should be noted that the similarity calculation formula is: In the formula, u It represents the psychological portrait of the client; n represents the number of matches of psychological counselors; t represents a constant; v represents the feature vector; I Indicates the degree of matching; Represents the similarity between the visitor's psychological profile and the feature vector.
[0077] It should be noted that the collaborative filtering algorithm can provide counselor recommendations that better meet the needs of clients based on the common characteristics and preferences of clients and counselors, increase the match and satisfaction between clients and counselors, and thus provide more effective intervention and counseling. At the same time, effective matching can also reduce the mismatch between clients and counselors and avoid wasting time and resources.
[0078] S35. Generate a recommendation list of psychological counselors with matching degree rankings and present it to the client so that the client can choose a matching psychological counselor.
[0079] It should be noted that a matching score is generated for each counselor based on the degree of similarity; all counselors are sorted from high to low according to the matching score; the top N counselors are taken to generate a recommendation list, which includes basic information and matching degree; this list is presented to the client, who chooses the most matching counselor; counselor information and client feedback are updated regularly to continuously optimize the recommendation effect.
[0080] S4. Develop adjustment plans based on the client’s main psychological problems and predict the effectiveness of psychological counseling.
[0081] It should be noted that formulating adjustment plans based on the client's main psychological problems and predicting the effectiveness of psychological counseling include: clarifying the main types of psychological problems, such as depression, anxiety, etc.; selecting appropriate psychotherapy theoretical models based on the type of problems, and formulating targeted psychotherapy plans based on the theoretical models, including treatment goals, methods, and step arrangements; regularly evaluating changes in the client's situation during psychotherapy and adjusting the plan if necessary; giving expected results based on the characteristics of the plan and the client's personal factors; providing follow-up service recommendations, such as the need to extend the course of treatment or referral; recording actual effects and comparing them with predicted results, and continuously improving the prediction model.
[0082] S5. Establish a remote psychological counseling platform to provide remote psychological counseling services.
[0083] It should be noted that establishing a remote psychological counseling platform to provide remote psychological counseling services includes the following steps: understanding user needs and determining the product positioning as an auxiliary psychological counseling service platform; developing core technologies such as natural language processing and emotion recognition to be able to preliminarily analyze the user's psychological state; designing system frameworks such as user modules, consulting modules, and decision support modules, developing specific functions for each module, and integrating them as a whole; hiring a psychological counseling team, formulating relevant process specifications, continuously optimizing and improving, and ensuring service quality.
[0084] like Figure 2 As shown, according to another embodiment of the present invention, there is also provided an auxiliary psychological counseling system based on natural language recognition, the auxiliary psychological counseling system based on natural language recognition comprises a psychological problem extraction module 1, an emotional state analysis module 2, a psychological counselor matching module 3, a program formulation module 4 and a psychological counseling platform establishment module 5; The psychological problem extraction module 1 is connected to the emotional state analysis module 2, the emotional state analysis module 2 is connected to the psychological counselor matching module 3, the psychological counselor matching module 3 is connected to the program formulation module 4, and the program formulation module 4 is connected to the psychological counseling platform establishment module 5; The psychological problem extraction module 1 is used to obtain the audio recording of the interactive interview with the visitor and extract the main psychological problems of the visitor from the audio recording; Emotional state analysis module 2, used to analyze the emotional state of the visitor and determine the visitor's willingness for psychological consultation; Psychological counselor matching module 3, used to build a psychological profile of the visitor based on the results of emotional state analysis, and match the visitor with a psychological counselor using a collaborative filtering algorithm; Program Development Module 4 is used to develop adjustment plans based on the client’s main psychological problems and predict the effectiveness of psychological counseling; The psychological counseling platform establishment module 5 is used to establish a remote psychological counseling platform to provide remote psychological counseling services.
[0085] To sum up, with the help of the above-mentioned technical scheme of the present invention, the present invention can avoid omissions or misunderstandings of the visitor's oral content by obtaining a true and complete audio record of the visitor's interview, and provide an accurate and objective data source, so as to capture subtle information such as the visitor's emotional expression, voice changes and non-verbal signals, and analyze the visitor's speech through natural language processing technology, so as to help psychological counselors understand the visitor's main psychological problems more deeply, and evaluate the severity and scope of the problems, and then provide more targeted intervention strategies and suggestions to improve the intervention effect and treatment effect.
[0086] The present invention can capture the visitor's emotional changes and subtle expression details by analyzing the visitor's tone, intonation and speaking speed, and accurately judge the visitor's needs and acceptance level based on the emotional state, rather than forcing consultation, thereby increasing the visitor's willingness to actively seek help, making the visitor feel respected and cared for, and facilitating the establishment of a foundation of trust. At the same time, it can better establish empathy with the visitor, give corresponding emotional feedback, enhance the visitor's sense of being understood, and improve the effect of psychological counseling.
[0087] The present invention can comprehensively consider different aspects of the visitor's language expression characteristics by allocating weights to the three characteristics of tone, intonation and speaking speed. The speaking speed change characteristic reflects the visitor's sense of rhythm and urgency in the expression process, the intonation change characteristic involves the change of voice pitch and tone, and the tone change characteristic is closer to the visitor's emotional expression. The weight allocation can ensure a comprehensive and objective analysis of these characteristics, and make it more systematic to consider the importance of different characteristics to emotional judgment, and guide intervention measures accordingly, thereby paying more attention to the emotional experience of the visitor.
[0088] The present invention constructs a psychological portrait of the visitor through emotional state analysis, and matches this information with the professional expertise and experience of the psychological counselor, so as to achieve more personalized counselor matching. The collaborative filtering algorithm can provide counselor recommendations that better meet the needs of the visitor based on the common characteristics and preferences of the visitor and the psychological counselor, increase the matching degree and satisfaction between the visitor and the counselor, and thus provide more effective intervention and counseling. At the same time, effective matching can also reduce the mismatch between the visitor and the counselor, and avoid wasting time and resources.
[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An auxiliary psychological consultation method based on natural language recognition, characterized in that: The auxiliary psychological consultation method based on natural language recognition comprises the following steps: S1. Obtain the audio recording of the interactive interview with the visitor and extract the visitor's main psychological problems from the audio recording; S2. Analyze the client’s emotional state and determine the client’s willingness for psychological counseling; S3. Build a psychological portrait of the visitor based on the results of emotional state analysis, and use collaborative filtering algorithm to match the visitor with a psychological counselor; S4. Develop adjustment plans based on the client’s main psychological problems and predict the effectiveness of psychological counseling; S5. Establish a remote psychological counseling platform to provide remote psychological counseling services.
2. The auxiliary psychological consultation method based on natural language recognition according to claim 1 is characterized in that: The method of obtaining the audio recording of the interactive interview with the visitor and extracting the visitor's main psychological problems from the audio recording comprises the following steps: S11. Obtain audio records of interactive interviews with visitors in real time and convert the audio records into a standard text format using speech recognition technology; S12. Use the BERT language model to perform real-time semantic understanding and keyword extraction of interview text content; S13. Construct a knowledge graph containing various psychological problems and attribute relationships, and perform keyword matching to preliminarily determine the psychological problems of the visitor; S14, asking additional questions in natural language, and performing speech recognition and text conversion on the newly added audio recordings; S15. Use the BERT language model to perform semantic understanding and keyword extraction on the newly added interview text content; S16. Match the newly added keywords in the knowledge graph, merge the matching results of the two keywords, and finally determine the main psychological problems of the visitor.
3. The auxiliary psychological consultation method based on natural language recognition according to claim 2 is characterized in that: The method of analyzing the emotional state of the visitor and judging the visitor's willingness for psychological consultation includes the following steps: S21, using a short-time energy difference algorithm to calculate the energy difference between adjacent frames in the audio recording to estimate the visitor's speech speed change characteristics; S22. Use spectral envelope technology to calculate the frequency domain characteristics in the audio recording to estimate the visitor's intonation characteristics; S23, perform sentiment analysis and sentiment feature extraction on the interview text content to predict the visitor's tone change characteristics; S24, respectively assigning weights to the speech speed change feature, the intonation change feature, and the tone change feature; S25, merging the weights of each change feature in a summation manner to obtain a comprehensive evaluation value; S26. Compare the comprehensive evaluation value with a preset threshold value to determine the visitor's emotional state.
4. The auxiliary psychological consultation method based on natural language recognition according to claim 3 is characterized in that: The method of calculating the energy difference between adjacent frames in the audio recording by using the short-time energy difference algorithm to estimate the visitor's speech speed change characteristics includes the following steps: S211, performing bandpass filtering on each frame of audio signal in the audio recording to obtain a power value at the Mel frequency, and then composing the power values into a dimensional vector to represent power spectrum distribution; S212, calculating the mean power spectrum by using a frame-by-frame weighted dynamic update method; S213, calculating the difference between the mean power spectrum of the current frame and the previous frame, and if the difference is less than a preset threshold, continuing to update the mean power spectrum, otherwise keeping the mean power spectrum the same as the previous frame; S214, defining a short-time energy difference between the current frame and the mean power spectrum, and estimating the visitor's speech speed change characteristics based on the short-time energy difference.
5. The auxiliary psychological consultation method based on natural language recognition according to claim 4 is characterized in that: The method of calculating the frequency domain characteristics in the audio recording by using the spectrum envelope technology to estimate the visitor's intonation variation characteristics comprises the following steps: S221, using a Hamming window to perform windowing processing on the audio record, performing a dot multiplication between each frame of audio signal and the Hamming window to obtain a windowed audio; S222, performing DFT transformation on the windowed audio and calculating the amplitude spectrum of the windowed audio to obtain gene frequency distribution at different frequencies; S223, searching for local maximum values one by one in the fundamental frequency period, and performing linear interpolation on the obtained local maximum value sequence to obtain a step spectrum envelope; S224, performing Mel-scale stretching on the step spectrum envelope to obtain a Mel-scale envelope function, and calculating Mel-frequency cepstrum coefficients according to the Mel-scale envelope function; S225, performing an inverse DFT transform on the Mel frequency cepstrum coefficients, and inversely transforming the Mel frequency cepstrum coefficients into a spectrum envelope in Hz; S226. Using Durbin's recursive algorithm to solve the LPC coefficients, then solving the LPC spectrum envelope based on the LPC coefficients, and inferring the visitor's intonation variation characteristics based on the LPC spectrum envelope.
6. The auxiliary psychological consultation method based on natural language recognition according to claim 5 is characterized in that: The weight allocation of the speech speed change feature, the intonation change feature and the tone change feature respectively comprises the following steps: S241. Based on the speech speed change characteristics, intonation change characteristics and tone change characteristics, corresponding indicator matrices are established respectively to ensure that each sample has corresponding characteristic indicators; S242, normalizing each indicator matrix, mapping the value range of each characteristic indicator to a unified interval, and obtaining a standard matrix; S243, converting the standard matrix into a similarity matrix, and obtaining the transitive closure of the similarity matrix using the square method; S244, determining a horizontal cut set according to the value distribution of the transitive closure, and classifying the samples in the similarity matrix; S245, calculating the information contribution rate of each characteristic indicator to the overall classification result, and preliminarily obtaining the relative weight ratio of each characteristic indicator; S246. Introduce standard deviation to correct the error caused by mutual information, define the importance of feature indicators, and normalize the importance of each feature indicator to obtain weight distribution.
7. The auxiliary psychological consultation method based on natural language recognition according to claim 6 is characterized in that: The calculation formula of the standard deviation is: In the formula, represents the mean; N represents the total number of samples; represents standard deviation; X i Indicates i The random variable of the row.
8. The auxiliary psychological consultation method based on natural language recognition according to claim 7 is characterized in that: The step of comparing the comprehensive evaluation value with a preset threshold value to determine the visitor's emotional state comprises the following steps: S261. If the comprehensive evaluation value is higher than the preset threshold, it is determined that the client's emotional state is positive and has the willingness for psychological counseling, and positive response support is provided to encourage him to continue to seek psychological counseling; S262. If the comprehensive evaluation value is lower than the preset threshold, it is determined that the visitor's emotional state is negative and he / she does not have the willingness for psychological consultation, and measures to comfort and relieve the emotions are taken; S263. If the client's emotional state is beyond the professional scope of the psychological counselor, support from a medical institution is required and referral recommendations should be provided.
9. The auxiliary psychological consultation method based on natural language recognition according to claim 8 is characterized in that: The method of constructing a psychological portrait of a visitor based on the emotional state analysis result and matching a psychological counselor for the visitor by using a collaborative filtering algorithm includes the following steps: S31. Collect and encode the visitor’s emotional state and major psychological problems to form a comprehensive psychological portrait; S32. Collect professional information of the psychological counselor, including professional background, qualification certification, years of experience, areas of psychological problems that the counselor is good at, and treatment methods; S33, encoding the professional information of the psychological counselor to form a feature vector; S34, using collaborative filtering algorithm to calculate the similarity between the client's psychological profile and the feature vector to evaluate the matching degree between the psychological counselor and the client; S35. Generate a recommendation list of psychological counselors with matching degree rankings and present it to the client so that the client can choose a matching psychological counselor.
10. An auxiliary psychological consultation system based on natural language recognition, used to implement the auxiliary psychological consultation method based on natural language recognition as described in any one of claims 1 to 9, characterized in that: The auxiliary psychological counseling system based on natural language recognition includes a psychological problem extraction module, an emotional state analysis module, a psychological counselor matching module, a program formulation module and a psychological counseling platform establishment module; The psychological problem extraction module is connected to the emotional state analysis module, the emotional state analysis module is connected to the psychological counselor matching module, the psychological counselor matching module is connected to the program formulation module, and the program formulation module is connected to the psychological counseling platform module; The psychological problem extraction module is used to obtain the audio record of the interactive interview with the visitor and extract the visitor's main psychological problems from the audio record; The emotional state analysis module is used to analyze the emotional state of the visitor and determine the visitor's willingness for psychological consultation; The psychological counselor matching module is used to construct a psychological profile of the visitor based on the emotional state analysis results, and match the visitor with a psychological counselor using a collaborative filtering algorithm; The program formulation module is used to formulate adjustment plans based on the main psychological problems of the visitor and predict the effect of psychological counseling; The psychological counseling platform establishment module is used to establish a remote psychological counseling platform to provide remote psychological counseling services.