Method, device and electronic device for identifying categories of livelihood issues

By automatically classifying people's livelihood hotline texts based on regular expressions, the problem of low efficiency and difficulty of manual annotation is solved, efficient and accurate identification of people's livelihood problem categories is achieved, and the impact of labor costs and subjective factors is reduced.

CN112131378BActive Publication Date: 2024-09-03彭涛
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202010841397.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-20
Publication Date
2024-09-03
Estimated Expiration
2040-08-20

AI Technical Summary

Technical Problem

In the existing technology, the classification of livelihood hotline data relies on manual annotation, which results in inefficiency and increased difficulty in processing large amounts of data. In particular, the colloquial nature and irregularity of natural language descriptions make it difficult to effectively process manual annotation.

Method used

Using a method based on regular expressions, candidate regular expressions are generated through the training sample set, the regular expression with the highest verification accuracy is determined based on the verification sample set, the text of the livelihood hotline to be identified is matched, and the corresponding livelihood issue category is automatically determined.

Benefits of technology

It realizes automatic classification of people's livelihood hotline texts, reduces labor costs and time costs, ensures classification accuracy and objectivity, and reduces the impact of manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112131378B
    Figure CN112131378B
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device and storage medium for identifying livelihood issue categories. A specific implementation of the method includes: obtaining a livelihood hotline text to be identified; matching the livelihood hotline text to be identified based on a regular expression corresponding to a livelihood issue category in a preset livelihood issue category set to obtain a corresponding matching result; and determining the livelihood issue category set corresponding to the livelihood hotline text to be identified based on the matching result. This implementation can realize automatic classification of livelihood hotline texts without manual intervention, reducing labor costs and time costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for identifying categories of livelihood issues. Background Art

[0002] The 12345 government service hotline (also known as the livelihood hotline) is a platform for people to reflect the difficulties and problems encountered in production and life. It is also an important way for government departments to pay attention to people's livelihood and listen to public opinion. By analyzing the livelihood hotline data, valuable livelihood information can be obtained, such as the types of livelihood issues, the number of various livelihood issues, etc., which can provide important support for targeted social governance and solving livelihood issues.

[0003] In the related technologies, the categories of livelihood issues corresponding to livelihood hotline data are mainly determined by manual labeling. This method has at least the following shortcomings. First, as time goes by, the amount of livelihood hotline data increases, and the low efficiency of manual labeling makes it impossible to effectively process large amounts of data. Second, livelihood hotline data are mostly described in natural language, and the expression is colloquial and irregular, which makes manual labeling increasingly difficult.

[0004] Therefore, it is necessary to propose a new technical solution for identifying categories of people's livelihood issues. Summary of the invention

[0005] The present disclosure proposes a method, an apparatus, an electronic device, and a storage medium for identifying categories of livelihood issues.

[0006] In a first aspect, the present disclosure provides a method for identifying categories of livelihood issues, the method comprising:

[0007] Get the livelihood hotline text to be identified;

[0008] Based on the regular expressions corresponding to the livelihood problem categories in the preset livelihood problem category set, the livelihood hotline text to be identified is matched to obtain the corresponding matching results;

[0009] According to the matching results, the category set of livelihood issues corresponding to the livelihood hotline text to be identified is determined.

[0010] In some optional implementations, for each livelihood issue category in the livelihood issue category set, the regular expression corresponding to the livelihood issue category is pre-trained through the following training steps:

[0011] Obtaining a training sample set and a validation sample set, wherein the samples in the training sample set and the validation sample set include historical livelihood hotline texts and corresponding category labels;

[0012] Generate a candidate regular expression set corresponding to the livelihood issue category according to the positive sample set corresponding to the livelihood issue category, wherein the positive sample set is a set of training samples whose category labels in the training sample set include the livelihood issue category;

[0013] Based on the verification sample set, a candidate regular expression with the highest verification accuracy is determined from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category.

[0014] In some optional implementations, generating a candidate regular expression set corresponding to the livelihood issue category according to the positive sample set corresponding to the livelihood issue category includes:

[0015] For each positive sample in the positive sample set corresponding to the livelihood issue category, the following regular expression generation operation is performed on the positive sample:

[0016] Perform word segmentation and part-of-speech tagging on the livelihood hotline text in the positive sample to obtain a candidate word segmentation sequence and a candidate word segmentation part-of-speech sequence corresponding to the positive sample;

[0017] Extract key participles from the candidate participle sequence corresponding to the positive sample;

[0018] According to the extracted key words and corresponding parts of speech, a candidate regular expression corresponding to the positive sample is generated.

[0019] In some optional embodiments, the method further comprises:

[0020] After obtaining the training sample set, perform the following equalization processing operations on the training sample set:

[0021] Determine a positive sample set and a negative sample set corresponding to the livelihood issue category from the training sample set, wherein the negative sample set is a set of samples whose category labels do not include the livelihood issue category in the training sample set;

[0022] Calculate the ratio of positive samples to negative samples corresponding to the livelihood issue category;

[0023] When the quantity ratio does not fall within the preset range, the samples in the training sample set are adjusted so that the quantity ratio falls within the preset range.

[0024] In some optional implementations, determining a set of livelihood problem categories corresponding to the livelihood hotline text to be identified according to the matching results includes:

[0025] According to the matching result of each regular expression, determine whether the livelihood hotline text to be identified belongs to the livelihood issue category corresponding to the regular expression;

[0026] The livelihood issue category set is determined by using the livelihood issue category to which the livelihood hotline text to be identified belongs.

[0027] In some optional implementations, obtaining the livelihood hotline text to be identified includes:

[0028] Obtain the recording of the livelihood hotline to be identified;

[0029] Perform speech recognition processing on the livelihood hotline recording to be identified to obtain the livelihood hotline text to be identified.

[0030] In a second aspect, the present disclosure provides a device for identifying a category of livelihood issues, the device comprising:

[0031] An acquisition module is configured to acquire the livelihood hotline text to be identified;

[0032] A matching module is configured to match the livelihood hotline text to be identified based on a regular expression corresponding to a livelihood problem category in a preset livelihood problem category set to obtain a corresponding matching result;

[0033] The determination module is configured to determine the set of livelihood issue categories corresponding to the livelihood hotline text to be identified based on the matching results.

[0034] In some optional embodiments, the device further includes a training module, the training module including:

[0035] A sample acquisition unit is configured to acquire a training sample set and a validation sample set, wherein the samples in the training sample set and the validation sample set include historical livelihood hotline texts and corresponding category labels;

[0036] A regular expression generation unit is configured to generate a candidate regular expression set corresponding to the livelihood issue category according to a positive sample set corresponding to the livelihood issue category, wherein the positive sample set is a set of training samples whose category labels in the training sample set include the livelihood issue category;

[0037] The selection unit is configured to determine, based on the verification sample set, a candidate regular expression with the highest verification accuracy from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category.

[0038] In some optional implementations, the regular expression generation unit is further configured to:

[0039] For each positive sample in the positive sample set corresponding to the livelihood issue category, the following regular expression generation operation is performed on the positive sample:

[0040] Perform word segmentation and part-of-speech tagging on the livelihood hotline text in the positive sample to obtain a candidate word segmentation sequence and a candidate word segmentation part-of-speech sequence corresponding to the positive sample;

[0041] Extract key participles from the candidate participle sequence corresponding to the positive sample;

[0042] According to the extracted key words and corresponding parts of speech, a candidate regular expression corresponding to the positive sample is generated.

[0043] In some optional implementations, the training module further includes an equalization processing unit, which is configured to perform the following equalization processing operations on the training sample set after acquiring the training sample set:

[0044] Determine a positive sample set and a negative sample set corresponding to the livelihood issue category from the training sample set, wherein the negative sample set is a set of samples whose category labels do not include the livelihood issue category in the training sample set;

[0045] Calculate the ratio of positive samples to negative samples corresponding to the livelihood issue category;

[0046] When the quantity ratio does not fall within the preset range, the samples in the training sample set are adjusted so that the quantity ratio falls within the preset range.

[0047] In some optional implementations, the determination module is further configured to:

[0048] According to the matching result of each regular expression, determine whether the livelihood hotline text to be identified belongs to the livelihood issue category corresponding to the regular expression;

[0049] The livelihood issue category set is determined by using the livelihood issue category to which the livelihood hotline text to be identified belongs.

[0050] In some optional implementations, the acquisition module is further configured to:

[0051] Obtain the recording of the livelihood hotline to be identified;

[0052] Perform speech recognition processing on the livelihood hotline recording to be identified to obtain the livelihood hotline text to be identified.

[0053] In a third aspect, the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the first aspect.

[0054] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method described in any one of the embodiments of the first aspect.

[0055] The method provided by the embodiment of the present disclosure matches the livelihood hotline text to be identified based on regular expressions, and determines the livelihood problem category set corresponding to the livelihood hotline text to be identified according to the matching results, which can realize the automatic classification of the livelihood hotline text without manual intervention, reducing the manpower cost and time cost. At the same time, the efficiency of text classification is improved on the basis of ensuring the classification accuracy. In addition, the above method can also ensure the objectivity of the classification standard and reduce the influence of human subjective factors on the classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0057] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0058] Figure 2 is a flowchart of an embodiment of a method for identifying categories of livelihood issues according to the present disclosure;

[0059] Figure 3 is a flow chart of one embodiment of the training steps according to the present disclosure;

[0060] Figure 4 is a structural schematic diagram of an embodiment of a device for identifying categories of livelihood issues according to the present disclosure;

[0061] Figure 5 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. DETAILED DESCRIPTION

[0062] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0063] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0064] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the method for identifying categories of livelihood issues or the apparatus for identifying categories of livelihood issues of the present disclosure can be applied.

[0065] like Figure 1As shown, system architecture 100 may include terminal device 101, network 102 and server 103. Network 102 is used to provide a medium for a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0066] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as livelihood hotline record applications, livelihood problem category identification applications, web browser applications, etc.

[0067] The terminal device 101 can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with a display screen and supporting text input, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, used to provide livelihood issue category identification services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0068] The server 103 may be a server that provides various services, such as a background server that provides recognition services for the livelihood hotline text sent by the terminal device 101. The background server may analyze the received livelihood hotline text and feed back the processing results (such as a set of livelihood problem categories) to the terminal device.

[0069] In some cases, the method for identifying the category of livelihood issues provided by the present disclosure can be performed jointly by the terminal device 101 and the server 103. For example, the step of "obtaining the livelihood hotline text to be identified" can be performed by the terminal device 101, and the remaining steps can be performed by the server 103. The present disclosure does not limit this. Accordingly, the device for identifying the category of livelihood issues can also be set in the terminal device 101 and the server 103 respectively.

[0070] In some cases, the method for identifying the categories of people's livelihood issues provided in the present disclosure can be executed by the server 103. Accordingly, the device for identifying the categories of people's livelihood issues can also be set in the server 103. At this time, the system architecture 100 may not include the terminal device 101.

[0071] In some cases, the method for identifying the categories of people's livelihood issues provided by the present disclosure can be executed by the terminal device 101. Accordingly, the device for identifying the categories of people's livelihood issues can also be set in the terminal device 101. In this case, the system architecture 100 may not include the server 103.

[0072] It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, used to provide livelihood issue category identification services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0073] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be used according to implementation requirements.

[0074] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a method for identifying the categories of livelihood issues according to the present disclosure. The method for identifying the categories of livelihood issues includes the following steps:

[0075] Step 201, obtaining the livelihood hotline text to be identified.

[0076] In this embodiment, the livelihood hotline text is livelihood hotline data in text form. Specifically, the livelihood hotline text can be a text record of the conversation content between the caller and the operator, or it can be structured data formed by the operator based on the annotation of the conversation content, or it can be structured data automatically generated by the livelihood hotline record server according to information such as the call time and the location of the incoming call base station. The corresponding livelihood hotline text can be generated according to a call process of the livelihood hotline.

[0077] In this embodiment, the execution subject of the method for identifying the category of livelihood issues (for example Figure 1 The execution subject can obtain the livelihood hotline text to be identified locally, or remotely from other electronic devices connected to the execution subject network. For example, the execution subject can obtain the livelihood hotline text to be identified from a database stored locally or from a database stored in other electronic devices connected to the execution subject network. The execution subject can also obtain the livelihood hotline text to be identified from a livelihood platform server or a server that provides resource management services for livelihood information.

[0078] In some optional implementations, the above-mentioned execution subject can also obtain the government hotline text to be identified through the following steps: First, obtain the livelihood hotline recording to be identified. Here, the livelihood hotline recording can be an audio file that records the content of the conversation between the livelihood hotline caller and the operator, and its acquisition method is, for example, recording the call process. Secondly, the livelihood hotline recording to be identified is processed by voice recognition to obtain the livelihood hotline text to be identified. The above-mentioned voice recognition processing can adopt a method based on dynamic time warping (Dynamic Time Warping, DTW), a method based on a hidden Markov model (HMM) of a parameter model, a method based on vector quantization (VectorQuantization, VQ) of a non-parametric model, a method based on an artificial neural network (Artificial Neural Network, ANN), etc. Through the above implementation, the livelihood hotline text can be efficiently obtained according to the livelihood hotline recording, thereby improving the efficiency of identifying the category of livelihood issues, and can also realize real-time classification of livelihood hotlines.

[0079] Step 202, based on the regular expressions corresponding to the livelihood issue categories in the preset livelihood issue category set, the livelihood hotline text to be identified is matched to obtain the corresponding matching results.

[0080] In this embodiment, at least one livelihood issue category is pre-set to form a preset livelihood issue category set. The livelihood issue category can be specifically set according to actual conditions, and the specific category can be, for example, education, employment, housing, medical care, and pension.

[0081] In this embodiment, each livelihood issue category in the preset livelihood issue category set may correspond to at least one regular expression, wherein the regular expression is used to perform information matching on the livelihood hotline text to be identified based on specific rules and obtain corresponding matching results.

[0082] In some optional implementations, at least one regular expression corresponding to each livelihood issue category may be a regular expression pre-set and stored in the above-mentioned execution entity by a technician based on a statistical analysis of a large number of historical livelihood hotline texts corresponding to the livelihood issue category. In one example, the regular expression corresponding to the "education" livelihood issue category may be "#school#", which can be used to find out whether there is text matching the word "school" in the livelihood hotline text to be identified. If the matching result in the above example is "yes", it indicates that the word "school" is contained in the livelihood hotline text to be identified. If the matching result in the above example is "no", it indicates that the word "school" is not contained in the livelihood hotline text to be identified.

[0083] In this embodiment, one question category may correspond to one regular expression, for example, question category A corresponds to regular expression a. Accordingly, the matching result corresponding to question category A is whether the livelihood hotline text to be identified matches regular expression a. One question category may also correspond to more than two regular expressions, for example, question category B corresponds to regular expression b1 and regular expression b2. Accordingly, the matching result corresponding to question category B includes both whether the livelihood hotline text to be identified matches regular expression b1 and whether the livelihood hotline text to be identified matches regular expression b1.

[0084] Step 203: Determine the livelihood issue category set corresponding to the livelihood hotline text to be identified based on the matching result.

[0085] In this embodiment, if the matching result of the livelihood hotline text to be identified under a certain regular expression is yes, it can be determined that the livelihood hotline text to be identified belongs to the livelihood issue category corresponding to the regular expression. In the example of the "education" livelihood issue category in the previous text, if the matching result is "yes", it indicates that the livelihood hotline text to be identified belongs to the "education" livelihood issue category. If the matching result is "no", it indicates that the livelihood hotline text to be identified does not belong to the "education" livelihood issue category.

[0086] In some optional implementations, step 203 may further include: first, according to the matching results of each regular expression, determine whether the people's livelihood hotline text to be identified belongs to the category of people's livelihood issues corresponding to the regular expression. Then, determine the people's livelihood issue category set using the category of people's livelihood issues to which the people's livelihood hotline text to be identified belongs. Here, for each category of people's livelihood issues in the preset people's livelihood issue category set, the matching result of the people's livelihood hotline text to be identified under the regular expression corresponding to the people's livelihood issue category can be determined, and then determine whether the people's livelihood hotline text to be identified belongs to the people's livelihood issue category. Further, according to the category of people's livelihood issues to which the people's livelihood hotline text to be identified belongs, a set of people's livelihood issue categories corresponding to the people's livelihood hotline text to be identified can be generated. Among them, the elements in the set of people's livelihood issue categories corresponding to the people's livelihood hotline text to be identified are the people's livelihood issue categories to which the people's livelihood hotline text to be identified belongs.

[0087] In this embodiment, the livelihood hotline to be identified may belong to only one livelihood issue category, or may belong to two or more livelihood issue categories at the same time, or may not belong to any livelihood issue category in the preset livelihood issue category set. Accordingly, the number of elements in the livelihood issue category set corresponding to the livelihood hotline text to be identified may be one, more than one, or zero.

[0088] The method provided by the above embodiment of the present disclosure matches the livelihood hotline text to be identified based on regular expressions, and determines the livelihood problem category set corresponding to the livelihood hotline text to be identified according to the matching results, which can realize the automatic classification of the livelihood hotline text, and improve the efficiency of text classification on the basis of ensuring the classification accuracy. In addition, the above method can ensure the objectivity of the classification standard and reduce the influence of human subjective factors on the classification results.

[0089] In some optional implementations, for each livelihood issue category recorded in the livelihood issue category set in step 201, the regular expression corresponding to the livelihood issue category can be as follows: Figure 3 The training steps shown are pre-trained.

[0090] Here, the execution subject of the training step can be the same as the execution subject of the method for identifying the categories of livelihood issues. In this way, after the execution subject of the training step obtains the regular expressions corresponding to the livelihood issue categories in the livelihood issue category set through training, the regular expressions corresponding to the livelihood issue categories in the livelihood issue category set can be stored locally in the execution subject, and the regular expressions can be read during the execution of the method for identifying the categories of livelihood issues.

[0091] Here, the execution subject of the training step may also be different from the execution subject of the method for identifying the categories of livelihood issues. In this way, after the execution subject of the training step obtains the regular expressions corresponding to the categories of livelihood issues in the category set of livelihood issues through training, the execution subject of the training step may send the regular expressions corresponding to the categories of livelihood issues in the category set of livelihood issues to the execution subject of the method for identifying the categories of livelihood issues. In this way, the execution subject of the method for identifying the categories of livelihood issues may read the regular expressions received from the execution subject of the training step during the execution of the method for identifying the categories of livelihood issues.

[0092] Please refer to Figure 3 , Figure 3 A process 300 of an embodiment of a training step according to the present disclosure is shown. The training step includes the following steps:

[0093] Step 301: Obtain a training sample set and a verification sample set.

[0094] In this embodiment, the samples in the training sample set and the verification sample set may include historical livelihood hotline texts and corresponding category labels. The training sample set can be used to generate regular expressions in the training phase, and the verification sample set can be used to verify the recognition effect of the generated regular expression. In one example, the acquisition process of the training sample set and the verification sample set is, for example: first, batch read the livelihood hotline text data from the database recording the livelihood hotline data and delete the invalid data therein (for example, the livelihood hotline text with all or part of the content being empty), and form the original sample set based on the remaining data. Secondly, a certain number of livelihood hotline texts are randomly selected from the original sample set to form a training sample set or a verification sample set. For example, 80% of the livelihood hotline texts are randomly selected from the original sample set to form a training sample set, and the remaining 20% ​​of the livelihood hotline texts are used as a verification sample set.

[0095] In this embodiment, for each sample in the training sample set and the validation sample set, the sample may include a livelihood hotline text and a category label corresponding to the livelihood hotline text. The category label corresponding to the livelihood hotline text may be obtained by manual annotation. For example, a sample includes a livelihood hotline text of "children's schooling problems" and a corresponding category label of "education".

[0096] In this embodiment, the number of category labels corresponding to each livelihood hotline text may be one or more than two. For example, for a livelihood hotline text that includes both "finding a job" and "seeing a doctor", the category labels corresponding to the livelihood hotline text include both "employment" and "medical care".

[0097] In some optional implementations, the executor of the above training steps may perform the following equalization processing operations on the training sample set after obtaining the training sample set: First, determine the positive sample set and negative sample set corresponding to the livelihood issue category from the training sample set. Among them, negative samples are samples in the training sample set whose category labels do not include the livelihood issue category, and positive samples are samples in the training sample set whose category labels include the livelihood issue category. Secondly, calculate the number ratio of positive samples and negative samples corresponding to the livelihood issue category. Finally, when the number ratio does not fall within the preset range, adjust the samples in the training sample set so that the number ratio falls within the preset range. The above preset range is, for example, 0.9-1.1.

[0098] In one example, the number of positive samples and negative samples corresponding to the "education" category in the training sample set are 2000 and 1000 respectively. The ratio of the number of positive samples to the number of negative samples is 2, which is not within the preset range of 0.9-1.1. In this regard, 1000 positive samples can be randomly selected from the 2000 positive samples for training, so that the ratio of the number of positive samples to the number of negative samples becomes 1, thereby meeting the sample balancing requirement.

[0099] Through the above-mentioned equalization processing operation, it can be ensured that the number of positive samples and negative samples in the training set is relatively balanced, which is conducive to the smooth completion of the training step and can improve the recognition effect of regular expressions.

[0100] Step 302: Generate a candidate regular expression set corresponding to the livelihood issue category based on the positive sample set corresponding to the livelihood issue category.

[0101] In this embodiment, for a preset livelihood issue category, the positive samples corresponding to the livelihood issue category are the set of samples whose category labels in the training sample set include the livelihood issue category. For example, for the livelihood issue category of "education", if the category label of a sample in the training sample set includes "education", then the sample is a positive sample of the livelihood issue category of "education". It is easy to understand that the set formed by the positive samples corresponding to a livelihood issue category is the positive sample set corresponding to the livelihood issue category.

[0102] In some optional implementations, the step of generating a candidate regular expression set corresponding to the livelihood issue category according to the positive sample set corresponding to the livelihood issue category recorded in step 302 may be performed as follows: for each positive sample in the positive sample set corresponding to the livelihood issue category, the following regular expression generation operation is performed on the positive sample. The regular expression generation operation may include:

[0103] First, the livelihood hotline text in the positive sample is segmented and POS tagged to obtain the candidate segmentation sequence and candidate segmentation POS sequence corresponding to the positive sample.

[0104] The above-mentioned word segmentation processing can adopt a word list-based word segmentation method, a statistical model-based word segmentation method, a sequence tagging-based word segmentation method, etc. The above-mentioned part-of-speech tagging processing can adopt a hidden Markov model, a conditional random field, etc.

[0105] Secondly, extract the key word segmentation from the candidate word segmentation sequence corresponding to the positive sample.

[0106] The above process of extracting related words may adopt a tf-idf (term frequency–inverse document frequency) algorithm or a textRank (text ranking) algorithm, or may be extracted based on grammatical rules.

[0107] Finally, based on the extracted key words and the corresponding parts of speech, a candidate regular expression corresponding to the positive sample is generated.

[0108] In one example, the text in the positive sample corresponding to the "education" livelihood issue category is "What should I do if my child goes to school?" By performing word segmentation and part-of-speech tagging on the positive sample, the candidate word segmentation sequence is obtained as "children|school|what should I do|what", and the candidate word segmentation part-of-speech sequence is obtained as {noun, verb, verb, auxiliary word}. Associated words are extracted from the above candidate word segmentation sequence, and the keywords obtained are "children", "school" and "what should I do", and the corresponding parts of speech are noun, verb and verb respectively. When generating regular expressions, the original keywords can be used, or the corresponding parts of speech can be used to replace the original keywords. For example, the generated regular expression can be "#children#school#what to do" or "#noun#school#verb".

[0109] In this embodiment, for each positive sample in the positive sample set corresponding to the livelihood issue category, a corresponding candidate regular expression can be generated in the above manner, thereby generating a candidate regular expression set corresponding to the corresponding livelihood issue category.

[0110] Step 303: Based on the verification sample set, determine the candidate regular expression with the highest verification accuracy from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category.

[0111] In this embodiment, for each candidate regular expression in the candidate regular expression set, the regular expression can be used to match the livelihood hotline text corresponding to the sample in the verification sample set (which can be referred to as the verification sample) to obtain the corresponding matching result. The above matching result can be compared with the category label corresponding to the verification sample. If they are consistent, the verification result of the candidate regular expression on the verification sample is determined to be correct. If they are inconsistent, the verification result of the candidate regular expression on the verification sample is determined to be wrong. In the above manner, the verification result of the candidate regular expression on each verification sample in the verification sample set can be determined, and the ratio of the number of verification samples with correct verification results to the total number of verification samples can be further calculated as the verification accuracy of the candidate regular expression on the verification sample set.

[0112] In this embodiment, the verification accuracy of each candidate regular expression in the candidate regular expression set can be determined in the above manner, and the candidate regular expression with the highest verification accuracy is determined as the regular expression corresponding to the livelihood issue category.

[0113] Figure 3In the training steps shown, candidate regular expressions are generated based on the training sample set, and the candidate regular expression with the highest verification accuracy is determined based on the verification sample set and used as the regular expression corresponding to the livelihood issue category. The above training steps can realize the automatic extraction of matching rules and obtain good matching results, and can also make full use of existing sample data to realize the refinement and accumulation of annotation experience.

[0114] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for identifying the category of livelihood issues. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0115] like Figure 4 As shown, the apparatus 400 for identifying livelihood issue categories of this embodiment includes: an acquisition module 401, a matching module 402 and a determination module 403. Among them, the acquisition module 401 is configured to acquire the livelihood hotline text to be identified; the matching module 402 is configured to match the livelihood hotline text to be identified based on the regular expression corresponding to the livelihood issue category in the preset livelihood issue category set to obtain the corresponding matching result; the determination module 403 is configured to determine the livelihood issue category set corresponding to the livelihood hotline text to be identified according to the matching result.

[0116] In this embodiment, the specific processing of the acquisition module 401, the matching module 402 and the determination module 403 of the apparatus 400 for identifying the category of livelihood issues and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of step 201, step 202 and step 203 in the corresponding embodiment are not repeated here.

[0117] In some optional implementations, the apparatus 400 for identifying the category of livelihood issues may further include a training module 404. The training module 404 may further include a sample acquisition unit, a regular expression generation unit, and a selection unit ( Figure 4 (not shown in the figure). The sample acquisition unit is configured to acquire a training sample set and a verification sample set, wherein the samples in the training sample set and the verification sample set include historical livelihood hotline texts and corresponding category labels. The regular expression generation unit is configured to generate a candidate regular expression set corresponding to the livelihood issue category based on the positive sample set corresponding to the livelihood issue category, wherein the positive sample set is a set of training samples whose category labels in the training sample set include the livelihood issue category. The selection unit is configured to determine, based on the verification sample set, a candidate regular expression with the highest verification accuracy from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category.

[0118] In some optional embodiments, the regular expression generation unit can be further configured to: for each positive sample in the positive sample set corresponding to the category of people's livelihood issues, perform the following regular expression generation operation on the positive sample: perform word segmentation and part-of-speech tagging on the people's livelihood hotline text in the positive sample to obtain a candidate word segmentation sequence and a candidate word segmentation part-of-speech sequence corresponding to the positive sample; extract key word segmentations from the candidate word segmentation sequence corresponding to the positive sample; and generate a candidate regular expression corresponding to the positive sample based on the extracted key word segmentations and the corresponding parts of speech.

[0119] In some optional implementations, the training module may further include an equalization processing unit ( Figure 4 (not shown in the figure), the equalization processing unit is configured to perform the following equalization processing operations on the training sample set after obtaining the training sample set: determine the positive sample set and the negative sample set corresponding to the livelihood issue category from the training sample set, wherein the negative sample set is a collection of samples whose category labels in the training sample set do not include the livelihood issue category; calculate the quantity ratio of the positive samples and the negative samples corresponding to the livelihood issue category; when the quantity ratio does not fall within a preset range, adjust the samples in the training sample set so that the quantity ratio falls within the preset range.

[0120] In some optional implementations, the determination module 403 can be further configured to: determine whether the people's livelihood hotline text to be identified belongs to the people's livelihood issue category corresponding to the regular expression based on the matching results of each regular expression; and determine the people's livelihood issue category set using the people's livelihood issue category to which the people's livelihood hotline text to be identified belongs.

[0121] In some optional implementations, the acquisition module 401 may be further configured to: acquire a livelihood hotline recording to be identified; perform speech recognition processing on the livelihood hotline recording to be identified to obtain a livelihood hotline text to be identified.

[0122] It should be noted that the implementation details and technical effects of each module and each unit in the device for identifying the categories of livelihood issues provided by the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.

[0123] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing the electronic device of the present disclosure. Figure 5 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present disclosure.

[0124] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. Various programs and data required for the operation of the system 500 are also stored in the RAM 503. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0125] The following components are connected to the I / O interface 505: an input section 506 including a touch screen, a handwriting tablet, a keyboard, or a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet.

[0126] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the method of the present disclosure are executed. It should be noted that the computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0127] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, Python, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0129] The units described in the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor, for example, may be described as: a processor including an acquisition module, a matching module, and a determination module. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the acquisition module may also be described as a "module for acquiring the livelihood hotline text to be identified".

[0130] As another aspect, the present disclosure further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device: obtains the livelihood hotline text to be identified; matches the livelihood hotline text to be identified based on the regular expression corresponding to the livelihood problem category in the preset livelihood problem category set, and obtains the corresponding matching result; and determines the livelihood problem category set corresponding to the livelihood hotline text to be identified according to the matching result.

[0131] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A method for identifying categories of livelihood issues, comprising: Acquire the livelihood hotline text to be identified, where the livelihood hotline text to be identified is obtained by performing voice recognition processing on the livelihood hotline recording to be identified; Based on the regular expressions corresponding to the livelihood problem categories in the preset livelihood problem category set, the livelihood hotline text to be identified is matched to obtain the corresponding matching results; According to the matching result of each regular expression, determine whether the livelihood hotline text to be identified belongs to the livelihood issue category corresponding to the regular expression, and use the livelihood issue category to which the livelihood hotline text to be identified belongs to determine the livelihood issue category set corresponding to the livelihood hotline text to be identified; Among them, for each livelihood issue category in the livelihood issue category set, the regular expression corresponding to the livelihood issue category is pre-trained through the following training steps: Obtaining a training sample set and a validation sample set, wherein the samples in the training sample set and the validation sample set include historical livelihood hotline texts and corresponding category labels, the number of category labels corresponding to each livelihood hotline text is more than two, and the category labels corresponding to the livelihood hotline texts are obtained by manual annotation; Generate a candidate regular expression set corresponding to the livelihood issue category according to the positive sample set corresponding to the livelihood issue category, wherein the positive sample set is a set of training samples whose category labels in the training sample set include the livelihood issue category; Based on the verification sample set, determine a candidate regular expression with the highest verification accuracy from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category; The step of generating a candidate regular expression set corresponding to the livelihood issue category according to the positive sample set corresponding to the livelihood issue category includes: For each positive sample in the positive sample set corresponding to the livelihood issue category, the following regular expression generation operation is performed on the positive sample: Perform word segmentation and part-of-speech tagging on the livelihood hotline text in the positive sample to obtain a candidate word segmentation sequence and a candidate word segmentation part-of-speech sequence corresponding to the positive sample; Extract key participles from the candidate participle sequence corresponding to the positive sample; Generate a candidate regular expression corresponding to the positive sample according to the extracted key participles and the corresponding parts of speech; when generating the candidate regular expression, replace at least one of the multiple key participles with the corresponding parts of speech; The method further comprises: After obtaining the training sample set, the following equalization processing operation is performed on the training sample set: Determine a positive sample set and a negative sample set corresponding to the livelihood issue category from the training sample set, wherein the negative sample set is a set of samples whose category labels in the training sample set do not include the livelihood issue category; Calculate the ratio of positive samples to negative samples corresponding to the livelihood issue category; When the quantity ratio does not fall within a preset range, adjusting the samples in the training sample set so that the quantity ratio falls within the preset range, wherein the preset range is 0.9-1.1; Based on the verification sample set, a candidate regular expression with the highest verification accuracy is determined from the candidate regular expression set corresponding to the livelihood issue category, and the regular expression corresponding to the livelihood issue category includes: For each candidate regular expression in the candidate regular expression set, use the regular expression to match the people's livelihood hotline text corresponding to the verification sample in the verification sample set to obtain the corresponding matching result; compare the above matching result with the category label corresponding to the verification sample, if they are consistent, then determine that the verification result of the candidate regular expression on the verification sample is correct; if they are inconsistent, then determine that the verification result of the candidate regular expression on the verification sample is wrong; through the above method, determine the verification result of the candidate regular expression on each verification sample in the verification sample set, and further calculate the ratio of the number of verification samples with correct verification results to the total number of verification samples as the verification accuracy of the candidate regular expression on the verification sample set, and determine the candidate regular expression with the highest verification accuracy as the regular expression corresponding to the livelihood issue category.

2. A device for identifying categories of livelihood issues, comprising: An acquisition module is configured to acquire a livelihood hotline text to be identified, where the livelihood hotline text to be identified is obtained by performing speech recognition processing on a livelihood hotline recording to be identified; A matching module is configured to match the livelihood hotline text to be identified based on a regular expression corresponding to a livelihood issue category in a preset livelihood issue category set to obtain a corresponding matching result; A determination module is configured to determine, according to the matching result of each regular expression, whether the livelihood hotline text to be identified belongs to the livelihood issue category corresponding to the regular expression, and determine the livelihood issue category set corresponding to the livelihood hotline text to be identified by using the livelihood issue category to which the livelihood hotline text to be identified belongs; The device also includes a training module, which includes: The sample acquisition unit is configured to acquire a training sample set and a verification sample set, wherein the samples in the training sample set and the verification sample set include historical livelihood hotline texts and corresponding category labels, the number of category labels corresponding to each livelihood hotline text is more than two, and the category labels corresponding to the livelihood hotline texts are obtained by manual annotation; A regular expression generation unit is configured to generate a candidate regular expression set corresponding to the livelihood issue category according to a positive sample set corresponding to the livelihood issue category, wherein the positive sample set is a set of training samples whose category labels in the training sample set include the livelihood issue category; A selection unit is configured to determine, based on the verification sample set, a candidate regular expression with the highest verification accuracy from the candidate regular expression set corresponding to the livelihood issue category as the regular expression corresponding to the livelihood issue category; The regular expression generation unit is further configured to: For each positive sample in the positive sample set corresponding to the livelihood issue category, the following regular expression generation operation is performed on the positive sample: Perform word segmentation and part-of-speech tagging on the livelihood hotline text in the positive sample to obtain a candidate word segmentation sequence and a candidate word segmentation part-of-speech sequence corresponding to the positive sample; Extract key participles from the candidate participle sequence corresponding to the positive sample; Generate a candidate regular expression corresponding to the positive sample according to the extracted key participles and the corresponding parts of speech; when generating the candidate regular expression, replace at least one of the multiple key participles with the corresponding parts of speech; The training module further includes an equalization processing unit, which is configured to perform the following equalization processing operation on the training sample set after acquiring the training sample set: Determine a positive sample set and a negative sample set corresponding to the livelihood issue category from the training sample set, wherein the negative sample set is a set of samples whose category labels in the training sample set do not include the livelihood issue category; Calculate the ratio of positive samples to negative samples corresponding to the livelihood issue category; When the quantity ratio does not fall within a preset range, adjusting the samples in the training sample set so that the quantity ratio falls within the preset range, wherein the preset range is 0.9-1.1; The selection unit is further configured to: for each candidate regular expression in the candidate regular expression set, use the regular expression to match the people's livelihood hotline text corresponding to the verification sample in the verification sample set to obtain the corresponding matching result; compare the above matching result with the category label corresponding to the verification sample, if they are consistent, determine that the verification result of the candidate regular expression on the verification sample is correct, if they are inconsistent, determine that the verification result of the candidate regular expression on the verification sample is wrong; in the above manner, determine the verification result of the candidate regular expression on each verification sample in the verification sample set, and further calculate the ratio of the number of verification samples with correct verification results to the total number of verification samples as the verification accuracy of the candidate regular expression on the verification sample set, and determine the candidate regular expression with the highest verification accuracy as the regular expression corresponding to the livelihood issue category.

3. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as claimed in claim 1 .

4. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to claim 1 is implemented.

Citation Information

Patent Citations

  • Semantic analysis method and device

    CN105095186A

  • Enterprise information classification method and apparatus

    CN107193915A

  • Regular expression matching method, device and system based on multi-way tree

    CN107992481A

  • Regular expression generation method, server and computer readable storage medium

    CN110909160A

  • Entity relationship extraction method and device

    CN111126067A