Question classification method and device, electronic equipment and storage medium
By removing stop words and keyword extraction of the problem text and inputting them into the problem classification model, comprehensively processing scores to determine the target problem category, the problem of low classification accuracy in the existing technology is solved and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202311060185.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-21
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the accuracy of the problem classification method is low, making it difficult to effectively classify user consultation problems.
By obtaining the problem text, removing stop words and extracting keyword groups, entering the problem classification model separately to obtain score sorting, and comprehensively processing the scores to determine the target problem category.
The accuracy of problem classification is improved, and the comprehensive processing of the two preprocessing results is enhanced to understand and classify problem texts.
Smart Images

Figure CN119513304A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text processing, and more specifically, to a question classification method, device, electronic device and storage medium. Background Art
[0002] Text classification refers to the automatic classification and labeling of text according to a certain classification system or standard. Question classification is a type of text classification. The purpose of question classification is to determine the category of the question the user is asking, so as to provide solutions based on the question category in the future, such as passing the question to experts in the relevant category, or matching the question with the professional knowledge base in the category, etc. The accuracy of question classification will directly affect the accuracy of subsequent solutions.
[0003] The current question classification method usually involves segmenting the question text and then inputting it into a neural network language model, which then outputs the question category. However, this approach has low accuracy. Summary of the invention
[0004] The present application provides a question classification method, device, electronic device and storage medium to improve the accuracy of classification.
[0005] In a first aspect, the present application provides a problem classification method, comprising:
[0006] Obtaining a question text, removing stop words in the question text to obtain a target question text, and extracting a keyword group contained in the question text based on a preset keyword library;
[0007] Input the target question text and the keyword group into the question classification model respectively, and obtain the first preset number of first question categories and the scores of each first question category in descending order of scores corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in descending order of scores corresponding to the keyword group;
[0008] Based on the score of the first question category and the score of the second question category, a preset number of target question categories corresponding to the question text and a score for each target question category are determined.
[0009] In one embodiment, the determining a preset number of target question categories corresponding to the question text and the scores of each target question category based on the score of the first question category and the score of the second question category includes:
[0010] Based on a preset threshold, determine whether the preset number of first question categories and the preset number of second question categories are credible results. If so, based on the score of the first question category and the score of the second question category, determine the preset number of target question categories corresponding to the question text and the score of each target question category.
[0011] In one implementation, judging whether the preset number of first question categories and the preset number of second question categories are credible results based on a preset threshold includes:
[0012] If the score of the first question category with the highest score is greater than or equal to the preset threshold, the preset number of first question categories are determined to be credible results; if the score of the first question category with the highest score is less than the preset threshold, the preset number of first question categories are determined to be not credible results;
[0013] If the score of the second question category with the highest score is greater than or equal to the preset threshold, then the preset number of second question categories are determined to be credible results; if the score of the second question category with the highest score is less than the preset threshold, then the preset number of second question categories are determined to be not credible results.
[0014] In one embodiment, the determining a preset number of target question categories corresponding to the question text and the scores of each target question category based on the score of the first question category and the score of the second question category includes:
[0015] If the first question category with the highest score is the same as the second question category with the highest score, then based on the weight of the first question category and the weight of the second question category, the scores of the first question category and / or the scores of the second question category corresponding to each question category in the preset number of first question categories and the preset number of second question categories are weighted, and the preset number of target question categories ranked from high to low and the scores of each target question category are determined according to the weighted results.
[0016] In one embodiment, it further includes:
[0017] If the first question category with the highest score is different from the second question category with the highest score, the scores of each second question category are weighted based on the weight of the second question category, and the target question category and the scores of each target question category are determined based on the weighted scores of each second question category.
[0018] In one embodiment, determining the target question category and the scores of each target question category based on the weighted scores of each second question category includes:
[0019] If the score of the second question category with the highest score among the weighted scores of the second question categories is greater than or equal to a preset threshold, the preset number of second question categories are determined as the target question categories, and the weighted scores of the second question categories are determined as the scores of the target question categories;
[0020] If the score of the second question category with the highest score among the weighted scores of the second question categories is less than a preset threshold, a prompt message is output to indicate that the question text cannot be categorized.
[0021] In one embodiment, it further includes:
[0022] If the keyword group included in the question text is empty, input the target question text into the question classification model to obtain the first preset number of third question categories and the scores of each third question category in descending order of scores corresponding to the target question text;
[0023] The preset number of third question categories and the scores of each third question category are determined as the target question category and the score of each target question category.
[0024] In one embodiment, it further includes:
[0025] If the preset number of first question categories and / or the preset number of second question categories are not credible results, a prompt message is output to indicate that the question text cannot be classified.
[0026] In one embodiment, the question text is related to the target field, and the method further includes:
[0027] Based on the target domain, a keyword library related to the problem classification of the target domain is constructed.
[0028] In a second aspect, the present application provides a problem classification method, comprising:
[0029] Acquire a question text related to the operating system, remove stop words in the question text to obtain a target question text, and extract a keyword group contained in the question text based on a preset keyword library, wherein the preset keyword library is related to the classification of operating system questions;
[0030] Input the target question text and the keyword group into the question classification model respectively, and obtain the first preset number of first question categories and the scores of each first question category in descending order of scores corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in descending order of scores corresponding to the keyword group;
[0031] Based on the score of the first question category and the score of the second question category, a preset number of target question categories corresponding to the question text and a score for each target question category are determined.
[0032] In a third aspect, the present application provides a question classification device, comprising:
[0033] A preprocessing module, used to obtain a question text, remove stop words in the question text to obtain a target question text, and extract a keyword group contained in the question text based on a preset keyword library;
[0034] A classification module, for inputting the target question text and the keyword group into a question classification model respectively, to obtain a preset number of first question categories and scores of each first question category in descending order of scores corresponding to the target question text, and a preset number of second question categories and scores of each second question category in descending order of scores corresponding to the keyword group;
[0035] A comprehensive module is used to determine a preset number of target question categories corresponding to the question text and a score for each target question category based on the score of the first question category and the score of the second question category.
[0036] In one embodiment, the integrated module is used to:
[0037] Based on a preset threshold, determine whether the preset number of first question categories and the preset number of second question categories are credible results. If so, based on the score of the first question category and the score of the second question category, determine the preset number of target question categories corresponding to the question text and the score of each target question category.
[0038] In one embodiment, the integrated module is used to:
[0039] If the score of the first question category with the highest score is greater than or equal to the preset threshold, the preset number of first question categories are determined to be credible results; if the score of the first question category with the highest score is less than the preset threshold, the preset number of first question categories are determined to be not credible results;
[0040] If the score of the second question category with the highest score is greater than or equal to the preset threshold, then the preset number of second question categories are determined to be credible results; if the score of the second question category with the highest score is less than the preset threshold, then the preset number of second question categories are determined to be not credible results.
[0041] In one embodiment, the integrated module is used to:
[0042] If the first question category with the highest score is the same as the second question category with the highest score, then based on the weight of the first question category and the weight of the second question category, the scores of the first question category and / or the scores of the second question category corresponding to each question category in the preset number of first question categories and the preset number of second question categories are weighted, and the preset number of target question categories ranked from high to low and the scores of each target question category are determined according to the weighted results.
[0043] In one embodiment, the integration module is further used to:
[0044] If the first question category with the highest score is different from the second question category with the highest score, the scores of each second question category are weighted based on the weight of the second question category, and the target question category and the scores of each target question category are determined based on the weighted scores of each second question category.
[0045] In one embodiment, the integrated module is used to:
[0046] If the score of the second question category with the highest score among the weighted scores of the second question categories is greater than or equal to a preset threshold, the preset number of second question categories are determined as the target question categories, and the weighted scores of the second question categories are determined as the scores of the target question categories;
[0047] If the score of the second question category with the highest score among the weighted scores of the second question categories is less than a preset threshold, a prompt message is output to indicate that the question text cannot be categorized.
[0048] In one embodiment, the classification module is further configured to:
[0049] If the keyword group included in the question text is empty, input the target question text into the question classification model to obtain the first preset number of third question categories and the scores of each third question category in descending order of scores corresponding to the target question text;
[0050] The integrated module is also used to:
[0051] The preset number of third question categories and the scores of each third question category are determined as the target question category and the score of each target question category.
[0052] In one embodiment, the integrated module is used to:
[0053] If the preset number of first question categories and / or the preset number of second question categories are not credible results, a prompt message is output to indicate that the question text cannot be classified.
[0054] In one embodiment, the question text is related to the target domain, and the preprocessing module is used to:
[0055] Based on the target domain, a keyword library related to the problem classification of the target domain is constructed.
[0056] In a fourth aspect, the present application provides an electronic device, including: a memory and a processor;
[0057] The memory is used to store computer programs;
[0058] The processor is used to execute a computer program stored in the memory, and when the computer program is run, the processor is caused to execute the method according to the first aspect or the second aspect.
[0059] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the method described in the first aspect or the second aspect.
[0060] In the question classification method, device, electronic device and storage medium provided in the present application, when determining the question category corresponding to the question text, two preprocessings are performed on the question text. One is to obtain the target question text by removing stop words in the question text, and the other is to use a preset keyword library to extract keyword groups in the question text. The two results obtained by the preprocessing, the target question text and the keyword group, are respectively input into the question classification model to obtain two groups of question categories and scores for each question category. The two groups of question categories are then comprehensively processed to obtain the target question category, and the keyword library is used to perform targeted keyword extraction. The classification accuracy is improved through comprehensive processing of the two classification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0062] Figure 1 It is a flowchart of a method for solving a problem provided by an embodiment of the present application;
[0063] Figure 2 It is a schematic diagram of the training and application scenarios of the question classification model provided in the embodiment of the present application;
[0064] Figure 3 It is a flowchart of another problem-solving method provided by an embodiment of the present application;
[0065] Figure 4 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0066] Figure 5 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0068] Problem classification is usually applied in more specific fields, such as product operation and maintenance, troubleshooting, customer service consultation and other fields. For example, in the automated operation and maintenance of operating systems, problem classification is used to classify the problems raised by users about the operating system, so as to provide more accurate solutions later. Taking the above characteristics into consideration, in order to improve the accuracy of problem classification, it is proposed in the embodiment of the present application that a preset keyword library is provided in the problem classification scheme, and the keyword library is set for the application scenario of problem classification. Taking the automated operation and maintenance of operating systems as an example, the keywords in the keyword library are all words related to the problem classification in the operating system scenario. When classifying problems, on the one hand, the problem text is segmented and the stop words therein are removed to obtain the target problem text. On the other hand, the keyword library is used to extract the keyword groups in the problem text, and the target problem text and the keyword groups are used to determine the problem category and the score of each problem category respectively, and then the obtained results are comprehensively processed to finally obtain the problem category and the corresponding score corresponding to the problem text.
[0069] Figure 1 is a flow chart of a problem classification method provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0070] S101, obtaining a question text, removing stop words in the question text to obtain a target question text, and extracting a keyword group contained in the question text based on a preset keyword library.
[0071] The problem classification method according to the embodiments of the present application can be applied to a client or a server. If the method is applied to the client, in this step, the client obtains the problem text that the user asks through the client. If the method is applied to the server, in this step, the server can obtain the problem text sent by the client, and this problem text is the problem text that the user asks through the client. When the user asks a question through the client, it can be that the user inputs the problem text through the user interface of the client, or it can be that the user inputs the problem voice through the client, and the client converts the problem voice into the problem text. The embodiments of the present application do not make any limitations in this regard.
[0072] The stop words in the embodiments of the present application refer to functional words that have no actual meaning in a sentence, such as "ah", "ma", "le", etc. The preset keyword library is a keyword library related to the target field, that is, the usage scenario of the problem classification method. For example, in the scenario of automated operation and maintenance of an operating system, the problem text is a problem regarding the operating system. Correspondingly, the keywords in the keyword library are words related to the problem classification of the operating system. Optionally, before this step, the method according to the embodiments of the present application may further include constructing a keyword library related to the problem classification of the target field based on the target field.
[0073] The preprocessing of the problem text in this step includes two parts. The problem text is segmented, and the stop words in the segmentation result are removed to obtain the target problem text. In addition, the segmentation result is also matched with the preset keyword library, and the keywords included in the problem text are extracted to form a keyword group.
[0074] S102: Input the target problem text and the keyword group into the problem classification model respectively, and obtain the top preset number of first problem categories with the highest to lowest score rankings corresponding to the target problem text and the scores of each first problem category, as well as the top preset number of second problem categories with the highest to lowest score rankings corresponding to the keyword group and the scores of each second problem category.
[0075] The input of the question classification model of the embodiment of the present application is text content, and the output is the classification category and the category score, and the score can also be expressed in probability. The question classification model can be a trained neural network language model. In this step, the question classification model is used to determine the question categories corresponding to the target question text and the keyword group, respectively, including: inputting the target question text into the question classification model, and obtaining the first preset number of question categories with the highest scores corresponding to the target question text, which are called the first question category; inputting the keyword group into the question classification model, and obtaining the first preset number of question categories with the highest scores corresponding to the keyword group, which are called the second question category. For example, if the preset number is three, then in this step, the three first question categories with the highest scores corresponding to the target question text and the scores of each first question category, as well as the three second question categories with the highest scores corresponding to the keyword group and the scores of each second question category will be obtained.
[0076] It is understandable that, due to differences in target question texts and keyword phrases, the preset number of first question categories and the preset number of second question categories may be completely identical, partially identical, or even completely different. In the case of being completely identical or partially identical, the scores of the same first question category and the same second question category may also be different.
[0077] S103: Based on the score of the first question category and the score of the second question category, determine a preset number of target question categories corresponding to the question text and the score of each target question category.
[0078] After obtaining the first question category and the second question category and the corresponding scores, in the embodiment of the present application, it is necessary to conduct a comprehensive evaluation of the first question category and the second question category. Based on the scores of the first question category and the scores of the second question category, a preset number of question categories can be selected from the first question category and the second question category as target question categories according to pre-set rules. For example, the selection can be made according to the scores, or the scores of each question category can be weighted according to the weight of the first question category and the weight of the second question category, and the selection can be made based on the weighted results, or one of the two groups of question categories can be determined as the target question category.
[0079] In the method of the embodiment of the present application, when determining the question category corresponding to the question text, two preprocessings are performed on the question text. One is to obtain a target question text by removing stop words in the question text, and the other is to use a preset keyword library related to the application scenario to extract keyword groups in the question text. The two results obtained by the preprocessing, the target question text and the keyword group, are respectively input into the question classification model to obtain two groups of question categories and scores for each question category. The two groups of question categories are then comprehensively evaluated, and targeted keyword extraction is performed using the keyword library. The classification accuracy is improved through comprehensive processing of the two classification results.
[0080] In a possible implementation, after inputting the text content into the question classification model and obtaining the category and score of the model output, it is possible to determine whether the category output by the model is a credible result based on a preset threshold. If the category output by the model is a credible result, further processing of subsequent steps is performed to improve the accuracy of the result. That is, based on the preset threshold, it is determined whether a preset number of first question categories and a preset number of second question categories are credible results. If so, based on the score of the first question category and the score of the second question category, the preset number of target question categories and the score of each target question category corresponding to the question text are determined; if the preset number of first question categories and / or the preset number of second question categories are not credible results, a prompt message is output to indicate that the question text cannot be classified.
[0081] Optionally, if the score of the first question category with the highest score among a preset number of first question categories is greater than or equal to a preset threshold, then the preset number of first question categories are determined to be credible results; if the score of the first question category with the highest score is less than the preset threshold, then the preset number of first question categories are determined to be not credible results.
[0082] Similarly, if the score of the second question category with the highest score among the preset number of second question categories is greater than or equal to a preset threshold, then the preset number of second question categories are determined to be credible results; if the score of the second question category with the highest score is less than the preset threshold, then the preset number of second question categories are determined not to be credible results.
[0083] It is understandable that after the text content is input into the question classification model and the category and score output by the model are obtained, the category with the highest score has a higher probability of being an accurate category. In the embodiment of the present application, the target question text and the keyword group are respectively input into the question classification model, and the corresponding first question category and second question category are obtained. For these two groups of question categories, if the question categories with the highest scores are the same, it can be considered that both groups of question categories are relatively accurate results. The scores of the two groups of question categories can be weighted and summed, and the target question category can be determined according to the result of the weighted summation. If the question categories with the highest scores are different, there may be a group of question categories in the two groups of question categories that are relatively inaccurate. Since the second question category in the embodiment of the present application is determined based on the keyword group, and the keyword library for extracting the keyword group is a pre-set keyword combined with the actual application scenario, it can be determined that when the question categories with the highest scores are different, the second question category has a higher accuracy. At this time, the second question category is weighted to determine the second question category. Thereby, the accuracy of the classification is improved. The following is a detailed description.
[0084] If the first question category with the highest score is the same as the second question category with the highest score, then based on the weight of the first question category and the weight of the second question category, the scores of the first question category and / or the scores of the second question category corresponding to each question category in the preset number of first question categories and the preset number of second question categories are weighted, and the preset number of target question categories ranked from high to low and the scores of each target question category are determined according to the weighted results.
[0085] In the embodiment of the present application, the weight of the first question category and the weight of the second question category can be pre-set. If the first question category with the highest score is the same as the second question category with the highest score, the scores of the first question category and the second question category are weighted and summed according to the weights to obtain the comprehensive score of each question category. For each identical question category in the preset number of first question categories and the preset number of second question categories, the weighted sum of the two scores corresponding to the question category (i.e., the score of the first question category and the score of the second question category) is the total score of the question category, and for each different question category in the preset number of first question categories and the preset number of second question categories, the question category has only one score (i.e., the score of the first question category or the score of the second question category), and the score of the question category is weighted according to the corresponding weight of the first question category or the second question category to obtain the comprehensive score. After obtaining the comprehensive score of each question category, the first preset number of question categories and the corresponding comprehensive scores are determined as the preset number of target question categories and the scores of each target question category corresponding to the question text in the order of the comprehensive scores from high to low.
[0086] For example, the preset number is three, the three first question categories are A, B, and C, and the scores are a1, b1, and c1 from high to low, and the three second question categories are A, B, and D, and the scores are a2, b2, and d2 from high to low. Assuming that the weight of the first question category is x, the weight of the second question category is y, and x+y=1, it can be seen that the question category with the highest score in the three first question categories and the three second question categories is A, and the three first question categories and the three second question categories include two identical questions A and B, and two different question categories C and D. Therefore, the comprehensive score of question category A is a1*x+a2*y, the comprehensive score of question category B is b1*x+b2*y, the comprehensive score of question category C is c1*x, and the comprehensive score of question category D is d2*y. Assuming a1*x+a2*y>b1*x+b2*y>d2*y>c1*x, the three target question categories corresponding to the final question text are A, B, and D, and the scores are a1*x+a2*y, b1*x+b2*y, and d2*y, respectively. It can be understood that since both the first question category and the second question category are credible results, the result after weighted summation is still a credible result.
[0087] If the first question category with the highest score is different from the second question category with the highest score, the scores of each second question category are weighted based on the weight of the second question category, and the target question category and the scores of each target question category are determined based on the weighted scores of each second question category.
[0088] For example, the preset number is three, the three first question categories are E, F, and G, and the scores are e1, f1, and g1 from high to low, the three second question categories are G, E, and K, and the scores are g2, e2, and k2 from high to low. Assuming that the weight of the first question category is x, and the weight of the second question category is y, x+y=1, it can be seen that the categories with the highest scores among the three first question categories and the three second question categories are E and G, which are different. Therefore, the scores of the second question categories are weighted. After weighting, the score of question category G is g2*y, the score of question category E is e2*y, and the score of question category K is k2*y. The three target question categories corresponding to the final question text are G, E, and K, and the scores are g2*y, e2*y, and k2*y, respectively.
[0089] In a scenario where the first question category with the highest score and the second question category with the highest score are different, the score of the second question category may be reduced due to weighting of the second question category, which may cause the second question category to no longer be a credible result. To this end, the score of the weighted second question category can be judged. If the score of the second question category with the highest score among the scores of each weighted second question category is greater than or equal to a preset threshold, it means that the weighted second question category is still a credible result, a preset number of second question categories are determined as target question categories, and the scores of each weighted second question category are determined as the scores of each target question category; if the score of the second question category with the highest score among the scores of each weighted second question category is less than the preset threshold, it means that the weighted second question category is not a credible result, and a prompt message is output to indicate that the question text cannot be categorized.
[0090] In a possible scenario of an embodiment of the present application, in the step of extracting the keyword group contained in the question text based on the preset keyword library, the result obtained may be empty, that is, the question text does not contain keywords, and then the target question text can be processed subsequently. That is, if the keyword group contained in the question text is empty, the target question text is input into the question classification model to obtain the first preset number of third question categories and the scores of each third question category in descending order of scores corresponding to the target question text; the preset number of third question categories and the scores of each third question category are determined as the target question category and the scores of each target question category.
[0091] The question classification model provided in the embodiment of the present application can be obtained by further training on the basis of a pre-trained language model. For example, a word vector trained based on big data can be used as pre-training data to obtain a pre-trained language model. On this basis, the question sample set is further used as a training data set for training, so that the model can achieve a more accurate understanding of the meaning of words using fewer question samples.
[0092] Figure 2 Schematic diagram of the training and application scenarios of the problem classification model provided in the embodiment of the present application. In the training stage, Figure 2 The pre-trained word vectors shown in the figure are the pre-trained data used to obtain the pre-trained model. The training data set is the question sample set. The pre-processing of the question samples includes word segmentation, removal of stop words, and extraction of keyword groups based on the keyword library. The language model is first trained using the pre-trained word vectors, and then further trained using the training data set to finally obtain the question classification model. In the application stage, Figure 2The user question input in is used to represent the question text. The preprocessing also includes word segmentation, stop word removal, and keyword group extraction based on the keyword library. The processed question sentence is used to represent the target question text after the stop words are removed. The target question text keyword groups are input into the question classification model respectively to obtain two groups of results. The two groups of results are comprehensively scored to finally obtain the classification result output.
[0093] When the aforementioned problem classification method is applied to the classification of problems related to the operating system, the embodiment of the present application provides a problem classification method, such as Figure 3 As shown, the method includes:
[0094] S301, obtaining a question text related to the operating system, removing stop words in the question text to obtain a target question text, and extracting a keyword group included in the question text based on a preset keyword library, where the preset keyword library is related to the classification of operating system problems;
[0095] S302, inputting the target question text and the keyword group into the question classification model respectively, obtaining the first preset number of first question categories and the scores of each first question category in descending order of scores corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in descending order of scores corresponding to the keyword group;
[0096] S303: Based on the score of the first question category and the score of the second question category, determine a preset number of target question categories corresponding to the question text and the score of each target question category.
[0097] The implementation of each step of the embodiment of the present application can refer to the description in the aforementioned embodiment and will not be repeated here.
[0098] Figure 4 Schematic diagram of a problem classification device provided in an embodiment of the present application. Figure 4 As shown, the question classification device 400 includes:
[0099] The preprocessing module 401 is used to obtain a question text, remove stop words in the question text to obtain a target question text, and extract a keyword group contained in the question text based on a preset keyword library;
[0100] A classification module 402 is used to input the target question text and the keyword group into the question classification model respectively, and obtain the first preset number of first question categories and the scores of each first question category in the order of scores from high to low corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in the order of scores from high to low corresponding to the keyword group;
[0101] The comprehensive module 403 is used to determine a preset number of target question categories corresponding to the question text and the scores of each target question category based on the scores of the first question category and the scores of the second question category.
[0102] In one embodiment, the integration module 403 is used to:
[0103] Based on the preset threshold, determine whether a preset number of first question categories and a preset number of second question categories are credible results. If so, based on the score of the first question category and the score of the second question category, determine the preset number of target question categories corresponding to the question text and the score of each target question category.
[0104] In one embodiment, the integration module 403 is used to:
[0105] If the score of the first question category with the highest score is greater than or equal to the preset threshold, a preset number of first question categories are determined to be credible results; if the score of the first question category with the highest score is less than the preset threshold, a preset number of first question categories are determined to be uncredible results;
[0106] If the score of the second question category with the highest score is greater than or equal to the preset threshold, a preset number of second question categories are determined to be credible results. If the score of the second question category with the highest score is less than the preset threshold, a preset number of second question categories are determined to be uncredible results.
[0107] In one embodiment, the integration module 403 is used to:
[0108] If the first question category with the highest score is the same as the second question category with the highest score, then based on the weight of the first question category and the weight of the second question category, the scores of the first question category and / or the scores of the second question category corresponding to each question category in the preset number of first question categories and the preset number of second question categories are weighted, and the preset number of target question categories ranked from high to low and the scores of each target question category are determined according to the weighted results.
[0109] In one embodiment, the integration module 403 is further configured to:
[0110] If the first question category with the highest score is different from the second question category with the highest score, the scores of each second question category are weighted based on the weight of the second question category, and the target question category and the scores of each target question category are determined based on the weighted scores of each second question category.
[0111] In one embodiment, the integration module 403 is used to:
[0112] If the score of the second question category with the highest score among the weighted scores of the second question categories is greater than or equal to a preset threshold, a preset number of second question categories are determined as target question categories, and the weighted scores of the second question categories are determined as the scores of the target question categories;
[0113] If the score of the second question category with the highest score among the weighted scores of the second question categories is less than a preset threshold, a prompt message is output to indicate that the question text cannot be categorized.
[0114] In one embodiment, the classification module 402 is further configured to:
[0115] If the keyword group included in the question text is empty, the target question text is input into the question classification model to obtain the first preset number of third question categories and the scores of each third question category in descending order of scores corresponding to the target question text;
[0116] The integrated module 403 is also used for:
[0117] A preset number of third question categories and the scores of each third question category are determined as the target question category and the score of each target question category.
[0118] In one embodiment, the integration module 403 is used to:
[0119] If a preset number of first question categories and / or a preset number of second question categories are not credible results, a prompt message is output to indicate that the question text cannot be classified.
[0120] In one embodiment, the question text is related to the target domain, and the pre-processing module 401 is used to:
[0121] Based on the target domain, a keyword library related to the problem classification of the target domain is constructed.
[0122] The device of the embodiment of the present application can be used to execute the problem classification method in the aforementioned embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0123] Figure 5 is a schematic block diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 may include at least one processor 501 for implementing the question classification method provided in the embodiment of the present application.
[0124] Optionally, the electronic device 500 also includes at least one memory 502 for storing program instructions and / or data. The memory 502 is coupled to the processor 501. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 501 may operate in conjunction with the memory 502. The processor 501 may execute program instructions stored in the memory 502. At least one of the at least one memory may be included in the processor.
[0125] Optionally, the electronic device 500 also includes a communication interface 503, which is used to communicate with other devices through a transmission medium, so that the electronic device 500 can communicate with other devices. The communication interface 503 can be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing a transceiver function. The processor 501 can use the communication interface 503 to send and receive data and / or information, and is used to implement the method provided in the embodiment of the present application. Please refer to the detailed description in the previous embodiment for details, which will not be repeated here.
[0126] The specific connection medium between the processor 501, the memory 502 and the communication interface 503 is not limited in the embodiment of the present application. Figure 5 In the embodiment, the processor 501, the memory 502 and the communication interface 503 are connected via a bus 505. The bus 505 is Figure 5 The connection between other components is only for illustration and is not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0127] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0128] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0129] The present application also provides a computer-readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method in any of the above embodiments.
[0130] The terms "unit", "module" and the like used in this specification may be used to represent a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
[0131] It will be appreciated by those skilled in the art that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0134] In the above-described embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, the flow or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0135] If this function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0136] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0137] 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 who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A problem classification method, characterized in that: include: Obtaining a question text, removing stop words in the question text to obtain a target question text, and extracting a keyword group contained in the question text based on a preset keyword library; Input the target question text and the keyword group into the question classification model respectively, and obtain the first preset number of first question categories and the scores of each first question category in descending order of scores corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in descending order of scores corresponding to the keyword group; Based on the score of the first question category and the score of the second question category, a preset number of target question categories corresponding to the question text and a score for each target question category are determined.
2. The method according to claim 1, characterized in that: The step of determining a preset number of target question categories corresponding to the question text and the scores of the target question categories based on the scores of the first question category and the second question category includes: Based on a preset threshold, determine whether the preset number of first question categories and the preset number of second question categories are credible results. If so, based on the score of the first question category and the score of the second question category, determine the preset number of target question categories corresponding to the question text and the score of each target question category.
3. The method according to claim 2, characterized in that The determining, based on a preset threshold, whether the preset number of first question categories and the preset number of second question categories are credible results includes: If the score of the first question category with the highest score is greater than or equal to the preset threshold, the preset number of first question categories are determined to be credible results; if the score of the first question category with the highest score is less than the preset threshold, the preset number of first question categories are determined to be not credible results; If the score of the second question category with the highest score is greater than or equal to the preset threshold, then the preset number of second question categories are determined to be credible results; if the score of the second question category with the highest score is less than the preset threshold, then the preset number of second question categories are determined to be not credible results.
4. The method according to claim 1 or 2, characterized in that: The step of determining a preset number of target question categories corresponding to the question text and the scores of the target question categories based on the scores of the first question category and the second question category includes: If the first question category with the highest score is the same as the second question category with the highest score, then based on the weight of the first question category and the weight of the second question category, the scores of the first question category and / or the scores of the second question category corresponding to each question category in the preset number of first question categories and the preset number of second question categories are weighted, and the preset number of target question categories ranked from high to low and the scores of each target question category are determined according to the weighted results.
5. The method according to claim 4, characterized in that Also includes: If the first question category with the highest score is different from the second question category with the highest score, the scores of each second question category are weighted based on the weight of the second question category, and the target question category and the scores of each target question category are determined based on the weighted scores of each second question category.
6. The method according to claim 5, characterized in that The determining the target question category and the score of each target question category based on the weighted scores of each second question category includes: If the score of the second question category with the highest score among the weighted scores of the second question categories is greater than or equal to a preset threshold, the preset number of second question categories are determined as the target question categories, and the weighted scores of the second question categories are determined as the scores of the target question categories; If the score of the second question category with the highest score among the weighted scores of the second question categories is less than a preset threshold, a prompt message is output to indicate that the question text cannot be categorized.
7. The method according to claim 1 or 2, characterized in that: Also includes: If the keyword group included in the question text is empty, input the target question text into the question classification model to obtain the first preset number of third question categories and the scores of each third question category in descending order of scores corresponding to the target question text; The preset number of third question categories and the scores of each third question category are determined as the target question category and the score of each target question category.
8. The method according to claim 2, characterized in that: Also includes: If the preset number of first question categories and / or the preset number of second question categories are not credible results, a prompt message is output to indicate that the question text cannot be classified.
9. The method according to claim 1, characterized in that: The question text is related to the target domain, and the method further includes: Based on the target domain, a keyword library related to the problem classification of the target domain is constructed.
10. A method for classifying problems, characterized in that: include: Acquire a question text related to the operating system, remove stop words in the question text to obtain a target question text, and extract a keyword group contained in the question text based on a preset keyword library, wherein the preset keyword library is related to the classification of operating system questions; Input the target question text and the keyword group into the question classification model respectively, and obtain the first preset number of first question categories and the scores of each first question category in descending order of scores corresponding to the target question text, and the first preset number of second question categories and the scores of each second question category in descending order of scores corresponding to the keyword group; Based on the score of the first question category and the score of the second question category, a preset number of target question categories corresponding to the question text and a score for each target question category are determined.
11. A question classification device, characterized in that: include: A preprocessing module, used to obtain a question text, remove stop words in the question text to obtain a target question text, and extract a keyword group contained in the question text based on a preset keyword library; A classification module, for inputting the target question text and the keyword group into a question classification model respectively, to obtain a preset number of first question categories and scores of each first question category in descending order of scores corresponding to the target question text, and a preset number of second question categories and scores of each second question category in descending order of scores corresponding to the keyword group; A comprehensive module is used to determine a preset number of target question categories corresponding to the question text and a score for each target question category based on the score of the first question category and the score of the second question category.
12. An electronic device, characterized in that: include: Memory and processor; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory, and when the computer program is executed, the processor is enabled to execute the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 10.