Multi-dimensional text classification method based on topic pre-classification and knowledge graph
Through the multi-dimensional text classification method based on topic pre-classification and knowledge graph, the BERT network training model is used to solve the problem of inefficiency in text data processing of complex hotline cases, the accurate allocation and efficient processing of hotline cases are achieved, and social functional management is improved Department management efficiency.
Patent Information
- Application Number
- CN202411002529.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-08
AI Technical Summary
The existing technology is difficult to effectively and accurately process and allocate complex hotline case text data, resulting in inefficiency of social functional management departments and unable to meet the processing needs of massive hotline cases.
Using the multi-dimensional text classification method based on topic pre-classification and knowledge graph, the steps of data collection, word classification, topic pre-classification, naming entity recognition, building knowledge graph, building department matrix and virtual functional departments, model training and model output, use the steps of BERT network trains the model to achieve efficient classification of text data.
It improves the accuracy and efficiency of text classification, and can effectively handle hotline cases with unbalanced data volume and large differences in text quality, reducing the burden on staff and improving the processing capabilities of social functional management departments.
Smart Images

Figure CN118916490A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing, further to the field of natural language data processing, and specifically to a text classification method, and in particular to a multidimensional text classification method, system, electronic device, and readable storage medium based on topic pre-classification and knowledge graph. Background Art
[0002] With the development of computer information processing technology, more and more industries and departments are using automatic information processing to replace the original manual information processing method. Information processing, especially text information processing, plays an increasingly important role in optimizing the management of social functional departments. Good text information processing results can help achieve refined and accurate management of social functional management departments, which is conducive to reducing the burden of manual processing and improving management efficiency.
[0003] At present, when people encounter some social problems in their daily lives, they usually choose the municipal hotline as a channel to submit information about these social problems in various ways such as phone calls and text messages, which are called hotline cases. These hotline cases are eventually recorded as text data information, called hotline texts. A key point in hotline case handling is to correctly assign hotline cases to the corresponding functional departments / institutions. If the assignment cannot be made accurately and quickly, it will directly lead to low efficiency in problem handling and affect the processing progress of some hotline cases that need to be responded to and handled in a timely manner.
[0004] At present, the data managed by social functional departments are vast and complex, the needs for information analysis are ever-changing, and the solutions for optimizing data information analysis managed by social functional departments are still very incomplete. Therefore, excellent solutions are urgently needed to process these massive amounts of data information.
[0005] Moreover, the current hotline business is becoming increasingly heavy, and a large amount of hotline case information needs to be processed in a timely manner. Manual classification and distribution alone cannot meet the processing needs. Some existing text information processing methods are not suitable for the business needs of these large and complex hotline cases.
[0006] Therefore, it has become a technical problem to be solved urgently to conduct targeted research on these special text data and explore new text classification methods in order to accurately classify and deal with such complex hot issues in a timely, effective and timely manner, and to achieve the transformation of social functional management departments to accurate and refined management. Summary of the invention
[0007] The technical problem to be solved by the present disclosure is to explore a new text classification method to process the hotline case text data information, and to timely, effectively and accurately allocate the hot issues involved in the hotline case text data information to the corresponding social functional management departments.
[0008] In order to achieve the above-mentioned invention purpose, to better classify these special text data quickly, efficiently and accurately, and to realize accurate and refined distribution to social functional management departments, the present disclosure studies the characteristics of these special text data themselves, the functional division of management departments and the data flow, and summarizes the following characteristics and difficulties:
[0009] 1. The quality of appeal texts varies greatly:
[0010] (1) The length of the text varies greatly, ranging from only one or two sentences to 800 words or more;
[0011] (2) There are a large number of proper names / professional terms in the text data. For the hotline text, there are many regional nouns. There are cases where the same place has different names, mainly because the pronunciation is the same but the characters are different. In addition, for example, due to historical reasons, the same place may be called a community or a village.
[0012] (3) The text data is obviously colloquial, and some are not written in a standard way, with grammatical problems and typos;
[0013] (4) The sources of text data are complex, so in terms of narrative, some people have poor description skills and are imprecise, showing a tendency to ambiguity.
[0014] 2. The hierarchy of functional units is uncertain
[0015] Taking the distribution of a municipal hotline in a certain place as an example, there are many relevant government departments / institutions, and some of the levels are as deep as 7 levels; the structure is seriously unbalanced, some departments are large and have many subordinate departments, while some departments have no subordinate departments and the overall level is only two levels. Figure 1 The above characteristics can be clearly seen in the diagram of the government departments / agencies involved in the distribution of a certain municipal hotline.
[0016] 3. Conventional text classification methods are not competent
[0017] For the above complex text classification problem, the usual text classification method can guarantee the effect when there are enough positive / negative cases. However, the reality is that the cases in some places are very limited, and some departments also have fewer cases. Therefore, the direct use of general classification methods has limited effect.
[0018] In addition, some hotline case text data information requires two or more level departments to work together to process, so it is necessary to distribute the hotline case text data information to the corresponding level departments at the same time or in sequence. This poses a more severe challenge to the classification method.
[0019] In view of the particularity and difficulty of the above problems, in order to achieve the purpose of the present invention, the present invention proposes a method for classification with the help of intermediate information "text topic", and performs multi-dimensional text classification based on topic pre-classification and knowledge graph. For different topics, corresponding "analysis mode (schema)" is constructed, keywords are extracted according to the mode, attached to the text vector, and a suitable model is trained by the BERT network. Among them, the model training flow chart is as follows Figure 2 As shown, the prediction flow chart is as follows Figure 3 shown.
[0020] Specifically, in order to solve the above technical problems, the present disclosure provides a multidimensional text classification method, system, electronic device and storage medium based on topic pre-classification and knowledge graph.
[0021] According to one aspect of the present disclosure, the present disclosure provides a multidimensional text classification method based on topic pre-classification and knowledge graph, comprising the following steps:
[0022] (1) Data collection: collecting the first hotline text data, performing text segmentation, and extracting the first keyword;
[0023] (2) Word classification: Classify the first keyword into regional words and non-regional words. If it is a regional word, directly obtain the superordinate and subordinate relationship.
[0024] (3) Topic pre-classification: pre-define multiple event categories, initialize the effect of the first keyword on the semantics of the event text and attach corresponding weights to obtain pre-defined rules; perform topic pre-classification according to the pre-defined rules, and directly generate coding function information if it is a regional word;
[0025] (4) Named entity recognition: Named entity recognition is performed by building a synonym forest;
[0026] (5) Constructing a knowledge graph: Using the triple <entity A, relationship R, entity B> to describe the knowledge graph using the predefined rules. For non-regional words, query the predefined rules, construct entity relationships, and obtain a knowledge graph.
[0027] (6) Constructing a department matrix and virtual functional departments: mapping the functional departments or institutions involved as geographical information and functional information, and establishing a specific mapping relationship based on the relevance between the first hotline text and the functional departments or institutions;
[0028] (7) Model training: The processed appeal text and extracted entity relationships are encoded as input, and the encoded virtual functional department information is used as output. The BERT network is used to train the model to obtain a usable model.
[0029] (8) Model output: output the available model.
[0030] Preferably, the method further comprises the following steps:
[0031] When in use, the second hotline text data is collected, the text is segmented, and the second keyword is extracted;
[0032] Classifying the second keyword into regional words and non-regional words. If the second keyword is a regional word, directly obtaining the superordinate and subordinate relationship.
[0033] Pre-classify the topics according to predefined rules, and query the knowledge graph based on the topics obtained by pre-classification;
[0034] After encoding the processed appeal text and the extracted entity relationships, they are input into the available model to obtain the functional department information.
[0035] Preferably, the mapping relationship is adjusted in real time: each functional department processes the assigned hotline text, marks the hotline text that does not belong to the department, returns the marked hotline text and reallocates it until the hotline text is received by another functional department; establishes a mapping relationship between the hotline text and the functional department that ultimately receives it, and at the same time releases the previous unmatched mapping relationship, and updates the mapping relationship matrix in real time.
[0036] Preferably, the first hotline text and the second hotline text data are identified by a 24-dimensional vector, and the encoding form is a one-hot code.
[0037] Preferably, the entity relationships stored in the knowledge graph are submitted to the BERT network input in the order of "[relationship type number, entity A, relationship R, entity B, attribute]".
[0038] Preferably, the virtual functional department information corresponding to the hotline text is encoded in a one-hot encoding manner, and the input sequence is subjected to multi-label classification. Pi is the probability value of the i-th bit in the output being predicted to be the i-th virtual functional department, which is expressed as follows:
[0039] p i =σ(W x+b)
[0040] Where W is the training weight, x is the encoded input sequence, b is the bias term, and σ is the mapping.
[0041] Preferably, the following objective loss function Loss is used:
[0042]
[0043] Where n is the length of the input sequence; y iis the known correct classification label, p i is the probability value of the i-th position in the output being predicted to be the i-th virtual functional department.
[0044] Preferably, the precision rate P, recall rate R and comprehensive index F1 value are used as indicators for judging model performance; a suitable test set is selected from the sample population for index testing; the higher the scores of the three evaluation indicators, the better the precision rate, recall rate and comprehensive performance of the model; the calculation formula of the evaluation indicators is as follows:
[0045]
[0046]
[0047] Among them, Nr is the number of samples predicted correctly; Nc is the total number of predicted samples; N is the total number of samples in the test set; the comprehensive index F1 is calculated by P and R.
[0048] According to another aspect of the present disclosure, the present disclosure provides a multidimensional text classification system based on topic pre-classification and knowledge graph, including:
[0049] (1) Data collection unit: collects the first hotline text data, performs text segmentation, and extracts the first keyword;
[0050] (2) a word classification unit: classifying the first keyword into regional words and non-regional words. If the first keyword is a regional word, directly obtaining the superordinate and subordinate relationship;
[0051] (3) Theme pre-classification unit: pre-define multiple event categories, initialize the effect of the first keyword on the semantics of the event text and attach corresponding weights to obtain pre-defined rules; perform theme pre-classification according to the pre-defined rules, and directly generate coding function information if it is a regional word;
[0052] (4) Named Entity Recognition Unit: Named entity recognition is performed by constructing a synonym forest;
[0053] (5) Constructing a knowledge graph unit: Using the triple <entity A, relationship R, entity B> to describe the knowledge graph according to the predefined rules, for non-regional words, query the predefined rules, construct entity relationships, and obtain a knowledge graph;
[0054] (6) Constructing a department matrix and a virtual functional department unit: mapping the functional departments or institutions involved as geographical information and functional information, and establishing a specific mapping relationship based on the relevance between the first hotline text and the functional departments or institutions;
[0055] (7) Model training unit: The processed appeal text and extracted entity relationships are encoded as input, and the encoded virtual functional department information is used as output. The BERT network is used to train the model to obtain a usable model.
[0056] (8) Model output unit: outputs the available model.
[0057] According to another aspect of the present disclosure, the present disclosure provides an electronic device, including:
[0058] a memory storing execution instructions; and
[0059] A processor executes the execution instructions stored in the memory, so that the processor executes the above method.
[0060] According to another aspect of the present disclosure, the present disclosure provides a readable storage medium, wherein the readable storage medium stores execution instructions, and the execution instructions are used to implement the above method when executed by a processor.
[0061] The present disclosure is not limited to classifying only hot issues in daily life. Similar issues, such as product consultations, customer complaints, etc., can all be effectively classified using the classification method of the present disclosure. For example, the product matrix of some merchants is very large and has many subcategories. The relevant appeal issues require personnel who are very familiar with the product characteristics to answer; however, the method of manually assigning appeal issues is not competent, so it is necessary to automatically assign them to the corresponding corporate functional units or corresponding technical personnel based on these appeal texts.
[0062] Beneficial effects of the present disclosure:
[0063] 1. Common business scenarios are mostly characterized by an imbalance in the amount of data between categories. The method proposed in this disclosure can effectively classify them.
[0064] 2. For texts with similar topics, further extracting keywords and implicit patterns can improve the accuracy of sub-classification.
[0065] 3. It can effectively improve the efficiency of hotline case handling and reduce repetitive work of staff.
[0066] 4. It can be used in the after-sales service process of some large merchants to improve the matching degree between departments and problems, improve work processes, and improve service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings illustrate exemplary embodiments of the present disclosure and are used together with the description thereof to explain the principles of the present disclosure, wherein these drawings are included to provide a further understanding of the present disclosure, and the drawings are included in and constitute a part of this specification. By describing the embodiments of the present disclosure in detail in conjunction with the accompanying drawings, the above and other purposes, features, and advantages of the present disclosure will become more apparent.
[0068] Figure 1 Shows the government departments / agencies involved in the distribution of a municipal hotline
[0069] Figure 2 Shows the model training flow chart
[0070] Figure 3 shows the prediction flow chart
[0071] Figure 4 Show relationship entity communication flow chart
[0072] Figure 5 Shows the rule retrieval flow chart
[0073] Figure 6 An example knowledge graph showing regional hierarchical relationships
[0074] Figure 7 Shows an example of a rule
[0075] Figure 8 Shows the entity relationships of the knowledge graph
[0076] Fig. 9 Shows the functional information (virtual functional departments) mapping demand department flow chart
[0077] Fig.10 The model structure diagram is shown DETAILED DESCRIPTION
[0078] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0079] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0080] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0081] The terms used in the present disclosure are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups are not excluded from existence or addition. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0082] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present application. In this specification, the schematic representations of the above terms are not necessarily the same embodiment / method or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments / methods or examples described in this specification and the features of the different embodiments / methods or examples, unless they are contradictory.
[0083] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0084] One of the purposes of the present disclosure is to provide a multi-dimensional text classification method based on topic pre-classification and knowledge graph, specifically a method for classification with the help of intermediate information "text topic", multi-dimensional text classification based on topic pre-classification and knowledge graph, for different topics, corresponding "analysis mode (schema)" is constructed, keywords are extracted according to the mode, attached to the text vector, and a suitable model is trained by BERT network. Among them, the model training flow chart is as follows Figure 2 As shown, the prediction flow chart is as follows Figure 3 The specific description is as follows:
[0085] 1. Topic pre-classification
[0086] For the distribution and processing of complex appeal texts, if the traditional form of manual hotline case assignment is adopted, the salesperson will manually label the hotline text with one or more tags, and these tags implicitly constitute a classification. Next, the hotline case will be assigned to a corresponding functional department / institution based on these tags. For example, there are as many as "16 first-level classifications, more than 100 second-level classifications and nearly 600 third-level classifications" in a certain place. If it is handled manually, it will not only be time-consuming and labor-intensive, resulting in low processing efficiency and high social costs, but also because the information and categories are too complicated, it will lead to inaccurate classification, thus affecting the processing progress of the pending hotline cases. To truly reflect the value of the "hotline", the hotline events must be kept "hot" in a short period of time so that they can be distributed and processed as soon as possible.
[0087] The method for multidimensional text classification based on topic pre-classification and knowledge graph disclosed in the present invention uses the Latent Dirichlet Allocation (LDA) model to perform text clustering of hotline texts. Through detailed analysis of a large number of actual data of hotline cases in a certain place, and comprehensive consideration of the actual responsibilities and subordinate relationships of functional departments in various regions, the following eight major event categories are predefined:
[0088] ①Student status and school management
[0089] ②Education and teaching assistance training
[0090] ③ Public health, public safety, and social hot spots
[0091] ④Municipal administration, roads and transportation
[0092] ⑤Community and property, water, electricity, coal
[0093] ⑥Relocation and compensation, household registration relationship
[0094] ⑦ Agricultural land leasing and neighborhood
[0095] ⑧Construction noise and nuisance to residents
[0096] The characteristic words under each topic are counted, and the top few characteristic words are counted. The effect of keywords on the semantics of the event text is initialized and the corresponding weights are attached. Table 1 lists the top 10 characteristic words and their corresponding weights under each topic of a certain place. For hotline texts with unknown categories, keywords can be extracted, and the corresponding probabilities of each category can be calculated based on the corresponding weights of the keywords.
[0097] Table 1 Some feature words and their corresponding weights
[0098]
[0099] At this point, the topic pre-classification is completed.
[0100] 2. Named Entity Recognition
[0101] Some hotline texts are generated from voice data files, and have problems such as colloquial narrative expressions, irregular writing, grammatical errors, typos, etc. The style of some texts is close to news reports, and the content involves a lot of named entities, one of the obvious characteristics of which is regional named entities.
[0102] These regional place names often have the following problems: different names for the same location, including the same pronunciation but different characters; the same name for different locations. Due to historical reasons, the place names have been replaced but multiple expressions have been retained. For example, the same place is called a community in some places and a village in others; some specific village names have the same pronunciation but different characters, resulting in different recording methods. Only manual matching methods are used, which is labor-intensive and difficult to expand. When automatically identifying such named entities, if the recognition is not good, it will directly lead to a decrease in allocation efficiency and accuracy.
[0103] Therefore, the recognition of named entities is very critical. Named entity recognition (NER) is an important step in the process, which aims to identify specific entities in the hotline text, such as names of people, places, and organizations. Most of these entities are the objects of appeal or are highly related to them.
[0104] Specific examples are as follows:
[0105] Hotline text 1: "A caller reported: On XX day of XX month of XXXX, the floor of the corridor in XX unit of XX building, XX district, Junwangtun community, XX street, XX district, was rather dirty. The property management has been contacted many times but no one has cleaned it. The caller is requested to verify and assist with cleaning as soon as possible. Please handle the matter and return the caller's call."
[0106] Hotline text 2: "Ms. Chen, the owner of Room XXXX, Unit X, Building XX, Junwangtun Community, XX Street, XX District, called to report: In February 2022, the property management reported a malfunction of the entrance door lock to the property management. The property management provided the caller with the entrance door repair phone number, but as of March 12, 2022, the repair was unsuccessful. We hope that the department will assist in verification and urge repairs as soon as possible. Please handle the matter and return the caller."
[0107] Hotline text 3: "Staff of the power supply company reported: In March 2020, staff (unclear department) who were repairing the crosswalk on XX Road on the west side of Junwangtun Village, XX Street, XX District damaged the cable manhole cover of the power supply company during construction work. They requested verification of this and a call back to resolve the issue. We hope that the relevant departments will implement it. Please handle it and reply to the caller."
[0108] Although the "Junwangtun Community", "Junwangtun Community" and "Junwangtun Village" that appear in the above three hotline texts are different, they can still be considered synonyms based on historical evolution, informal usage and other reasons, and actually refer to the same geographical entity. If they are simply classified as different geographical entities, it will directly affect the allocation results, resulting in reduced allocation accuracy, thereby affecting processing efficiency.
[0109] Because the distribution of hotline texts is highly correlated with the region, poor matching will directly affect the distribution accuracy and processing efficiency, so regional named entities must be specially processed. For the "Junwangtun Community", "Junwangtun Community", and "Junwangtun Village" that appear in the above hotline texts, since they actually refer to the same regional entity, the synonym forest is constructed to resolve ambiguity and perform named entity recognition.
[0110] 3. Build a knowledge graph
[0111] First, a keyword table is constructed. The keyword table is manually created based on business experience, or is created based on each subject feature word table, and a processing rule is created for each keyword. The processing rule is a regular expression, or an execution rule represented by a program code.
[0112] The knowledge graph in the present disclosure is described in the form of a triple <entity A, relationship R, entity B>.
[0113] For example, a hotline text: "As of June 19, every day after 18:30, there are many vendors on both sides of the road from XXX Bridge in Zhuzhuang Village, XX Town, XX District to the airport eastward, which seriously affects traffic. We hope to deal with it as soon as possible. Please handle it." For the text, the knowledge graph construction process is as follows:
[0114] After topic pre-classification and named entity recognition, the topic pre-classification result of the text is the fourth category in Table 1. Then, remove stop words and retain the following participles as much as possible: as of, June 19, 2021, every day, 18:30, XX District, XX Town, Zhuzhuang Village, XXX Bridge, Airport Road, Road, Both Sides, Vendors, Occupy the Road, Operate, Influence, Pass. Excluding regional words such as institutions and addresses, the keyword table corresponding to the knowledge graph rules is retrieved, and the matching result "Occupy the Road" is used as the feature word of the text to match a corresponding rule of "XX Occupy the Road XX". The rule processing flow includes: storing a record in the knowledge graph, storing the subordinate relationship of "XX District XX Town Zhuzhuang Village XXX Bridge" in the knowledge graph, and storing "XX District XX Town Zhuzhuang Village XXX Bridge" as an attribute of the record.
[0115] The above rules for constructing the knowledge graph use predefined rules, which are defined when the program is initialized. The relationship entity communication flow chart is as follows: Figure 4 After the hotline text data is input, the text data is segmented and then classified. The word segmentation tool gives the part of speech corresponding to the word, and the result after word classification is used to determine whether it is a regional word or a non-regional word. If it is a regional word, the superordinate and subordinate relationship is directly obtained; if it is a non-regional word, the rules are queried to construct the entity relationship.
[0116] Specifically, before extracting the relationships required by the knowledge graph, the word segmentation results of the appeal text need to be further processed. Taking the occupation of the road in road management matters as an example, "occupy the road" is an important keyword, but in the approximately 30,000 sampled appeal texts in a certain hotline text, the proportion of appeal texts containing the keyword "occupy the road" is 1.7%. This type of appeal text contains a large number of high-frequency words such as "road" and "pavement", which makes "occupy the road" rank low. If it is not processed, the role of the keyword "occupy the road" cannot be reflected, thereby affecting the classification accuracy. Therefore, it needs to be further processed and subdivided into the fourth category of topics. After excluding the high-frequency words of the topic, it is easier to identify the pattern. The rule retrieval flow chart is as follows Figure 5 As shown in the figure, after the hotline text data is input, the text data is segmented and the corresponding part of speech is obtained. Before rule retrieval and matching, the keywords are filtered according to the high-frequency word list under each topic, and further rule detection and matching processing are determined according to the trigger word list, so as to obtain matching results that conform to the actual situation, just as the "occupying the road" in the above example is subdivided into the fourth category of topics. This construction of the knowledge graph can solve the problem of inaccurate matching, thereby improving the efficiency and accuracy of allocation.
[0117] The following is an explanation of the construction process using a hotline text: "As of June 19, 2021, after 18:30 every day, there are many vendors occupying the road on both sides of the road from XXX Bridge in Zhuzhuang Village, XX Town, XX District to the airport section to the east, which seriously affects traffic. We hope to deal with it as soon as possible. Please handle it."
[0118] First, two types of entity relationships are extracted, one of which is business relationship and the other is the relationship between regional words and their hyponyms. Table 2 lists a rule template for entity relationships. Figure 6 An example knowledge graph of regional hyponymy is described.
[0119] Table 2 Example of rule template for entity relationship
[0120]
[0121] Initialize pre-defined and refine rules for trigger words of key business relationships. Take "occupying the road" as an example, and further subdivide it into multiple small rules, such as "occupying the road for business", "occupying the road for operation", "occupying the road for unloading", "occupying the road for selling", "vendors occupying the road", "occupying the road for drying", "occupying the road for drying grain", etc., which are all key business relationship trigger words, and situations like "container occupying the road" are treated as general situations. The rule examples are as follows: Figure 7 As shown in Figure 2. Based on the predefined rules, other entity words are further extracted from the hotline text with the keywords specified by the rules as the center. The entity relationship of its knowledge graph is shown in Figure 2. Figure 8 As shown in the figure, we can see that two entities "vendor" and "business" are extracted from the text, and the relationship is defined as "occupy the road", which has an attribute "XX District XX Town Zhuzhuang Village XXX Bridge".
[0122] If the hotline text is found to not meet any of the above "rules" after processing, an exception will be thrown, left to the personnel to handle manually, and an exception report will be generated. These hotline texts may be submitted by someone maliciously.
[0123] 4. Department Matrix and Virtual Functional Departments
[0124] The functional departments or functional units that handle hotline requests usually have a certain level of complexity and are divided into key and unpopular ones. There are many similar scenarios in real life. For example, if a new product is launched at a certain time, then obviously the related requests will increase significantly. If there are many subdivided product lines, the data will be unbalanced. Therefore, it is necessary to handle it appropriately. According to the business attributes, virtual functional units can be constructed to merge smaller units together, or several small departments can be merged to facilitate technical processing of later data processing, or large departments can be split into several small departments.
[0125] by Figure 1Take the government departments / institutions involved in the dispatch of a municipal hotline in a certain place as an example. There are many functional departments / institutions involved in hotline text processing in this region, and the unit level of some cases reaches 7 layers. However, it can be seen that there are obvious regional subordinate characteristics. Under the formal administrative region, similar departments and institutions are basically set up to handle corresponding hotline cases, which is also in line with the actual situation.
[0126] Therefore, the present disclosure regards the functional departments / institutions involved as a mapping of geographical information and functional information, and establishes a specific mapping relationship based on the correlation between the actual hotline text and the specific functional department, and forms an initialization program code. The mapping relationship is adjusted in real time during subsequent classification use. For example, each functional department processes the assigned hotline text and marks the hotline text that does not belong to the department. For the marked hotline text, the present disclosure processes it in the form of returning and reallocating it until the allocation is successful and the hotline text is received by a functional department. A mapping relationship is established between the hotline text and the functional department that is finally received, and the previous unmatched mapping relationship is released, and the mapping relationship matrix is updated in real time.
[0127] org:=f(loc,func);
[0128] Among them, org represents the virtual functional department, loc represents the geographical information, func represents the functional information, f is the mapping from the geographical information loc and the functional information func to the virtual functional department org, and := is the assignment operation.
[0129] In actual situations, there is overlap in regional information, such as "Haibin New Village", "Haibin Second Village", and "Haibin Third Village" in a certain area. These communities are closely connected. Even if the hotline text flows to one of the villages and the distribution is incorrect, the village that receives the case can forward it correctly. Therefore, in order to effectively classify the labels, we can simply create an organization "Haibin New Village Second Village Third Village" as a virtual functional department.
[0130] Another typical situation, such as the "enrollment qualifications" of children of school age, is resolved through coordination between the "Education Bureau" and the "Street Office". The specific transfer can start from the Education Bureau or the Street Office without affecting the actual transfer process. Therefore, a virtual "XX District School-Age Children's Enrollment" agency is set up as a virtual functional department to facilitate classification processing.
[0131] The virtual functional department used in the present disclosure is more conducive to labeling hotline texts and effectively classifying them.
[0132] Table 3 Examples of virtual functional departments / institutions
[0133]
[0134] In Table 3, when the functional information func is "urban appearance and environment" and the geographical information loc is "XX Town, High-tech Zone", the mapping org is "Comprehensive law enforcement in XX Town, High-tech Zone".
[0135] Table 4 List of some functional information
[0136]
[0137]
[0138] Table 4 lists some functional information of a certain place, and it can be seen that most of the functions are covered.
[0139] Functional information is the intermediate state of the hotline text classification process. In the specific operation process, we output the functional information func state of a certain place, number it, and give an explainable description.
[0140] Processing hotline texts with knowledge graphs and rule processes is a process of classification label preprocessing. Obviously, the rules are applicable to texts with high similarity in words and word order. The subdivision rules mainly involve two types of demands. One is people's livelihood properties, and the process processing is assigned to the corresponding community property or neighborhood committee; the other is certain specific functional agencies, which have clear division of labor at the department level. Demands that cannot be dealt with during processing are assigned to the highest administrative basic comprehensive law enforcement office.
[0141] By studying a large number of hotline texts, we can see that many hotline cases are related to community property management, such as trivial matters in daily life such as elevator maintenance, so they should be assigned to the property management under the jurisdiction of the corresponding community. When handling specific matters, a virtual functional agency "XX District Property Management" is set up.
[0142] 5. Model training
[0143] The processed appeal text and the extracted entity relationships are encoded as input, and the encoded virtual functional department information is used as output to train the model, that is, the BERT network is used to train the appropriate model parameters. The model training process is as follows: Figure 2 As shown. To encode the virtual functional department information, it is necessary to combine it with specific issues, such as the hotline appeal text of a certain place. After comprehensive consideration, a 24-dimensional vector is used to identify it, and the encoding form is One-Hot Encoding, that is, only the position corresponding to a certain department is 1, and the other bits are 0.
[0144] The model structure diagram is as follows Fig.10As shown. The model framework of Bidirectional Encoder Representations from Transformers (BERT) is as follows: A key point of the BERT model framework is "token embedding", where "token" refers to a single word in a text sequence, and "token embedding" actually refers to mapping the segmented words obtained after text segmentation to a multidimensional geometric space.
[0145] The input is divided into two parts: the appeal text and the relationship stored in the knowledge graph. The following uses the text processing of a local hotline as an example to illustrate the embedding method. The three layers of information are: word vector, segment information, and location information. Different parts are processed differently.
[0146] After the appeal text is segmented, only stop words are removed and the order of the remaining words is retained. For word segmentation mapping, pre-trained Chinese word vectors available online are used, such as the 300-dimensional Chinese word vector pre-trained by Sogou News.
[0147] The entity relationships stored in the knowledge graph are submitted to the BERT network input in the order of “[relationship type number, entity A, relationship R, entity B, attribute]”.
[0148] The virtual functional department information corresponding to the hotline text is encoded using a one-hot code, and the input sequence is classified into multiple labels. Pi is the probability value of the i-th position in the output being predicted as the i-th virtual functional department, which is expressed as follows:
[0149] p i =σ(W x+b)
[0150] Where W is the training weight, x is the encoded input sequence, b is the bias term, and σ is the mapping.
[0151] Use the following objective loss function Loss:
[0152]
[0153] Where n is the length of the input sequence; y i is the known correct classification label, p i is the probability value of the i-th position in the output being predicted to be the i-th virtual functional department.
[0154] The precision rate P, recall rate R and comprehensive index F1 value are used as indicators to judge the performance of the model. Select a suitable test set from the sample population for indicator testing; the higher the score of the three evaluation indicators, the better the precision rate, recall rate and comprehensive performance of the model; the calculation formula of the evaluation indicators is as follows:
[0155]
[0156]
[0157] Among them, Nr is the number of samples predicted correctly; Nc is the total number of predicted samples; N is the total number of samples in the test set; the comprehensive index F1 is calculated by P and R.
[0158] The macro-average F1 value (Macro-F1) is the arithmetic mean of the F1 values of each category. This indicator treats all categories equally without considering the importance of different categories. The weighted F1 value (Weighted-F1) uses the number of samples in each category as the weight and calculates the average value of the weighted F1 value.
[0159] The training results are as follows. The embedding vector space is set to 300 dimensions, and the training results of setting the truncation length of the hotline text to 130 are shown in Table 5. After improvement, the truncation length of the hotline text is set to 80, and then the encoding of the entity relationship is added, and the total length is still controlled to 130. The training results are shown in Table 6.
[0160] Table 5 Performance of direct training using text word vectors (%)
[0161]
[0162] Table 6 Improved performance (%)
[0163]
[0164] Among them, BERT (Bidirectional Encoder Representation from Transformers) is a powerful basic model that can capture deep semantic information in text through pre-training and fine-tuning. BERT-CNN (Bidirectional Encoder Representation from Transformers-Convolutional Neural Networks) is a model that combines BERT with convolutional neural networks (CNN). CNN is usually used to further extract local features and patterns. This combination can usually enhance the model's ability to recognize specific patterns and structures in text.
[0165] From the results, we can see that the accuracy is improved by 2.93-3.36% after improvement, and the macro-average F1 value and weighted F1 value of multi-classification evaluation indicators are significantly improved, indicating that the improved method of this scheme can help improve small subcategories with small sample sizes, and the knowledge learned in other categories can be effectively transferred.
[0166] It can be seen that the improved method of this scheme can effectively deal with the practical problems of numerous subcategories, unbalanced data, non-standard texts, and complex classifications in hotline cases. It is conducive to the automatic flow of hotline cases, which can reduce the burden on personnel and improve work efficiency.
[0167] Any process or method description in the flowchart of the present disclosure or described in other ways herein can be understood as a module, fragment or part of a code representing one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes other implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the technical field to which the embodiments of the present disclosure belong. The processor performs the various methods and processes described above. For example, the method implementation in the present disclosure can be implemented as a software program, which is tangibly contained in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via a memory and / or a communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform one of the above methods in any other appropriate manner (e.g., by means of firmware).
[0168] The logic and / or steps represented in the flowchart or otherwise described herein may be embodied in any readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in combination with such instruction execution systems, apparatuses, or devices.
[0169] For the purposes of this specification, a "readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples of readable storage media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, a device on the Internet, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting or, if necessary, processing in another suitable manner, and then stored in a memory.
[0170] It should be understood that the various parts of the present disclosure can be implemented with hardware, software or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented with software stored in a memory and executed by a suitable instruction execution system. For example, if implemented with hardware, as in another embodiment, it can be implemented with any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0171] A person of ordinary skill in the art of the present disclosure may understand that all or part of the steps of implementing the above-mentioned implementation method may be completed by instructing related hardware through a program, and the program may be stored in a readable storage medium, which, when executed, includes one or a combination of the steps of the implementation method.
[0172] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.
[0173] The present disclosure also provides an electronic device, including: a memory, the memory storing execution instructions; and a processor or other hardware module, the processor or other hardware module executes the execution instructions stored in the memory, so that the processor or other hardware module executes the above method.
[0174] The present disclosure also provides a readable storage medium, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the above method.
[0175] In summary, the method disclosed in the present invention has the following advantages:
[0176] 1. Common business scenarios are mostly characterized by an imbalance in the amount of data between categories. The method proposed in this disclosure can effectively classify them.
[0177] 2. For texts with similar topics, further extracting keywords and implicit patterns can improve the accuracy of sub-classification.
[0178] 3. It can effectively improve the efficiency of hotline case handling and reduce repetitive work of staff.
[0179] 4. It can be used in the after-sales service process of some large merchants to improve the matching degree between departments and problems, improve work processes, and improve service quality.
[0180] It can be seen that the present disclosure has achieved good results in actual use, and can realize timely, effective and accurate allocation of hot issues involved in the hotline case text data information to the corresponding social function management departments, and realize accurate and refined allocation of these special text data to social function management departments.
[0181] So far, the technical solutions of the present disclosure have been described in conjunction with the preferred implementation methods shown in the accompanying drawings. However, those skilled in the art should understand that the above implementations are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. The protection scope of the present disclosure is obviously not limited to these specific implementations. Without departing from the principles of the present disclosure, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions are still within the scope of the present disclosure.
Claims
1. A multidimensional text classification method based on topic pre-classification and knowledge graph, characterized in that: The steps include: (1) Data collection: collecting the first hotline text data, performing text segmentation, and extracting the first keyword; (2) Word classification: Classify the first keyword into regional words and non-regional words. If it is a regional word, directly obtain the superordinate and subordinate relationship. (3) Topic pre-classification: pre-define multiple event categories, initialize the effect of the first keyword on the semantics of the event text and attach corresponding weights to obtain pre-defined rules; perform topic pre-classification according to the pre-defined rules, and directly generate coding function information if it is a regional word; (4) Named entity recognition: Named entity recognition is performed by building a synonym forest; (5) Constructing a knowledge graph: Using the triple <entity A, relationship R, entity B> to describe the knowledge graph using the predefined rules. For non-regional words, query the predefined rules, construct entity relationships, and obtain a knowledge graph. (6) Constructing a department matrix and virtual functional departments: mapping the functional departments or institutions involved as geographical information and functional information, and establishing a specific mapping relationship based on the relevance between the first hotline text and the functional departments or institutions; (7) Model training: The processed appeal text and extracted entity relationships are encoded as input, and the encoded virtual functional department information is used as output. The BERT network is used to train the model to obtain a usable model. (8) Model output: output the available model.
2. According to claim 1, a multidimensional text classification method based on topic pre-classification and knowledge graph is characterized in that: The following steps are also included: When in use, the second hotline text data is collected, the text is segmented, and the second keyword is extracted; Classifying the second keyword into regional words and non-regional words. If the second keyword is a regional word, directly obtaining the superordinate and subordinate relationship. Pre-classify the topics according to predefined rules, and query the knowledge graph based on the topics obtained by pre-classification; After encoding the processed appeal text and the extracted entity relationships, they are input into the available model to obtain the functional department information.
3. A multidimensional text classification method based on topic pre-classification and knowledge graph according to claim 1, characterized in that: Adjust the mapping relationship in real time: each functional department processes the assigned hotline text, marks the hotline text that does not belong to the department, returns the marked hotline text and reallocates it until the hotline text is received by another functional department; establishes a mapping relationship between the hotline text and the functional department that finally receives it, and at the same time releases the previous unmatched mapping relationship, and updates the mapping relationship matrix in real time.
4. A multidimensional text classification method based on topic pre-classification and knowledge graph according to claim 1 or 2, characterized in that: The first hotline text and the second hotline text data are identified by a 24-dimensional vector, and the encoding form is a one-hot code.
5. The multidimensional text classification method based on topic pre-classification and knowledge graph according to claim 1 is characterized in that: The entity relationships stored in the knowledge graph are submitted to the BERT network input in the order of "[relationship type number, entity A, relationship R, entity B, attribute]".
6. A multidimensional text classification method based on topic pre-classification and knowledge graph according to claim 1, characterized in that: The virtual functional department information corresponding to the hotline text is encoded using a one-hot code, and the input sequence is classified into multiple labels. Pi is the probability value of the i-th position in the output being predicted as the i-th virtual functional department, which is expressed as follows: p i =σ(W x+b) Where W is the training weight, x is the encoded input sequence, b is the bias term, and σ is the mapping.
7. The multidimensional text classification method based on topic pre-classification and knowledge graph according to claim 1 is characterized in that: Use the following objective loss function Loss: Where n is the length of the input sequence; y i is the known correct classification label, p i is the probability value of the i-th position in the output being predicted to be the i-th virtual functional department.
8. A multidimensional text classification system based on topic pre-classification and knowledge graph, characterized in that: include: (1) Data collection unit: collects the first hotline text data, performs text segmentation, and extracts the first keyword; (2) a word classification unit: classifying the first keyword into regional words and non-regional words. If the first keyword is a regional word, directly obtaining the superordinate and subordinate relationship; (3) Theme pre-classification unit: pre-define multiple event categories, initialize the effect of the first keyword on the semantics of the event text and attach corresponding weights to obtain pre-defined rules; perform theme pre-classification according to the pre-defined rules, and directly generate coding function information if it is a regional word; (4) Named Entity Recognition Unit: Named entity recognition is performed by constructing a synonym forest; (5) Constructing a knowledge graph unit: Using the triple <entity A, relationship R, entity B> to describe the knowledge graph according to the predefined rules, for non-regional words, query the predefined rules, construct entity relationships, and obtain a knowledge graph; (6) Constructing a department matrix and a virtual functional department unit: mapping the functional departments or institutions involved as geographical information and functional information, and establishing a specific mapping relationship based on the relevance between the first hotline text and the functional departments or institutions; (7) Model training unit: The processed appeal text and extracted entity relationships are encoded as input, and the encoded virtual functional department information is used as output. The BERT network is used to train the model to obtain a usable model. (8) Model output unit: outputs the available model.
9. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory so that the processor executes the method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Short text classification method fusing knowledge graph and topic model
CN114491062A
Intelligent hotline work order dispatching method based on knowledge graph
CN116108169A
Document processing method and system based on natural language and knowledge graph
CN116501875A
Method for determining text topic, and electronic device
US20230122093A1
