Psychological counseling label classification identification method, device and equipment and storage medium

By semantically and word-by-word decomposition of user-input segments, generating keywords and calculating weighted label arrays, the shortcomings of classification and recognition in online psychological counseling are solved, achieving accurate psychological guidance matching and improving counseling efficiency and reliability.

CN115905541BActive Publication Date: 2025-12-19GUANGDONG BAIYUN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211664610.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-12-19
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

The current online psychological counseling lacks a reasonable psychological problem classification mechanism, making it difficult for users to choose the best counselor, resulting in low counseling efficiency. Furthermore, the lack of professional AI application hinders the development of the industry.

Method used

By acquiring the original text segment input by the user, semantic and word-by-word segmentation is performed, keywords are generated using permutations and combinations, word definitions are matched in the database, a weighted tag array is calculated, invalid keywords are removed, and accurate psychological counseling tag classification is provided.

Benefits of technology

It has achieved efficient results with a small amount of data, accurately analyzed the direction of user input, provided precise matching for psychological counseling, and improved the efficiency and reliability of online psychological counseling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905541B_ABST
    Figure CN115905541B_ABST
Patent Text Reader

Abstract

The application relates to the field of artificial intelligence, and discloses a psychological consultation label classification identification method, device, equipment and storage medium. The method comprises the following steps: obtaining an original speech segment sent by a user end, performing semantic splitting on the original speech segment through a preset keyword to obtain a plurality of phrases; performing word-by-word splitting on all the phrases, and obtaining a plurality of keywords by using permutation and combination; matching all the keywords in a database to obtain corresponding word explanation items, comprehensively calculating the word explanation items to obtain a corresponding label array with weights, and returning to the user end. The application can train efficient results from a small amount of data, can accurately analyze the direction to which the input content of a user belongs, and can provide strong assistance for accurate matching of psychological counseling.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a psychological counseling label classification identification method, device and equipment and a storage medium. BACKGROUND

[0002] The rapid development of society and economy is accompanied by a rapidly changing environment, which has a huge impact on people's psychology. Nowadays, mental health problems have become very common, such as anxiety, depression, and restlessness. It is worth noting that more and more people have begun to pay attention to mental health, and people have begun to seek mental health services to alleviate mental health problems, the most common of which is psychological counseling.

[0003] However, the online psychological counseling software lacks a reasonable psychological problem classification mechanism, which makes it difficult for users to choose the best counselor for online psychological counseling. After contacting the user, the psychological counselor may subjectively determine whether to match according to the individual's limited experience, and due to the driving of profit motivation, such judgment often lacks scientificity and systematicness, and the efficiency of psychological counseling is greatly reduced. On the other hand, there is no professional AI for the psychological counseling industry, and the particularity of the industry leads to slow online development, and various professional terms and cases in the industry are difficult to serve as original data for AI training. At the same time, the current AI generally has the problems of large training database and inability to efficiently invest in production environment. SUMMARY

[0004] Therefore, the purpose of the present application is to overcome the deficiencies in the prior art and provide a psychological counseling label classification identification method, device, equipment and storage medium.

[0005] The present application provides the following technical solutions:

[0006] In a first aspect, the present application provides a psychological counseling label classification identification method, which comprises:

[0007] Obtaining an original speech segment sent by a user terminal, and performing semantic splitting on the original speech segment through a preset keyword to obtain a plurality of phrases;

[0008] Performing word-by-word splitting on all phrases and using permutation and combination to obtain a plurality of keywords;

[0009] Matching all keywords in a database to obtain corresponding word explanation items, and performing comprehensive calculation on the word explanation items to obtain a corresponding label array with weights, and returning to the user terminal.

[0010] Further, the word-by-word splitting on all phrases and the use of permutation and combination to obtain a plurality of keywords comprise:

[0011] splitting each phrase word by word, and using permutation and combination to form a plurality of possible keywords;

[0012] determining whether each possible keyword has a corresponding phrase interpretation item in the database;

[0013] If so, the corresponding possible keyword is identified as the keyword, and the remaining possible keywords are re-split word by word and determined until all phrases are traversed, forming a plurality of keywords.

[0014] Further, the phrase interpretation item includes the keyword, direction, matching value and validity value, the matching of all keywords in the database obtains the corresponding phrase interpretation item, and the comprehensive calculation of the phrase interpretation item obtains the corresponding weighted label array, including:

[0015] Matching each keyword in the database obtains a preset number of directions, wherein each direction corresponds to the matching value and the validity value associated with it;

[0016] The weighted average value of the matching value of all keywords in each direction is calculated using the validity value;

[0017] Eliminate the keywords corresponding to the matching value of 0, and calculate the variance of the matching value of the remaining keywords in each direction using the weighted average value;

[0018] According to the variance, the invalid keywords are determined and removed, and the weighted label array is composed of a plurality of keywords and corresponding matching values, weighted average values, and variances.

[0019] Further, the determination and removal of invalid keywords according to the variance include:

[0020] Using a preset dynamic algorithm, determine whether the variance is greater than a variance threshold;

[0021] If greater than the variance threshold, the keyword corresponding to the maximum or minimum matching value is determined as the invalid keyword, and the invalid keyword is removed;

[0022] Recalculate the variance of the matching value of the remaining keywords in each direction, and continue to determine the variance using the preset dynamic algorithm until the variance is less than the variance threshold.

[0023] Further, if the variance is greater than the variance threshold, the keyword corresponding to the maximum or minimum matching value is determined as the invalid keyword, including:

[0024] If the variance is greater than the variance threshold, the matching values of the corresponding keywords are sorted in descending order;

[0025] calculate a first difference value between the maximum value and the second maximum value, calculate a second difference value between the minimum value and the second minimum value, and compare the first difference value with the second difference value;

[0026] when the first difference value is greater than the second difference value, determine that the keyword corresponding to the maximum value is the invalid keyword;

[0027] when the first difference value is less than the second difference value, determine that the keyword corresponding to the minimum value is the invalid keyword.

[0028] Further, after the corresponding weighted label array is obtained and returned to the user end, the method further comprises:

[0029] obtaining an effectiveness value of each keyword in each direction;

[0030] calculating a difference value between the effectiveness value of each keyword in each direction and the weighted average value;

[0031] when the difference value exceeds a difference value threshold, updating the effectiveness value of the corresponding keyword in the corresponding direction according to a preset effectiveness value calculation formula.

[0032] Further, after the effectiveness value of the corresponding keyword in the corresponding direction is updated according to the preset effectiveness value calculation formula, the method further comprises:

[0033] re-splitting the original sentence according to the keyword to obtain a plurality of words;

[0034] judging whether each word has a word explanation item in the database, and sending the word without the corresponding word explanation item to an administrator end to enable the administrator end to label the word explanation item;

[0035] changing a label field in the word explanation item of the corresponding word to labeled, and updating the corresponding word to the database.

[0036] In a second aspect, the disclosure provides a psychological counseling label classification and recognition device, which comprises:

[0037] a first splitting module configured to obtain an original sentence sent by a user end, and split the original sentence according to a preset keyword to obtain a plurality of phrases;

[0038] a second splitting module configured to split all the phrases word by word, and obtain a plurality of keywords by using permutation and combination;

[0039] The computing module is configured to match all the keywords in a database to obtain corresponding word explanation items, to comprehensively calculate the word explanation items to obtain a corresponding label array with weights, and to return to the user terminal.

[0040] In a third aspect, the present disclosure provides a computer device, which comprises a memory and a processor. The memory stores a computer program. The processor implements the steps of the psychological counseling label classification and identification method in the first aspect when executing the computer program.

[0041] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores a computer program. The computer program implements the steps of the psychological counseling label classification and identification method in the first aspect when executed by a processor.

[0042] Embodiments of the present application have the following advantages:

[0043] The psychological counseling label classification and identification method provided by the embodiments of the present application comprises the following steps: obtaining an original sentence sent by a user terminal, and performing semantic splitting on the original sentence by a preset keyword to obtain a plurality of phrases; performing word-by-word splitting on all the phrases, and obtaining a plurality of keywords by using permutation and combination; matching all the keywords in a database to obtain corresponding word explanation items, and comprehensively calculating the word explanation items to obtain a corresponding label array with weights, and returning to the user terminal. The present application can accurately analyze the direction to which the user input content belongs by training a small amount of data to obtain efficient results, and can provide strong assistance for precise matching of psychological counseling.

[0044] In order to make the above objectives, characteristics and advantages of the present application more apparent and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor. In each drawing, similar components are denoted by similar reference numerals.

[0046] Figure 1 A flowchart of a psychological counseling label classification and identification method provided by an embodiment of the present application is shown;

[0047] Figure 2 A flowchart of another psychological counseling label classification and identification method provided by an embodiment of the present application is shown;

[0048] Figure 3 A flow chart of still another method for identifying a counseling label classification is shown.

[0049] Figure 4 A structural schematic diagram of a counseling label classification identification device is shown. DETAILED DESCRIPTION

[0050] Embodiments of the present application are described in detail below with reference to the attached drawing figures, wherein the same or like reference numerals and characters in the drawings denote the same or like components, features, or functions having the same or similar functions. The embodiments described below are merely exemplary for explaining the present application, and should not be construed as limiting the present application.

[0051] It should be noted that when an element is referred to as being “on” another element, it can be directly on the other element or intervening elements can also be present. In contrast, when an element is referred to as being “directly on” another element, there are no intervening elements present. The terms “vertical”, “horizontal”, “left”, “right”, and the like as used herein are used for explanation purposes only.

[0052] In the present application, unless otherwise explicitly specified and limited, the terms “mounting”, “connecting”, “connecting”, “fixing” and the like should be understood in a broad sense, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0053] In addition, the terms “first”, “second” are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of “multiple” is two or more, unless otherwise explicitly specified and limited.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the templates herein is used only for the purpose of describing particular embodiments and is not intended to be limiting of the present application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0055] Embodiment 1

[0056] The method of the embodiments of the present application is mainly based on a psychological counseling label classification recognition AI, which is a backend service based on a springboot framework.

[0057] As Figure 1 shown, a flowchart of a psychological counseling label classification recognition method in the embodiments of the present application, the psychological counseling label classification recognition method provided by the embodiments of the present application includes the following steps:

[0058] In step S110, an original sentence sent by a user terminal is acquired, and the original sentence is semantically split by a preset keyword to obtain a plurality of phrases.

[0059] After the user inputs an original sentence describing his / her own psychological problems or life conditions in the front-end software, the original sentence is analyzed by the psychological counseling label classification recognition AI. First, the original sentence is processed by a word breaker, which has a large number of keywords such as "de", "le", "will" and the like built-in. These auxiliary verbs and predicates that have no effect on the classification of the original sentence are removed by matching the text, and the remaining words are combined to form phrases, which are then output.

[0060] For example, the user inputs: "frequently think about the future, fear the departure of relatives, fear the loneliness of being independent in the world". After the word breaker removes the preset keywords, the output sentence is: "frequently", "think about the future", "things", "fear relatives", "leave", "fear that oneself", "world", "rely on", "loneliness". The purpose of semantic splitting is to block the original sentence input by the user to a certain extent, and to split the complete sentence into phrases that may express multiple semantics according to punctuation marks or certain sentence breaks. These phrases exist in an array: ["frequently", "think about the future", "things", "fear relatives", "leave", "fear that oneself", "world", "rely on", "loneliness"], which are processed by the psychological counseling label classification recognition AI in turn.

[0061] In step S120, all phrases are split by word, and permutation and combination are used to obtain a plurality of keywords.

[0062] Further, the psychological counseling label classification recognition AI performs word-by-word splitting on the phrases after receiving the phrases split by the tokenizer, and generates multiple keywords by using permutation and combination.

[0063] For example, a phrase of n words will finally output possible keywords, and the psychological counseling label classification recognition AI will match these possible keywords with the database. If there is a corresponding word explanation item in the database, it means that the word is a keyword. After matching an m-word keyword, the remaining n-m words of the phrase are recombined, and possible keywords are generated. Through this recursive relationship, the number of words that need to be recombined by the system will become less and less after each successful keyword matching, until all phrases are traversed to form multiple keywords.

[0064] As shown in Figure 2 , in an alternative embodiment, step S120 includes:

[0065] Step S121, split all phrases word by word, and generate multiple possible keywords by using permutation and combination;

[0066] Step S122, determine whether each possible keyword has a corresponding word explanation item in the database;

[0067] Step S123, if there is, identify the corresponding possible keyword as the keyword, and re-split the remaining possible keywords word by word and determine, until all phrases are traversed to form multiple keywords.

[0068] Taking a phrase "fear that oneself" in step S110 as an example, permutation and combination generates possible keywords such as "fear", "fear that", "fear that", "fear that", "fear that oneself", and the psychological counseling label classification recognition AI requests the database with these possible keywords in turn. When it is found that "fear" is a keyword containing a corresponding word explanation item, the original phrase is rearranged, and "fear" is no longer involved in the arrangement, i.e. "that oneself" is rearranged, leaving possible keywords such as "that", "that", "that", and "that". The psychological counseling label classification recognition AI requests the database with these possible keywords in turn, and finds that "that" is a keyword containing a corresponding word explanation item, leaving the possible keyword "self". Therefore, the final phrase is split into keywords "fear", "that", and "self", and all phrases are recombined to generate the keywords of all phrases.

[0069] By semantically and word-by-word decomposition of the original text segment and applying permutations and combinations, multiple keywords are obtained. This facilitates subsequent matching of keywords in the database by the AI ​​for psychological counseling tag classification and recognition. Consequently, this method can accurately analyze the psychological counseling content input by users, providing strong support for precise matching of online psychological counseling.

[0070] Step S130: Match all keywords in the database to obtain the corresponding word explanations, perform comprehensive calculations on the word explanations to obtain the corresponding weighted tag array, and return it to the user terminal.

[0071] Furthermore, all keywords are matched against the database to obtain corresponding word explanations. Each word explanation includes the keyword and a preset number of directions, matching values, and validity values ​​for each keyword. In this embodiment, the preset number is set to 10, meaning each keyword corresponds to 10 directions, 10 matching values, and 10 validity values. The 10 directions are guidance, learning, career, family, health, behavior, development, personality, interpersonal relationships, and emotion. It is understood that the specific preset number and the names of the directions can be determined according to actual circumstances, and this embodiment does not limit this. The psychological counseling tag classification and recognition AI comprehensively calculates the matching degree and validity value for each direction, finally obtaining a weighted tag array, which is then returned to the user.

[0072] like Figure 3 As shown, in one optional implementation, step S130 includes:

[0073] Step S131: Match each keyword in the database to obtain a preset number of directions, wherein each direction is associated with the matching value and the validity value;

[0074] Step S132: Calculate the weighted average of the matching values ​​of all keywords in each direction using the validity value;

[0075] Step S133: Eliminate keywords corresponding to matching values ​​of 0, and calculate the variance of matching values ​​of the remaining keywords in each direction using the weighted average value;

[0076] Step S134: Invalid keywords are determined and removed based on the variance. The weighted tag array is composed of multiple keywords and their corresponding matching values, weighted averages, and variances.

[0077] Specifically, after obtaining the keywords and their corresponding preset number of directions, matching values, and validity values, the weighted average of the matching values ​​of all keywords in each direction is calculated using the validity values. The specific calculation formula is as follows: wherein, is a weighted average value, x i is a matching value, effective is an effectiveness value, and n is the number of keywords.

[0078] Further, the keywords corresponding to the matching values of 0 are removed, and the variance of the matching values of the remaining keywords in each direction is calculated using the calculated weighted average value, and the specific calculation formula is: wherein, s 2 is a variance, x i is a matching value, is a weighted average value, and n is the number of keywords. After obtaining the variance of the matching values of the keywords in each direction, the invalid keywords are determined and removed according to the variance. The specific removal steps are as follows:

[0079] (1) First, a preset dynamic algorithm is used to determine whether the variance is greater than a variance threshold value. The function of the preset dynamic algorithm is to determine whether s 2 is greater than the variance threshold value. When s 2 is greater than the variance threshold value, it indicates that the dispersion degree in the keywords is large, and the preset dynamic algorithm can dynamically remove the keywords that affect the dispersion degree. In the embodiments of the present application, the variance threshold value is set to 8, and the specific variance threshold value can be determined according to the actual situation, which is not limited in the embodiments of the present application.

[0080] (2) If it is greater than the variance threshold value, the matching values of the corresponding keywords are sorted in descending order. The first difference value between the maximum value and the second maximum value is calculated, the second difference value between the second minimum value and the minimum value is calculated, and the first difference value and the second difference value are compared. When the first difference value is greater than the second difference value, it is determined that the keyword corresponding to the maximum value is the invalid keyword and is removed; when the first difference value is less than the second difference value, it is determined that the keyword corresponding to the minimum value is the invalid keyword and is removed.

[0081] For example, if the matching values of all keywords in a certain direction are sorted in descending order as “10, 9, 8, 7, 5, 1”, wherein the maximum value and the second maximum value are 10 and 9 respectively, the first difference value is 1; the second minimum value and the minimum value are 5 and 1 respectively, and the second difference value is 4. Comparing the first difference value and the second difference value, it can be seen that the first difference value is less than the second difference value, so the keyword corresponding to the minimum value 1 is determined as the invalid keyword and is removed.

[0082] If the matching values of all keywords in a certain direction are sorted in descending order as "10, 6, 4, 3, 2, 1", wherein the maximum value and the second maximum value are 10 and 6 respectively, the first difference value is 4, the second minimum value and the minimum value are 2 and 1 respectively, and the second difference value is 1. Comparing the first difference value with the second difference value, it is found that the first difference value is greater than the second difference value, so the keyword corresponding to the maximum value 10 is determined as the invalid keyword and is removed.

[0083] (3) Recalculating the variance of the matching values of the remaining keywords in each direction, and using the preset dynamic algorithm to continue judging the variance until the variance is less than the variance threshold, and the preset dynamic algorithm ends. The multiple keywords and the corresponding matching values, weighted average values, and variances remaining after removing the invalid keywords form the weighted label array, and the method returns to the user end.

[0084] By using the preset dynamic algorithm, the keyword corresponding to the excessively large or small data value can be found out. The keyword may be a keyword mentioned in the original sentence input by the user which has a greater impact on the classification recognition result but is not described by the semantic keyword. The preset dynamic algorithm can dynamically remove these keywords. For the keyword-based psychological counseling label classification recognition AI, the above-mentioned method of removing outliers is particularly important. Removing outliers can greatly ensure the removal of non-semantic words in the psychological counseling label classification recognition process and improve the reliability of the psychological counseling label classification recognition AI in matching the original sentence of the user in extreme cases.

[0085] After returning the weighted label array to the user end, the effectiveness value of each keyword in each direction is continuously obtained, the difference between the effectiveness value and the weighted average value of each keyword in each direction is calculated, and it is judged whether the difference is greater than the difference threshold. If the difference is less than the interpolation threshold, it indicates that the keyword corresponding to the difference is close to the matching result, and the smaller the difference, the closer the corresponding keyword to the matching result. In the embodiment of the present application, the difference threshold is set to 5, and the specific difference threshold can be determined according to the actual situation, which is not limited in the embodiment of the present application.

[0086] When the difference exceeds the difference threshold, the effectiveness value of the corresponding keyword in the corresponding direction is updated according to the preset effectiveness value calculation formula wherein k is the effectiveness value, dX is the difference, and effective is the original effectiveness value.

[0087] Compared with the traditional psychological label matching AI, the psychological counseling label classification recognition AI in the application matches the keyword-based word explanation item, and all output results are based on the keywords originally existing in the user input original sentence, and the matching is more targeted. Meanwhile, in the result aggregation stage, the psychological counseling label classification recognition AI in the application calculates the dispersion degree between the data value matching result of each keyword and the final matching result through variance, and only when the keywords corresponding to the data values with high dispersion degree are excluded, the psychological counseling label classification recognition AI returns the final weighted label array to the user end, to ensure that the final result will not be affected by individual special keywords, and the reliability of the psychological counseling label classification recognition AI is ensured.

[0088] Finally, after the psychological counseling label classification recognition AI is processed, the original sentence input by the user is re-split according to all keywords to obtain a plurality of words, it is judged whether each word has a word explanation item in the database, and the word without the corresponding word explanation item is transmitted to the word labeler. The word labeler records the word without the corresponding word explanation item and transmits it to the database, waits for the administrator end to mark whether it has a label meaning and a label weight, changes the marking field in the word explanation item corresponding to the word after marking to be marked, and updates the corresponding word to the database. Through the above method, the psychological counseling label classification recognition AI can recognize these keywords in the next matching, and dynamically update the effectiveness value of the keywords in the future matching, and continuously grind the effectiveness of new keywords, to help the psychological counseling label classification recognition AI accurately match the keywords, and provide a guarantee in the matching reliability. In this way, the psychological counseling label classification recognition AI can continuously improve its database, match more keywords to obtain more accurate classification recognition results.

[0089] The psychological counseling label classification recognition method provided in the embodiment of the application comprises the following steps: acquiring an original sentence sent by a user end, splitting the original sentence through a preset keyword to obtain a plurality of phrases; performing word-by-word splitting on all phrases, and obtaining a plurality of keywords by using permutation and combination; matching all keywords in a database to obtain corresponding word explanation items, and performing comprehensive calculation on the word explanation items to obtain a corresponding weighted label array and return the label array to the user end. The application can train efficient results from a small amount of data, accurately analyze the direction to which the input content belongs, and provide strong assistance for the accurate matching of psychological counseling.

[0090] Embodiment 2

[0091] As shown in Figure 4 FIG. 1 is a structural schematic diagram of a psychological counseling label classification recognition device 200 in the embodiment of the application, and the device comprises:

[0092] The first splitting module 210 is configured to acquire an original sentence sent by a user terminal, and split the original sentence by a preset keyword to obtain a plurality of phrases;

[0093] The second splitting module 220 is configured to split all the phrases word by word, and obtain a plurality of keywords by permutation and combination.

[0094] The computing module 230 is configured to match all the keywords in a database to obtain corresponding word explanation items, and comprehensively calculate the word explanation items to obtain a corresponding weighted label array, and return to the user terminal.

[0095] Optionally, the psychological counseling label classification and identification device further includes:

[0096] The first splitting submodule is configured to split all the phrases word by word, and form a plurality of possible keywords by permutation and combination.

[0097] The first judging module is configured to judge whether each possible keyword has a corresponding word explanation item in the database.

[0098] The traversal module is configured to, if there is, identify the corresponding possible keyword as the keyword, and re-split and judge the remaining possible keywords word by word until all the phrases are traversed to form a plurality of keywords.

[0099] Optionally, the psychological counseling label classification and identification device further includes:

[0100] The matching submodule is configured to match each keyword in the database to obtain a preset number of directions, wherein each direction is associated with the matching value and the effectiveness value.

[0101] The first computing submodule is configured to calculate a weighted average value of the matching values of all the keywords in each direction by using the effectiveness value.

[0102] The second computing submodule is configured to eliminate the keywords corresponding to the matching values of 0, and calculate the variance of the matching values of the remaining keywords in each direction by using the weighted average value.

[0103] The first elimination module is configured to determine and eliminate invalid keywords according to the variance, and the weighted label array is composed of the plurality of keywords and the corresponding matching values, weighted average values, and variances.

[0104] Optionally, the psychological counseling label classification and identification device further includes:

[0105] The second judging module is configured to judge whether the variance is greater than a variance threshold by using a preset dynamic algorithm.

[0106] The second elimination module is configured to determine the keyword corresponding to the maximum or minimum matching value as the invalid keyword and eliminate the invalid keyword if the variance is greater than the variance threshold.

[0107] The third calculation sub-module is configured to recalculate the variance of the matching values of the remaining keywords in each direction and continue to judge the variance by using the preset dynamic algorithm until the variance is less than the variance threshold.

[0108] Optionally, the psychological counseling label classification and identification device further comprises:

[0109] The sorting module is configured to sort the matching values of the corresponding keywords in descending order if the variance is greater than the variance threshold.

[0110] The fourth calculation sub-module is configured to calculate a first difference value between the maximum value and the second maximum value, calculate a second difference value between the second minimum value and the minimum value, and compare the first difference value with the second difference value.

[0111] The first determination module is configured to determine that the keyword corresponding to the maximum value is the invalid keyword if the first difference value is greater than the second difference value.

[0112] The second determination module is configured to determine that the keyword corresponding to the minimum value is the invalid keyword if the first difference value is less than the second difference value.

[0113] Optionally, the psychological counseling label classification and identification device further comprises:

[0114] The acquisition module is configured to acquire the validity value of each keyword in each direction.

[0115] The fifth calculation sub-module is configured to calculate a difference value between the validity value of each keyword in each direction and the weighted average value.

[0116] The update module is configured to update the validity value of the corresponding keyword in the corresponding direction according to a preset validity value calculation formula when the difference value exceeds a difference value threshold.

[0117] Optionally, the psychological counseling label classification and identification device further comprises:

[0118] The second splitting sub-module is configured to re-split the original sentence according to the keywords to obtain a plurality of words.

[0119] The labeling module is configured to determine whether each word has a word explanation item in the database, and send the word without the corresponding word explanation item to an administrator end to enable the administrator end to label the word explanation item.

[0120] An updating module is configured to change a marked field in a word explanation item corresponding to the word to marked, and update the word to the database.

[0121] The psychological consultation tag classification and identification device provided by the embodiments of the present application can train efficient results from a small amount of data, accurately analyze the direction to which the input content of a user belongs, and provide strong assistance for accurate matching of psychological counseling.

[0122] The computer device provided in the embodiments of the present disclosure includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the psychological consultation tag classification and identification method described in Embodiment 1 when executing the computer program.

[0123] The computer readable storage medium provided in the embodiments of the present disclosure stores a computer program, and the computer program implements the steps of the psychological consultation tag classification and identification method described in Embodiment 1 when executed by a processor.

[0124] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and structural diagrams in the drawings show the possible implementation architectures, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in alternative implementation ways, the functions annotated in the blocks can also occur in different orders from those annotated in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the structural diagram and / or flowchart, and the combination of blocks in the structural diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0125] In addition, each functional module or unit in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0126] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A method for classifying and recognizing psychological counseling labels, characterized in that, The method includes: The system acquires the original text segment sent by the user and performs semantic segmentation using preset keywords to obtain multiple phrases. All phrases were broken down character by character, and multiple keywords were obtained through permutations and combinations. All keywords are matched in the database to obtain the corresponding word explanations. The word explanations are then comprehensively calculated to obtain the corresponding weighted tag array, which is then returned to the user. The term explanation includes the keyword, direction, matching value, and validity value. The process involves matching all keywords in the database to obtain corresponding term explanations, and then comprehensively calculating these term explanations to obtain a weighted tag array, including: Each keyword is matched against the database to obtain a preset number of directions, wherein each direction is associated with the matching value and the validity value; The validity value is used to calculate the weighted average of the matching values ​​of all keywords in each direction; Keywords with a matching value of 0 are removed, and the variance of the matching values ​​of the remaining keywords in each direction is calculated using the weighted average. Invalid keywords are determined and removed based on the variance, and the weighted tag array is composed of multiple keywords and their corresponding matching values, weighted averages, and variances. The process of determining and removing invalid keywords based on the variance includes: A preset dynamic algorithm is used to determine whether the variance is greater than a variance threshold; If the variance is greater than the variance threshold, the keyword corresponding to the largest or smallest matching value will be determined as the invalid keyword and the invalid keyword will be removed. The variance of the matching values ​​of the remaining keywords in each direction is recalculated, and the variance is further judged using the preset dynamic algorithm until the variance is less than the variance threshold.

2. The psychological counseling label classification and identification method according to claim 1, characterized in that, The process involves breaking down all phrases character by character and using permutations and combinations to obtain multiple keywords, including: Each phrase is broken down into its own characters, and multiple possible keywords are generated through permutations and combinations. Determine whether each possible keyword has a corresponding word definition in the database; If it exists, the corresponding possible keyword is identified as the keyword, and the remaining possible keywords are re-splitting and judging word by word until all phrases are traversed to form multiple keywords.

3. The psychological counseling label classification and identification method according to claim 1, characterized in that, If the variance is greater than the variance threshold, the keyword corresponding to the largest or smallest matching value will be determined as the invalid keyword, including: If the variance is greater than the variance threshold, the matching values ​​of the corresponding keywords are sorted in descending order. Calculate the first difference between the maximum value and the second maximum value, calculate the second difference between the second minimum value and the minimum value, and compare the first difference with the second difference. When the first difference is greater than the second difference, the keyword corresponding to the maximum value is determined to be the invalid keyword; When the first difference is less than the second difference, the keyword corresponding to the minimum value is determined to be the invalid keyword.

4. The psychological counseling label classification and identification method according to claim 1, characterized in that, After obtaining the corresponding weighted label array and returning it to the user terminal, the process further includes: Obtain the validity value of each keyword in each direction; Calculate the difference between the effectiveness value of each keyword in each direction and the weighted average; When the difference exceeds the difference threshold, the validity value of the corresponding keyword in the corresponding direction is updated according to the preset validity value calculation formula.

5. The psychological counseling label classification and identification method according to claim 4, characterized in that, The word explanation item also includes a labeling field. After updating the validity value of the corresponding keyword in the corresponding direction according to the preset validity value calculation formula, it also includes: The original text segment was re-splittered based on the keywords to obtain multiple words; Determine whether each word has a corresponding definition in the database, and send words without a corresponding definition to the administrator so that the administrator can annotate the definition. Change the annotation field in the word definition of the corresponding word to "annotated", and update the corresponding word to the database.

6. A psychological counseling label classification and identification device, characterized in that, The device includes: The first segmentation module is used to obtain the original text segment sent by the user terminal and perform semantic segmentation on the original text segment using preset keywords to obtain multiple phrases; The second splitting module is used to split all phrases character by character and use permutations and combinations to obtain multiple keywords; The calculation module is used to match all keywords in the database to obtain the corresponding word explanation items, and to perform comprehensive calculations on the word explanation items to obtain the corresponding weighted tag array, which is then returned to the user terminal. The word explanation items include the keyword, direction, matching value, and validity value. The matching submodule is used to match each keyword in the database to obtain a preset number of directions, wherein each direction is associated with the matching value and the validity value; The first calculation submodule is used to calculate the weighted average of the matching values ​​of all keywords in each direction using the validity value; The second calculation submodule is used to remove keywords corresponding to matching values ​​of 0, and to calculate the variance of the matching values ​​of the remaining keywords in each direction using the weighted average value. The first elimination module is used to determine and eliminate invalid keywords based on the variance, and the weighted tag array consists of multiple keywords and their corresponding matching values, weighted averages, and variances. The second judgment module is used to determine whether the variance is greater than the variance threshold using a preset dynamic algorithm; The second elimination module is used to determine the keyword corresponding to the largest or smallest matching value as the invalid keyword if the variance threshold is greater than the variance threshold, and then eliminate the invalid keyword. The third calculation submodule is used to recalculate the variance of the matching values ​​of the remaining keywords in each direction, and to continue to judge the variance using the preset dynamic algorithm until the variance is less than the variance threshold.

7. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the psychological counseling label classification and identification method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the psychological counseling label classification and recognition method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Probabilistic word embeddings for text classification

    US20200401658A1

  • Training corpus expansion method and apparatus, and intent recognition model training method and apparatus

    WO2022142613A1