A social media depression text recognition method based on symptom prototype guidance

CN122986704APending Publication Date: 2026-10-27CHINA UNITED NETWORK COMMUNICATIONS CO LTD NANCHONG BRANCH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611313388.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0007]本发明的目的在于解决现有技术中核心症状线索易被冗余信息稀释,导致识别精度受限、预测过程缺乏临床依据支持且不可解释、低样本和噪声场景下方法鲁棒性不足的问题

Benefits of technology

本发明通过构建基于临床抑郁诊断标准的症状原型集合,将临床先验知识有效融入文本识别流程,使模型具备明确的抑郁症状维度判别依据,克服了传统方法仅依赖通用情感特征而无法区分日常情绪表达与病理性抑郁症状的缺陷,显著提升了识别精度与临床适配性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986704A_ABST
    Figure CN122986704A_ABST
Patent Text Reader

Abstract

The application provides a kind of social media depression text recognition method based on symptom prototype guidance, it is related to natural language understanding processing technical field, solve the core symptom clue in prior art is easy to be diluted, lead to the limited recognition accuracy, lack of clinical basis, uninterpretable and other limitations.The method, obtaining the social media text to be identified and preprocessing into standardized text, based on clinical depression diagnostic criteria to construct symptom prototype set, the set carries symptom description semantic information;Evidence sentence screening is carried out on the standardized text, the key evidence sentence is determined and the local evidence feature is extracted, the global semantic feature of the whole text of the standardized text is also extracted, the local evidence feature and the global semantic feature are fused, and the fused feature is input into the preset classification model, that is, the output depression text recognition result.The application enables the model to be deployed in a lightweight manner, and achieves high recognition accuracy, strong noise robustness and traceable clinical interpretability and other advantages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language understanding and processing technology, specifically to a method for recognizing depressive text on social media based on symptom prototypes. Background Technology

[0002] With the widespread use of social media platforms, the text content left by users online has become an important source of information reflecting their mental state. Depression, as a highly prevalent mental health problem, requires early identification and intervention for significant social importance. Utilizing natural language processing technology to intelligently identify depression risk in social media text has become a research hotspot in the field of mental health screening. Currently, the industry has developed various technical approaches for the automatic identification of depressive text on social media, but limitations still exist in terms of accuracy, interpretability, deployment cost, and robustness.

[0003] The first type of approach is the full-text modeling method based on traditional machine learning. This type of method typically relies on a mental lexicon or a general sentiment lexicon to extract shallow text features such as word frequency, sentence structure, and personal pronouns, and then combines these features with classifiers such as logistic regression (LR) and support vector machines (SVM) to model and classify the entire text. This approach has the advantages of lightweight models and easy deployment, but the extracted features lack specificity for clinical depressive symptoms and cannot effectively distinguish between everyday emotional expressions and pathological depressive symptoms. Furthermore, social media texts often contain a large amount of everyday narrative content unrelated to depression; the equal-weighted full-text modeling approach dilutes core symptom clues with redundant information, resulting in limited recognition accuracy and weak generalization ability in low-sample scenarios.

[0004] The second category of solutions involves full-text modeling based on deep pre-trained language models (BERT, RoBERTa, etc.). These methods utilize large-scale pre-trained models to perform contextual semantic encoding on the text, which can improve recognition accuracy to some extent. However, these models have a large number of parameters, requiring significant computing power and training data, resulting in substantial deployment costs. More importantly, the pre-trained models employ a full-text equal-weight encoding strategy, which also fails to effectively filter core symptom clues, and the semantic dilution problem persists. Furthermore, the prediction process of deep models is essentially a black box operation, unable to output traceable discriminatory evidence, making it difficult to meet the credibility and interpretability requirements of mental health assisted screening scenarios.

[0005] The third category consists of improved methods based on local fragment selection. These methods use attention mechanisms, keyword extraction, or general negative lexicon matching to filter emotional fragments in the text, replacing full-text modeling. While this approach achieves initial local cue focusing, the selection criteria are mostly general emotional indicators that do not align with clinical diagnostic criteria for depression, making it difficult to accurately capture pathologically significant depressive symptoms. Furthermore, these methods typically lack integration of global contextual semantics, making them prone to misjudgments due to the one-sidedness of local semantics, and struggling to achieve a balance between accuracy, robustness, and interpretability.

[0006] In summary, existing technical solutions generally face the following common shortcomings: First, they fail to effectively integrate prior knowledge of clinical depression diagnosis into the recognition process, resulting in a lack of symptom-level discriminative basis in the model; second, full-text modeling methods struggle to filter redundant information, easily diluting core symptom clues; third, the model prediction process lacks interpretability and cannot provide a traceable chain of evidence; and fourth, some solutions are overly reliant on computing power and data scale, hindering lightweight deployment and large-scale application. Therefore, there is an urgent need for a social media depression text recognition method that can integrate prior clinical knowledge, balance recognition accuracy and interpretability, and possess lightweight deployment capabilities. Summary of the Invention

[0007] The purpose of this invention is to address the problems in existing technologies where core symptom clues are easily diluted by redundant information, leading to limited recognition accuracy, a lack of clinical evidence to support the prediction process, and insufficient robustness in low-sample and noisy scenarios. This invention proposes a symptom prototype-guided method for recognizing depressive text on social media. It constructs symptom prototypes using clinical depression diagnostic criteria as priors, guides the selection of key evidence sentences from the text using these prototypes, and fuses local evidence features with global semantic features. Finally, it achieves depressive text recognition based on a lightweight classification model. This invention maintains the advantages of lightweight deployment while achieving high recognition accuracy, strong noise resistance, and traceable clinical interpretability.

[0008] The present invention employs the following technical solutions to achieve its objective: A method for identifying depressive text on social media based on symptom prototypes, comprising the following steps: S1. Obtain the social media text to be identified, and preprocess the social media text to obtain normalized text; S2. Based on the clinical diagnostic criteria for depression, a set of symptom prototypes is constructed. The set of symptom prototypes contains multiple symptom prototypes. Each symptom prototype corresponds to a dimension of depressive symptoms and carries semantic information describing the symptoms under that dimension of depressive symptoms. S3. Using the set of symptom prototypes, the standardized text is screened for evidence sentences to determine the key evidence sentences that match each of the symptom prototypes, and the corresponding local evidence features are extracted based on the key evidence sentences. S4. Extract global semantic features from the entire normalized text to obtain the corresponding global semantic features; S5. The local evidence features are fused with the global semantic features to obtain fused features; S6. Input the fused features into a preset classification model and output the depression text recognition result.

[0009] Specifically, in step S1, the social media text is preprocessed, including: segmenting the social media text to remove stop words, special symbols, and meaningless characters; performing lexical restoration or stemming on the segmented text to unify the text into a standardized word sequence list; and truncating or padding the standardized word sequence list according to a preset maximum text length to obtain the standardized text.

[0010] Furthermore, in step S2, based on the clinical diagnostic criteria for depression, a symptom prototype set is constructed, including: dividing the depressive symptoms into multiple symptom dimensions according to the depressive symptom items defined in the patient health questionnaire; for each symptom dimension, extracting the core symptom description from the clinical description text corresponding to that symptom dimension, and constructing the symptom prototype corresponding to that symptom dimension; the number of symptom prototypes in the symptom prototype set corresponds to the number of symptom items in the patient health questionnaire.

[0011] Preferably, the semantic information of each symptom prototype is represented by a combination of the following two methods: The first method involves segmenting the clinical description text corresponding to the symptom dimension into words and extracting a set of core keywords related to that symptom dimension as the lexical semantic representation of the symptom prototype. The second method involves inputting the clinical description text into a pre-trained language model for encoding to obtain a vector-layer semantic representation of the symptom prototype. The lexical layer semantic representation and the vector layer semantic representation together constitute the symptom description semantic information of the symptom prototype.

[0012] Furthermore, in step S3, the standardized text is screened for evidence sentences using the symptom prototype set, including: segmenting the standardized text according to sentence boundaries to obtain a candidate sentence set; calculating the semantic matching degree between each candidate sentence in the candidate sentence set and each of the symptom prototypes; identifying candidate sentences with semantic matching degrees exceeding a preset threshold as key evidence sentences that match the symptom prototype; and retaining the symptom prototype with the highest semantic matching degree as the corresponding label for candidate sentences that match multiple symptom prototypes.

[0013] Specifically, based on the key evidence sentences, the corresponding local evidence features are extracted, including: for each symptom prototype dimension, merging all key evidence sentences matched by the symptom prototype to construct the local evidence text corresponding to the symptom prototype dimension; performing word frequency-inverse document frequency feature extraction on each of the local evidence texts to obtain the local feature vector corresponding to each symptom prototype dimension; and concatenating the local feature vectors to obtain the local evidence features.

[0014] Specifically, in step S4, global semantic feature extraction is performed on the full text of the normalized text, including: extracting term frequency-inverse document frequency features from the full text of the normalized text to obtain a full-text term frequency-inverse document frequency feature vector, which is used as the global semantic feature; the dictionary used for global semantic feature extraction shares the same feature space as the dictionary used for local evidence feature extraction, and the local evidence features and the global semantic features are consistent in dimension.

[0015] Specifically, in step S5, fusing the local evidence features with the global semantic features includes: concatenating the local evidence features and the global semantic features along the feature dimension to obtain a concatenated feature vector; normalizing the concatenated feature vector to obtain the fused feature; or, setting corresponding weight coefficients for the local evidence features and the global semantic features respectively, and performing a weighted summation to obtain the fused feature.

[0016] Preferably, in step S6, the preset classification model is a logistic regression model; the method further includes calibrating the output probability of the logistic regression model: after the training phase, using an independent calibration dataset, the original probability of the logistic regression model is mapped and calibrated by temperature scaling or ordinal-preserving regression to obtain the calibrated prediction probability; the calibrated prediction probability is used as the final confidence output for depression text recognition.

[0017] Specifically, the method also includes a model training phase, which comprises: obtaining a set of labeled social media depressive text training samples; constructing the symptom prototype set according to step S2; performing local evidence feature extraction, global semantic feature extraction, and feature fusion on each sample in the training sample set according to steps S3 to S5 to obtain the fused features corresponding to each sample; training the classification model using the fused features as input and the corresponding depression label as a supervision signal; and balancing the ratio of positive depressive samples to negative non-depressive samples in the training sample set through oversampling or undersampling.

[0018] In summary, due to the adoption of this technical solution, the beneficial effects of this invention are as follows: This invention constructs a symptom prototype set based on clinical depression diagnostic criteria, effectively integrating clinical prior knowledge into the text recognition process. This enables the model to have clear criteria for judging depressive symptoms, overcoming the shortcomings of traditional methods that rely solely on general emotional features and cannot distinguish between everyday emotional expressions and pathological depressive symptoms. This significantly improves recognition accuracy and clinical adaptability.

[0019] This invention uses symptom prototypes to guide the screening of key evidence sentences in social media texts, effectively filtering out redundant information unrelated to depressive symptoms. This allows the model to focus on core symptom clues for feature modeling, avoiding the problem of symptom semantics being diluted by everyday narratives under the full-text equal-weighted encoding method, thereby further improving recognition accuracy.

[0020] This invention integrates local evidence features with global semantic features in its modeling, preserving the fine-grained symptom information carried by key evidence sentences while also taking into account the overall semantic representation provided by the full text context. The two complement each other and work together to enhance the robustness of the model in noisy scenarios such as text truncation and random word deletion, enabling it to adapt to the actual characteristics of social media texts that are irregular and of varying lengths.

[0021] This invention constructs a complete traceability chain from symptom prototypes to key evidence sentences and then to recognition results, so that each recognition output can be traced back to the specific clinical symptom dimension and the corresponding textual evidence. It solves the problems of black box prediction process and uninterpretable judgment basis in traditional models, and can meet the credibility requirements of mental health auxiliary screening scenarios.

[0022] This invention is based on word frequency-inverse document frequency features and a lightweight classification model. It does not rely on large-scale pre-trained models or high-performance computing resources, resulting in stable training, simple parameter tuning, and strong reproducibility, which is beneficial for large-scale deployment and practical application. Furthermore, thanks to the introduction of prior clinical knowledge, this invention can maintain high recognition performance even with insufficient labeled samples, reducing dependence on large-scale labeled data. In addition, by calibrating the model's output probabilities, this invention makes the prediction confidence level more closely match the actual results, facilitating flexible adjustment of risk screening thresholds according to different application scenarios. Attached Figure Description

[0023] The present invention is described in detail with reference to the following accompanying drawings, specifically including one drawing as follows: Figure 1 This is a schematic diagram illustrating the overall process of the social media depression text recognition method of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The parts of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0026] Example A method for identifying depressive text on social media based on symptom prototypes. Figure 1 The overall process of this method is briefly described below and can be viewed concurrently; the key steps of this method can be summarized as follows: S1. Obtain the social media text to be identified, preprocess the social media text to obtain normalized text; S2. Based on the clinical diagnostic criteria for depression, a set of symptom prototypes is constructed. The set of symptom prototypes contains multiple symptom prototypes. Each symptom prototype corresponds to a dimension of depressive symptoms and carries semantic information describing the symptoms under that dimension of depressive symptoms. S3. Using the symptom prototype set, the evidence sentences in the standardized text are screened to determine the key evidence sentences that match each symptom prototype, and the corresponding local evidence features are extracted based on the key evidence sentences. S4. Extract global semantic features from the entire normalized text to obtain the corresponding global semantic features; S5. Fuse local evidence features with global semantic features to obtain fused features; S6. Input the fused features into the preset classification model and output the depressive text recognition result.

[0027] This embodiment uses the clinical diagnostic criteria for depression as a priori knowledge source to construct a set of symptom prototypes covering multiple dimensions of depressive symptoms. These prototypes serve as guiding signals for evidence screening, and key evidence sentences that match each symptom dimension are extracted from social media texts. This allows for focusing on core symptom clues at the feature level and avoids interference from redundant information.

[0028] Based on this, the local evidence features obtained from key evidence sentences are fused with the global semantic features obtained from the whole text, taking into account both fine-grained symptom information and overall contextual semantics. Finally, a lightweight classification model is used to complete the identification of depressive texts.

[0029] The entire process of this embodiment forms a complete technical flow from clinical prior guidance, local evidence screening, multi-granularity feature fusion to lightweight classification output. The method of this embodiment will now be described in detail, focusing on the specific details and preferred methods of each step.

[0030] I. Text Data Acquisition and Standardized Preprocessing The core task of step S1 is to transform the raw text data voluntarily published by social media users into a standardized and structured input format, providing a reliable data foundation for subsequent symptom prototype matching, evidence sentence screening, and feature extraction. Because social media text is characterized by arbitrary expression, non-standard formatting, and high levels of noise, directly using the raw text for modeling would introduce a large amount of interference. Therefore, systematic standardized preprocessing needs to be performed at the very beginning of the recognition process.

[0031] In this embodiment, preprocessing first performs a character unification operation on the original text, converting all characters to lowercase to eliminate the problem of the same word being identified as different feature items due to differences in capitalization, ensuring the consistency of subsequent feature statistics. Then, redundancy cleaning is performed to remove redundant whitespace, special symbols, meaningless characters, and invalid placeholder characters from the text, purifying the text content and avoiding interference from non-semantic characters on word segmentation and feature extraction. Based on this, word segmentation is performed, and lemmatization or stemming is performed to unify different inflectional forms of the same word into a unified root form, ensuring that the same semantic unit has a unique representation in the feature space, ultimately forming a standardized word sequence list.

[0032] At the sentence segmentation level, periods, question marks, exclamation marks, and line breaks are used as the primary delimiters to segment the entire text into main clauses. When only a single sentence block remains after the main clause segmentation, English commas are used as auxiliary delimiters for further subdivision to avoid excessively long sentence blocks affecting the granularity and accuracy of subsequent evidence sentence matching. After sentence segmentation, only semantically valid sentence blocks with a character length greater than a preset threshold are retained, while invalid fragments that are too short are filtered out to ensure that each retained sentence block has independent semantic carrying capacity.

[0033] After the above processing, the normalized word sequence list is truncated or padded according to the preset maximum text length, unifying all text to a fixed length to ensure the consistency of input dimensions in subsequent feature calculations. Finally, the preprocessing stage saves both the cleaned full-text and the segmented sentence texts. The former is used for global semantic feature extraction in subsequent steps, while the latter is used for local evidence sentence selection guided by symptom prototypes. The data from both dimensions together support subsequent multi-granularity feature fusion.

[0034] II. Construction of Clinical Symptom Prototype Database In step S2, a set of symptom prototypes based on clinical diagnostic criteria for depression is constructed. This transforms professional medical knowledge into calculable and matchable mathematical representations, providing clear clinically relevant guiding signals for subsequent evidence sentence screening. Unlike approaches that rely on general affective lexicons or data-driven methods to obtain screening criteria, this embodiment directly uses the clinically applicable PHQ depression diagnostic scale as its knowledge source. This ensures that the definition of symptom prototypes aligns with the diagnostic criteria for pathological depression, making the subsequent screening process clinically traceable.

[0035] In this embodiment, the construction of the symptom prototype set is based on the depressive symptom items defined in the PHQ scale, and the depressive symptoms are divided into 9 core symptom dimensions, including: loss of interest, low mood, sleep abnormalities, physical fatigue, changes in appetite, feelings of worthlessness and self-blame, decreased attention, psychomotor changes, and self-harm and suicidal tendencies.

[0036] For each symptom dimension, standard clinical description texts corresponding to that dimension are compiled, and core symptom expressions are extracted to construct symptom prototypes for that symptom dimension. The number of prototypes in the symptom prototype set corresponds one-to-one with the number of symptom items in the PHQ scale, ensuring coverage of all aspects of depressive symptoms relevant to clinical diagnosis, without omissions or redundancy.

[0037] The semantic representation of symptom prototypes employs a dual-dimensional approach combining lexical and vector layers. Lexical semantic representation is achieved by segmenting the clinical description text corresponding to the symptom dimension and extracting a set of core keywords relevant to that symptom dimension; this method is intuitive and straightforward, facilitating manual review and understanding. Vector-level semantic representation, on the other hand, encodes the clinical description text into a pre-trained language model to obtain high-dimensional dense vectors; this method captures deep semantic relationships and contextual associations within the symptom description. These two representation methods complement and synergistically constitute the complete semantic information of each symptom prototype, providing a sufficient semantic foundation for subsequent matching calculations with text sentences.

[0038] Continuing with the vectorization of symptom prototypes, this embodiment employs the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm to transform all symptom description texts into sparse text vectors. Specific parameter configurations are as follows: enabling sublinear_tf to suppress the excessive weighting of high-frequency words; using a combination of unary and bigram grammars with ngram_range=(1,2) to model and balance word semantics and phrase collocation information; setting minimum term frequency filtering min_df=2 to remove low-frequency noise words; and removing English stop words to eliminate interference from function words without actual semantic meaning. During vectorization, the vectorizer fits the union of all text samples in the training set with the nine symptom prototype texts to generate a unified global vocabulary. All subsequent text fragments reuse the same vectorizer and the same global vocabulary during vector mapping, ensuring all features reside in the same sparse vector space with consistent dimensions, allowing for direct concatenation, fusion, and similarity calculation.

[0039] In this embodiment, the symptom prototype set plays the role of the sole clinical basis in the overall technical process. Unlike general emotion dictionaries or negative word databases that can only identify general negative emotions, the symptom prototypes carry definitions of depressive symptoms with clear pathological significance. This enables subsequent evidence sentence screening to accurately distinguish between daily emotional venting and clinically significant expressions of depressive symptoms, ensuring the clinical suitability and interpretability of the identification results from the source.

[0040] III. Selection of Key Evidence Sentences In step S3, the standardized text is filtered for targeted evidence sentences using a set of symptom prototypes. This accurately identifies high-value sentences carrying information about depressive symptoms from a large pool of candidate sentences, while avoiding interference from redundant daily narratives, ineffective short sentences, and general emotional statements. This part is the stage in this embodiment for achieving local evidence focusing, and its filtering results directly determine the quality and clinical interpretability of subsequent local evidence features.

[0041] In this embodiment, the standardized text is first segmented according to sentence boundaries to obtain a set of candidate sentences. Then, each candidate sentence in the set is quantitatively scored across multiple dimensions, and a comprehensive sentence importance score is calculated, which serves as the selection criterion. The scoring system in this embodiment consists of four dimensions, characterizing sentences from four perspectives: clinical semantic relevance, intensity of negative emotions, subjective self-expression characteristics, and reasonableness of text length.

[0042] The specific operation corresponding to clinical semantic fit is symptom semantic similarity calculation. Using the same TF-IDF vectorizer and the same global vocabulary constructed in step S2, the single sentence text to be scored is mapped to a vector space that is exactly the same as the symptom prototype. The cosine similarity value between the single sentence vector and the 9 symptom vectors in the symptom prototype set is calculated, and the maximum value is taken as the symptom matching score of the sentence. This score represents the degree to which the statement closely matches clinical depressive symptoms, and its value ranges from [value missing]. The most crucial indicator in the 4-dimensional scoring is the sentence itself, which directly reflects whether the sentence carries information about depressive symptoms with pathological significance.

[0043] The specific operation corresponding to the intensity of negative emotions is the density of negative cues. The calculation in this embodiment is based on a self-built negative cue dictionary, which counts the frequency of negative keywords in sentences. Divide by the total number of words in the sentence The calculation formula is: The range of values ​​is Taking the self-built negative cue dictionary (with corresponding Chinese translations) as an example, the English dictionary contains 31 core English words related to depression and negative emotions, including: alone, anxious, ashamed, burden, crying, dead, depressed, desert, die, drained, empty, exhausted, failure, fear, guilt, hate, helpless, hopeless, insomnia, lonely, miserable, numb, overwhelmed, sad, self-harm, sleep, suicidal, suicide, tired, useless, and worthless. This dimension is used to quantify the intensity of negative emotions in statements, serving as a supplementary measure to symptom semantic similarity, and helping to capture statements that, while not directly hitting the prototype of the symptom, have a clear negative emotional tendency.

[0044] The specific operation corresponding to subjective self-expression characteristics is the self-reference ratio. The calculation involves counting the number of times first-person pronouns (using an English dictionary as an example, i.e., I, me, my, myself, I'm, I've, etc.) appear in a sentence. Divide by the total number of words in the sentence The calculation formula is: The range of values ​​is This dimension is used to filter subjective self-statements. Depressive texts exhibit a significant self-focused linguistic style, with patients tending to use the first person extensively to express their subjective feelings. Therefore, this indicator effectively matches the expressive characteristics of depressive texts and helps identify symptom descriptions that are based on personal experiences.

[0045] The specific operation corresponding to the text length reasonableness is sentence length normalization calculation, which normalizes the word segmentation count of a single sentence, and the normalization result is denoted as... In this embodiment, the calculation formula is as follows: The range of values ​​is The purpose of introducing this dimension is to prevent extremely short texts from receiving abnormally high scores due to the occasional inclusion of a few matching words, while also preventing scoring biases caused by semantic redundancy in extremely long texts, thus making the scoring results more stable and reliable.

[0046] The above 4-dimensional features are then weighted and fused according to the preferred weighting formula shown in the example below:

[0047] In the formula, This is the final importance score of the sentence; symptom matching score. Dominant weight 65%, negative clue density 20% is the proportion of self-reference. 10% of the normalized result of single-sentence word segmentation. It accounts for 5%. This weighting allocation aligns with the logic of prioritizing pathological semantics and supplementing them with emotional features in clinical assessment. Specifically, the relevance to clinical symptoms is the primary criterion for determining evidence sentences, while negative emotions and self-reference serve as secondary references, and sentence length plays only a minor moderating role. These weighting parameters can be further fine-tuned through grid search and experimental verification.

[0048] This embodiment is based on the scoring After sorting from high to low, filter These sentences are used as key symptom evidence sentences, by default. In this process, the top five sentences with the highest scores are selected. For candidate sentences that match multiple symptom prototypes, the symptom prototype with the highest semantic match is retained as the corresponding label. For each evidence sentence, the depressive symptom dimension with the highest matching score is recorded, achieving a one-to-one correspondence between evidence and clinical symptoms. This mechanism enables the final output recognition results to be traced back to specific symptom dimensions and textual evidence, forming a complete and interpretable traceability chain.

[0049] IV. Construction of Local-Global Multi-Feature Fusion Representation Steps S3 to S5 in this embodiment involve a complete process of extracting local evidence features from key evidence sentences, extracting global semantic features from the entire text, and fusing the two to form the final input features. The design goal of this process is to balance the integrity of the semantic context of the entire text with the specificity of local core symptom clues. Through the complementary fusion of multi-granularity features, a hybrid feature representation can be constructed that can capture both the overall semantic distribution and focus on pathological depressive symptoms.

[0050] In this embodiment, the feature extraction system consists of three types of feature vectors. The first type is the full-text TF-IDF binary grammar feature vector. TF-IDF features are constructed on the preprocessed full-text text. The parameters are configured as follows: enable sublinear_tf to suppress the excessive weighting of high-frequency words; use ngram_range=(1,2) binary grammar modeling to balance word semantics and adjacent word collocation information; set min_df=2 minimum word frequency filtering to remove low-frequency noise words; and remove English stop words to eliminate interference from function words without actual semantics. This vectorizer fits and generates a global vocabulary based on all text samples in the training set, preserving the contextual semantic distribution information of the full text, serving as the carrier of global semantic features.

[0051] The second category is the TF-IDF binary grammar feature vector of key evidence sentences. For each symptom prototype dimension, all key evidence sentences matching that symptom prototype are merged to construct the local evidence text corresponding to that symptom prototype dimension. Subsequently, using the same TF-IDF vectorizer and the same global vocabulary as the full-text feature extraction, the selected... Key evidence sentences are concatenated into the text for feature mapping. Since local evidence features and global semantic features share the same vectorizer and the same global vocabulary, they reside in the same sparse vector space with identical dimensions, allowing for direct concatenation and fusion. This feature vector strengthens the weighted representation of core depressive symptoms and mitigates noise interference from redundant everyday narratives throughout the text, enabling the model to focus on clinically significant symptom cues.

[0052] The third category is a 9-dimensional dense symptom statistical feature vector, based on the scoring results of each clause and... The filtered results are then used to calculate statistical data across nine dimensions. In this embodiment, these nine dimensions include: (1) The highest symptom matching score of a single sentence is taken as the maximum value of the symptom matching scores of each clause; (2) The average matching score of the evidence sentences is taken as follows: Mean score of symptom matching for evidence sentences; (3) The standard deviation of the evidence sentence matching score is taken as follows: The standard deviation of the symptom matching scores for the evidence sentences; (4) Average negative clue density of evidence sentences, taking The mean density of negative cues in the evidence sentences; (5) The average self-referential ratio of evidence sentences, taking The mean proportion of self-referential sentences in evidence statements; (6) The average number of word segments in the evidence sentences, taken as... The average number of word segments in the evidence sentence; (7) Number of symptoms covered, statistics The number of different symptom labels matched by the evidence sentence; (8) Maximum negative cue density: take the maximum value of the negative cue density of each clause; (9) Total number of valid sentences: The total number of sentences that meet the minimum length constraint after preprocessing.

[0053] The above 9-dimensional features, after being standardized by StandardScaler, are concatenated and fused with two types of TF-IDF sparse features to provide quantitative constraint information on the symptom dimension for the model from a statistical perspective.

[0054] In the feature fusion stage, the three types of feature vectors mentioned above are directly concatenated along the feature dimension to form the final fused feature that takes into account global semantics, local symptom focus, and statistical regularity. After concatenation, the fused feature vector is normalized to eliminate the differences in numerical scale between different feature sources, resulting in the final fused feature input. Alternatively, as another fusion method, corresponding weight coefficients can be set for local evidence features and global semantic features respectively, and the fused feature can be obtained through weighted summation to adapt to the differentiated needs of local and global information emphasis in different application scenarios.

[0055] By synergistically fusing the above three types of features, the model can not only grasp the overall semantic distribution of the text using full-text TF-IDF features, but also focus on core symptom clues through evidence sentence features, and obtain a quantitative overview of the symptom dimension by using dense statistical features. The three complement each other and work together to overcome the shortcomings of single feature representation of semantics and serious noise interference, and provide sufficient and stable feature support for the accurate judgment of subsequent classification models.

[0056] V. Lightweight Model Training and Depression Recognition Output In step S6, the fused features are input into a pre-defined classification model to complete the final binary classification recognition of depressive texts. The reliability and interpretability of the recognition results are ensured through probability calibration and traceable output mechanisms. This embodiment uses logistic regression as a lightweight classifier model. This model is naturally adapted to high-dimensional sparse TF-IDF features and has advantages such as stable training, strong interpretability, and low computational cost. It does not rely on large-scale pre-trained models and high-performance computing resources, which is conducive to large-scale deployment and practical application.

[0057] In this embodiment, the logistic regression classifier uses the liblinear solver for parameter optimization, with a maximum number of iterations set to 2500 to ensure sufficient convergence during training. The default classification threshold is set to 0.5. The fused hybrid feature vector is input into the logistic regression classifier to complete model training and parameter fitting, enabling binary classification of the detected social media text into depressive and non-depressive texts.

[0058] In this embodiment, when training the logistic regression model, a set of labeled social media depressive text training samples is first obtained. The ratio of positive depressive samples to negative non-depressive samples is balanced using oversampling or undersampling to avoid class imbalance that could cause the model to favor the majority class. Then, a symptom prototype set is constructed following step S2. For each sample in the training sample set, evidence sentence filtering, local evidence feature extraction, global semantic feature extraction, and feature fusion are performed sequentially according to steps S3 to S5 to obtain the fused features for each sample. Using the fused features as input and the corresponding depressive label as a supervision signal, the logistic regression classifier is trained to fit the model parameters.

[0059] Because the raw probabilities output by the logistic regression model may exhibit systematic biases under different data distributions, leading to a deviation between the predicted confidence level and the actual results, this embodiment preferably introduces an independent calibration step after the training phase. Using an independent calibration dataset, the raw probabilities output by the logistic regression model are mapped and calibrated through temperature scaling or ordinal-preserving regression to obtain calibrated predicted probabilities. These calibrated predicted probabilities serve as the final confidence level output for depression text recognition, making the model's output probability values ​​more closely match the true category distribution and improving the reliability of the screening results.

[0060] Finally, the key evidence sentences and their corresponding optimal symptom labels independently generated in step S3 are associated with the current sample through an index, and explicitly bound to the classifier's prediction results, forming a complete ternary traceable discriminant chain. This chain contains information at three levels: binary classification prediction labels for depression or non-depression and their corresponding probability scores; supporting evidence for the discriminant result; and other relevant information. The key evidence sentences are presented in their original form; the corresponding PHQ symptom dimension label is also provided for each evidence sentence. The evidence sentences and symptom labels are generated independently by the sentence scoring mechanism in step S3. The classifier is only responsible for the final binary classification decision, and the two are linked through a sample index and output synchronously. In this way, each recognition result in this embodiment can be traced back to the specific clinical symptom dimension and the original textual evidence, realizing a complete traceability chain from the symptom prototype to the key evidence sentence and then to the recognition result.

[0061] Furthermore, in actual deployment, the classification threshold can be flexibly adjusted according to the business needs of specific screening scenarios. In high-precision diagnostic scenarios, the threshold can be appropriately increased to ensure accuracy, while in high-risk full-coverage scenarios, the threshold can be appropriately decreased to improve recall, thereby adapting to differentiated application needs.

[0062] This embodiment will now introduce the replaceability of some key points in the overall process framework of the method. While keeping the core logic of symptom prototype-guided screening and multi-granularity feature fusion unchanged, there are several replaceable local details in the method, and the core purpose can still be achieved after replacement.

[0063] This embodiment uses logistic regression as the default classifier, but in practice, it can be replaced with traditional lightweight machine learning classifiers such as support vector machines and Naive Bayes. The only difference lies in the model parameter structure and fitting method; the core logic of symptom prototype screening and multi-feature fusion remains unchanged. It can still adapt to high-dimensional sparse TF-IDF features and achieve high-precision depression identification, while maintaining a consistent overall technical architecture and output process.

[0064] This embodiment preferably uses the bigram TF-IDF feature with ngram_range=(1,2), but in practice it can be replaced with ungram or ternary TF-IDF features. This replacement only adjusts the granularity of semantic extraction. Ungram focuses on word-level semantic capture, while ternary incorporates a wider range of contextual collocation information. However, the core symptom prototype matching mechanism and the local-global feature fusion architecture remain unchanged and do not affect the overall performance.

[0065] This embodiment selects When it comes to key evidence sentences, The default value is 5, but in practice, it can be replaced with [value] to adapt to the text length requirements. , Different values ​​can be obtained. It has been verified that... The values ​​themselves are highly robust; after adjustment within the above range, the model performance shows virtually no degradation and can still accurately extract core symptom clues. For scenarios where the text is generally short, the number of evidence sentences can be appropriately reduced to avoid overfilling; for scenarios where the text is long, the number can be appropriately increased to cover more symptom dimensions.

[0066] The scoring of the preferred weight formula described above in this embodiment A fixed weight configuration was used for weighted fusion of 4-dimensional features. However, in practice, the fixed weighted scoring method can be replaced with an adaptive weight training scoring method. A grid search is used to traverse different combinations of 4-dimensional weights on the validation set to filter the results. The F1 score of the evidence sentence on the validation set is used as the optimization objective function, automatically selecting the optimal weight combination to replace fixed empirical values. This iterative process only involves hyperparameter tuning of the four-dimensional weights, without changing the calculation method of the four-dimensional features for sentence scoring. The evidence sentence selection logic achieves the effect of local algorithm optimization.

Claims

1. A method for recognizing depressive text on social media based on symptom prototypes, characterized in that, The method includes the following steps: S1. Obtain the social media text to be identified, and preprocess the social media text to obtain normalized text; S2. Based on the clinical diagnostic criteria for depression, a set of symptom prototypes is constructed. The set of symptom prototypes contains multiple symptom prototypes. Each symptom prototype corresponds to a dimension of depressive symptoms and carries semantic information describing the symptoms under that dimension of depressive symptoms. S3. Using the set of symptom prototypes, the standardized text is screened for evidence sentences to determine the key evidence sentences that match each of the symptom prototypes, and the corresponding local evidence features are extracted based on the key evidence sentences. S4. Extract global semantic features from the entire normalized text to obtain the corresponding global semantic features; S5. The local evidence features are fused with the global semantic features to obtain fused features; S6. Input the fused features into a preset classification model and output the depression text recognition result.

2. The social media depressive text recognition method according to claim 1, characterized in that, In step S1, the social media text is preprocessed, including: segmenting the social media text into words and removing stop words, special symbols and meaningless characters; performing lemmatization or stemming on the segmented text to unify the text into a standardized word sequence list; and truncating or padding the standardized word sequence list according to the preset maximum text length to obtain the standardized text.

3. The social media depressive text recognition method according to claim 1, characterized in that, In step S2, based on the clinical diagnostic criteria for depression, a set of symptom prototypes is constructed, including: dividing the depressive symptoms into multiple symptom dimensions according to the depressive symptom items defined in the patient health questionnaire; for each symptom dimension, extracting the core symptom description from the clinical description text corresponding to that symptom dimension, and constructing the symptom prototype corresponding to that symptom dimension; the number of symptom prototypes in the set of symptom prototypes corresponds to the number of symptom items in the patient health questionnaire.

4. The social media depressive text recognition method according to claim 3, characterized in that, The semantic information of each symptom prototype is represented by a combination of the following two methods: The first method involves segmenting the clinical description text corresponding to the symptom dimension into words and extracting a set of core keywords related to that symptom dimension as the lexical semantic representation of the symptom prototype. The second method involves inputting the clinical description text into a pre-trained language model for encoding to obtain a vector-layer semantic representation of the symptom prototype. The lexical layer semantic representation and the vector layer semantic representation together constitute the symptom description semantic information of the symptom prototype.

5. The social media depressive text recognition method according to claim 1, characterized in that, In step S3, the evidence sentences are screened on the normalized text using the symptom prototype set, including: segmenting the normalized text according to sentence boundaries to obtain a candidate sentence set; calculating the semantic matching degree between each candidate sentence in the candidate sentence set and each of the symptom prototypes; identifying candidate sentences with semantic matching degrees exceeding a preset threshold as key evidence sentences that match the symptom prototype; and retaining the symptom prototype with the highest semantic matching degree as the corresponding label for candidate sentences that match multiple symptom prototypes.

6. The social media depressive text recognition method according to claim 5, characterized in that, Based on the key evidence sentences, the corresponding local evidence features are extracted, including: for each symptom prototype dimension, merging all key evidence sentences matched by the symptom prototype to construct the local evidence text corresponding to the symptom prototype dimension; performing word frequency-inverse document frequency feature extraction on each of the local evidence texts to obtain the local feature vector corresponding to each symptom prototype dimension; and concatenating the local feature vectors to obtain the local evidence features.

7. The social media depressive text recognition method according to claim 1, characterized in that, In step S4, global semantic feature extraction is performed on the full text of the normalized text, including: extracting term frequency-inverse document frequency features from the full text of the normalized text to obtain a full-text term frequency-inverse document frequency feature vector, which is used as the global semantic feature; the dictionary used for global semantic feature extraction shares the same feature space as the dictionary used for local evidence feature extraction, and the local evidence features and the global semantic features are consistent in dimension.

8. The social media depressive text recognition method according to claim 1, characterized in that, In step S5, fusing the local evidence features with the global semantic features includes: concatenating the local evidence features and the global semantic features along the feature dimension to obtain a concatenated feature vector; normalizing the concatenated feature vector to obtain the fused feature; or, setting corresponding weight coefficients for the local evidence features and the global semantic features respectively, and performing a weighted summation to obtain the fused feature.

9. The social media depressive text recognition method according to claim 1, characterized in that, In step S6, the preset classification model is a logistic regression model; the method also includes calibrating the output probability of the logistic regression model: after the training phase, using an independent calibration dataset, the original probability of the logistic regression model is mapped and calibrated by temperature scaling or ordinal-preserving regression to obtain the calibrated prediction probability; the calibrated prediction probability is used as the final confidence output of the depression text recognition.

10. The social media depressive text recognition method according to claim 1, characterized in that, The method also includes a model training phase, which comprises: obtaining a set of labeled social media depressive text training samples; constructing the symptom prototype set according to step S2; performing local evidence feature extraction, global semantic feature extraction, and feature fusion on each sample in the training sample set according to steps S3 to S5 to obtain the fused features corresponding to each sample; training the classification model using the fused features as input and the corresponding depression label as a supervision signal; and balancing the ratio of positive depressive samples to negative non-depressive samples in the training sample set through oversampling or undersampling.