Number identification method, device and equipment and computer storage medium
By extracting and analyzing multiple feature data in user communication data, using the random forest model and number identification model to identify the research number, the problem of low number judgment accuracy in the existing technology is solved, and higher recognition accuracy is achieved.
Patent Information
- Application Number
- CN202411792924.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art fails to fully explore its complex associations and dependencies when analyzing the characteristics of call behavior, resulting in limited accuracy of number judgment.
By obtaining user communication data, user attribute data, call behavior data, call object data and time series data are extracted, and the random forest model and number identification model are used to extract behavior pattern features, and identify them based on the pre-learned research number behavior pattern.
It significantly improves the accuracy of survey number identification and can better explore the complex relationships contained in the user's signal code.
Smart Images

Figure CN119603395A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and in particular, relates to a number recognition method, device, equipment and computer storage medium. Background Art
[0002] With the rapid development of communication technology, problems such as communication fraud and telephone harassment are becoming increasingly serious. Therefore, relevant departments need intelligent means to identify and block suspicious numbers.
[0003] In related technologies, the suspiciousness of a number can be determined based on rules or machine learning models by analyzing call behavior characteristics, such as call duration, number of called numbers, and call time, and then the suspicious number can be intercepted.
[0004] However, in the related art, when analyzing call behavior features, the complex correlations and dependencies among the call behavior features are not fully explored, which leads to limited accuracy in number judgment. Therefore, improving the accuracy of suspicious number identification is a technical problem that needs to be solved urgently by related technical personnel. Summary of the invention
[0005] The embodiments of the present application provide a number identification method, apparatus, device and computer storage medium, which can realize the identification of survey numbers.
[0006] In a first aspect, an embodiment of the present application provides a number identification method, including: obtaining user communication data; extracting user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data; determining the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number; using a number identification model, extracting the behavior pattern characteristics corresponding to the communication key data, and performing survey number identification on the behavior pattern characteristics based on the survey number behavior pattern pre-learned by the number identification model.
[0007] In one implementation, based on user attribute data, call behavior data, call object data, and time series data corresponding to the communication number, key communication data corresponding to the communication number is obtained, including:
[0008] The random forest model is used to extract key data from user attribute data, call behavior data, call object data and time series data to obtain key communication data.
[0009] In one embodiment, the key communication data includes: at least one of number-related features, attribute-related features, and behavior-related features, wherein the number-related features are obtained based on call object data; the attribute-related features are obtained based on user attribute data; and the behavior-related features are obtained based on call behavior data;
[0010] Using the number recognition model, we extract the behavior pattern features corresponding to the key communication data, including:
[0011] In the case where the communication key data includes number-like features, a number semantic vector corresponding to the number-like features is generated using a number semantic vector generation method in a number recognition model;
[0012] In the case where the communication key data includes attribute features, an attribute semantic vector corresponding to the attribute features is generated using an attribute semantic vector generation method in a number recognition model;
[0013] In the case where the key communication data includes behavior features, a behavior semantic vector generation method in a number recognition model is used to generate a behavior semantic vector corresponding to the behavior features;
[0014] Based on at least one of the number semantic vector, the attribute semantic vector and the behavior semantic vector, a behavior pattern feature is obtained.
[0015] In one implementation, a number semantic vector corresponding to a number feature is generated by using a number semantic vector generation method in a number recognition model, including:
[0016] Segmenting the number-type features to obtain multiple number feature segments;
[0017] Perform vector mapping on each number feature segment respectively to obtain multiple number feature segment vectors;
[0018] Multiple number feature segment vectors are concatenated to obtain the number semantic vector corresponding to the number class feature.
[0019] In one implementation, the attribute semantic vector corresponding to the attribute class feature is generated by using the attribute semantic vector generation method in the number recognition model, including:
[0020] Perform vector mapping on the attribute class features to obtain the attribute semantic vector corresponding to the attribute class features.
[0021] In one implementation, generating a behavior semantic vector corresponding to a behavior feature by using a behavior semantic vector generation method in a number recognition model includes:
[0022] Discretize the behavior features with continuous values to obtain multiple behavior feature intervals;
[0023] Vector mapping is performed on each behavior feature interval to obtain the behavior semantic vector corresponding to the behavior class feature.
[0024] In one implementation, the number recognition model is used to extract the behavior pattern features corresponding to the key communication data, including:
[0025] Performing vector mapping on the communication key data through the first embedding layer to obtain the semantic vector corresponding to the communication key feature;
[0026] The semantic vector is embedded by position encoding through the second embedding layer to obtain the target vector corresponding to the key feature of the communication;
[0027] The target vector is feature extracted through the encoding layer to obtain the behavior pattern features;
[0028] The behavior pattern features are identified through the classification layer to determine the number category corresponding to the behavior pattern features.
[0029] In one embodiment, the encoding layer includes multiple sublayers, and each sublayer includes a multi-head attention layer, a feedforward neural network layer, a normalization layer, and a residual connection layer;
[0030] The target vector is extracted through the encoding layer to obtain the behavior pattern features, including:
[0031] The following operations are performed on each sublayer to obtain the behavioral pattern characteristics:
[0032] Performing weighted calculation on one or more sub-features corresponding to the target vector based on a multi-head attention mechanism to obtain a first output result, where the one or more sub-features are sub-features obtained by performing feature extraction on the segmented target vector;
[0033] The feedforward neural network layer extracts features of the first output result through an activation function and a bias vector to obtain a second output result;
[0034] The normalization layer adaptively scales and offsets the parameters of the second output result to obtain a third output result;
[0035] Through the residual connection layer, the third output result is residually connected with the input feature of the corresponding sub-layer to obtain the sub-behavior pattern feature output by the corresponding sub-layer;
[0036] The sub-behavior pattern features output by multiple sub-layers are concatenated to obtain the behavior pattern features.
[0037] In one implementation, identifying the behavior pattern features through a classification layer to determine the number category corresponding to the behavior pattern features includes:
[0038] Aggregate the behavior pattern features to obtain the behavior pattern vector;
[0039] Using the classification function, determine the probability value and confidence level corresponding to the behavior pattern vector;
[0040] The number category corresponding to the behavior pattern characteristics is determined through probability value and confidence level.
[0041] In one implementation, determining the number category corresponding to the behavior pattern feature through the probability value and the confidence level includes:
[0042] Calculate the product between the probability value and the confidence level;
[0043] When the product is greater than a preset threshold, determining that the behavior pattern feature corresponds to the first number category;
[0044] When the product is less than or equal to the preset threshold, the behavior pattern feature is determined to be a second number category.
[0045] In one embodiment, when the product is greater than a preset threshold, before determining that the behavior pattern feature corresponds to the first type of behavior pattern, the method further includes:
[0046] Determine the precision and recall corresponding to different thresholds;
[0047] Calculate the harmonic mean of precision and recall corresponding to different thresholds;
[0048] A preset threshold is determined from the different thresholds using the harmonic mean.
[0049] In one implementation, the behavior pattern features are aggregated to obtain a behavior pattern vector, including:
[0050] Obtain the features corresponding to each time step in the behavior pattern features;
[0051] From the features corresponding to each time step, determine the first feature of the time step corresponding to the maximum feature, and the second feature corresponding to the last time step;
[0052] Performing weighted calculation on the first feature and the second feature to obtain a first aggregate feature;
[0053] The features corresponding to each time step are used for weighted calculation to obtain the second aggregated features;
[0054] The first aggregate feature and the second aggregate feature are concatenated to obtain a behavior pattern vector.
[0055] In one implementation, before extracting the behavior pattern features corresponding to the key communication data using the number recognition model, the method further includes:
[0056] Obtaining a training sample set, the training sample set comprising a plurality of training samples, each training sample comprising a communication data sample and a corresponding number category label;
[0057] Input the communication data sample into the preset number recognition model, identify the communication data sample through the preset number recognition model, and obtain the predicted number category;
[0058] Using the predicted number category and number category label, calculate the focal loss function value of the number recognition model;
[0059] When it is determined that the focal loss function value does not meet the training stop condition, adjust the model parameters, and return to input the communication data sample into the preset number recognition model. The communication data sample is identified by the preset number model to obtain the predicted number category until the training stop condition is met to obtain a trained number recognition model.
[0060] In a second aspect, an embodiment of the present application provides a number recognition device, the device comprising:
[0061] An acquisition module, used to acquire user communication data;
[0062] An extraction module is used to extract user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data;
[0063] A determination module, used to determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number;
[0064] The identification module is used to extract the behavior pattern characteristics corresponding to the key communication data by using the number identification model, and to identify the investigation number based on the behavior pattern characteristics based on the investigation number behavior pattern pre-learned by the number identification model.
[0065] In a third aspect, an embodiment of the present application provides a number identification device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the number identification method in the first aspect or any one of the embodiments of the first aspect is implemented.
[0066] In a fourth aspect, a computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the number recognition method in the first aspect or any one of the embodiments of the first aspect is implemented.
[0067] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a number identification method such as the first aspect or any one of the embodiments of the first aspect.
[0068] The number identification method, device, equipment and computer storage medium of the embodiment of the present application extracts user attribute data, call behavior data, call object data and time series data from the acquired user communication data, and extracts communication key data from the user attribute data, call behavior data, call object data and time series data, and then uses the trained number identification model to determine the behavior pattern characteristics corresponding to the key data, and then determines the number type corresponding to the communication number, so as to distinguish the survey number. Among them, in the present application, the survey number is identified through various data associated with the user's communication number, which can better explore the complex associations contained in the user's communication number and improve the accuracy of survey number identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0070] Figure 1 It is a flowchart of a number recognition model training method provided by an embodiment of the present application;
[0071] Figure 2 A schematic diagram showing a flow chart of a number identification method provided by an embodiment of the present application is shown;
[0072] Figure 3 A schematic diagram showing a flow chart of a number identification method provided by an embodiment of the present application is shown;
[0073] Figure 4 A schematic diagram of a process for generating a number semantic vector provided by an embodiment of the present application is shown;
[0074] Figure 5 A schematic diagram of a process for generating an attribute semantic vector provided by an embodiment of the present application is shown;
[0075] Figure 6 A schematic diagram of a process for generating a behavior semantic vector provided by an embodiment of the present application is shown;
[0076] Figure 7 A schematic diagram of a process for extracting behavior pattern features corresponding to key communication data provided by an embodiment of the present application is shown;
[0077] Figure 8 A schematic diagram showing a flow chart of a number identification method provided by an embodiment of the present application is shown;
[0078] Fig. 9A schematic diagram of a process of determining a target vector using a second embedding layer provided by an embodiment of the present application is shown;
[0079] Fig.10 A schematic diagram of a process for determining behavior pattern characteristics using a coding layer provided by an embodiment of the present application is shown;
[0080] Fig.11 A schematic diagram of a process for determining a behavior number category by using a classification layer provided by an embodiment of the present application is shown;
[0081] Fig.12 A schematic diagram of a process for obtaining a behavior pattern vector provided by an embodiment of the present application is shown;
[0082] Fig.13 A schematic diagram of a process for determining a preset threshold value provided by an embodiment of the present application is shown;
[0083] Fig.14 is a structural diagram of a number identification device provided by another embodiment of the present application;
[0084] Fig.15 It is a structural diagram of a number identification device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0085] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0086] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0087] With the development of communication technology, the problem of users being harassed by survey calls has become increasingly serious. Therefore, training machine learning models so that they can identify survey numbers is of great significance in solving users' problems.
[0088] In the related art, traditional machine learning models can be used for number recognition, such as decision trees and support vector machines, to achieve number recognition. However, traditional machine learning models are difficult to fully mine the complex association patterns contained in communication data, so the generalization ability of the trained model is weak.
[0089] Moreover, in the related art, the training data used to train the traditional machine learning model may require training samples that are manually collected and labeled in advance. It is understandable that in the process of manually collecting and labeling training samples, the quality of the collected or labeled samples is not high or the number is small, which may lead to poor model training effect, and the manually collected and labeled training samples are difficult to cover all abnormal number scenarios, and the generalization ability of the model is limited.
[0090] In addition, in related technologies, the feature dimensions and types extracted by the model are relatively few, making it difficult to fully characterize the user's communication behavior profile, and the trained model lacks robustness.
[0091] In summary, improving the accuracy of survey number recognition is a technical problem that needs to be urgently solved by relevant technical personnel.
[0092] In order to solve the problems in the prior art, the embodiments of the present application provide a number identification method, device, equipment and computer storage medium. The number identification method provided by the embodiments of the present application is first introduced below.
[0093] It should be noted that in the number recognition method provided in the embodiment of the present application, it is necessary to use the behavior pattern features corresponding to the communication key data of the number recognition model to extract and then identify the survey number. Therefore, the following first describes the specific implementation method of the training method of the number recognition model provided in the embodiment of the present application in combination with the accompanying drawings.
[0094] like Figure 1 As shown, Figure 1 : is a flow chart of a number recognition model training method provided by an embodiment of the present application, and the number recognition model training method includes:
[0095] S110: Obtain a training sample set, where the training sample set includes a plurality of training samples.
[0096] Exemplarily, each training sample includes a communication data sample and a corresponding number category label.
[0097] Exemplarily, the training sample set may be obtained by augmenting the data using data augmentation techniques such as random noise, feature occlusion, and data mixing. It is understandable that the training samples augmented by data augmentation techniques such as random noise, feature occlusion, and data mixing have diversity, thereby improving the generalization ability of the model.
[0098] In one example, a data augmentation method based on sequence structure can be used, including sequence cropping and splicing. That is, sequence cropping and splicing can randomly crop and splice the original sequence to generate some new sequences with different lengths and similar structures, thereby expanding the scale and diversity of the training set. For example, for each behavioral sequence x1, x2, ..., x n , randomly select two positions i and j (1≤i<j≤n). Cut the sequence into three subsequences according to positions i and j: x1,...,x i , x i+1 ,...,x j , x j+1 ,...,x n Randomly select two of these three subsequences and concatenate them into a new sequence in the original order. For example, you can generate x1,...,x i ,x j+1 ,...,x n ,x1,...,x i ,x i+1 ,...,x j Etc. Repeat the above steps multiple times until a sufficient number of enhanced samples are generated. The ratio of the number of generated samples to the number of original samples can be controlled, such as 1:1, 1:2, etc. Finally, the generated enhanced samples are mixed with the original samples to obtain the final training set.
[0099] S120: Input the communication data sample into a preset number recognition model, and recognize the communication data sample through the preset number recognition model to obtain a predicted number category.
[0100] Exemplarily, the preset number model may be a transformer model.
[0101] S130. Calculate the focal loss function value of the number recognition model using the predicted number category and number category label.
[0102] For example, when training the number recognition model, a focal loss function (Focal Loss) can be used. It is understandable that Focal Loss can reduce the weight of easy-to-classify samples and strengthen the learning of difficult-to-classify samples to improve the generalization ability of the model, targeting the imbalance problem between survey numbers and common numbers.
[0103] In an example, Focal Loss can be defined by the following formula (1):
[0104] FL(p i )=-α i (1-p i ) γ log(p i ) (1)
[0105] Among them, p i is the probability that sample i is a positive class, α i is the weight factor of positive and negative samples, and γ is a regulating factor used to control the weight difference between difficult and easy samples. When γ>0, Focal Loss imposes a smaller loss on easy-to-classify samples (i.e., samples close to 1) and a larger loss on difficult-to-classify samples (i.e., samples close to 0). This makes the model focus more on difficult-to-classify samples.
[0106] In formula (1), the weight factor α i is determined by the following formula (2):
[0107]
[0108] Among them, y i is the true label of sample i, and α is a hyperparameter used to represent the weight of positive samples. Usually, α=0.25 and γ=2 can be used to help balance the contribution of positive and negative samples to the total loss.
[0109] Furthermore, the L1 regularization term or L2 regularization term of the embedding layer can be added to the loss function of the transformer model to prevent overfitting of the embedding layer.
[0110] S140, determining whether the focus loss function value satisfies the training stop condition, if so, ending the training. If not, executing step S150.
[0111] Exemplarily, when it is determined that the focus loss function value satisfies the training stop condition, it is confirmed that the model has completed training, and a trained number recognition model is obtained. When it is determined that the focus loss function value does not satisfy the training stop condition, S150 can be executed to adjust the parameters of the number recognition model, and return to input the communication data sample into the preset number recognition model, and identify the communication data sample through the preset number model to obtain a predicted number category, until the training stop condition is met, and a trained number recognition model is obtained.
[0112] Exemplarily, the training stop condition may be that the loss function converges, or that a preset number of iterations is reached.
[0113] S150: Adjust parameters of the model.
[0114] Exemplarily, the focus loss function value between the measured number category and the number category label can be reduced by optimizing the parameters in the model.
[0115] In an example, the Focal Loss of each sample can be weighted and summed to obtain the loss of the entire training set, as shown in formula (3):
[0116]
[0117] Where N is the number of samples in the training set. Furthermore, the parameters of the model can be updated by an optimization algorithm based on gradient descent (Adaptive Moment Estimation, Adam) to minimize this loss function.
[0118] In this example, Adam maintains the first-order moment estimate (i.e., mean) and the second-order moment estimate (i.e., uncentered variance) of each parameter and uses them to adaptively adjust the update step size of the parameter. For example, suppose that at the tth iteration, the gradient of the parameter θ is g t , then the update formula (4) of Adam is:
[0119]
[0120] Among them, m t and v t are the first-order moment estimate and the second-order moment estimate of the gradient, β1 and β2 are their decay rates (usually β1=0.9$, β2=0.999$), and It is for m t and v t correction (used to offset the deviation in the initial iteration), α is the initial learning rate (usually α = 0.001), is a small constant (usually taken as ), for numerical stability.
[0121] As can be seen from the formula, Adam adaptively adjusts the learning rate of each parameter (i.e. ), so that parameters with larger gradients have smaller update steps, and parameters with smaller gradients have larger update steps. This adaptive mechanism can help the model converge smoothly and quickly in complex optimization terrain.
[0122] In the embodiment of the present application, by applying the transformer architecture to the scenario of number recognition, with its powerful feature extraction and modeling capabilities, the complex patterns contained in the characteristics of user communication behavior are mined, overcoming the limitations of traditional machine learning models. In addition, a multi-dimensional and fine-grained feature engineering system is constructed using the transformer model, covering a variety of key information, and feature selection, preprocessing, cross-combination and other optimizations are performed, which greatly improves the discriminative power and information density of the features, which is conducive to improving the accuracy of number recognition.
[0123] The above is a specific implementation of the number recognition model training method provided in the embodiment of the present application. The number recognition model obtained through the above training can be used in the number recognition method provided in the following embodiment.
[0124] Figure 2 FIG. 1 is a flow chart of a number identification method provided by an embodiment of the present application. Figure 2 As shown, the number identification method includes the following steps:
[0125] S210: Obtain user communication data.
[0126] Exemplarily, the user communication data may be communication data corresponding to a communication number.
[0127] S220. Extract user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data.
[0128] Exemplarily, data of different dimensions corresponding to the communication number can be extracted from the user communication data, wherein the data of different dimensions can include user attribute data, call behavior data, call object data and time series data.
[0129] In one example, user attribute data may include communication number, location, package type, and network access time.
[0130] In one example, the call behavior data may include data such as the number of calls, call duration, call time distribution, and the number of calls received.
[0131] In another example, the call object data may include data such as the distribution of the call object's location, stability of the call number, etc.
[0132] In another example, the time series data may include data such as a trend of changes in duration and the number of calls per day, week, and month.
[0133] S230. Determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number.
[0134] Exemplarily, in the data of different dimensions, each dimension of data may include multiple data. Therefore, the data of each dimension may be screened to determine the key communication data corresponding to the communication number. Among them, the user attribute data, call behavior data, call object data and time series data corresponding to the communication number may be screened respectively to determine the key communication data corresponding to the communication number.
[0135] In some optional embodiments, a random forest model may be used to extract key data from user attribute feature data, call behavior feature data, call object feature data, and time series feature data to obtain communication key data.
[0136] In one example, the importance of data can be evaluated through the random forest model to screen out the key data subset that contributes most to the discrimination of the survey number. And the key data subset is preprocessed to improve the data quality. The preprocessing steps may include data operations such as denoising, normalization, and discretization. Furthermore, high-order derivative data can be constructed on the basis of the original data through cross-combination, time window aggregation, statistical analysis, etc. The constructed high-order derivative data can be used as key communication data. It is understandable that the random forest model can be used to automatically extract important multi-dimensional features from a large amount of communication data corresponding to the communication number in an unsupervised manner, and optimize the feature quality through data preprocessing, feature selection, etc., without the need for manual labeling, reducing dependence on the experience of technical personnel, and improving the coverage and richness of the data.
[0137] In the embodiment of the present application, data importance assessment can be implemented based on the random forest model, which can achieve sub-adaptive screening of the most discriminative key data sets and reduce data redundancy and noise.
[0138] S240. Utilize the number recognition model to extract the behavior pattern features corresponding to the key communication data, and perform survey number recognition on the behavior pattern features based on the survey number behavior pattern pre-learned by the number recognition model.
[0139] For example, the key communication data can be input into a trained number recognition model, and the number recognition model can be used to extract features of the key communication data to obtain behavioral features corresponding to the key communication data. Then, the behavioral pattern of the survey number learned in advance by the number recognition model is used to perform survey number recognition on the behavioral pattern features, thereby determining whether the communication number is a survey number.
[0140] In the embodiment of the present application, user attribute data, call behavior data, call object data and time series data can be extracted from the acquired user communication data, and communication key data can be extracted from the user attribute data, call behavior data, call object data and time series data, and then the behavior pattern characteristics corresponding to the key data can be determined using the trained number recognition model, and the number type corresponding to the communication number can be determined to achieve the identification of the survey number. Among them, in the embodiment of the present application, the survey number is identified through various data associated with the user's communication number, which can better explore the complex associations contained in the user's communication number and improve the accuracy of survey number identification.
[0141] Exemplarily, the key communication data may include at least one of number-based features, attribute-based features, and behavior-based features. The number-based features may be features obtained based on call object data; the attribute-based features may be features obtained based on user attribute data; and the behavior-based features may be features obtained based on call behavior data.
[0142] Exemplarily, for different types of features, corresponding semantic vectors can be generated by different semantic vector generation methods. It can be understood that in order to enable the model to better understand different user communication data, it is necessary to map user communication data of different dimensions by representing the data in a low-dimensional dense real-valued vector space. Therefore, as another implementation of the present application, the present application also provides another implementation of the number recognition method, see the following embodiments for details.
[0143] Figure 3 FIG. 1 is a flow chart of a number identification method provided by an embodiment of the present application. Figure 3 As shown, the number identification method includes the following steps:
[0144] S310: Obtain user communication data.
[0145] S320. Extract user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data.
[0146] S330. Determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number.
[0147] S341. When the key communication data includes number-type features, a number semantic vector corresponding to the number-type features is generated using a number semantic vector generation method in a number recognition model.
[0148] S342: When the communication key data includes attribute features, an attribute semantic vector corresponding to the attribute features is generated using an attribute semantic vector generation method in a number recognition model.
[0149] S343: When the communication key data includes behavior features, a behavior semantic vector generation method in a number recognition model is used to generate a behavior semantic vector corresponding to the behavior feature.
[0150] S350: Obtain a behavior pattern feature based on at least one of the number semantic vector, the attribute semantic vector, and the behavior semantic vector.
[0151] S360. Based on the investigation number behavior pattern pre-learned by the number recognition model, the investigation number is recognized based on the behavior pattern characteristics.
[0152] In some embodiments, steps S310 - S330 are consistent with steps S210 - S230 and are not described in detail herein.
[0153] In some embodiments, in S341, when the communication key data is a number-type feature, a number semantic vector corresponding to the number-type feature can be generated using a number semantic vector generation method in a number recognition model.
[0154] In some optional embodiments, Figure 4 FIG. 1 is a flow chart showing a process of generating a number semantic vector provided by an embodiment of the present application. Figure 4 As shown, the number identification method includes the following steps:
[0155] S410: Segment the number feature to obtain multiple number feature segments.
[0156] Exemplarily, the number-related feature is related data in digital form, such as a calling number and a called number, etc. In one example, the calling number and the called number may include 11-digit numbers.
[0157] Exemplarily, the number-type feature may be segmented according to the structural characteristics of the numbers in the number-type feature, thereby obtaining a plurality of number feature segments.
[0158] In one example, number-type features can be divided into six feature segments according to region, operator, segment number and other information.
[0159] S420. Perform vector mapping on each number feature segment respectively to obtain multiple number feature segment vectors.
[0160] Exemplarily, each number feature segment may be subjected to vector mapping to obtain multiple number feature segment vectors, that is, each number feature segment may be allowed to learn an independent matrix.
[0161] S430: Concatenate multiple number feature segment vectors to obtain a number semantic vector corresponding to the number class feature.
[0162] Exemplarily, the matrix learned from each number feature, that is, the number feature segment vector, may be concatenated to obtain a number semantic vector corresponding to the code-type feature.
[0163] In one example, the number semantic vector corresponding to the code-like feature can be represented by the following formula (5):
[0164]
[0165] Among them, x i represents the i-th communication number, Indicates the communication number x i The A segment substring, that is, the A segment number feature vector segment, E A is the matrix corresponding to segment A, with dimension D A ×V A . Similarly, the vector dimension D of the complete communication number is as follows (6):
[0166]
[0167] Among them, D k is the matrix of the k-th number eigenvector segment.
[0168] For example, in order to avoid segmenting number features, which would result in the fragmentation of the complete semantics of the number and limit the expressiveness of the model, an attention layer can be added to learn the interaction weights between different number feature segments, thereby dynamically fusing the semantics of each segment.
[0169] In an embodiment of the present application, the number-type features are segmented so that each number feature segment learns the corresponding number feature segment vector and concatenates them. This can reduce the number of parameters and computational overhead, and introduces prior knowledge of the communication number structure, making the vector learned by the model more interpretable.
[0170] For example, the following formula (7) can be used to directly learn the vector corresponding to the number-type feature:
[0171] Embedding(x i )=W·onehot(x i )(7)
[0172] Among them, onehot(x i) can be a V-dimensional one-hot vector (V can be the size of the communication number set), and W is a D×V-dimensional matrix, where D is the dimension of the vector (the dimension of D is much smaller than V).
[0173] In some embodiments, in S342, when the communication key data is an attribute-type feature, a number semantic vector corresponding to the number-type feature can be generated using a number semantic vector generation method.
[0174] In some optional embodiments, Figure 5 FIG. 1 is a flow chart showing a method for generating an attribute semantic vector provided by an embodiment of the present application. Figure 5 As shown, the method for generating an attribute semantic vector includes the following steps:
[0175] S510: Perform vector mapping on attribute class features.
[0176] Exemplarily, attribute features may be data that can exist in the form of a string or an enumeration value. For example, attribute features may include the location of the communication number, the operator, and the type of the communication number (including ordinary users, commercial users, etc.). It is understood that these data are generally data with discrete attributes.
[0177] S520: Obtain an attribute semantic vector corresponding to the attribute class feature.
[0178] Exemplarily, the attribute semantic vector corresponding to each data feature can be calculated by the following formula (8):
[0179]
[0180] Among them, you can represents the ath attribute of communication number i, W a is the D corresponding to the ath attribute a ×V a dimensional matrix. Among them, D a The dimension of can be set according to the number of attribute values and importance. For example, if attribute a has many values and / or attribute a is more important, D a Higher dimensions.
[0181] In the embodiment of the present application, the attribute features can be vector mapped to obtain the attribute semantic vector corresponding to the attribute features. In this way, the attribute features can be mapped into a vector, so that the model can better understand the attribute features and lay a better foundation for the model to perform downstream tasks.
[0182] In some embodiments, in S343, when the communication key data is a behavior feature, a behavior semantic vector corresponding to the behavior feature may be generated using a behavior semantic vector generation method.
[0183] In some optional embodiments, Figure 6 FIG. 1 is a flow chart of generating a behavior semantic vector according to an embodiment of the present application. Figure 6 As shown, the method for generating a behavior semantic vector includes the following steps:
[0184] S610: Discretize the behavior features with continuous values to obtain multiple behavior feature intervals.
[0185] Exemplarily, the behavior feature may be data with continuous values. In one example, the behavior feature may include call duration, call time period, and call frequency.
[0186] For example, the behavior features with continuous values can be discretized by bucketing, etc., so as to obtain multiple feature intervals represented by discrete representations. In one example, the call duration can be divided into four feature intervals: [0, 10), [10, 30), [30, 60), [60, +∞).
[0187] For example, two or more behavior features may be combined to obtain a high-level feature, so as to more finely characterize the behavior pattern features of the call number. In one example, the call period and the call duration may be combined.
[0188] S620 , respectively perform vector mapping on each behavior feature interval to obtain a behavior semantic vector corresponding to the behavior class feature.
[0189] Exemplarily, the discretized feature intervals may be subjected to vector mapping to obtain a behavior semantic vector corresponding to the behavior feature.
[0190] In one example, the discretized feature interval can be vector mapped using the following formula (9):
[0191]
[0192] in, represents the bth behavior feature after discretization of communication number i, W b is the matrix of the b-th behavior class features.
[0193] Exemplarily, high-order features formed by combining two or more behavior-related features may be discretized, and vector mapping may be performed on the discretized high-order features to obtain a behavior semantic vector.
[0194] In the embodiment of the present application, a plurality of behavior feature intervals are obtained by discretizing the behavior features with continuous values, and vector mapping is performed on each behavior feature interval to obtain the behavior semantic vector corresponding to the behavior feature. In this way, the behavior feature can be mapped into a low-order vector, so that the model can better understand the behavior feature and lay a better foundation for the model to perform downstream tasks.
[0195] In some embodiments, in step S350, a behavior pattern feature may be obtained based on at least one of a number semantic vector, an attribute semantic vector, and a behavior semantic vector.
[0196] Exemplarily, one or more of the number semantic vector, the attribute semantic vector and the behavior semantic vector may be concatenated to obtain the behavior pattern feature. Further, in step S360, the behavior pattern feature may be used to perform investigation number identification based on the investigation number behavior pattern pre-learned by the number identification model.
[0197] Exemplary, combined Figure 7 The following example illustrates the process of extracting behavioral pattern features corresponding to key communication data.
[0198] Figure 7 FIG. 1 is a flow chart showing a process for extracting behavior pattern features corresponding to key communication data provided by an embodiment of the present application. Figure 7 As shown, in step S701, communication key data is obtained. Further, S702 is used to determine the feature type contained in the communication key data. When it is determined that the communication key data contains number-type features, step S703 is executed to segment the number-type features to obtain operator feature segments, regional feature segments, and number segment feature segments. In S704, vector mapping is performed on each feature segment to obtain an operator segment vector, a regional segment vector, and a number segment vector. In S705, the operator segment vector, the regional segment vector, and the number segment vector are concatenated to obtain a number semantic vector.
[0199] Further, when it is determined that the communication key data contains attribute features, step S706 is executed to perform vector mapping on each pair of location, operator and number type to obtain a location semantic vector, an operator semantic vector and a number type semantic vector. In S707, the location semantic vector, the operator semantic vector and the number type semantic vector are evaluated and spliced to obtain an attribute semantic vector.
[0200] Furthermore, when it is determined that the communication key data contains behavioral features, step S708 is executed to discretize the call duration, call period, and call frequency, and vector mapping is performed on the discretized call duration, call period, and call frequency to obtain a duration semantic vector, a call period semantic vector, and a call frequency semantic vector. In step S709, the duration semantic vector, the call period semantic vector, and the call frequency semantic vector are spliced to obtain a behavioral semantic vector. Furthermore, in step S710, the number semantic vector, the attribute semantic vector, and the behavior semantic vector are spliced to obtain a behavioral pattern feature.
[0201] In the embodiment of the present application, by using different semantic vector generation methods for different types of features, the model can understand various types of features, significantly improving the richness and quality of the features, enabling the model to better mine the complex associations contained in the user's communication numbers and improve the accuracy of survey number recognition.
[0202] In order to better determine the characteristics of the behavior pattern, as another implementation of the present application, the present application also provides another implementation of the number identification method, please refer to the following embodiments for details.
[0203] For example, Figure 8 FIG. 1 is a flow chart of a number identification method provided by an embodiment of the present application. Figure 8 As shown, the number identification method includes the following steps:
[0204] S810. Perform vector mapping on the communication key data through the first embedding layer to obtain a semantic vector corresponding to the communication key data.
[0205] S820. Perform position encoding and embedding on the semantic vector through the second embedding layer to obtain a target vector corresponding to the communication key data.
[0206] S830. Extract features of the target vector through the encoding layer to obtain behavior pattern features.
[0207] S840. Identify the behavior pattern features through the classification layer and determine the number category corresponding to the behavior pattern features.
[0208] In some embodiments, in S810, the first embedding layer may map the key data through a variety of semantic vector generation methods to obtain semantic vectors corresponding to the key communication features.
[0209] In one example, the first embedding layer can be used to vectorize and map discrete communication key data so that the model can recognize the communication key data. For example, the first embedding layer can be a semantic embedding layer of a transformer model.
[0210] Exemplarily, the semantic vector corresponding to the key communication feature may include at least one of a number semantic vector, an attribute semantic vector, and a behavior semantic vector.
[0211] In some embodiments, in S820, the second embedding layer can be used to embed the semantic vector by position encoding to obtain the target vector corresponding to the key communication feature. The second embedding layer can enable the model to perceive the sequential relationship of the features, so as to better determine the behavioral feature pattern of the communication number. In one example, the second embedding layer can be the positional encoding layer of the transformer model.
[0212] In one example, combining Fig. 9 The following example illustrates the process of determining the target vector using the second embedding layer.
[0213] Fig. 9 FIG. 2 shows a flow chart of determining a target vector using a second embedding layer according to an embodiment of the present application. Fig. 9 As shown, in S901, the semantic vector corresponding to the key communication feature is obtained. In S902, the type of the semantic vector is determined. When it is determined that the semantic vector represents related data in digital form, S903 is executed to perform sequence segmentation on the feature vector to obtain multiple subsequence vectors. In S904, each subsequence vector is positionally indexed to obtain a position encoding vector PE corresponding to each subsequence vector. Among them, the position index vector can be defined by the following formula (10):
[0214]
[0215] Where L represents the maximum length of the sequence (which can be set according to the longest sequence in the data), and d represents the dimension of the position encoding (usually the same as the dimension of the input data). For the i-th position, its position encoding vector is expressed by the following formula (11):
[0216] PE i =PE[i,:] (11)
[0217] Furthermore, the semantic vectors and position encoding vectors corresponding to each subsequence vector can be concatenated to obtain a position-aware semantic vector. The position-aware semantic vector can be represented by the following formula (12):
[0218] Embedding pos (x i )=Embedding(x i )+PE i (12)
[0219] Among them, x i represents the feature of the i-th position, Embedding(x i ) represents x i Semantic vector of PE i Represents x i The position encoding vector of .
[0220] Further, when it is determined that the semantic vector is related data with periodic characteristics, S905 is executed to generate a periodic position coding vector using a sine function and / or a cosine function. In S906, the semantic vector is combined with the position coding vector to obtain a position-aware semantic vector. It can be understood that the periodic position coding vector can generate a coding vector that can represent these periodic laws through sine and cosine functions, so that the model can better learn this periodic law, thereby improving the recognition ability of the survey number.
[0221] Further, when it is determined that the semantic vector is related data with a fixed order, S907 is executed to generate a unique fixed position encoding vector for each position. In S908, the semantic vector is combined with the fixed position encoding vector to obtain a position-aware semantic vector. It can be understood that the absolute position encoding vector can provide a unique identifier for each position, so that the model can accurately capture the order and time of occurrence of these behaviors, ensuring that the model can clearly identify the fixed patterns of these behaviors.
[0222] Furthermore, S909 is executed to concatenate multiple position-aware semantic vectors to obtain a target vector.
[0223] In some embodiments, in S830, feature extraction may be performed on the target vector through an encoder layer to obtain behavior pattern features.
[0224] Exemplarily, the encoding layer can be used to perform higher-level feature extraction on the target vector.
[0225] In some optional embodiments, the encoding layer may include multiple sub-layers, namely, Encoder Block, and each sub-layer includes a multi-head attention (Multi-Head Self-Attention) layer, a feedforward neural network (Position-wiseFeed-Forward) layer, a normalization (Layer Normalization) layer and a residual connection layer.
[0226] Fig.10 FIG. 1 shows a flow chart of determining behavior pattern characteristics by using a coding layer according to an embodiment of the present application. Fig.10As shown, determining the behavior pattern characteristics using the coding layer may include the following steps:
[0227] S1010. Perform weighted calculation on one or more sub-features corresponding to the target vector based on a multi-head attention mechanism to obtain a first output result.
[0228] S1020, the feedforward neural network layer extracts features of the first output result through an activation function and a bias vector to obtain a second output result.
[0229] S1030: The normalization layer performs adaptive scaling and parameter shift on the second output result to obtain a third output result.
[0230] S1040. Perform a residual connection on the third output result and the input feature of the corresponding sub-layer through a residual connection layer to obtain the sub-behavior pattern feature output by the corresponding sub-layer.
[0231] S1050, concatenating the sub-behavior pattern features output by multiple sub-layers to obtain a behavior pattern feature.
[0232] In some embodiments, in S1010, the target vector may be segmented to obtain one or more sub-vectors. Feature extraction may be performed on the segmented one or more sub-vectors to obtain one or more sub-features. Further, weighted calculation may be performed on the one or more sub-features based on a multi-head attention mechanism to obtain a first output result.
[0233] In one example, each target vector can be divided into multiple sub-vectors of fixed length (for example, the length can be 100), and the self-attention mechanism is applied to each sub-vector. When calculating the attention weight, a position-aware attention mask can be introduced to strengthen the interaction between adjacent positions. A relative position matrix can be defined The R matrix can be expressed by the following formula (13):
[0234] R ij ={0|ij|≤k-∞|ij|>k (13)
[0235] Among them, L is the length of the subsequence, and k is a hyperparameter, which means that the model only focuses on position pairs whose distance does not exceed k.
[0236] Furthermore, the R matrix is added to the Attention calculation to obtain the attention weight formula (14):
[0237]
[0238] Among them, Ai It can be the attention weight corresponding to the i-th sub-vector; Q i Can be used to represent the query vector corresponding to the i-th sub-vector; K i Can be used to represent the key vector corresponding to the i-th sub-vector; d k It can be used to represent the dimension corresponding to the i-th sub-vector.
[0239] It is understandable that the association patterns between different positions in the sequence can be extracted through the Multi-Head Self-Attention mechanism. In this way, the model can pay more attention to the interaction patterns of adjacent positions and capture the local characteristics of the communication number.
[0240] In some embodiments, in S1020, the feedforward neural network layer extracts features from the first output result through an activation function and a bias vector to obtain a second output result.
[0241] In one example, the calculation process of the feedforward neural network layer can be calculated by the following formula (15):
[0242] FFN(X (l) )=(ReLU(X (l) W1+b1)⊙σ(X (l) V1+c1))W2+b2 (15)
[0243] Among them, FFN(X (l) ) represents the output result of the feedforward neural network layer corresponding to the lth local feature; represents the Hadamard product (i.e., element-by-element multiplication), σ is the Sigmoid function, ReLU is the activation function, W1 and W2 are used to represent different linear transformation layers; b1 and b2 are used to represent different bias vectors; is the parameter of the gating mechanism. It can be understood that by introducing the gating mechanism, the model can adaptively adjust the information flow at different locations, so as to better capture the behavior patterns of communication numbers at different time scales.
[0244] Furthermore, it can be understood that after extracting local features through the multi-head attention layer, the Position-wise Feed-Forward layer can be used to further enhance the expressiveness of the features. Considering that the behavior pattern of the communication number may have different manifestations at different time scales, a gating mechanism can be added to the Position-wise Feed-Forward layer to dynamically adjust the information flow at different positions, thereby better capturing the behavior pattern of the communication number at different time scales.
[0245] In some embodiments, in S1030, a normalization layer is used to perform adaptive scaling and parameter shift on the second output result to obtain a third output result.
[0246] In one example, the adaptive scaling and parameter offset of the normalization layer can be expressed by the following formula (16):
[0247]
[0248] Among them, μ, σ 2 They are X (l) The mean and variance of , ∈ is a small constant (such as 1e-5) for numerical stability. are learnable scaling parameters and offset parameters. It can be understood that the robustness of the model can be improved by adaptively adjusting the numerical distribution of different sub-layers and different positions through the normalization layer.
[0249] In some embodiments, in S1040, the third output result can be residually connected with the input features of the corresponding sub-layer through a residual connection layer to obtain the sub-behavior pattern features output by the corresponding sub-layer.
[0250] In one example, a residual connection layer can be used, that is, the input of the sub-layer is directly added to the output, as shown in formula (17):
[0251] X (l+1) =X (l) +Sublayer(X (l) )(17)
[0252] Among them, Sublayer can be Self-Attention or Feed-Forward.
[0253] It is understandable that residual connections can help gradients to propagate back more smoothly, alleviating the optimization difficulties of deep networks. At the same time, residual connections also play a role of "identity mapping", making it easier for the model to learn simple and shallow patterns.
[0254] In some embodiments, in S1050, sub-behavior pattern features output by multiple sub-layers may be concatenated to obtain a behavior pattern feature.
[0255] In the embodiment of the present application, the encoding layer captures the behavioral pattern characteristics of the communication number at multiple scales and multiple granularities through a multi-head attention layer, a feedforward neural network layer, a normalization layer, and a residual connection layer, and has a certain degree of adaptability and robustness. In addition, in practical applications, the number of Encoder Blocks N, the number of Attention Heads h, and the hidden dimensions of the Feed-Forward layer can be flexibly set according to the data scale and computing resources to balance the performance and efficiency of the model.
[0256] In some embodiments, in S840, the behavior pattern feature may be identified through a classification layer to determine the number category corresponding to the behavior pattern feature. For example, the classification layer may be a normalized exponential function.
[0257] Exemplarily, the classification layer may be used to determine the probability that the communication number is a research number.
[0258] In some optional embodiments, Fig.11 FIG. 1 shows a flow chart of determining the category of a behavior number by using a classification layer according to an embodiment of the present application. Fig.11 As shown, using the classification layer to determine the behavior number category may include the following steps:
[0259] S1101. Aggregate behavior pattern features to obtain a behavior pattern vector.
[0260] S1102: Using the classification function, determine the probability value and confidence level corresponding to the behavior pattern vector.
[0261] S1103. Determine the number category corresponding to the behavior pattern feature through the probability value and confidence level.
[0262] In some embodiments, in S1101, features output by the encoding layer may be aggregated into a vector having a fixed length.
[0263] In some optional embodiments, Fig.12 FIG. 4 shows a flow chart of obtaining a behavior pattern vector according to an embodiment of the present application. Fig.12 As shown, obtaining the behavior pattern vector may include the following steps:
[0264] S1201, by obtaining the features corresponding to each time step in the behavior pattern features.
[0265] Exemplarily, the behavior pattern features may be divided according to time steps, thereby obtaining features corresponding to each time step.
[0266] S1202: Determine, from the features corresponding to each time step, a first feature of the time step corresponding to the maximum feature and a second feature corresponding to the last time step.
[0267] Exemplarily, the features corresponding to each time step may be sorted and compared to determine the first feature of the time step corresponding to the maximum feature and the second feature corresponding to the last time step.
[0268] S1203: Perform weighted calculation on the first feature and the second feature to obtain a first aggregated feature.
[0269] In one example, the first aggregate feature z can be expressed by the following formula (18):
[0270] z=α·z last +(1-α)·z max (18)
[0271] S1204: Perform weighted calculation using the features corresponding to each time step to obtain a second aggregated feature.
[0272] In one example, the second aggregate feature z is expressed by formula (19): att :
[0273] Among them, z last is the feature of the last time step, z max is the maximum feature of all time steps,
[0274]
[0275] α∈[0,1] is a learnable weight parameter. Through this weighted fusion, the global and local information of the sequence can be captured simultaneously, improving the representation ability of the features.
[0276] Among them, z t is the feature vector of the tth time step, a t Yes t The corresponding weight. Furthermore, a t It can be calculated by the following formula (20):
[0277]
[0278] in, is a learnable parameter vector. It is understandable that by introducing the attention mechanism, the model can adaptively focus on the importance of different time steps, ensuring that the model can automatically learn the importance of different time steps and dynamically adjust the feature aggregation method as needed. At the same time, the attention weight a t It also provides a certain degree of explainability for the model's decision-making process.
[0279] S1205: Concatenate the first aggregate feature and the second aggregate feature to obtain a behavior pattern vector.
[0280] In one example, the first aggregate feature z and the second aggregate feature z att The behavior pattern vector is obtained by performing weighted summation according to the preset weights.
[0281] In some embodiments, at S1102 , a classification function may be used to determine a probability value and a confidence level corresponding to a behavior pattern vector.
[0282] In one example, a binary classification model can be used, for example, using a Sigmoid function, as shown in the following formula (21), to map the behavior pattern vector to a probability value p in the range of (0, 1):
[0283] p=σ(w T z+b) (21)
[0284] in, is a learnable parameter and T represents the transpose operation.
[0285] It is understandable that outputting only one probability value may not be robust enough, especially when the distribution of positive and negative samples is unbalanced and the data is noisy. Therefore, a confidence estimation mechanism is introduced to enable the model to output the probability value p and confidence c of the communication number.
[0286] In one example, the behavior pattern vector Z can be projected into two different subspaces, which can be expressed by the following formula (22) and formula (23):
[0287]
[0288]
[0289] in, is a learnable parameter. The probability value p indicates the possibility that the communication number belongs to the survey number, and the confidence c indicates the confidence of the model in this judgment. It can be understood that by introducing the confidence estimation, the model can learn the confidence of judgments on different samples, so as to be more cautious and robust in the reasoning stage. At the same time, the confidence c also provides richer information for the decision-making of the model, which helps to improve the credibility of the system.
[0290] In some embodiments, in S1103, the number category corresponding to the behavior pattern feature is determined through the probability value and the confidence level.
[0291] In some optional embodiments, the number category can be determined by calculating the product of the probability value and the confidence level.
[0292] For example, the model output can be optimized by using the cross entropy loss function, as shown in formula (24):
[0293]
[0294] Among them, y i is the true label of the i-th sample, is the predicted output of the model.
[0295] When the product of the probability value and the confidence level is greater than the preset threshold, it can be determined that the behavior pattern feature corresponds to the first number category, that is, the communication number is a research number. When the product of the probability value and the confidence level is less than or equal to the preset threshold, it is determined that the behavior pattern feature is the second number category, that is, the communication number is not a research number.
[0296] It is understandable that whether the preset threshold is set reasonably has a great influence on the decision of number category. Therefore, an adaptive preset threshold optimization mechanism can be introduced. Fig.13 A schematic diagram of a process for determining a preset threshold value provided by an embodiment of the present application is shown. Fig.13 As shown, determining the preset threshold may include the following steps:
[0297] 1301. Determine the precision and recall corresponding to different thresholds.
[0298] For example, the precision and recall of the model under different threshold values can be determined respectively.
[0299] 1302. Calculate the harmonic mean of the precision and recall corresponding to different thresholds.
[0300] For example, the harmonic mean of the precision and recall corresponding to different thresholds may be calculated.
[0301] 1303. Determine a preset threshold from different thresholds using the harmonic mean.
[0302] Exemplarily, a threshold corresponding to the largest harmonic mean value may be selected as the preset threshold.
[0303] In one example, a grid search can be performed on the validation set for different thresholds, such as formula (25), to find the optimal threshold that maximizes the F1 score:
[0304] τ opt = argmax τ F1(τ) (25)
[0305] Where F1(τ) is the F1 score under the threshold τ, which can be defined as the harmonic mean of precision and recall as follows (26):
[0306]
[0307] Among them, P(τ) and R(τ) are the precision and recall rate under the threshold τ, respectively.
[0308] Furthermore, after finding the optimal threshold, it can be used for inference decisions in test sets and practical applications as follows:
[0309]
[0310] Where I is the indicator function.
[0311] In the embodiment of the present application, vector mapping can be performed through the first embedding layer to obtain the semantic vector corresponding to the key communication feature; and the semantic vector can be embedded by position encoding through the second embedding layer to obtain the target vector corresponding to the key communication feature. Then, the encoding layer is used to extract features from the target vector to obtain the behavior pattern features; the classification layer is used to identify the behavior pattern features to determine the number category corresponding to the behavior pattern features. The number recognition model in the embodiment of the present application has powerful feature extraction and modeling capabilities, and can mine the complex patterns contained in the user's communication behavior data, thereby significantly improving the accuracy of survey number recognition.
[0312] Based on the number identification method provided in the above embodiment, the present application also provides a specific implementation of a number identification device. Please refer to the following embodiment.
[0313] See first Fig.14 , the number identification device 1400 provided in the embodiment of the present application includes the following modules:
[0314] Acquisition module 1401, used to acquire user communication data;
[0315] Extraction module 1402, used to extract user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data;
[0316] A determination module 1403, configured to determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number;
[0317] The identification module 1404 is used to extract the behavior pattern characteristics corresponding to the key communication data by using the number identification model, and perform investigation number identification on the behavior pattern characteristics based on the investigation number behavior pattern pre-learned by the number identification model.
[0318] In the embodiment of the present application, user attribute data, call behavior data, call object data and time series data can be extracted from the acquired user communication data, and communication key data can be extracted from the user attribute data, call behavior data, call object data and time series data, and then the behavior pattern characteristics corresponding to the key data can be determined using the trained number recognition model, and the number type corresponding to the communication number can be determined to achieve the identification of the survey number. Among them, in the embodiment of the present application, the survey number is identified through various data associated with the user's communication number, which can better explore the complex associations contained in the user's communication number and improve the accuracy of survey number identification.
[0319] As an implementation method of the present application, in order to obtain key communication data, the extraction module 1402 adopts the following method to obtain the key communication data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number: using the random forest model, key data extraction is performed on the user attribute data, call behavior data, call object data and time series data to obtain the key communication data.
[0320] As an implementation method of the present application, the communication key data includes: at least one of number-type features, attribute-type features and behavior-type features, wherein the number-type features are obtained based on call object data; the attribute-type features are obtained based on user attribute data; and the behavior-type features are obtained based on call behavior data; the identification module 1404 uses the number recognition model in the following manner to extract the behavior pattern features corresponding to the communication key data: when the communication key data includes number-type features, the number semantic vector corresponding to the number-type features is generated using the number semantic vector generation method in the number recognition model; when the communication key data includes attribute-type features, the attribute semantic vector generation method in the number recognition model is used to generate the attribute semantic vector corresponding to the attribute-type features; when the communication key data includes behavior-type features, the behavior semantic vector generation method in the number recognition model is used to generate the behavior semantic vector corresponding to the behavior-type features; based on at least one of the number semantic vector, the attribute semantic vector and the behavior semantic vector, the behavior pattern features are obtained.
[0321] As an implementation method of the present application, the recognition module 1404 uses the following method to generate a number semantic vector corresponding to the number feature using the number semantic vector generation method in the number recognition model: segment the number class features to obtain multiple number feature segments; perform vector mapping on each number feature segment respectively to obtain multiple number feature segment vectors; splice multiple number feature segment vectors to obtain the number semantic vector corresponding to the number class features.
[0322] As an implementation method of the present application, the identification module 1404 generates an attribute semantic vector corresponding to the attribute class feature by using the attribute semantic vector generation method in the number recognition model in the following manner: vector mapping is performed on the attribute class feature to obtain the attribute semantic vector corresponding to the attribute class feature.
[0323] As an implementation method of the present application, the identification module 1404 uses the following method to generate a behavior semantic vector corresponding to the behavior feature using the behavior semantic vector generation method in the number recognition model, including: discretizing the behavior feature with continuous values to obtain multiple behavior feature intervals; and performing vector mapping on each behavior feature interval to obtain the behavior semantic vector corresponding to the behavior feature.
[0324] As an implementation method of the present application, the identification module 1404 uses the number recognition model in the following manner to extract the behavior pattern features corresponding to the communication key data: vector mapping is performed on the communication key data through the first embedding layer to obtain the semantic vector corresponding to the communication key feature; the semantic vector is embedded by position encoding through the second embedding layer to obtain the target vector corresponding to the communication key feature; feature extraction is performed on the target vector through the encoding layer to obtain the behavior pattern features; the behavior pattern features are identified through the classification layer to determine the number category corresponding to the behavior pattern features.
[0325] As an implementation of the present application, the encoding layer includes multiple sublayers, and each sublayer includes a multi-head attention layer, a feedforward neural network layer, a normalization layer, and a residual connection layer;
[0326] The recognition module 1404 extracts features of the target vector through the encoding layer to obtain the behavior pattern features in the following manner: perform the following operations on each sub-layer to obtain the behavior pattern features: perform weighted calculation on one or more sub-features corresponding to the target vector based on the multi-head attention mechanism to obtain a first output result, where the one or more sub-features are sub-features obtained by extracting features from the segmented target vector; the feedforward neural network layer extracts features of the first output result through an activation function and a bias vector to obtain a second output result; the normalization layer performs adaptive scaling and parameter shift on the second output result to obtain a third output result; the third output result is residually connected with the input features of the sub-layer to which it belongs through the residual connection layer to obtain the sub-behavior pattern features output by the sub-layer to which it belongs; the sub-behavior pattern features output by multiple sub-layers are concatenated to obtain the behavior pattern features.
[0327] As an implementation method of the present application, the identification module 1404 uses the following method to identify the behavior pattern features through the classification layer to determine the number category corresponding to the behavior pattern features, including: aggregating the behavior pattern features to obtain a behavior pattern vector; using a classification function to determine the probability value and confidence level corresponding to the behavior pattern vector; and determining the number category corresponding to the behavior pattern features through the probability value and confidence level.
[0328] As an implementation method of the present application, the identification module 1404 determines the number category corresponding to the behavior pattern characteristics through the probability value and the confidence level in the following manner: calculate the product between the probability value and the confidence level; when the product is greater than a preset threshold, determine that the behavior pattern characteristics correspond to the first number category; when the product is less than or equal to the preset threshold, determine that the behavior pattern characteristics are the second number category.
[0329] As an implementation method of the present application, when the product is greater than a preset threshold, before determining that the behavior pattern feature corresponds to the first type of behavior pattern, the identification module 1404 is also used to: determine the precision and recall corresponding to different thresholds; calculate the harmonic mean of the precision and recall corresponding to different thresholds; and use the harmonic mean to determine the preset threshold from different thresholds.
[0330] As an implementation method of the present application, the identification module 1404 aggregates the behavior pattern features in the following manner to obtain a behavior pattern vector: obtain the features corresponding to each time step in the behavior pattern features; determine the first feature of the time step corresponding to the maximum feature, and the second feature corresponding to the last time step from the features corresponding to each time step; perform weighted calculation on the first feature and the second feature to obtain a first aggregate feature; perform weighted calculation using the features corresponding to each time step to obtain a second aggregate feature; and concatenate the first aggregate feature and the second aggregate feature to obtain a behavior pattern vector.
[0331] As an implementation method of the present application, in order to improve the accuracy of number recognition, before using the number recognition model to extract the behavioral pattern characteristics corresponding to the communication key data, the device also includes a training module for obtaining a training sample set, the training sample set includes multiple training samples, each training sample includes a communication data sample and a corresponding number category label; the communication data sample is input into a preset number recognition model, and the communication data sample is identified by the preset number recognition model to obtain a predicted number category; the focus loss function value of the number recognition model is calculated using the predicted number category and the number category label; when it is determined that the focus loss function value does not meet the training stop condition, the parameters of the model are adjusted, and the communication data sample is returned to the preset number recognition model, and the communication data sample is identified by the preset number model to obtain a predicted number category, until the training stop condition is met, and a trained number recognition model is obtained.
[0332] Fig.15 A schematic diagram of the hardware structure of number identification provided in an embodiment of the present application is shown.
[0333] The number identification device may include a processor 1501 and a memory 1502 storing computer program instructions.
[0334] Specifically, the processor 1501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0335] Memory 1502 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 1502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 1502 may include removable or non-removable (or fixed) media. In appropriate cases, memory 1502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, memory 1502 is a non-volatile solid-state memory.
[0336] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0337] The processor 1501 implements any one of the number identification methods in the above embodiments by reading and executing the computer program instructions stored in the memory 1502 .
[0338] In one example, the number identification device may further include a communication interface 1503 and a bus 1510. Fig.15 As shown, the processor 1501, the memory 1502, and the communication interface 1503 are connected via a bus 1510 and communicate with each other.
[0339] The communication interface 1503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0340] Bus 1510 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0341] The number identification device can execute the number identification method in the embodiment of the present application based on the communication number, thereby realizing the combination Figure 2 and Fig.14 Described number identification method and device.
[0342] In addition, in combination with the number recognition method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any number recognition method in the above embodiment is implemented.
[0343] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the number recognition methods in the above embodiments when the computer program is executed by a processor.
[0344] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0345] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0346] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0347] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0348] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.
Claims
1. A number identification method, characterized in that: include: Obtain user communication data; Extracting user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data; Determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number; The behavior pattern features corresponding to the communication key data are extracted by using the number recognition model, and based on the survey number behavior pattern pre-learned by the number recognition model, the survey number recognition is performed on the behavior pattern features.
2. The number recognition method according to claim 1, characterized in that: Based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number, the communication key data corresponding to the communication number is obtained, including: The random forest model is used to extract key data from the user attribute data, call behavior data, call object data and time series data to obtain the communication key data.
3. The number recognition method according to claim 1, characterized in that: The communication key data includes: at least one of number-based features, attribute-based features and behavior-based features, wherein the number-based features are obtained based on the call object data; the attribute-based features are obtained based on the user attribute data; and the behavior-based features are obtained based on the call behavior data; The method of utilizing the number recognition model to extract the behavior pattern characteristics corresponding to the key communication data includes: In the case where the communication key data includes number-like features, a number semantic vector corresponding to the number-like features is generated using a number semantic vector generation method in the number recognition model; In the case where the communication key data includes attribute features, an attribute semantic vector corresponding to the attribute features is generated using an attribute semantic vector generation method in the number recognition model; In the case where the communication key data includes behavior features, generating a behavior semantic vector corresponding to the behavior features using a behavior semantic vector generation method in the number recognition model; The behavior pattern feature is obtained based on at least one of the number semantic vector, the attribute semantic vector and the behavior semantic vector.
4. The number recognition method according to claim 3, characterized in that: The method of generating a number semantic vector corresponding to the number class feature by using the number semantic vector generation method in the number recognition model includes: Segmenting the number-type feature to obtain a plurality of number feature segments; Performing vector mapping on each of the number feature segments respectively to obtain a plurality of number feature segment vectors; The multiple number feature segment vectors are concatenated to obtain a number semantic vector corresponding to the number class feature.
5. The number recognition method according to claim 3, characterized in that: The generating of the attribute semantic vector corresponding to the attribute class feature by using the attribute semantic vector generating method in the number recognition model includes: Vector mapping is performed on the attribute-like feature to obtain an attribute semantic vector corresponding to the attribute-like feature.
6. The number recognition method according to claim 3, characterized in that: The generating of the behavior semantic vector corresponding to the behavior feature by using the behavior semantic vector generating method in the number recognition model includes: Discretizing the behavior-like features with continuous values to obtain a plurality of behavior feature intervals; Vector mapping is performed on each of the behavior feature intervals to obtain a behavior semantic vector corresponding to the behavior class feature.
7. The number recognition method according to any one of claims 1 to 3, characterized in that: The method of utilizing the number recognition model to extract the behavior pattern characteristics corresponding to the key communication data includes: Performing vector mapping on the communication key data through a first embedding layer to obtain a semantic vector corresponding to the communication key data; The semantic vector is embedded by position encoding through a second embedding layer to obtain a target vector corresponding to the communication key data; Extracting features of the target vector through a coding layer to obtain behavior pattern features; The behavior pattern feature is identified through a classification layer to determine the number category corresponding to the behavior pattern feature.
8. The number recognition method according to claim 7, characterized in that: The encoding layer includes multiple sublayers, and each sublayer includes a multi-head attention layer, a feedforward neural network layer, a normalization layer and a residual connection layer; The step of extracting features from the target vector through the coding layer to obtain the behavior pattern features includes: The following operations are performed on each sub-layer to obtain the behavior pattern characteristics: Performing weighted calculation on one or more sub-features corresponding to the target vector based on a multi-head attention mechanism to obtain a first output result, wherein the one or more sub-features are sub-features obtained by performing feature extraction on the segmented target vector; The feedforward neural network layer performs feature extraction on the first output result through an activation function and a bias vector to obtain a second output result; The normalization layer adaptively scales and performs parameter shift on the second output result to obtain a third output result; Through the residual connection layer, the third output result is residually connected with the input feature of the corresponding sub-layer to obtain the sub-behavior pattern feature output by the corresponding sub-layer; The sub-behavior pattern features output by the multiple sub-layers are concatenated to obtain the behavior pattern features.
9. The number recognition method according to claim 7, characterized in that: The identifying the behavior pattern feature through the classification layer to determine the number category corresponding to the behavior pattern feature includes: Aggregating the behavior pattern features to obtain a behavior pattern vector; Using a classification function, determining a probability value and a confidence level corresponding to the behavior pattern vector; The number category corresponding to the behavior pattern feature is determined by the probability value and the confidence level.
10. The number recognition method according to claim 9, characterized in that: Determining the number category corresponding to the behavior pattern feature by using the probability value and the confidence level includes: Calculating the product between the probability value and the confidence level; In the case where the product is greater than a preset threshold, determining that the behavior pattern feature corresponds to a first number category; When the product is less than or equal to a preset threshold, the behavior pattern feature is determined to be a second number category.
11. The number recognition method according to claim 10, characterized in that: When the product is greater than a preset threshold, before determining that the behavior pattern feature corresponds to the first type of behavior pattern, the method further includes: Determine the precision and recall corresponding to different thresholds; Calculate the harmonic mean of the precision and recall corresponding to the different thresholds; The harmonic mean is used to determine a preset threshold from the different thresholds.
12. The number recognition method according to claim 9, characterized in that: The step of aggregating the behavior pattern features to obtain a behavior pattern vector includes: Obtaining features corresponding to each time step in the behavior pattern features; From the features corresponding to the respective time steps, determine the first feature of the time step corresponding to the maximum feature, and the second feature corresponding to the last time step; Performing weighted calculation on the first feature and the second feature to obtain a first aggregate feature; Performing weighted calculation using the features corresponding to each time step to obtain a second aggregated feature; The first aggregate feature and the second aggregate feature are concatenated to obtain the behavior pattern vector.
13. The number recognition method according to claim 1, characterized in that: Before extracting the behavior pattern features corresponding to the communication key data using the number recognition model, the method further includes: Acquire a training sample set, the training sample set comprising a plurality of training samples, each training sample comprising a communication data sample and a corresponding number category label; Inputting the communication data sample into a preset number recognition model, identifying the communication data sample by the preset number recognition model, and obtaining a predicted number category; Calculating the focal loss function value of the number recognition model using the predicted number category and the number category label; When it is determined that the focal loss function value does not meet the training stop condition, the parameters of the model are adjusted, and the communication data sample is returned to the preset number recognition model, and the communication data sample is identified by the preset number recognition model to obtain the predicted number category until the training stop condition is met, thereby obtaining a trained number recognition model.
14. A number recognition device, characterized in that: The device comprises: An acquisition module, used to acquire user communication data; An extraction module, used to extract user attribute data, call behavior data, call object data and time series data corresponding to the communication number from the user communication data; A determination module, configured to determine the communication key data corresponding to the communication number based on the user attribute data, call behavior data, call object data and time series data corresponding to the communication number; The identification module is used to extract the behavior pattern characteristics corresponding to the communication key data by using the number identification model, and perform investigation number identification on the behavior pattern characteristics based on the investigation number behavior pattern pre-learned by the number identification model.
15. A number identification device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the number recognition method according to any one of claims 1 to 13 is implemented.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the number recognition method according to any one of claims 1 to 13 is implemented.
17. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the number recognition method as described in any one of claims 1 to 13.