A whistle single classification method
By preprocessing the address descriptions of the sentry slips and extracting place names, combined with optimized processing of the problem descriptions, and using word embedding vectors and long short-term memory neural network models to automatically determine the handling department, the problems of low efficiency and delay in sentry slip classification are solved, and efficient and accurate automatic classification is achieved.
Patent Information
- Application Number
- CN202310615444.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-05-29
AI Technical Summary
The current manual sorting of sentry slips suffers from low efficiency, delays in sorting, and high time and money costs in training sentry slip personnel.
By preprocessing and mapping the address descriptions on the sentry list, the place names are extracted and community information is determined. Combined with the problem description, the information is spliced and optimized, and the handling department is automatically determined using word embedding vectors and long short-term memory neural network models.
It achieves efficient and accurate classification of sentry slips, solves the problem of untimely classification, reduces the need for manual operation, and lowers the time and money costs of training sentry slip operators.
Smart Images

Figure CN116521881B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of natural language processing, and in particular to a whistle order classification method. BACKGROUND
[0002] In recent years, with the continuous development of society, people are increasingly yearning for a better life. At the same time, the problems encountered by people in life are increasingly prominent. In order to timely handle the problems, a group of grid members has emerged. The grid members upload the problems in the form of whistle orders to a whistle order system. A whistle order is composed of an address description and a problem description. The address description of the whistle order is the detailed address of the problem, and the problem description of the whistle order is the specific problem reflected by the whistle order. In the whistle order system, whistle order clerks classify the whistle orders. The whistle order clerks determine the location of the problem according to the address description and classify the whistle orders to the relevant handling departments in cooperation with the problem description. The handling departments solve the problems reflected in the whistle orders. Therefore, rapid and accurate classification of whistle orders has an important influence on the handling of problems.
[0003] The prior art classifies whistle orders by relying on whistle order clerks to classify the whistle orders. The whistle order clerks analyze the address and problem provided by the whistle order and classify the whistle order according to the experience of relevant whistle order classification.
[0004] A large number of whistle orders enter the whistle order system every day, and the whistle order clerks need to handle a large number of whistle orders every day. The manual method is time-consuming and labor-intensive. The grid members are an offline group and can upload whistle orders to the whistle order system at any time. The whistle order clerks are not online 24 hours a day to classify whistle orders, so there is a risk of whistle order delay. The whistle order clerks rely on experience to classify whistle orders, and the time and money cost of training whistle order clerks is high. SUMMARY
[0005] The present application provides a whistle order classification method, which can solve the problems of low efficiency of manual classification of whistle orders, delay of whistle order classification, and high time and money cost of training whistle order clerks.
[0006] The technical solution of the present application is a whistle order classification method, which comprises:
[0007] S1: determining the address description and the problem description of the whistle order;
[0008] The address description is preprocessed and mapped to obtain a first word embedding vector corresponding to the address description;
[0009] S2: performing place name extraction processing on the first word embedding vector to obtain a place name corresponding to the address description;
[0010] According to the place name corresponding to the address description, the community information corresponding to the address description is determined;
[0011] S3: Splicing processing is performed on community information and problem description, and description information corresponding to the whistle order is obtained;
[0012] Mapping processing is performed on the description information, and a second word embedding vector corresponding to the description information is obtained;
[0013] S4: Optimization processing is performed on the second word embedding vector, and an enhanced word embedding vector corresponding to the second word embedding vector is obtained;
[0014] S5: Determination processing is performed on the enhanced word embedding vector, and a treatment department corresponding to the enhanced word embedding vector is obtained.
[0015] Optionally, the step S1 comprises:
[0016] S11: Determine the address description and the problem description of the whistle order;
[0017] S12: Perform word segmentation processing on the address description by jieba word segmentation, and correspondingly obtain a plurality of segmented words;
[0018] S13: Perform stop word removal processing on the segmented words, and correspondingly obtain a plurality of words;
[0019] S14: Perform mapping processing on the plurality of words by a continuous bag-of-words model, and obtain a plurality of first word embedding vectors corresponding to the address description.
[0020] Optionally, the step S2 comprises:
[0021] S21: Based on a bidirectional long short-term memory neural network structure, a sequence extraction model taking the first word embedding vector as an input item and taking an input observation sequence as an output item is trained;
[0022] The structure of the sequence extraction model is as follows:
[0023] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0024] i t =σ(W i ·[h t-1 ,x t ]+b i );
[0025]
[0026]
[0027] o t =σ(Wo ·[h t-1 ,x t ]+b o );
[0028] h t =o t tanh(C t );
[0029] In the formula, f t Indicates the forget gate; i t Indicates the input threshold;
[0030] Indicates the neuron's state at the previous moment; C t Indicates the state of a neuron;
[0031] o t Indicates the output threshold; h t Indicates the output of the current cell; h t-1 This indicates the output of the unit at the previous time step;
[0032] S22: Input the first word embedding vector into the sequence extraction model to obtain the input observation sequence corresponding to the first word embedding vector;
[0033] S23: Based on conditional random fields, a place name extraction model is trained that takes the input observation sequence as input and place names as output.
[0034] S24: Input the input observation sequence corresponding to the first word embedding vector into the place name extraction model to obtain the place name corresponding to the address description;
[0035] S25: Determine the place names of all communities and calculate the Lewinstein distance between the place names corresponding to the address descriptions and the place names of all communities respectively;
[0036] Based on the Lewinstein distance, determine the regional information corresponding to the address description.
[0037] Optionally, the loss function of the place name extraction model during training is as follows:
[0038]
[0039]
[0040] In the formula, represents the output labeled sequence; x represents the input observation sequence, and y represents the value of the input observation sequence.
[0041] This indicates that y is in the output labeled sequence y. i The output score; This indicates that y is in the output labeled sequence y. i The transition score.
[0042] Optionally, step S3 includes:
[0043] S31: Concatenate the string of community information and the string of problem description to obtain the description information corresponding to the sentry list;
[0044] S32: Based on the basic structure of n-gram, a vector transformation model is trained that takes descriptive information as input and the second word embedding vector as output.
[0045] S33: Input the description information corresponding to the sentry into the vector transformation model to obtain the second word embedding vector corresponding to the description information.
[0046] Optionally, the structure of the vector transformation model is as follows:
[0047]
[0048]
[0049] In the formula, S = {w1, w2, ..., wn} represents a sentence;
[0050] P(w i |w i-n-1 ,…,w i-1 ) represents the conditional probability of each word appearing given all the words preceding it;
[0051] Let P(S) represent the probability of the current sentence appearing;
[0052] Furthermore, the loss function of the vector transformation model during the training process is as follows:
[0053]
[0054] Optionally, step S4 includes:
[0055] S41: Determine the set of embedding vector update operations I = {i1,…,i...}, which includes several update operations. n};
[0056] Based on the set of embedding vector update operations I = {i1,…,i...} n}, select a second word embedding vector, for the selected second word embedding vector x1={w0,…,w s Perform several update operations to obtain several updated embedding vectors corresponding to the selected second word embedding vector.
[0057] S42: selecting a second word embedding vector again, repeating steps S41-S42 to obtain a plurality of updated embedding vectors corresponding to each second word embedding vector;
[0058] S43: determining a plurality of hyperparameters W1, …, W n ;
[0059] Based on the hyperparameters W1, …, W n , selecting a second word embedding vector x1 and a second word embedding vector x2, performing weight summation processing on a plurality of updated embedding vectors corresponding to the selected second word embedding vectors x1 and x2 respectively to obtain weight embedding vectors and
[0060] S44: determining a hyperparameter λ according to the Beta distribution;
[0061] Based on the hyperparameter λ, performing weight summation processing on the second word embedding vectors x1 and x2 and the weight embedding vectors x'1 and x'2, respectively obtaining enhanced word embedding vectors
[0062] The formula for calculating the enhanced word embedding vectors is as follows:
[0063]
[0064]
[0065] wherein, and denote the enhanced word embedding vectors corresponding to the second word embedding vectors x1 and x2;
[0066] denote the corresponding labels, denote the corresponding labels;
[0067] S45: repeating the steps S43-S44 to determine a plurality of enhanced word embedding vectors.
[0068] Optionally, the step S5 comprises:
[0069] S51: training a department extraction model taking the enhanced word embedding vectors as input items and taking the treatment departments as output items based on the long short-term memory neural network structure;
[0070] S52: inputting the enhanced word embedding vectors corresponding to the second word embedding vectors into the department extraction model to obtain the treatment departments corresponding to the enhanced word embedding vectors.
[0071] Beneficial effects:
[0072] This application first processes the address description to obtain the place name in the dispatch list, then determines the community information of the place name, and can also perform mapping and optimization processing on the description information obtained by splicing the community information and the problem description to obtain an enhanced word embedding vector. Then, the handling department is determined through the word embedding vector. The entire process does not require manual classification, achieving efficient and accurate classification of dispatch lists, solving the problem of untimely classification of dispatch lists, and helping dispatchers to process dispatch lists more quickly.
[0073] In summary, this application can solve the problems of low efficiency, delays in sorting sentry slips, and high time and money costs in training sentry slip personnel in existing manual sorting methods. Attached Figure Description
[0074] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a flowchart illustrating the sentry classification method in an embodiment of this application;
[0076] Figure 2 This is a schematic diagram of data flow in the embodiments of this application. Detailed Implementation
[0077] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0078] This application provides a sentry list classification method, such as Figure 1 and Figure 2 As shown, Figure 1 This is a flowchart illustrating the sentry classification method in an embodiment of this application. Figure 2 This is a schematic diagram of data flow in an embodiment of this application. The method includes:
[0079] S1: Determine the address and problem description of the dispatch slip;
[0080] Preprocessing and mapping are performed on the address description to obtain the first word embedding vector corresponding to the address description.
[0081] Step S1 includes:
[0082] S11: Determine the address description and the problem description of the whistle.
[0083] Specifically, the whistle is composed of an address description and a problem description, the address description is a detailed occurrence place of the whistle, such as a certain community, a certain street, and a certain supermarket, and the problem description is a detailed problem description of the whistle, such as garbage accumulation and a tree beside the street falling.
[0084] S12: Perform word segmentation processing on the address description by using jieba word segmentation, and correspondingly obtain a plurality of segmented words.
[0085] Specifically, the address description of the whistle is segmented by using jieba word segmentation, and jieba word segmentation is performed in full mode to obtain a plurality of words. The words after segmentation are processed by removing stop words, and the stop word table used is the Harbin Institute of Technology stop word table.
[0086] S13: Perform stop word removal processing on the segmented words, and correspondingly obtain a plurality of words.
[0087] S14: Perform mapping processing on the plurality of words by using a continuous bag-of-words model, and obtain a plurality of first word embedding vectors corresponding to the address description.
[0088] Specifically, each word is input, and the continuous bag-of-words model is used to map the word into a word embedding vector. The continuous bag-of-words model predicts the context by using a center word, and then forms a first word embedding vector by using the parameter weight in the prediction process.
[0089] S2: Perform place name extraction processing on the first word embedding vector, and obtain a place name corresponding to the address description.
[0090] According to the place name corresponding to the address description, community information corresponding to the address description is determined.
[0091] The step S2 includes:
[0092] S21: Based on a bidirectional long short-term memory neural network structure, a sequence extraction model taking the first word embedding vector as an input item and taking an input observation sequence as an output item is trained.
[0093] The structure of the sequence extraction model is as follows:
[0094] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0095] i t =σ(W i ·[h t-1 ,xt ]+b i );
[0096]
[0097]
[0098] o t =σ(W o ·[h t-1 ,x t ]+b o );
[0099] h t =o t tanh(C t );
[0100] In the formula, f t Indicates the forget gate; i t Indicates the input threshold;
[0101] Indicates the neuron's state at the previous moment; C t Indicates the state of a neuron;
[0102] o t Indicates the output threshold; h t Indicates the output of the current cell; h t-1 This indicates the output of the unit at the previous time step;
[0103] S22: Input the first word embedding vector into the sequence extraction model to obtain the input observation sequence corresponding to the first word embedding vector.
[0104] Specifically, the input of a long short-term memory neural network is determined by the input at a certain moment and several previous inputs, while the input of a bidirectional long short-term memory neural network is determined by several previous inputs and several subsequent inputs at a certain moment, resulting in more accurate prediction results.
[0105] S23: Based on conditional random fields, a place name extraction model is trained that takes the input observation sequence as input and place names as output.
[0106] The loss function for the place name extraction model during training is shown below:
[0107]
[0108]
[0109] In the formula, represents the output labeled sequence; x represents the input observation sequence, and y represents the value of the input observation sequence.
[0110] denotes the output score of the output label sequence y i . denotes the transition score of the output label sequence y i .
[0111] Specifically, the model is trained based on maximizing the log-likelihood function, is the score of the entire sequence:
[0112]
[0113] After the training is completed, the output score of the conditional random field is calculated, the label tag of each word is predicted through the model, and the place name in the address description is obtained based on the label tag.
[0114] S24: inputting the input observation sequence corresponding to the first word embedding vector into the place name extraction model to obtain the place name corresponding to the address description.
[0115] Specifically, the output of the bidirectional long short-term memory neural network is taken as the input of the conditional random field, the order dependence information between the labels is learned, the place name of the address description is obtained, the conditional random field can correct the output of the bidirectional long short-term memory neural network by learning the transition probability between the labels in the data set, so as to ensure the rationality of the place name prediction, and the bidirectional long short-term memory neural network learns the context information of the sequence, and the conditional random field learns the dependence information between the labels.
[0116] S25: determining the place names of all communities and respectively calculating the Levenshtein distance between the place name corresponding to the address description and the place names of all communities.
[0117] Based on the Levenshtein distance, the district information corresponding to the address description is determined.
[0118] Specifically, the Levenshtein distance between the place name and each place name in each community information is calculated, and for two strings A and B, the formula for calculating the Levenshtein distance between the first i characters of string A and the first j characters of string B is as follows:
[0119]
[0120]
[0121] Based on the Levenshtein distance, the most matched community information is obtained.
[0122] By extracting the community information in the address description, a large amount of invalid information in the address description is removed, the core community information is retained, and the accuracy of the model in predicting the treatment department is effectively improved.
[0123] S3: Combine community information and problem descriptions to obtain the corresponding descriptive information for the sentry post;
[0124] The descriptive information is mapped to obtain the second word embedding vector corresponding to the descriptive information.
[0125] Step S3 includes:
[0126] S31: Concatenate the string of community information and the string of problem description to obtain the description information corresponding to the sentry list.
[0127] Specifically, the community information and the problem description of the sentry list are concatenated to obtain the description information of the sentry list. The concatenation method is to add strings together, directly adding the problem description of the sentry list after the community information.
[0128] S32: Based on the basic structure of n-gram, a vector transformation model is trained that takes descriptive information as input and the second word embedding vector as output.
[0129] The structure of the vector transformation model is shown below:
[0130]
[0131]
[0132] In the formula, S = {w1, w2, ..., wn} represents a sentence;
[0133] P(w i |w i-n-1 ,…,w i-1 ) represents the conditional probability of each word appearing given all the words preceding it;
[0134] Let P(S) represent the probability of the current sentence appearing;
[0135] Furthermore, the loss function of the vector transformation model during training is shown below:
[0136]
[0137] S33: Input the description information corresponding to the sentry into the vector transformation model to obtain the second word embedding vector corresponding to the description information.
[0138] S4: Optimize the second word embedding vector to obtain the enhanced word embedding vector corresponding to the second word embedding vector.
[0139] Step S4 includes:
[0140] S41: Determine the set of embedding vector update operations I = {i1,…,i...}, which includes several update operations.n};
[0141] Based on the set of embedding vector update operations I = {i1,…,i...} n}, select a second word embedding vector, for the selected second word embedding vector x1={w0,…,w s Perform several update operations to obtain several updated embedding vectors corresponding to the selected second word embedding vector.
[0142] S42: Select another second word embedding vector and repeat steps S41 to S42 to obtain several updated embedding vectors corresponding to each second word embedding vector.
[0143] Specifically, a second word embedding vector x1 = {w0,…,w} is selected. s}, randomly select from the operation set I = {i1,…,i n Select an operation i m m is a random value between 1 and n, and the operation set I = {i1, ..., i} n The process consists of three operations: back-translation, synonym-replacement, and Gaussian noise perturbation. The second word embedding vector x1 undergoes i... m The update operation yields a new updated embedding vector.
[0144] Repeat S41 n times to obtain n updated embedding vectors for the second word embedding vector.
[0145] S43: Based on the Dirichlet distribution, determine several hyperparameters W1,…,W n ;
[0146] Based on hyperparameters W1,…,W n Select a second word embedding vector x1 and a second word embedding vector x2. Perform weighted summation on several updated embedding vectors corresponding to the selected second word embedding vectors x1 and x2 respectively to obtain weighted embedding vectors corresponding to the selected second word embedding vectors x1 and x2 respectively. and
[0147] Specifically, a series of hyperparameters (W1,…,W) are selected from the Dirichlet distribution. n ), to obtain the weight embedding vector
[0148] A second word embedding vector x2 is selected, and a corresponding weight embedding vector x'2 is obtained.
[0149] S44: According to the beta distribution, the hyperparameter λ is determined.
[0150] Based on the hyperparameter λ, weight summation processing is performed on the second word embedding vectors x1 and x2 and the weight embedding vectors x'1 and x'2, and corresponding enhanced word embedding vectors are obtained.
[0151] The formula for calculating the enhanced word embedding vector is as follows:
[0152]
[0153]
[0154] In the formula, and denote the enhanced word embedding vectors corresponding to the second word embedding vectors x1 and x2.
[0155] denote the corresponding label, denote the corresponding label.
[0156] Specifically, the hyperparameter λ is selected from the beta distribution.
[0157] S45: Repeat the steps S43-S44, and corresponding enhanced word embedding vectors are determined.
[0158] Specifically, the vectors input into the long short-term memory neural network are optimized by the enhanced word embedding vectors, effectively improving the accuracy of the long short-term neural network in predicting the treatment department.
[0159] S5: The enhanced word embedding vectors are determined, and the treatment department corresponding to the enhanced word embedding vectors is obtained.
[0160] Wherein, the step S5 includes:
[0161] S51: Based on the long short-term memory neural network structure, a department extraction model is trained, which takes the enhanced word embedding vectors as input and takes the treatment department as output.
[0162] S52: The enhanced word embedding vectors corresponding to the second word embedding vectors are input into the department extraction model, and the treatment department corresponding to the enhanced word embedding vectors is obtained
[0163] The above detailed description of the embodiments of the application has been given for the purposes of illustration and description. It is not intended to be exhaustive or to limit the application to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. Embodiments were chosen and described in order to provide the best description and to most clearly explain the principles and the applications, the intended scope of which is set forth in the following claims.
Claims
1. A method of single-class classification, characterized in that, The method comprises: S1: determining the address description and the question description of the whistle order; Preprocessing and mapping processing are performed on the address description to obtain a first word embedding vector corresponding to the address description; S2: place name extraction processing is performed on the first word embedding vector to obtain a place name corresponding to the address description; According to the place name corresponding to the address description, the community information corresponding to the address description is determined; S3: the community information and the question description are spliced to obtain description information corresponding to the whistle order; Mapping processing is performed on the description information to obtain a second word embedding vector corresponding to the description information; S4: optimization processing is performed on the second word embedding vector to obtain an enhanced word embedding vector corresponding to the second word embedding vector; S5: determination processing is performed on the enhanced word embedding vector to obtain a handling department corresponding to the enhanced word embedding vector; The step S2 comprises: S21: based on a bidirectional long short-term memory neural network structure, a sequence extraction model taking the first word embedding vector as an input item and taking an input observation sequence as an output item is trained; The structure of the sequence extraction model is as follows: ; ; ; ; ; ; In the formula, denotes a forget gate; denotes an input threshold; represents the neuron state at the previous time instant; represents the neuron state; represents an output threshold; represents a current cell output; represents an output of the cell at a previous time instant; S22: the first word embedding vector is input into the sequence extraction model to obtain an input observation sequence corresponding to the first word embedding vector; S23: based on a conditional random field, a place name extraction model taking the input observation sequence as an input item and taking a place name as an output item is trained; S24: the input observation sequence corresponding to the first word embedding vector is input into the place name extraction model to obtain a place name corresponding to the address description; S25: the place names of all communities are determined, and the Levenshtein distance between the place name corresponding to the address description and the place names of all communities is calculated respectively; Based on the Levenshtein distance, the community information corresponding to the address description is determined.
2. The whistle single-sorting method according to claim 1, characterized in that, The step S1 comprises: S11: determining the address description and the question description of the whistle order; S12: the address description is processed by jieba word segmentation to obtain a plurality of segmented words; S13: stop word processing is performed on the segmented words to obtain a plurality of words; S14: mapping processing is performed on the plurality of words by a continuous bag-of-words model to obtain a plurality of first word embedding vectors corresponding to the address description.
3. The whistle single-sorting method of claim 1, wherein, The loss function of the place name extraction model in the training process is as follows: ; ; wherein represents an output label sequence; x represents an input observation sequence, y represents an input observation sequence value; representing the output label sequence y in the output score; representing the transition score of the output label sequence y in 4. The whistle single-sorting method of claim 1, wherein, The step S3 comprises: S31: the string of the community information and the string of the question description are spliced to obtain description information corresponding to the whistle order; S32: based on an n-gram basic structure, a vector conversion model taking the description information as an input item and taking a second word embedding vector as an output item is trained; S33: the description information corresponding to the whistle order is input into the vector conversion model to obtain a second word embedding vector corresponding to the description information.
5. The whistle single-sorting method according to claim 4, characterized in that, The structure of the vector conversion model is as follows: ; ; In the formula, S={w1, w2, …, wn} represents a sentence; conditional probability of each word given the condition that the given word precedes all the words preceding it; denotes denotes the probability that the current sentence occurs; And the loss function of the vector conversion model in the training process is as follows: 。 6. The whistle single-sorting method of claim 1, wherein, The step S4 comprises: S41: Determine an embedding vector update operation set comprising several update operations ; Updating a set of operation based on embedding vectors selecting a second word embedding vector, performing a number of update operations on the selected second word embedding vector to obtain a number of updated embedding vectors corresponding to the selected second word embedding vector ; S42: a second word embedding vector is selected again, and steps S41-S42 are repeated to obtain a plurality of updated embedding vectors corresponding to each second word embedding vector; S43: Determine several hyperparameters according to Dirichlet distribution ; Based on hyperparameters Select a second word embedding vector and a second word embedding vector For each of the selected second word embedding vectors and The weights of several updated embedding vectors are summed to obtain embedding vectors corresponding to the selected second word. and Weight embedding vector and ; S44: Determine hyperparameters from Beta distribution ; Based on hyperparameters , for the second word embedding vector and and the weight embedding vector and weight sum processing, respectively, to obtain an enhanced word embedding vector The formula for calculating the enhanced word embedding vector is as follows: ; ; ; ; wherein and denote an enhanced word embedding vector corresponding to the second word embedding vector and indicates the corresponding label, indicates the corresponding label; S45: Repeat the steps S43-S44, and determine a plurality of enhanced word embedding vectors accordingly.
7. The whistle single-sorting method of claim 1, wherein, The step S5 comprises: S51: Training a department extraction model taking the enhanced word embedding vector as an input item and taking the department as an output item based on a long short-term memory neural network structure; S52: Inputting the enhanced word embedding vector corresponding to the second word embedding vector into the department extraction model to obtain the department corresponding to the enhanced word embedding vector.
Citation Information
Patent Citations
Systems and methods for multi-modal automated categorization
US20190065589A1
Systems and methods of business categorization and service recommendation
US20210241331A1