Text clustering method, device, equipment and storage medium based on non-text scenario

By serializing and vectorizing the information to be classified in non-text scenarios, and using clustering algorithms, the problem of difficulty in applying existing text clustering methods in non-text scenarios is solved, and effective classification of information is achieved.

CN112905792BActive Publication Date: 2024-09-24WEBANK (CHINA)
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202110195010.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-20
Publication Date
2024-09-24
Estimated Expiration
2041-02-20

AI Technical Summary

Technical Problem

Existing text clustering methods have limited application scope and are difficult to solve classification problems in non-text scenarios.

Method used

By obtaining the internal logical relationship of the information to be classified in non-text scenarios, serializing it, converting it into a sequence of word vectors, and using a clustering algorithm for clustering, it breaks the application limitations of text clustering methods.

Benefits of technology

It realizes the application of text clustering ideas to non-text scenes, expands the application scope of text clustering methods, and can effectively classify information in non-text scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112905792B
    Figure CN112905792B
Patent Text Reader

Abstract

The present invention relates to the technical field of financial technology (Fintech). The present invention discloses a text clustering method, device, equipment and computer-readable storage medium based on non-text scenarios. The present invention extracts the inherent logical relationship of information to be classified in the non-text scenario, and then serializes it according to the logical relationship, so that the information to be classified in the non-text scenario can also be converted into a sequence form, so as to have the structural relationship of the context in the text, which is convenient for subsequent processing; by vectorizing and clustering the serialized information to be classified, the category of the information to be classified in the non-text scenario is finally obtained, so that the text clustering idea can be applied in the non-text scenario, thereby breaking the limitation of the application scope of the existing text clustering method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a text clustering method, device, equipment and computer-readable storage medium based on non-text scenarios. Background Art

[0002] With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming to financial technology (Fintech), but due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology. Text clustering method is a method that trains word vectors in text words based on text, and uses word vectors as input to cluster them using clustering algorithms. It is usually used in text scenarios and plays an important role in natural language processing. However, in other application scenarios outside of text, there are few practical applications that use the ideas of text clustering methods to solve problems, which reflects the technical problem that the application scope of existing text clustering methods is relatively limited. Summary of the invention

[0003] The main purpose of the present invention is to propose a text clustering method, device and computer-readable storage medium based on non-text scenarios, aiming to solve the technical problem that the application scope of existing text clustering methods is relatively limited.

[0004] To achieve the above object, the present invention provides a text clustering method based on a non-text scenario, and the text clustering method based on a non-text scenario comprises:

[0005] Acquire information to be classified in a non-text scenario, and serialize the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified;

[0006] Vectorizing each of the elements to be classified in the sequence of elements to be classified, so as to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors;

[0007] The vector sequence to be classified is clustered using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories.

[0008] Optionally, the contextual logical relationship includes a time sequence,

[0009] The step of obtaining the information to be classified in the non-text scenario and serializing the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified comprises:

[0010] receiving a classification instruction, and acquiring, based on the classification instruction, a plurality of words to be classified in a non-text scenario and time information corresponding to each of the words to be classified as the information to be classified;

[0011] The plurality of words to be classified are sorted according to a time sequence determined based on the time information, and the sorted words to be classified are used as the elements to be classified to form the sequence of elements to be classified.

[0012] Optionally, the step of using the sorted words to be classified as the elements to be classified to form the sequence of elements to be classified includes:

[0013] Taking the sorted words to be classified as the elements to be classified, to obtain an initial element sequence;

[0014] Determine an interval duration threshold in combination with the non-text scene and the initial element sequence, and obtain the interval duration between each two adjacent elements to be classified;

[0015] Invalid elements to be classified in the initial element sequence are determined based on the interval duration threshold and the interval duration, and the invalid elements to be classified are deleted from the initial element sequence to form the element sequence to be classified.

[0016] Optionally, the step of determining invalid elements to be classified in the initial element sequence based on the interval duration threshold and the interval duration, and deleting the invalid elements to be classified from the initial element sequence to form the element sequence to be classified includes:

[0017] Determine one by one whether each of the interval durations exceeds the interval duration threshold;

[0018] If yes, then the previous element to be classified between the two adjacent elements to be classified corresponding to the interval time length is deleted from the initial element sequence;

[0019] Until all the interval durations are traversed, the sequence of elements to be classified is obtained.

[0020] Optionally, the clustering algorithm includes a K-means clustering algorithm.

[0021] The step of clustering the vector sequence to be classified by using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories includes:

[0022] Based on the K-means clustering algorithm, a preset number of word vectors in the vector sequence to be classified are used as initial clustering centers;

[0023] Allocating the word vectors in the vector sequence to be classified except the initial cluster center to one of the initial cluster centers one by one according to the shortest distance principle until the allocation is completed to generate a preset number of initial vector sets;

[0024] Calculating the mean vector of each of the initial vector sets, and using each of the mean vectors as each new cluster center to continue the allocation process;

[0025] Until it is detected that each of the new cluster centers meets a preset termination condition, each of the new cluster centers is used as a target cluster center, and each of the target cluster centers and the corresponding assigned word vector is used as a vector set.

[0026] Optionally, after the step of clustering the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories, the method further includes:

[0027] Dividing each of the vector sets into a first vector subset with clear category meaning and a second vector subset with unclear category meaning;

[0028] The category meaning of each of the first vector subsets is obtained, and the category meaning is used as the category shared by the first vector subset and the second vector subset in the same vector set and outputted.

[0029] Optionally, the step of vectorizing each of the elements to be classified in the sequence of elements to be classified to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors includes:

[0030] The sequence of elements to be classified is used as an input of Word2vec, so as to utilize Word2vec to convert each of the elements to be classified into a word vector, thereby obtaining the sequence of vectors to be classified.

[0031] In addition, to achieve the above object, the present invention also provides a text clustering device based on a non-text scenario, and the text clustering device based on a non-text scenario includes:

[0032] An element sequence acquisition module is used to acquire information to be classified in a non-text scenario, and to serialize the information to be classified according to the inherent logical relationship of the information to be classified, so as to obtain an element sequence to be classified consisting of a plurality of elements to be classified;

[0033] A vector sequence conversion module, used for vectorizing each of the elements to be classified in the element sequence to be classified, so as to convert the element sequence to be classified into a vector sequence to be classified composed of a plurality of word vectors;

[0034] The vector category division module is used to cluster the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories.

[0035] Optionally, the element sequence acquisition module includes:

[0036] An instruction information acquisition unit, configured to receive a classification instruction, and acquire, based on the classification instruction, a plurality of words to be classified in a non-text scenario and time information corresponding to each of the words to be classified, as the information to be classified;

[0037] The time sequence sorting unit is used to sort the multiple words to be classified according to the time sequence determined based on the time information, and use the sorted words to be classified as the elements to be classified to form the sequence of elements to be classified.

[0038] Optionally, the time sequence sorting unit is further used for:

[0039] Taking the sorted words to be classified as the elements to be classified, to obtain an initial element sequence;

[0040] Determine an interval duration threshold in combination with the non-text scene and the initial element sequence, and obtain the interval duration between each two adjacent elements to be classified;

[0041] Invalid elements to be classified in the initial element sequence are determined based on the interval duration threshold and the interval duration, and the invalid elements to be classified are deleted from the initial element sequence to form the element sequence to be classified.

[0042] Optionally, the time sequence sorting unit is further used for:

[0043] Determine one by one whether each of the interval durations exceeds the interval duration threshold;

[0044] If yes, then the previous element to be classified between the two adjacent elements to be classified corresponding to the interval time length is deleted from the initial element sequence;

[0045] Until all the interval durations are traversed, the sequence of elements to be classified is obtained.

[0046] Optionally, the clustering algorithm includes a K-means clustering algorithm.

[0047] The vector classification module comprises:

[0048] An initial center determination unit, configured to use a preset number of word vectors in the to-be-classified vector sequence as initial clustering centers based on a K-means clustering algorithm;

[0049] An initial set generating unit, used to assign the word vectors in the vector sequence to be classified except the initial cluster center to the initial cluster center one by one according to the shortest distance principle, until the assignment is completed to generate a preset number of initial vector sets;

[0050] A cluster center iteration unit, used to calculate the mean vector of each of the initial vector sets, and use each of the mean vectors as each new cluster center to continue the allocation process;

[0051] The vector set determination unit is used to use each of the new cluster centers as the target cluster centers until it is detected that each of the new cluster centers meets a preset termination condition, so as to use each of the target cluster centers and the corresponding assigned word vector as a vector set.

[0052] Optionally, the text clustering device based on non-text scenarios further includes:

[0053] A vector set division module, used for dividing each of the vector sets into a first vector subset with clear category meaning and a second vector subset with unclear category meaning;

[0054] The category output module is used to obtain the category meaning of each of the first vector subsets, and output the category meaning as the category shared by the first vector subset and the second vector subset in the same vector set.

[0055] Optionally, the vector sequence conversion module includes:

[0056] The vector sequence conversion unit is used to use the sequence of elements to be classified as the input of Word2vec, so as to use Word2vec to convert each of the elements to be classified into a word vector to obtain the sequence of vectors to be classified.

[0057] In addition, to achieve the above-mentioned purpose, the present invention also provides a text clustering device based on non-text scenarios, and the text clustering device based on non-text scenarios includes: a memory, a processor, and a text clustering program based on non-text scenarios stored in the memory and executable on the processor, and when the text clustering program based on non-text scenarios is executed by the processor, the steps of the text clustering method based on non-text scenarios as described above are implemented.

[0058] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a text clustering program based on non-text scenarios is stored. When the text clustering program based on non-text scenarios is executed by a processor, the steps of the text clustering method based on non-text scenarios as described above are implemented.

[0059] The present invention provides a text clustering method, device, equipment and computer-readable storage medium based on non-text scenarios. The present invention extracts the inherent logical relationship of information to be classified in the non-text scenario, and then serializes it according to the logical relationship, so that the information to be classified in the non-text scenario can also be converted into a sequence form, so that it has the structural relationship of the context in the text, which is convenient for subsequent processing; by vectorizing and clustering the serialized information to be classified, the category of the information to be classified in the non-text scenario is finally obtained, so that the text clustering idea can be applied in the non-text scenario, thereby breaking the limitation of the application scope of the existing text clustering method and solving the technical problem that the application scope of the existing text clustering method is relatively limited. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;

[0061] Figure 2 It is a flowchart of a first embodiment of a text clustering method based on a non-text scenario of the present invention;

[0062] Figure 3 It is a flowchart of a specific embodiment of the first embodiment of the text clustering method based on non-text scenarios of the present invention;

[0063] Figure 4 It is a schematic diagram of the functional modules of the text clustering device based on non-text scenarios of the present invention.

[0064] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0065] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0066] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0067] like Figure 1As shown, the text clustering device based on non-text scenes may include: a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0068] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0069] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a text clustering program based on non-text scenarios.

[0070] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (programmer end) and perform data communication with the client; and the processor 1001 can be used to call the text clustering program based on the non-text scene stored in the memory 1005, and perform the following operations in the text clustering method based on the non-text scene:

[0071] Acquire information to be classified in a non-text scenario, and serialize the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified;

[0072] Vectorizing each of the elements to be classified in the sequence of elements to be classified, so as to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors;

[0073] The vector sequence to be classified is clustered using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories.

[0074] Furthermore, the contextual logical relationship includes a time sequence,

[0075] The step of obtaining the information to be classified in the non-text scenario and serializing the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified comprises:

[0076] receiving a classification instruction, and acquiring, based on the classification instruction, a plurality of words to be classified in a non-text scenario and time information corresponding to each of the words to be classified as the information to be classified;

[0077] The plurality of words to be classified are sorted according to a time sequence determined based on the time information, and the sorted words to be classified are used as the elements to be classified to form the sequence of elements to be classified.

[0078] Furthermore, the step of using the sorted words to be classified as the elements to be classified to form the sequence of elements to be classified includes:

[0079] Taking the sorted words to be classified as the elements to be classified, to obtain an initial element sequence;

[0080] Determine an interval duration threshold in combination with the non-text scene and the initial element sequence, and obtain the interval duration between each two adjacent elements to be classified;

[0081] Invalid elements to be classified in the initial element sequence are determined based on the interval duration threshold and the interval duration, and the invalid elements to be classified are deleted from the initial element sequence to form the element sequence to be classified.

[0082] Further, the step of determining the invalid elements to be classified in the initial element sequence based on the interval duration threshold and the interval duration, and deleting the invalid elements to be classified from the initial element sequence to form the element sequence to be classified includes:

[0083] Determine one by one whether each of the interval durations exceeds the interval duration threshold;

[0084] If yes, then the previous element to be classified between the two adjacent elements to be classified corresponding to the interval time length is deleted from the initial element sequence;

[0085] Until all the interval durations are traversed, the sequence of elements to be classified is obtained.

[0086] Furthermore, the clustering algorithm includes a K-means clustering algorithm.

[0087] The step of clustering the vector sequence to be classified by using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories includes:

[0088] Based on the K-means clustering algorithm, a preset number of word vectors in the vector sequence to be classified are used as initial clustering centers;

[0089] Allocating the word vectors in the vector sequence to be classified except the initial cluster center to one of the initial cluster centers one by one according to the shortest distance principle until the allocation is completed to generate a preset number of initial vector sets;

[0090] Calculating the mean vector of each of the initial vector sets, and using each of the mean vectors as each new cluster center to continue the allocation process;

[0091] Until it is detected that each of the new cluster centers meets a preset termination condition, each of the new cluster centers is used as a target cluster center, and each of the target cluster centers and the corresponding assigned word vector is used as a vector set.

[0092] Further, after the step of clustering the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories, the processor 1001 can be used to call the text clustering program based on non-text scenarios stored in the memory 1005, and perform the following operations in the text clustering method based on non-text scenarios:

[0093] Dividing each of the vector sets into a first vector subset with clear category meaning and a second vector subset with unclear category meaning;

[0094] The category meaning of each of the first vector subsets is obtained, and the category meaning is used as the category shared by the first vector subset and the second vector subset in the same vector set and outputted.

[0095] Furthermore, the step of vectorizing each of the elements to be classified in the sequence of elements to be classified to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors includes:

[0096] The sequence of elements to be classified is used as an input of Word2vec, so as to utilize Word2vec to convert each of the elements to be classified into a word vector, thereby obtaining the sequence of vectors to be classified.

[0097] Based on the above hardware structure, an embodiment of the text clustering method based on non-text scenarios of the present invention is proposed.

[0098] To solve the above problems, the present invention provides a text clustering method based on non-text scenarios, that is, by first extracting the inherent logical relationship of the information to be classified in the non-text scenario, and then serializing it according to the logical relationship, so that the information to be classified in the non-text scenario can also be converted into a sequence form, so as to have the structural relationship of the context in the text, which is convenient for subsequent processing; by vectorizing and clustering the serialized information to be classified, the category to which the information to be classified in the non-text scenario belongs is finally obtained, so that the text clustering idea can be applied to the non-text scenario, thereby breaking the limitation of the application scope of the existing text clustering method and solving the technical problem that the application scope of the existing text clustering method is relatively limited.

[0099] Reference Figure 2 , Figure 2 The flowchart of the first embodiment of the text clustering method based on non-text scenarios of the present invention is shown in FIG. The text clustering method based on non-text scenarios includes:

[0100] Step S10, obtaining information to be classified in a non-text scenario, and serializing the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified;

[0101] In this embodiment, the method is applied to a terminal device. Non-text scenarios refer to certain actual scenarios other than text, such as different place names that appear in different periods of a day, APPs downloaded by users at different time points, etc. Information to be classified refers to information that needs to be classified in non-text scenarios, and can be information in various forms. For example, if the information to be classified is location information, the location information may be in the form of text, longitude and latitude, etc. The internal logical relationship is usually expressed in chronological order, and other orders may also be used to express it in actual situations. The element to be classified refers to the sequence element after the information to be classified is serialized, and the sequence of elements to be classified is usually composed of multiple elements to be classified.

[0102] If the terminal obtains a series of information that needs to be classified in the current clustering task in a non-text scenario, it is necessary to first extract the logical relationship inherent in this series of information, and then serialize this series of information according to this contextual logical relationship so that it has a structural relationship in the context of the text. This series of information is converted into multiple elements to be classified to form a sequence of elements to be classified. Each element to be classified in the sequence can be regarded as a word in the text.

[0103] Step S20, vectorizing each of the elements to be classified in the sequence of elements to be classified, so as to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors;

[0104] In this embodiment, word vector refers to the vector obtained by vectorizing the elements to be classified. Commonly used methods for vectorizing sequence data include Word2vec, one-hot encoding, label encoding, etc., and the preferred method is Word2vec. Word2vec is a toolkit for obtaining word vectors launched by Google in 2013. It is simple and efficient, and is generally divided into two models: CBOW and Skip-Gram. One-hot encoding is also called one-bit effective encoding. Its method is to use an N-bit state register to encode N states. Each state has its own independent register bit, and at any time, only one of them is valid.

[0105] The terminal vectorizes each element to be classified in the sequence of elements to be classified by some sequence data vectorization method, so that each element to be classified is converted into a word vector, and the original sequence of elements to be classified is correspondingly converted into a sequence of vectors to be classified.

[0106] Step S30: clustering the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories.

[0107] In this embodiment, the clustering algorithm can specifically adopt the K-means clustering algorithm, the mean shift clustering algorithm, the density-based spatial clustering algorithm (DBSCAN, Density-Based Spatial Clustering of Applications with Noise), etc., preferably the K-means clustering algorithm. The K-means clustering algorithm is an iterative clustering analysis algorithm, and its steps are: pre-dividing the data into K groups, then randomly selecting K objects as the initial clustering centers, and then calculating the distance between each object and each seed clustering center, and assigning each object to the clustering center closest to it. The clustering center and the objects assigned to them represent a cluster. Each time a sample is assigned, the clustering center of the cluster will be recalculated according to the existing objects in the cluster. This process will be repeated until a certain termination condition is met. The mean shift clustering algorithm first assumes that each cluster in the sample space obeys a known probability distribution rule, and then fits the statistical histogram in the sample with different probability density functions, and continuously moves the position of the center (mean) of the density function until the best fitting effect is obtained. The peak points of these probability density functions are the centers of the clusters. Then, according to the distance of each sample from each center, the category to which the nearest cluster center belongs is selected as the category of the sample. DBSCAN is a density-based spatial clustering algorithm. The algorithm divides areas with sufficient density into clusters and finds clusters of arbitrary shapes in a noisy spatial database. It defines a cluster as the largest set of density-connected points.

[0108] The terminal uses a clustering algorithm to cluster the current vector sequence to be classified. For example, the current vector sequence to be classified contains 10 word vectors, which are divided into three vector sets belonging to different categories after clustering. The first vector set has 3 word vectors, the second vector set has 2 word vectors, and the third vector set has 5 word vectors. This means that these 3 word vectors belong to the first category, these 2 word vectors belong to the second category, and these 5 word vectors belong to the third category.

[0109] As a specific embodiment, Figure 3 As shown. Taking the different locations where customers appear in a time series (such as different time periods within a day) as an example, the idea of ​​text clustering can be used to effectively cluster locations (which can be in any form, such as text, longitude and latitude, etc.). After the terminal preprocesses a series of location information through a certain technology, each location is sorted according to its corresponding time order as a sequence; then the terminal vectorizes the sorted locations based on the Word2vec tool to obtain a series of location vectors, and finally uses the K-means clustering algorithm to cluster a series of location vectors. The locations in the same cluster are considered to belong to the same category. The specific category of the cluster is determined and output through the locations with clear category meanings, thereby realizing rapid identification of the categories to which all locations belong.

[0110] The present invention provides a text clustering method based on a non-text scenario. The text clustering method based on a non-text scenario obtains information to be classified in a non-text scenario, and serializes the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a number of elements to be classified; vectorizes each of the elements to be classified in the sequence of elements to be classified to convert the sequence of elements to be classified into a sequence of vectors to be classified consisting of a number of word vectors; and clusters the sequence of vectors to be classified using a preset clustering algorithm to divide the word vectors into a number of vector sets belonging to different categories. The present invention extracts the inherent logical relationship of the information to be classified in a non-text scenario first, and then serializes it according to the logical relationship, so that the information to be classified in the non-text scenario can also be converted into a sequence form, so that it has the structural relationship of the context in the text, which is convenient for subsequent processing; by vectorizing and clustering the serialized information to be classified, the category to which the information to be classified in the non-text scenario belongs is finally obtained, so that the text clustering idea can be applied in the non-text scenario, thereby breaking the limitation of the application scope of the existing text clustering method and solving the technical problem that the application scope of the existing text clustering method is relatively limited.

[0111] Furthermore, based on the above Figure 2The first embodiment shown in the figure proposes a second embodiment of the text clustering method based on non-text scenes of the present invention. In this embodiment, the contextual logical relationship includes a time sequence, and step S10 includes:

[0112] receiving a classification instruction, and acquiring, based on the classification instruction, a plurality of words to be classified in a non-text scenario and time information corresponding to each of the words to be classified as the information to be classified;

[0113] The plurality of words to be classified are sorted according to a time sequence determined based on the time information, and the sorted words to be classified are used as the elements to be classified to form the sequence of elements to be classified.

[0114] In this embodiment, the information to be classified includes multiple words to be classified and the time information corresponding to each word to be classified. When the terminal receives the classification instruction, it can directly obtain the information of the specified customer appearing in different places within the specified time, and the time information of appearing in each place according to the classification instruction; or the APP information downloaded by the customer within the specified time, and the download time information of each APP. The terminal can regard each location information or APP information as a word, that is, the above-mentioned word to be classified, and the location information or APP information and its corresponding time line are collectively used as the above-mentioned information to be classified. The terminal sorts all the current words in the time sequence indicated by the time information corresponding to each word, and the above-mentioned sequence of elements to be classified can be obtained.

[0115] Furthermore, the step of using the sorted words to be classified as the elements to be classified to form the sequence of elements to be classified includes:

[0116] Taking the sorted words to be classified as the elements to be classified, to obtain an initial element sequence;

[0117] Determine an interval duration threshold in combination with the non-text scene and the initial element sequence, and obtain the interval duration between each two adjacent elements to be classified;

[0118] Invalid elements to be classified in the initial element sequence are determined based on the interval duration threshold and the interval duration, and the invalid elements to be classified are deleted from the initial element sequence to form the element sequence to be classified.

[0119] In this embodiment, the validity of the logical relationship between each two adjacent elements in the sequence also needs to be considered. If the time interval between two adjacent elements is too long, then the previous element will hardly be used as a reference for influencing the next element. This time interval needs to be determined in combination with the current non-text scene and the specific data performance.

[0120] The terminal uses the sequence formed by sorting the words to be classified as the initial element sequence, and then determines an interval time threshold based on the current actual scenario and the data performance in the sequence. The terminal obtains the time interval between each two adjacent elements in the current sequence, and combines the interval time threshold with the time interval between each two adjacent elements to determine the invalid elements in the current sequence and remove them, and uses the sequence after removing all invalid elements as the above-mentioned element sequence to be classified.

[0121] Further, the step of determining the invalid elements to be classified in the initial element sequence based on the interval duration threshold and the interval duration, and deleting the invalid elements to be classified from the initial element sequence to form the element sequence to be classified includes:

[0122] Determine one by one whether each of the interval durations exceeds the interval duration threshold;

[0123] If yes, then the previous element to be classified between the two adjacent elements to be classified corresponding to the interval time length is deleted from the initial element sequence;

[0124] Until all the interval durations are traversed, the sequence of elements to be classified is obtained.

[0125] In this embodiment, specifically, the terminal needs to determine one by one whether the time interval between each two adjacent elements exceeds the interval time threshold. If exceeded, it means that the logical relationship between the two loud elements may have been greatly attenuated and no longer has the contextual relationship in the text, and should be removed from the current sequence; if not exceeded, continue to compare the next one until the time intervals between all adjacent elements are traversed to obtain the final sequence of elements to be classified.

[0126] Furthermore, this embodiment determines the interval time threshold by combining actual non-text scenarios and actual data performance to screen out invalid elements in the sequence whose logical relationship with the subsequent element to be classified is excessively attenuated, thereby ensuring the validity of the final sequence of elements to be classified, and further ensuring the accuracy of the final clustering result.

[0127] Furthermore, based on the above Figure 2 The first embodiment shown in the figure proposes a third embodiment of the text clustering method based on non-text scenarios of the present invention. In this embodiment, the clustering algorithm includes a K-means clustering algorithm, and step S30 includes:

[0128] Based on the K-means clustering algorithm, a preset number of word vectors in the vector sequence to be classified are used as initial clustering centers;

[0129] Allocating the word vectors in the vector sequence to be classified except the initial cluster center to one of the initial cluster centers one by one according to the shortest distance principle until the allocation is completed to generate a preset number of initial vector sets;

[0130] Calculating the mean vector of each of the initial vector sets, and using each of the mean vectors as each new cluster center to continue the allocation process;

[0131] Until it is detected that each of the new cluster centers meets a preset termination condition, each of the new cluster centers is used as a target cluster center, and each of the target cluster centers and the corresponding assigned word vector is used as a vector set.

[0132] In this embodiment, the terminal selects K (K is a preset value) word vectors from the current sequence as the initial clustering center according to the K-means clustering algorithm, and then assigns each of the remaining word vectors to the nearest initial clustering center to obtain a set of K initial vectors. The terminal then starts to calculate the mean vector of the combination of each initial vector to determine it as the new clustering center required for a new round of iteration, and continues the assignment process until it is detected that the new clustering center in a certain round of iteration meets the preset termination condition, such as when the distance between the new clustering center and the initial clustering center is less than a preset threshold, etc., the iterative process is terminated, and the new clustering center at this time is used as the final target clustering center, and each target clustering center and the word vector corresponding to the target clustering center are used as a vector set belonging to the same category.

[0133] Furthermore, after step S30, the method further includes:

[0134] Dividing each of the vector sets into a first vector subset with clear category meaning and a second vector subset with unclear category meaning;

[0135] The category meaning of each of the first vector subsets is obtained, and the category meaning is used as the category shared by the first vector subset and the second vector subset in the same vector set and outputted.

[0136] In this embodiment, the first vector subset represents a set of word vectors with clear category meanings in a vector set; the second vector subset represents a set of word vectors with unclear category meanings in a vector set. Since clustering is equivalent to dividing the original multiple elements to be classified into multiple sets according to categories, each set may contain words with clear category meanings and words with unclear category meanings at the same time, so the category of the words with unclear category meanings can be quickly determined by the words with category meanings. For example, the words corresponding to an existing vector set include KTV, cinema and AAA. Since the first two words are words with clear category meanings, their categories are obviously entertainment venues, then the category of "AAA" belonging to the same category should also be entertainment venues, so entertainment venues can be used as the category of the vector set and displayed, and the same applies to other clusters.

[0137] Further, step S20 includes:

[0138] The sequence of elements to be classified is used as an input of Word2vec, so as to utilize Word2vec to convert each of the elements to be classified into a word vector, thereby obtaining the sequence of vectors to be classified.

[0139] In this embodiment, Word2vec is a toolkit for obtaining word vectors launched by Google in 2013. It is a group of related models for generating word vectors. These models are shallow and double-layer neural networks used for training to reconstruct linguistic word texts. The network is represented by words, and it is necessary to guess the input words in adjacent positions. Under the assumption of the bag of words model in word2vec, the order of words is not important. After training, the word2vec model can be used to map each word to a vector, which can be used to represent the relationship between words. The vector is the hidden layer of the neural network. The specific operation process is a common method in this field and will not be repeated here.

[0140] Furthermore, this embodiment predicts the category of words with unclear category meanings by utilizing the category of words with clear category meanings in the same cluster, and outputs it as the common category of the cluster, so that the category meanings of all words with unclear category meanings in this classification task can be determined quickly and accurately.

[0141] like Figure 4 As shown, the present invention also provides a text clustering device based on a non-text scenario, and the text clustering device based on a non-text scenario includes:

[0142] An element sequence acquisition module 10 is used to acquire information to be classified in a non-text scenario, and to serialize the information to be classified according to the inherent logical relationship of the information to be classified, so as to obtain an element sequence to be classified consisting of a plurality of elements to be classified;

[0143] A vector sequence conversion module 20, configured to vectorize each of the elements to be classified in the element sequence to be classified, so as to convert the element sequence to be classified into a vector sequence to be classified composed of a plurality of word vectors;

[0144] The vector category division module 30 is used to cluster the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories.

[0145] The methods executed by the above-mentioned program modules can refer to the various embodiments of the text clustering method based on non-text scenarios of the present invention, which will not be described in detail here.

[0146] The present invention also provides a text clustering device based on non-text scenarios.

[0147] The text clustering device based on non-text scenarios includes a processor, a memory, and a text clustering program based on non-text scenarios stored in the memory and executable on the processor, wherein when the text clustering program based on non-text scenarios is executed by the processor, the steps of the text clustering method based on non-text scenarios as described above are implemented.

[0148] Among them, the method implemented when the text clustering program based on non-text scenarios is executed can refer to the various embodiments of the text clustering method based on non-text scenarios of the present invention, and will not be repeated here.

[0149] The present invention also provides a computer-readable storage medium.

[0150] The computer-readable storage medium of the present invention stores a text clustering program based on non-text scenarios, and when the text clustering program based on non-text scenarios is executed by a processor, the steps of the text clustering method based on non-text scenarios as described above are implemented.

[0151] Among them, the method implemented when the text clustering program based on non-text scenarios is executed can refer to the various embodiments of the text clustering method based on non-text scenarios of the present invention, and will not be repeated here.

[0152] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0153] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0155] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A text clustering method based on non-text scenarios, characterized in that: The text clustering method based on non-text scenarios includes: Acquire information to be classified in a non-text scenario, and serialize the information to be classified according to the internal logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified; Vectorizing each of the elements to be classified in the sequence of elements to be classified, so as to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors; Clustering the vector sequence to be classified using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories; Dividing each of the vector sets into a first vector subset with clear category meaning and a second vector subset with unclear category meaning; Obtaining the category meaning of each of the first vector subsets, and outputting the category meaning as the category shared by the first vector subset and the second vector subset in the same vector set; The logical relationship includes a time sequence, and the steps of obtaining the information to be classified in a non-text scenario and serializing the information to be classified according to the inherent logical relationship of the information to be classified to obtain a sequence of elements to be classified consisting of a plurality of elements to be classified include: receiving a classification instruction, and acquiring, based on the classification instruction, a plurality of words to be classified in a non-text scenario and time information corresponding to each of the words to be classified as the information to be classified; Sorting the plurality of words to be classified according to the time order determined based on the time information, and using the sorted words to be classified as the elements to be classified to obtain an initial element sequence; Determine an interval duration threshold in combination with the non-text scene and the initial element sequence, and obtain the interval duration between each two adjacent elements to be classified; Determine an invalid element to be classified in the initial element sequence based on the interval time threshold and the interval time, and delete the invalid element to be classified from the initial element sequence to form the sequence of elements to be classified, wherein the invalid element to be classified is the first element to be classified of the two elements to be classified whose interval time exceeds the interval time threshold, and there is no contextual relationship in the text between the invalid element to be classified and the second element to be classified; The step of determining the invalid elements to be classified in the initial element sequence based on the interval duration threshold and the interval duration, and deleting the invalid elements to be classified from the initial element sequence to form the element sequence to be classified includes: Determine one by one whether each of the interval durations exceeds the interval duration threshold; If yes, then the previous element to be classified between the two adjacent elements to be classified corresponding to the interval time length is deleted from the initial element sequence; Until all the interval durations are traversed, the sequence of elements to be classified is obtained.

2. The text clustering method based on non-text scenarios as claimed in claim 1, characterized in that: The clustering algorithm includes a K-means clustering algorithm, The step of clustering the vector sequence to be classified by using a preset clustering algorithm to divide the word vectors into a plurality of vector sets belonging to different categories includes: Based on the K-means clustering algorithm, a preset number of word vectors in the vector sequence to be classified are used as initial clustering centers; Allocating the word vectors in the vector sequence to be classified except the initial cluster center to one of the initial cluster centers one by one according to the shortest distance principle until the allocation is completed to generate a preset number of initial vector sets; Calculating the mean vector of each of the initial vector sets, and using each of the mean vectors as each new cluster center to continue the allocation process; Until it is detected that each of the new cluster centers meets a preset termination condition, each of the new cluster centers is used as a target cluster center, and each of the target cluster centers and the corresponding assigned word vector is used as a vector set.

3. The text clustering method based on non-text scenarios as described in any one of claims 1-2, characterized in that: The step of vectorizing each of the elements to be classified in the sequence of elements to be classified to convert the sequence of elements to be classified into a sequence of vectors to be classified composed of a plurality of word vectors comprises: The sequence of elements to be classified is used as an input of Word2vec, so as to utilize Word2vec to convert each of the elements to be classified into a word vector, thereby obtaining the sequence of vectors to be classified.

4. A text clustering device based on non-text scenarios, characterized in that: The text clustering device based on non-text scenarios comprises: An element sequence acquisition module is used to acquire information to be classified in a non-text scenario, and to serialize the information to be classified according to the inherent logical relationship of the information to be classified, so as to obtain an element sequence to be classified consisting of a plurality of elements to be classified; A vector sequence conversion module, used for vectorizing each of the elements to be classified in the element sequence to be classified, so as to convert the element sequence to be classified into a vector sequence to be classified composed of a plurality of word vectors; A vector classification module, used for clustering the vector sequence to be classified using a preset clustering algorithm, so as to divide the word vectors into a plurality of vector sets belonging to different categories; The vector category division module is further used to: divide each of the vector sets into a first vector subset with a clear category meaning and a second vector subset with an unclear category meaning; obtain the category meaning of each of the first vector subsets, and output the category meaning as a category shared by the first vector subset and the second vector subset in the same vector set; Wherein, the logical relationship includes a time sequence, and the element sequence acquisition module is also used to: receive a classification instruction, and based on the classification instruction, acquire multiple words to be classified in a non-text scene and the time information corresponding to each of the words to be classified as the information to be classified; sort the multiple words to be classified according to the time sequence determined based on the time information, and use each sorted word to be classified as each element to be classified to obtain an initial element sequence; determine an interval time threshold in combination with the non-text scene and the initial element sequence, and obtain the interval time between each two adjacent elements to be classified; determine invalid elements to be classified in the initial element sequence based on the interval time threshold and the interval time, and delete the invalid elements to be classified from the initial element sequence to form the element sequence to be classified, wherein the invalid element to be classified is the first element to be classified between the two elements to be classified whose interval time exceeds the interval time threshold, and there is no contextual relationship in the text between the invalid element to be classified and the second element to be classified; The element sequence acquisition module is also used to: determine one by one whether each of the interval durations exceeds the interval duration threshold; if so, delete the previous element to be classified between the two adjacent elements to be classified corresponding to the interval duration from the initial element sequence; until all the interval durations are traversed to obtain the element sequence to be classified.

5. A text clustering device based on non-text scenarios, characterized in that: The text clustering device based on non-text scenarios includes: a memory, a processor, and a text clustering program based on non-text scenarios stored in the memory and executable on the processor. When the text clustering program based on non-text scenarios is executed by the processor, the steps of the text clustering method based on non-text scenarios as described in any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a text clustering program based on a non-text scenario, and when the text clustering program based on a non-text scenario is executed by a processor, the steps of the text clustering method based on a non-text scenario as described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method of pushing information by combining geographic position of terminal, and server

    CN105430032A

  • Detection method for user group behavior rules based on stay places in mobile trajectory

    CN106339417A

  • Site recommendation method based on time and geographical location information integrally

    CN106776930A

  • Scenic spot recommendation method based on gated recurrent unit neural network

    CN109993668A

  • Network behavior abnormity detection method based on sub-track mode

    CN110113368A