Merchant text recognition method, device, equipment and storage medium

By configuring weight coefficients for merchant texts and performing weighted summation, and combining the text mining results from the sample library for clustering, the problem of low recognition accuracy caused by the short length of merchant texts is solved, and higher accuracy in merchant text classification is achieved.

CN115618871BActive Publication Date: 2025-12-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110791436.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2025-12-12
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

In existing technologies, the length of merchant text is relatively short, resulting in fewer features reflected in the extracted feature vectors. This makes it difficult to train a sufficiently accurate classification model, leading to poor accuracy in merchant text recognition.

Method used

By acquiring the merchant text to be identified, weight coefficients are configured to perform weighted summation on each word, and text mining is performed using pre-annotated merchant text in the sample library to obtain keywords, topic words, entity words and frequent sequence patterns, and clustering is performed to determine the merchant text category.

Benefits of technology

It improves the accuracy of merchant text recognition by obtaining more comprehensive feature vectors through different types of feature words, thus achieving more accurate merchant text classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618871B_ABST
    Figure CN115618871B_ABST
Patent Text Reader

Abstract

The application provides a merchant text recognition method, device and equipment and a storage medium. The method comprises the following steps: obtaining a to-be-recognized merchant text; for each type of feature word, according to whether each word in the to-be-recognized merchant text is a feature word of the type, configuring a corresponding weight coefficient for each word in the to-be-recognized merchant text, and performing weighted summation on the word vectors of each word in the to-be-recognized merchant text by using the configured weight coefficients to obtain a feature vector corresponding to the type of the to-be-recognized merchant text; the types of feature words include any multiple of keywords, subject words, entity words and words belonging to frequent sequence patterns; and the feature vectors corresponding to each type of the to-be-recognized merchant text are integrated and clustered to obtain a category to which the to-be-recognized merchant text belongs. Compared with the prior art, the feature vectors of different types obtained by the present scheme can reflect more features of the merchant text, so that the category to which the merchant text belongs can be more accurately recognized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text recognition, and in particular to a merchant text recognition method, device, equipment and storage medium. BACKGROUND

[0002] With the popularity of mobile internet technology (such as mobile payment), the amount of online merchant text data is increasing day by day, and the recognition of merchant text (or the classification of merchant text) plays an increasingly important role in the fields of merchant portrait construction, user consumption preference analysis, and user rights recommendation.

[0003] Merchant text refers to text containing a merchant name, such as the merchant text "A pays 2 yuan to XX clothing store", which contains the merchant name "XX clothing store". The recognition of merchant text refers to identifying the category to which the merchant in the merchant text belongs, such as identifying that "XX clothing store" belongs to the clothing category.

[0004] One method of recognizing merchant text is to obtain a large number of pre-classified merchant text samples, train a classification model (which can be a multi-classification model or multiple binary classification models) using the feature vectors of these merchant text samples, and then input the feature vector of the merchant text to be recognized into the trained classification model to obtain the category to which the merchant text to be recognized belongs.

[0005] The problem with this method is that the length of the merchant text (such as the example above) is short, and the corresponding extracted feature vector can only reflect fewer features of the merchant text. It is difficult to train an accurate enough classification model using the feature vector of the merchant text, so the accuracy of this method for recognizing merchant text is poor. SUMMARY

[0006] To solve the above problems of the prior art, the present application provides a merchant text recognition method, device, equipment and storage medium to provide a more accurate merchant text recognition scheme.

[0007] The first aspect of the present application provides a merchant text recognition method, comprising:

[0008] obtaining a merchant text to be recognized;

[0009] For each type of feature word, a corresponding weight coefficient is configured for each word in the to-be-identified merchant text according to whether the word is a feature word of the type, and a word vector of each word in the to-be-identified merchant text is weighted and summed by using the configured weight coefficient to obtain a feature vector corresponding to the type for the to-be-identified merchant text; wherein the type of feature word includes any multiple of a keyword, a subject word, an entity word, and a word belonging to a frequent sequence pattern; the feature word is obtained by text mining on a plurality of merchant texts in a sample library, which are pre-labeled with a category; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts in the sample library; the sequence pattern is composed of at least one word in the text;

[0010] For each type of feature word, a corresponding weight coefficient is configured for each word in the to-be-identified merchant text according to whether the word is a feature word of the type, and a word vector of each word in the to-be-identified merchant text is weighted and summed by using the configured weight coefficient to obtain a feature vector corresponding to the type for the to-be-identified merchant text; wherein the type of feature word includes any multiple of a keyword, a subject word, an entity word, and a word belonging to a frequent sequence pattern; the feature word is obtained by text mining on a plurality of merchant texts in a sample library, which are pre-labeled with a category; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts in the sample library; the sequence pattern is composed of at least one word in the text;

[0011] The most frequently occurring clustering result in the plurality of clustering results is determined as a final clustering result, and the category to which the to-be-identified merchant text belongs is determined according to the final clustering result.

[0012] Optionally, after the to-be-identified merchant text is added to the sample library, the sample library is subjected to text mining to update any one or more types of feature words.

[0013] The to-be-identified merchant text is added to the sample library.

[0014] The sample library after the to-be-identified merchant text is added is subjected to text mining to update any one or more types of feature words.

[0015] Optionally, the process of obtaining the keywords by text mining on the merchant texts in the sample library includes:

[0016] For each category of merchant text in the sample library, the word frequency and the inverse document frequency of each word in the category of merchant text are counted, and the category feature weight of each word is calculated according to the word frequency and the inverse document frequency of each word.

[0017] For each category of merchant text in the sample library, a word in the category of merchant text with a category feature weight greater than a second threshold is selected as a keyword.

[0018] Optionally, the process of obtaining the subject words by text mining on the merchant texts in the sample library includes:

[0019] For each category of merchant text in the sample library, determine the first word frequency and the second word frequency of each word in the category of merchant text, and determine the theme comprehensive weight of each word according to the difference between the first word frequency and the second word frequency of each word; wherein the first word frequency is the word frequency of the word in the category of merchant text; the second word frequency is the word frequency of the word in the merchant text of other categories except the category;

[0020] For each category of merchant text in the sample library, select N words as theme words in the order of theme comprehensive weight of each word in the category of merchant text from large to small; wherein N is a preset positive integer.

[0021] The second aspect of the application provides a kind of identification device of merchant text, comprising:

[0022] Mining unit, for a plurality of merchant texts in sample library pre-labeled with category are text mining, obtain multiple types of feature words;Wherein, the type of feature word includes any multiple of keyword, theme word, entity word and the word belonging to frequent sequence mode;The frequent sequence mode refers to the sequence mode with support rate greater than the first threshold in the merchant text of the sample library;Sequence mode is composed of at least one word in the text;

[0023] Acquisition unit, for acquiring the merchant text to be identified;

[0024] Weighting unit, for each type of feature word, according to whether each word in the merchant text to be identified is the feature word of the type, configure the corresponding weight coefficient for each word in the merchant text to be identified, and utilize the configured weight coefficient to weight and sum the word vector of each word of the merchant text to be identified, obtain the feature vector corresponding to the type of the merchant text to be identified;Wherein, the type of feature word includes any multiple of keyword, theme word, entity word and the word belonging to frequent sequence mode;The frequent sequence mode refers to the sequence mode with support rate greater than the first threshold in the merchant text of the sample library;Sequence mode is composed of at least one word in the text;

[0025] Clustering unit, for:

[0026] For each type of feature word, utilize the feature vector corresponding to the type of the merchant text to be identified, and the feature vector corresponding to the type of the merchant text in the sample library is clustered, and the clustering result corresponding to the type is obtained;

[0027] Among a plurality of clustering results, the clustering result with the most repeated number of times is determined as the final clustering result, and the category to which the merchant text to be identified belongs is determined according to the final clustering result.

[0028] Optionally, the mining unit is further configured to:

[0029] add the to-be-identified merchant text into the sample library;

[0030] perform text mining on the sample library after adding the to-be-identified merchant text, to update any one or more types of feature words.

[0031] Optionally, the process of mining the merchant text in the sample library by the mining unit to obtain the key words comprises:

[0032] for each category of merchant text in the sample library, counting the term frequency and inverse document frequency of each word in the category of merchant text, and calculating the category feature weight of each word according to the term frequency and inverse document frequency of each word;

[0033] for each category of merchant text in the sample library, selecting a word in the category of merchant text whose category feature weight is greater than a second threshold value as a key word.

[0034] Optionally, the process of mining the merchant text in the sample library by the mining unit to obtain the theme words comprises:

[0035] for each category of merchant text in the sample library, determining a first term frequency and a second term frequency of each word in the category of merchant text, and determining a theme comprehensive weight of each word according to the difference between the first term frequency and the second term frequency of each word; wherein the first term frequency is the term frequency of the word in the category of merchant text; and the second term frequency is the term frequency of the word in the merchant text of other categories except the category;

[0036] for each category of merchant text in the sample library, selecting N words in the category of merchant text as theme words in descending order of the theme comprehensive weight of each word in the category of merchant text; wherein N is a preset positive integer.

[0037] The third aspect of the present application provides a computer storage medium for storing a computer program, wherein the computer program is executed to specifically implement the merchant text identification method provided in any one of the first aspect of the present application.

[0038] The fourth aspect of the present application provides an electronic device comprising a memory and a processor.

[0039] The memory is configured to store a computer program.

[0040] The processor is configured to execute the computer program, and specifically implement the merchant text identification method provided in any one of the first aspect of the present application.

[0041] The application provides a merchant text recognition method, device and equipment and a storage medium. The method comprises the following steps: obtaining a to-be-recognized merchant text; for each type of feature word, according to whether each word in the to-be-recognized merchant text is a feature word of the type, configuring a corresponding weight coefficient for each word in the to-be-recognized merchant text, and performing weighted summation on the word vectors of each word in the to-be-recognized merchant text by using the configured weight coefficients to obtain a feature vector corresponding to the type of the to-be-recognized merchant text; the types of feature words include any multiple of keywords, subject words, entity words and words belonging to frequent sequence patterns; the feature words are obtained by text mining on a plurality of merchant texts in a sample library which are pre-labeled with the categories; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts in the sample library; the sequence pattern is composed of at least one word in the text; and the categories to which the to-be-recognized merchant text belongs are obtained by performing integrated clustering on the feature vectors corresponding to the types of the to-be-recognized merchant text. According to the scheme, different types of feature vectors of the to-be-recognized merchant text are obtained based on different types of feature words, and compared with the prior art, the different types of feature vectors obtained by the scheme can reflect more features of the merchant text, so that the categories to which the merchant text belongs can be more accurately recognized. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute a part of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of the provided drawings.

[0043] Figure 1 A flowchart of a merchant text recognition method provided by the embodiment of the present application;

[0044] Figure 2 A structural schematic diagram of a merchant text recognition device provided by the embodiment of the present application;

[0045] Figure 3 A structural schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the scope of protection of the present application.

[0047] The present application mainly relates to text recognition (or text classification) technology, which is an important branch of natural language processing field.

[0048] Natural language processing (NLP) is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that can realize effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language used in daily life, so it is closely related to the study of linguistics. In addition to the text recognition technology involved in the present application, natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question and answer, knowledge graph and other technologies.

[0049] The merchant text recognition method provided in the present application mainly includes two stages, one is the text mining stage, and the other is the text recognition stage. In the text mining stage, a large amount of merchant text pre-labeled with the category thereof is subjected to text mining, so as to obtain a certain amount of keywords, topic words, entity words and frequent sequence patterns. In the text recognition stage, the keywords, topic words, entity words and frequent sequence patterns obtained by mining are used to process the merchant text to be recognized, so as to obtain feature vectors of different types of the merchant text to be recognized. Finally, the feature vectors of different types are integrated and clustered to determine the category of the merchant text to be recognized.

[0050] It can be understood that the relationship between the text mining stage and the text recognition stage is that, on the one hand, after the text mining stage is performed once to obtain the keywords, topic words, entity words and frequent sequence patterns, the text recognition stage is directly performed based on the keywords, topic words, entity words and frequent sequence patterns obtained by mining before, without the need to perform the text mining stage again each time the merchant text to be recognized is obtained.

[0051] On the other hand, the text mining stage can also be performed again to update the keywords, topic words, entity words and frequent sequence patterns using the merchant text to be recognized obtained this time after the text recognition stage is performed once.

[0052] Next, the specific implementation process of the first stage, i.e. the text mining stage, will be described first.

[0053] Firstly, a sample library for text mining needs to be constructed, which includes a large amount of merchant text, and each merchant text in the sample library is labeled with the category thereof (specifically, the category is the category of the merchant appearing in the merchant text) by manual labeling.

[0054] Among them, for each category of merchant, it can be divided by different granularity. For example, it can be divided into catering, comprehensive retail, specialized retail, life service, transportation, medical, etc. by coarse granularity, that is, divided into multiple first-level categories, and it can be further divided into multiple second-level categories under each first-level category by fine granularity. For example, catering can be further divided into restaurants, drinks and desserts, seasonings, and other catering, and comprehensive retail can be divided into chain convenience stores, supermarkets, and personal retail stores.

[0055] Table 1 below is an example of a plurality of merchant texts with annotated categories at a finer granularity. This table can be considered as part of the constructed sample library.

[0056] Table 1

[0057]

[0058] As can be seen from Table 1, after annotation, the merchant text “Kitchen Fragrance Dry Pot (Xiaoguo Store)” belongs to the category “catering-restaurant”, and the merchant text “Li Tai Cake Shop” belongs to the category “catering-drinks and desserts”.

[0059] Optionally, after the sample library is constructed, text preprocessing can be performed. Text preprocessing can include stop word filtering and invalid information filtering.

[0060] Stop word filtering refers to deleting stop words contained in each merchant text in the sample library. Stop word filtering can be performed based on a pre-set stop word library. Specifically, the stop word library records can be searched in each merchant text in the sample library, and each stop word library record is deleted.

[0061] Invalid information filtering refers to deleting invalid information such as date and time, name, email, mobile phone number, etc. from the merchant text. Such invalid information generally has a specific format, so a regular expression conforming to this format can be constructed, and the invalid information in the merchant text can be identified and deleted using the regular expression.

[0062] After preprocessing is completed, text segmentation and part-of-speech tagging are required. The purpose of segmentation is to split each merchant text in the sample library into multiple words. As an example, a general segmentation algorithm based on a binary word model can be used in this application, such as the Vertbi segmentation algorithm. In other embodiments, other existing segmentation algorithms can also be used for segmentation.

[0063] The part-of-speech tagging is to tag the part-of-speech of each word after the word segmentation (the part-of-speech includes noun, verb or adjective), in other words, to determine whether each word after the word segmentation belongs to noun, verb or adjective. In the present application, the general part-of-speech tagging algorithm based on the hidden Markov model can be used for the part-of-speech tagging, or other existing part-of-speech tagging algorithms can be used for the part-of-speech tagging.

[0064] The basic principle of the part-of-speech tagging algorithm based on the hidden Markov model is to regard the possible part-of-speech of each word as a hidden state, to calculate the probability that the word belongs to the part-of-speech by defining the transition probability P(t2| t1) (t1 and t2 represent two different part-of-speeches) and the emission probability P(w|t) on each hidden state.

[0065] After the above processing, the theme words can be mined from the multiple merchant texts in the sample library by the following method:

[0066] It should be noted that the process of mining the theme words is performed on each category of merchant texts in the sample library respectively. For example, the sample library includes two categories of merchant texts, i.e. the "dining-restaurant" category and the "dining-drinks and desserts" category. In the text mining stage, the theme words of the "dining-restaurant" category are obtained by performing the following method of mining the theme words on all the texts of the "dining-restaurant" category in the sample library, and then the theme words of the "dining-drinks and desserts" category are obtained by mining the theme words from all the merchant texts of the "dining-drinks and desserts" category in the sample library.

[0067] The number of theme words mined from each category is not limited, and can be one or more.

[0068] The method of mining the theme words in the present application will be described below by taking a certain category (which can be denoted as the current category) as an example.

[0069] Firstly, the first word frequency and the second word frequency of each word in the merchant texts of the current category are counted. The first word frequency of a certain word refers to the word frequency of the word in the merchant texts of the current category, and the second word frequency of the word refers to the word frequency of the word in the merchant texts of other categories except the current category.

[0070] For example, the current category is "dining-drinks and desserts", the merchant texts of this category in the sample library are segmented to obtain 1000 words, and the merchant texts of all other categories are segmented to obtain 9000 words. There are 100 "desserts" in the merchant texts of the "dining-drinks and desserts" category after the word segmentation, and there are 90 "desserts" in the merchant texts of all other categories except the "dining-drinks and desserts" category after the word segmentation. Therefore, the first word frequency of the word "dessert" is 10%, and the second word frequency of the word "dessert" is 1%.

[0071] Then, the subject comprehensive weight of each word can be determined according to the difference between the first word frequency and the second word frequency of each word.

[0072] The difference between the first word frequency and the second word frequency can be represented by the difference value between the first word frequency and the second word frequency, or the ratio of the two. Specifically, three intervals can be divided according to the size of the difference between the first word frequency and the second word frequency. If the difference between the first word frequency and the second word frequency of a word belongs to the largest interval, the word is marked as an irrelevant word. If the difference between the first word frequency and the second word frequency of a word belongs to the middle interval, the word is marked as a common word. If the difference between the first word frequency and the second word frequency of a word belongs to the smallest interval, the word is marked as a domain word.

[0073] Then, the subject comprehensive weight of each word can be determined according to the following rules:

[0074] If the word w is an irrelevant word, the subject comprehensive weight of the word w is set to 0, i.e. , where PW(w) represents the subject comprehensive weight of the word w.

[0075] If the word w is a common word, the subject comprehensive weight of the word w can be calculated according to the following formula:

[0076]

[0077] where tf c represents the frequency of the common word w in all categories of merchant text in the sample library, max(df k ) represents the maximum value of the document frequency of each common word in all categories of merchant text in the sample library, df c represents the document frequency of the word w in all categories of merchant text in the sample library. The document frequency of a word refers to the proportion of texts containing the word in all texts. For example, there are 500 texts in all categories of merchant text in the sample library, and 20 of them contain the word w, so the document frequency of w is 4%.

[0078] If the word w is a domain word, the subject comprehensive weight of the word w can be calculated according to the following formula:

[0079]

[0080] where max(PW c ) represents the maximum value of the subject comprehensive weight of all common words, tf f represents the word frequency of the word w in all categories of merchant text in the sample library, max(df l ) represents the maximum value of the document frequency of each domain word in all categories of merchant text in the sample library, df f represents the document frequency of the word w in all categories of merchant text in the sample library.

[0081] Optionally, the subject comprehensive weight of each word can be further modified as follows. If the word w is a proper noun, the subject comprehensive weight of the word w can be multiplied by a proper noun coefficient , and if the part of speech of the word w is a noun, the subject comprehensive weight of the word w can be multiplied by a noun coefficient , wherein the values of the noun coefficient and the proper noun coefficient are pre-set. That is, if the word w is a proper noun, the part of speech of the word w is obviously a noun, and at this time, the subject comprehensive weight of the word w can be modified according to the following formula:

[0082]

[0083] In the formula, PW(w) on the left side of the equal sign is the modified subject comprehensive weight, and PW(w) on the right side of the equal sign is the unmodified subject comprehensive weight.

[0084] The identification of the proper noun can be achieved by using an existing algorithm or by establishing a proper noun library, which will not be described in detail here.

[0085] After the subject comprehensive weight of each word is determined, N words can be selected as subject words in the order of the subject comprehensive weight of each word in the merchant text of the current category from large to small, and if modified, N words can be selected as subject words in the order of the modified subject comprehensive weight of each word from large to small.

[0086] Wherein N is a pre-set positive integer.

[0087] Similar to the method of mining subject words, the method of mining keywords is also performed on the merchant text of each category in the sample library.

[0088] In the present application, the keywords can be mined based on the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm. Taking the current category as an example, the process of keyword mining of the merchant text of the current category includes:

[0089] First, the term frequency and the inverse document frequency of each word in the merchant text of the current category in the sample library are counted, and the category feature weight of each word is calculated according to the term frequency and the inverse document frequency of each word.

[0090] For any word w in the merchant text of the current category, the term frequency of the word w can be calculated according to the following formula:

[0091]

[0092] Wherein TF(w) represents the term frequency of the word w in the merchant text of the current category in the sample library.

[0093] The inverse document frequency of the word w can be calculated as follows:

[0094]

[0095] IDF(w) represents the inverse document frequency of the word w, and the other category refers to each category in the sample library except the current category. For example, if the sample library includes the business text of the "dining-restaurant", "dining-drinks and desserts", and "general retail-supermarket" categories, and the current category is the "dining-restaurant" category, then the other category in the calculation formula of the inverse document frequency includes the "dining-drinks and desserts" and "general retail-supermarket" categories.

[0096] Finally, the category feature weight TFIDF(w) of the word w is calculated as follows:

[0097] TFIDF(w) = TF(w) x IDF(w).

[0098] That is, the category feature weight is the product of the term frequency and the inverse document frequency of the word w.

[0099] For any word w in the business text of the current category, the greater the category feature weight of the word, the more often the word appears in the business text of the category, and the less often the word appears in the business text of other categories, which can indicate that the word is a key word that distinguishes the current category from other categories.

[0100] Therefore, the words with a category feature weight greater than a second threshold value in the business text of the current category can be selected as key words. The second threshold value can be set according to specific circumstances.

[0101] Table 2 is an example of the key words of the business text of each category mined by the above method:

[0102] Table 2

[0103]

[0104] As can be seen, the key words of several categories such as "dining-drinks and desserts", "dining-restaurant", "dining-spices", and "dining-other dining" are mined in Table 2. For example, the key words mined from the business text of the "dining-drinks and desserts" category include "iced black tea", "ice cream", and "biscuit".

[0105] For some chain stores, the name of the store usually contains a word indicating the entity, such as Starbucks, Jusco, etc., which often plays a great role in store classification. Therefore, in the entity word mining part, for the store text of each category in the sample library, the existing named entity recognition (NER) tool can be used to identify the entity word indicating the entity in the store text of the category, that is, to mine the entity word of the store text of the category.

[0106] When the NER tool mines the entity word from a batch of texts, an entity word weight is configured for each entity word w indicating the entity, denoted as P org (w).

[0107] It can be understood that the method of mining entity words is also performed on the store text of each category in the sample library, for example, the NER tool is used to mine the entity words from the store text of the "dining-drinks and desserts" category in the sample library, and then the entity words are mined from the store text of the "dining-restaurants" category in the sample library, and so on.

[0108] In addition to mining theme words, keywords and entity words, the Prefixspan algorithm (an existing sequence pattern mining algorithm) can also be used to mine frequent sequence patterns from the store text of each category in the sample library.

[0109] The category that needs to be mined for frequent sequence patterns at present is denoted as the current category. In the specific implementation, the frequent sequence patterns can be directly mined from all store texts of the current category in the sample library, or the store texts of the current category that contain any one or more of the theme words, keywords and entity words of multiple categories can be first screened out, and the frequent sequence patterns are mined from these store texts. As shown in Table 3, an example of screening multiple store texts that meet the condition from the "dining-restaurants" category:

[0110] Table 3

[0111]

[0112] When mining the frequent sequence patterns from the text of the "dining-restaurants" category, the text used is the store text listed in Table 3, that is:

[0113] {Yunlong Supermarket Tea Oil Noodle Restaurant, Ginza Shopping Plaza Da Fei Chongqing Chicken Pot Restaurant, Chen Glasses Hot Pot Youyang Franchise Store, Home Furniture City Noodle Restaurant, Tide Clothing 0048 Spicy Shrimp Franchise Store}.

[0114] The present application adopts a multi-minimum support strategy when mining frequent sequential patterns, and the calculation formula of the minimum support is min sup=Axn.

[0115] In the formula, A represents a pre-set minimum support rate, and n represents the number of merchant texts used for mining frequent sequential patterns. If the calculation result of the formula contains a decimal, the minimum support is obtained by rounding up. For example, there are 6 merchant texts in Table 3, and when mining the frequent sequential patterns of the merchant texts listed in Table 3, n is equal to 6. The minimum support rate A can be adjusted according to the magnitude of n.

[0116] In the present application, the algorithm principle for mining frequent sequential patterns is as follows:

[0117] First, from all the merchant texts used for mining, delete the words with the number of occurrences less than the minimum support to obtain filtered merchant texts. For example, in Table 3, n is equal to 6, and assuming that the minimum support rate A is equal to 1 / 4, the minimum support is 2, that is, delete the words with the number of occurrences less than 2 from each merchant text.

[0118] Then, the following algorithm is executed for the filtered merchant texts:

[0119] Find the prefixes with a length of 1 and the projection data set corresponding to each prefix.

[0120] A prefix refers to a sequence composed of the first M words of a text, and M is the length of the prefix. If the length of the prefix is set to 1, the prefix of the text is the first word of the text. If M is set to 2, the prefix is a sequence composed of the first and second words of the text.

[0121] For any text, the text remaining after deleting the prefix from the text is called a suffix corresponding to the prefix, and the set of all suffixes of a prefix is called the projection data set corresponding to the prefix.

[0122] Statistical each prefix support (equivalent to the number of occurrences of the prefix in all texts used for mining), and mark the prefixes with a support greater than the minimum support as frequent sequential patterns with a length of 1.

[0123] Set i to 1, and then execute the following mining process for each frequent sequential pattern with a length of i:

[0124] Determine whether the projection data set of the frequent sequential pattern is an empty set. If yes, end the mining process of the frequent sequential pattern.

[0125] If the projection data set of the frequent sequential pattern is not an empty set, count the support of each prefix with a length of 1 in the projection data set.

[0126] If the support of the prefix is greater than the minimum support of the prefix, the prefix and the current frequent sequential pattern are combined to obtain a frequent sequential pattern of length i+1, and the mining process of the current frequent sequential pattern is ended.

[0127] After the mining process of each frequent sequential pattern of length i is ended, i is incremented by 1, i.e. i = i + 1, and the mining process is performed again for each frequent sequential pattern of length i until i equals the maximum text length. The maximum text length is the maximum value of the text lengths of all the texts used for mining.

[0128] The frequent sequential patterns of various lengths are outputted.

[0129] The following will be described in combination with the texts listed in Table 3:

[0130] After the 6 merchant texts in Table 3 are filtered, the filtered merchant texts shown in Table 4 are obtained:

[0131] The filtered samples are as follows:

[0132] Table 4

[0133]

[0134] Through mining, the prefixes of length 1 in Table 4 are obtained, and the support of each prefix corresponds to the projection dataset shown in Table 5:

[0135] Table 5

[0136]

[0137] Only the projection dataset of the prefix "franchise" is non-empty, and through mining, the frequent sequential pattern "franchise store" of length 2 is obtained, and the support thereof is 2.

[0138] Finally, the frequent sequential patterns shown in Table 6 are obtained through mining for the 6 merchant texts listed in Table 3:

[0139] Table 6

[0140]

[0141] It can be seen that the above text mining stage includes four parts, i.e. topic word mining, keyword mining, entity word mining and frequent sequential pattern mining. In the specific implementation, any multiple parts of the four parts can be executed according to the needs, for example, only topic word mining, keyword mining and frequent sequential pattern mining can be executed.

[0142] The second stage, i.e., the text recognition stage, is described below, please refer to Figure 1 The merchant text recognition method provided by the embodiment of the application can include the following steps:

[0143] S101, obtaining a merchant text to be recognized.

[0144] It should be noted that the number of the merchant text to be recognized can be one or more.

[0145] S102, for each type of feature word, according to the result of whether each word in the merchant text to be recognized is a feature word of this type, a weight coefficient is configured for the word of the merchant text to be recognized, and the word vector of the merchant text to be recognized is weighted using the configured weight coefficient to obtain a feature vector corresponding to the type for the merchant text to be recognized.

[0146] Among them, the type of feature word includes any multiple of keywords, topic words, entity words and words belonging to frequent sequence patterns; the feature words are obtained by text mining from a plurality of merchant texts in a sample library which are pre-labeled with their categories; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts of the sample library; the sequence pattern is composed of at least one word in the text.

[0147] When there are multiple merchant texts to be recognized, step S102 needs to be executed for each merchant text to be recognized to obtain the feature vector corresponding to each feature word type for each merchant text to be recognized.

[0148] It can be understood that the type of feature word used for weighting processing in step S102 is determined by the part executed in the text mining stage.

[0149] If the text mining stage performs four parts of topic word mining, keyword mining, entity word mining and frequent sequence pattern mining, then in step S102, weighting processing needs to be performed according to the topic word, the keyword, the entity word and the frequent sequence pattern. Conversely, if the text mining stage only performs three parts of topic word mining, keyword mining and frequent sequence pattern mining, then in step S102, weighting processing needs to be performed only according to the topic word, the keyword and the frequent sequence pattern.

[0150] When step S102 is executed, a minimum weight coefficient needs to be determined according to the topic comprehensive weight of each topic word in the text mining stage, the category feature weight of each keyword, and the entity word weight of each entity word. Specifically, the minimum value of all the above weights can be determined first, denoted as min, expressed by the following formula:

[0151] min=min{P org{ (wi) (i = 1...x), TFIDF (wj) (j = 1...y), PW (wk) (k = 1...z)}, wherein, wi represents each entity word mined in the text mining stage, wj represents each keyword mined in the text mining stage, and wk represents each topic word mined in the text mining stage.

[0152] Then, the minimum weight coefficient (denoted as low) is set as a value much smaller than min, i.e., low << min.

[0153] The specific execution process of step S102 is described below for each type of feature word.

[0154] For the topic word type, it is identified whether each word in the to-be-identified merchant text is a topic word obtained in the text mining stage. If a word is a topic word, the topic comprehensive weight PW (wk) of the topic word obtained in the text mining stage is determined as the weight coefficient of the word in the to-be-identified merchant text. If a word is not a topic word, the minimum weight coefficient low is determined as the weight coefficient of the word.

[0155] Subsequently, the word vectors of each word in the to-be-identified merchant text are weighted and summed using the respective weight coefficients, to obtain a feature vector corresponding to the topic word, i.e., a topic word feature vector, denoted as C1.

[0156] For the keyword type, it is identified whether each word in the to-be-identified merchant text is a keyword obtained in the text mining stage. If a word is a keyword, the category feature weight TFIDF (wj) of the keyword obtained in the text mining stage is determined as the weight coefficient of the word in the to-be-identified merchant text. If a word is not a keyword, the minimum weight coefficient low is determined as the weight coefficient of the word.

[0157] Subsequently, the word vectors of each word in the to-be-identified merchant text are weighted and summed using the respective weight coefficients, to obtain a feature vector corresponding to the keyword, i.e., a keyword feature vector, denoted as C2.

[0158] For the entity word type, it is identified whether each word in the to-be-identified merchant text is an entity word obtained in the text mining stage. If a word is an entity word, the entity word weight PW (wi) of the entity word obtained in the text mining stage is determined as the weight coefficient of the word in the to-be-identified merchant text. If a word is not an entity word, the minimum weight coefficient low is determined as the weight coefficient of the word. org

[0159] ​Subsequently, the word vectors of each word in the to-be-identified merchant text are weighted and summed by using each weight coefficient to obtain a feature vector corresponding to the to-be-identified merchant text and the entity word, that is, an entity word feature vector, denoted as C3.

[0160] For the words belonging to the frequent sequence pattern, it can be detected whether the to-be-identified merchant text contains any one or more frequent sequence patterns obtained in the text mining stage. Then, for the frequent sequence pattern contained in the to-be-identified merchant text, the support rate of the frequent sequence pattern is set as the weight coefficient of each word in the frequent sequence pattern. For the words in the to-be-identified merchant text that do not belong to the frequent sequence pattern, a preset value (denoted as A low ) smaller than the minimum support rate A can be set as the weight coefficient of the word. Subsequently, the word vectors of each word in the to-be-identified merchant text are weighted and summed by using each weight coefficient to obtain a feature vector corresponding to the to-be-identified merchant text and the frequent sequence pattern, that is, a sequence pattern feature vector, denoted as C4.

[0161] Optionally, when the to-be-identified merchant text contains multiple frequent sequence patterns, it can occur that one or more words belong to multiple frequent sequence patterns at the same time. For such words, the maximum value of the support rates of each frequent sequence pattern to which the words belong can be set as the weight coefficient of the words.

[0162] S103, for each type of feature word, the clustering model is used to cluster the feature vector corresponding to the type in the to-be-identified merchant text and the feature vector corresponding to the type in the merchant text in the sample library to obtain a clustering result corresponding to the type.

[0163] S104, the clustering result that appears most frequently in the multiple clustering results is determined as the final clustering result, and the category to which the to-be-identified merchant text belongs is determined according to the final clustering result.

[0164] Steps S103 and S104 are equivalent to integrated clustering of the to-be-identified merchant text.

[0165] It should be noted that the clustering model used in the present application is completely different from the classification model based on neural network technology. Moreover, unlike existing clustering models, the clustering model of the present application is an integrated clustering model. The integrated clustering model specifically includes the following two aspects of integrated mechanisms:

[0166] Firstly, the clustering model of the present application is based on the voting integration of the results of multiple clustering algorithms under the condition that the features are unchanged. Specifically, the clustering model of the present application includes multiple different clustering algorithms, so the clustering result obtained by the clustering model of the present application is the integration of the clustering results produced by multiple different clustering algorithms, rather than the clustering result produced by a single clustering algorithm.

[0167] In a second aspect, the same clustering model is used to cluster different types of features, and the clustering results of different types are integrated to obtain the final clustering result.

[0168] Compared with a common clustering model, the integrated clustering model has the advantage of making the model more generalizable. In short, the final result is not determined by a single clustering algorithm or a single type of feature clustering result, but is based on the principle of majority over minority, integrating multiple clustering algorithms and multiple types of features for clustering, which is obviously different from clustering based on a single clustering algorithm and a single type of feature.

[0169] In a specific example, the clustering model described above can include three clustering algorithms: K-means clustering algorithm, mean shift clustering algorithm, and density-based clustering algorithm. Accordingly, in step S103, clustering a type of feature vector using a clustering model actually means clustering the type of feature vector using K-means clustering algorithm, mean shift clustering algorithm, and density-based clustering algorithm, respectively. Finally, the clustering results of the three clustering algorithms are integrated into the corresponding clustering result of the type.

[0170] The way to integrate the clustering results of multiple clustering algorithms is similar to step S104, that is, the clustering result that appears most frequently in the multiple clustering results corresponding to the multiple clustering algorithms is determined as the clustering result output by the clustering model.

[0171] In combination with the foregoing example, when clustering the feature vector corresponding to the subject word using the clustering model, three clustering results can be obtained based on the K-means clustering algorithm, mean shift clustering algorithm, and density-based clustering algorithm. Assuming that the clustering result obtained by the K-means clustering algorithm is the same as the clustering result obtained by the mean shift clustering algorithm, both of which are clustering result 1, then the clustering result corresponding to the subject word type is determined as clustering result 1.

[0172] Integrated clustering is a clustering method that combines multiple clustering members and analyzes the clustering results of the multiple clustering members based on a voting method to obtain the final clustering result. In this scheme, each type of feature word corresponds to a clustering member, and each clustering member clusters the object to be clustered (the merchant text belongs to the object to be clustered) to obtain the clustering result of the member. After obtaining the clustering result of each member, the clustering result that appears most frequently is determined as the final clustering result based on the voting method.

[0173] The following is described with reference to an example.

[0174] Assuming that the to-be-identified texts obtained in step S101 are respectively denoted as a and c, in step S102, the two to-be-identified merchant texts are weighted based on the topic words, the keywords and the frequent sequence patterns respectively, and the topic word feature vector C1, the keyword feature vector C2 and the sequence pattern feature vector C4 of a and the topic word feature vector C1, the keyword feature vector C2 and the sequence pattern feature vector C4 of c are obtained.

[0175] Then, before clustering, a plurality of merchant texts with labeled categories are read from the sample library to participate in clustering, and the feature vectors corresponding to the types of the respective feature words of the read merchant texts are obtained according to the method of step S102. Assuming that the merchant texts with labeled categories read from the sample library are b, d and e, and the three feature vectors C1, C2 and C4 corresponding to each of b, d and e are obtained according to step S102.

[0176] After obtaining the plurality of feature vectors of the respective merchant texts, clustering can be performed based on the feature vectors of each type respectively.

[0177] In the above example, the feature vector corresponding to the topic word can be regarded as a cluster member, and the cluster member includes the topic word feature vectors C1 of the five merchant texts a, b, c, d and e, that is, the five merchant texts can obtain different C1, and clustering the five C1 can obtain a clustering result.

[0178] Similarly, clustering the keyword feature vectors C2 of the five merchant texts a, b, c, d and e can obtain another clustering result, and clustering the sequence pattern feature vectors C4 of the five merchant texts a, b, c, d and e can obtain still another clustering result.

[0179] Further, in step S103, for the same type of feature words, a plurality of clustering models can be used to cluster the feature vectors corresponding to the type respectively.

[0180] The clustering results of the five merchant texts a, b, c, d and e based on the three cluster members C1, C2 and C4 can be represented by Table 7 as follows:

[0181] Table 7

[0182]

[0183] The labels 1 to 3 in Table 7 are irrelevant to the categories of the merchant texts described above, and are only used to represent which merchant texts belong to the same cluster after clustering. Specifically, for a cluster member, the merchant texts with the same label in the clustering result of the cluster member belong to the same cluster, and the merchant texts with different labels are divided into different clusters.

[0184] It can be seen that the clustering result obtained after clustering according to C1 of each merchant text is that a and b belong to the same cluster, and c, d and e belong to the same cluster, and the clustering result expressed by symbols is:

[0185] { (a, b), (c, d, e)}.

[0186] Similarly, in the clustering result obtained after clustering according to C2, a and b belong to the same cluster, and c, d and e belong to the same cluster, and the clustering result corresponding to C2 is { (a, b), (c, d, e)}, and the clustering result obtained after clustering according to C4 is { (a), (b), (c, d, e)}.

[0187] It can be seen that the clustering result { (a, b), (c, d, e)} appears twice, and the clustering result { (a), (b), (c, d, e)} appears only once, so { (a, b), (c, d, e)} is determined as the final clustering result.

[0188] Finally, the category to which the to-be-recognized merchant text belongs can be determined according to the final clustering result.

[0189] As described above, in addition to the to-be-recognized merchant text, a plurality of merchant texts with labeled categories are read from the sample library and participate in clustering. Therefore, the category of the to-be-recognized merchant text can be determined according to the merchant text (that is, the sample merchant text read from the sample library) with the same cluster as the to-be-recognized merchant text in the final clustering result.

[0190] If there are multiple sample merchant texts of different categories in the final clustering result and they belong to the same cluster as the to-be-recognized merchant text, the category corresponding to the sample merchant text with the largest number in the cluster is determined as the category of the to-be-recognized merchant text.

[0191] For example, there is one to-be-recognized merchant text, two sample merchant texts belonging to the "dining-restaurant" category, and five sample merchant texts belonging to the "dining-drinks and desserts" category in a cluster, and the category of the to-be-recognized merchant text can be determined as "dining-drinks and desserts".

[0192] If the sample merchant texts belonging to the same cluster as the to-be-recognized merchant text belong to the same category in the final clustering result, the category is determined as the category of the to-be-recognized merchant text. For example, a cluster contains one to-be-recognized merchant text and two sample merchant texts belonging to the "dining-restaurant" category, and the to-be-recognized merchant text belongs to the "dining-restaurant" category.

[0193] With the above example, for the final clustering result { (a, b), (c, d, e)}, assuming that the sample merchant text b belongs to the "specialty retail - home lighting" category, and the sample merchant texts d and e both belong to the "catering - restaurant" category, then it can be determined that the to-be-identified merchant text a belongs to the "specialty retail - home lighting" category, and the to-be-identified merchant text c belongs to the "catering - restaurant" category.

[0194] Optionally, after each text recognition stage, the text mining stage can also be performed again based on the to-be-identified merchant text obtained this time to update the keywords, key words, entity words and frequent sequence patterns, that is, after step S104, the merchant text recognition method provided by the embodiment can further include:

[0195] adding the to-be-identified merchant text to the sample library;

[0196] performing text mining on the sample library after adding the to-be-identified merchant text to update any one or more types of feature words.

[0197] The process of performing text mining on the sample library after adding the to-be-identified merchant text is consistent with the text mining stage described above, and will not be repeated here.

[0198] On the one hand, the weight coefficients configured for different types of feature words in the to-be-identified merchant text can reflect the distribution of different types of feature words in the to-be-identified merchant text, so compared with the existing scheme of combining each word vector of the merchant text to obtain a feature vector, the present application can obtain multiple feature vectors reflecting the distribution of keywords, keywords, entity words and / or frequent sequence patterns of the to-be-identified merchant text, so the present scheme can classify the to-be-identified merchant text in combination with its multiple features, and can more accurately identify the category of the merchant text.

[0199] On the other hand, compared with the existing scheme of matching similar words in the merchant text using multiple seed words recorded in the seed word library, the present application can automatically obtain new keywords, keywords, entity words and / or frequent sequence patterns from the sample library and the to-be-identified merchant text through the text mining stage. The seed word library based scheme needs to be manually updated, so the present scheme can quickly identify various newly appearing merchant texts, while the seed word library based scheme is limited by the vocabulary in the seed word library, and it is difficult to identify some newly appearing merchant texts that do not contain seed words and their similar words, so the scope of application is limited.

[0200] In still another aspect, compared with a merchant text recognition scheme based on a crawler technology, the present application can realize classification of different merchants only by using merchant text, while the scheme based on the crawler technology needs to use merchant text and additional information (such as geographic location information and user review information) of the merchant to realize classification of the merchant. Therefore, the present scheme can be widely applied to merchant text recognition in various scenarios, while the scheme based on the crawler technology can only be applied to scenarios where additional information can be obtained, that is, the application scenarios of the present scheme are wider than those of the scheme based on the crawler technology.

[0201] The present application provides a method for recognizing merchant text, which comprises: obtaining a to-be-recognized merchant text; for each type of feature word, configuring a corresponding weight coefficient for each word in the to-be-recognized merchant text according to whether the word is a feature word of the type, and performing weighted summation on word vectors of each word in the to-be-recognized merchant text by using the configured weight coefficients to obtain a feature vector corresponding to the type for the to-be-recognized merchant text; the types of feature words include any multiple of keywords, subject words, entity words and words belonging to frequent sequence patterns; the feature words are obtained by text mining from a plurality of merchant texts in a sample library which are pre-labeled with a belonging category; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts in the sample library; the sequence pattern is composed of at least one word in the text; and the belonging category of the to-be-recognized merchant text is obtained by integrating clustering according to the feature vectors corresponding to each type for the to-be-recognized merchant text. The present scheme obtains different types of feature vectors for the to-be-recognized merchant text based on different types of feature words, and compared with the prior art, the different types of feature vectors obtained by the present scheme can reflect more features of the merchant text, so that the belonging category of the merchant text can be more accurately recognized.

[0202] The following illustrates a specific application scenario of the present scheme:

[0203] Suppose that the current consumption preference of user A needs to be analyzed, and therefore, the consumption record texts of user A in the last week are obtained from a mobile payment platform. It can be understood that each consumption record text will contain the merchant name of a merchant consumed by user A, that is, each consumption record text is equivalent to a to-be-recognized merchant text.

[0204] Subsequently, the consumption record texts of user A in the last week can be recognized by using the method for recognizing merchant text provided by the present application, so as to determine the category to which each consumption record text belongs, that is, to determine the category to which each merchant consumed by user A in the last week belongs.

[0205] Assuming that the proportion of the consumption record text belonging to the "catering-drinks and desserts" category in the consumption record text of the last week is the largest, it can be judged that user A currently prefers to consume drinks and desserts, and accordingly more "catering-drinks and desserts" category merchants can be recommended to user A.

[0206] In combination with the merchant text recognition method provided in the embodiments of the present application, the embodiments of the present application further provide a merchant text recognition device, please refer to Figure 2 The device can include the following units:

[0207] The mining unit 201 is configured to perform text mining on the plurality of merchant texts in the sample library which are pre-labeled with the corresponding categories, to obtain a plurality of types of feature words.

[0208] The types of feature words include any of keywords, subject words, entity words, and words belonging to frequent sequence patterns; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts of the sample library; the sequence pattern is composed of at least one word in the text.

[0209] The acquisition unit 202 is configured to acquire the merchant text to be recognized.

[0210] The weighting unit 203 is configured to, for each type of feature word, configure a corresponding weight coefficient for each word in the merchant text to be recognized according to whether the word is a feature word of the type, and perform weighted summation on the word vectors of each word in the merchant text to be recognized using the configured weight coefficients, to obtain a feature vector corresponding to the type for the merchant text to be recognized.

[0211] The clustering unit 204 is configured to:

[0212] For each type of feature word, perform clustering on the feature vector corresponding to the type for the merchant text to be recognized and the feature vector corresponding to the type for the merchant texts in the sample library, to obtain a clustering result corresponding to the type;

[0213] Determine the clustering result with the most repeated occurrences in the plurality of clustering results as the final clustering result, and determine the category to which the merchant text to be recognized belongs according to the final clustering result.

[0214] Optionally, the mining unit 201 is further configured to:

[0215] Add the merchant text to be recognized to the sample library;

[0216] Perform text mining on the sample library after adding the merchant text to be recognized, to update any one or more types of feature words.

[0217] The process of the mining unit 201 performing text mining on the merchant texts in the sample library to obtain keywords includes:

[0218] For each category of merchant text in the sample library, the word frequency and inverse document frequency of each word in the category of merchant text are counted, and the category feature weight of each word is calculated according to the word frequency and inverse document frequency of each word.

[0219] For each category of merchant text in the sample library, a word in the category of merchant text whose category feature weight is greater than a second threshold is selected as a keyword.

[0220] The process of the mining unit 201 performing text mining on the merchant text in the sample library to obtain the topic words includes:

[0221] For each category of merchant text in the sample library, the first word frequency and the second word frequency of each word in the category of merchant text are determined, and the topic comprehensive weight of each word is determined according to the difference between the first word frequency and the second word frequency of each word; wherein the first word frequency is the word frequency of the word in the category of merchant text; and the second word frequency is the word frequency of the word in the merchant text of other categories except the category.

[0222] For each category of merchant text in the sample library, N words are selected as topic words in the order of the topic comprehensive weight of each word in the category of merchant text from large to small; wherein N is a preset positive integer.

[0223] The specific working principle of the merchant text recognition device provided in this embodiment can refer to the related steps in the merchant text recognition method provided in the embodiments of the present application, which will not be described here.

[0224] This application provides a merchant text recognition device, wherein: an acquisition unit 202 acquires the merchant text to be recognized; a weighting unit 203, for each type of feature word, configures a corresponding weight coefficient for each word in the merchant text to be recognized based on whether each word in the merchant text to be recognized is a feature word of that type, and uses the configured weight coefficient to perform a weighted summation of the word vectors of each word in the merchant text to be recognized, to obtain the feature vector of the merchant text to be recognized corresponding to that type; the types of feature words include any combination of keywords, subject words, entity words, and words belonging to frequent sequence patterns; the feature words are obtained by text mining from multiple merchant texts in the sample library that are pre-labeled with their respective categories; frequent sequence patterns refer to sequence patterns in the merchant texts in the sample library with a support rate greater than a first threshold; a sequence pattern consists of at least one word in the text; and a clustering unit 204 performs integrated clustering based on the feature vectors of the merchant text to be recognized corresponding to each type, to obtain the category to which the merchant text to be recognized belongs. This solution obtains different types of feature vectors from the merchant text to be identified based on different types of feature words. Compared with existing technologies, the different types of feature vectors obtained by this solution can reflect more features of the merchant text, and thus can more accurately identify the category to which the merchant text belongs.

[0225] This application also provides a computer storage medium for storing a computer program, which, when executed, is specifically used to implement the merchant text recognition method provided in any embodiment of this application.

[0226] This application also provides an electronic device, such as... Figure 3 As shown, it includes a memory 301 and a processor 302.

[0227] The memory 301 is used to store computer programs.

[0228] The processor 302 is used to execute the above-described computer program, specifically to implement the merchant text recognition method provided in any embodiment of this application.

[0229] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the merchant text recognition method provided in any of the above embodiments.

[0230] Finally, it needs to be pointed out that, in this document, the terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or sequence between these entities or operations. Moreover, the terms "include", "contain" 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 not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0231] It should be noted that the "first", "second", and the like concepts mentioned in the present application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0232] A person skilled in the art can implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for identifying a merchant text, characterized by, The method comprises the following steps: obtaining a to-be-identified merchant text; for each type of feature word, according to whether each word in the to-be-identified merchant text is a feature word of this type, configuring a corresponding weight coefficient for each word in the to-be-identified merchant text, and performing weighted summation on the word vectors of each word in the to-be-identified merchant text by using the configured weight coefficients to obtain a feature vector corresponding to this type for the to-be-identified merchant text; wherein, for each to-be-identified merchant text, the feature vector corresponding to each type of feature word is obtained, and the types of feature words include keywords, topic words, entity words, and words belonging to frequent sequence patterns; the feature words are obtained by text mining on a plurality of merchant texts in a sample library which are pre-labeled with their categories; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts in the sample library; the sequence pattern is composed of at least one word in the text, and the weight coefficient is configured in the following manner: for each type of feature word, if each word in the to-be-identified merchant text is a feature word of this type, the weight of this type is determined as the weight coefficient of the word in the to-be-identified merchant text, and if each word in the to-be-identified merchant text is not a feature word of this type, the minimum weight coefficient is determined as the weight coefficient of the word; for each type of feature word, a clustering model is used to perform clustering processing on the feature vector corresponding to this type of the to-be-identified merchant text and the feature vector corresponding to this type of the merchant texts in the sample library to obtain a clustering result corresponding to this type; wherein, the clustering model includes K-means clustering algorithm, mean shift clustering algorithm and density-based clustering algorithm, and the clustering results of the three clustering algorithms are integrated into the clustering result corresponding to this type; determining the clustering result with the highest frequency of occurrence in the plurality of clustering results as the final clustering result, and determining the category to which the to-be-identified merchant text belongs according to the final clustering result.

2. The identification method according to claim 1, characterized in that, After the integration clustering of the feature vectors corresponding to each type of the to-be-identified merchant text is performed to obtain the category to which the to-be-identified merchant text belongs, the method further comprises the following steps: adding the to-be-identified merchant text to the sample library; performing text mining on the sample library after the to-be-identified merchant text is added to update any one or more types of feature words.

3. The identification method according to claim 1, characterized in that, The process of obtaining the keywords by performing text mining on the merchant texts in the sample library comprises the following steps: for each category of merchant texts in the sample library, counting the word frequency and inverse document frequency of each word in the merchant texts of the category, and respectively calculating the category feature weight of each word according to the word frequency and inverse document frequency of each word; for each category of merchant texts in the sample library, selecting the words with a category feature weight greater than a second threshold in the merchant texts of the category as keywords.

4. The identification method according to claim 1, characterized in that, The process of obtaining the topic words by performing text mining on the merchant texts in the sample library comprises the following steps: For each category of merchant text in the sample library, determine the first word frequency and the second word frequency of each word in the category of merchant text, and determine the theme comprehensive weight of each word according to the difference between the first word frequency and the second word frequency; wherein the first word frequency is the word frequency of the word in the category of merchant text; the second word frequency is the word frequency of the word in the merchant text of other categories except the category; For each category of merchant text in the sample library, select N words as theme words in the order of theme comprehensive weight of each word in the category of merchant text from large to small; wherein N is a preset positive integer.

5. A device for recognizing a merchant text, characterized by, Comprise: The mining unit is used for text mining on a plurality of merchant texts in a sample library which are pre-labeled with their categories, to obtain a plurality of types of feature words; wherein the types of feature words include any of keywords, theme words, entity words and words belonging to frequent sequence patterns; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts of the sample library; a sequence pattern is composed of at least one word in the text; The acquisition unit is used for acquiring a to-be-identified merchant text; The weighting unit is configured to, for each type of feature word, configure a corresponding weight coefficient for each word in the to-be-identified merchant text according to whether each word in the to-be-identified merchant text is a feature word of the type, and perform weighted summation on the word vectors of each word in the to-be-identified merchant text using the configured weight coefficients, to obtain a feature vector corresponding to the type for the to-be-identified merchant text; wherein the feature vector corresponding to each feature word type for each to-be-identified merchant text is obtained by performing the above operations on each to-be-identified merchant text; the types of feature words include keywords, theme words, entity words and words belonging to frequent sequence patterns; the frequent sequence pattern refers to a sequence pattern with a support rate greater than a first threshold in the merchant texts of the sample library; a sequence pattern is composed of at least one word in the text; the weight coefficient is configured in the following manner: for each type of feature word, if each word in the to-be-identified merchant text is a feature word of the type, the weight of the type is determined as the weight coefficient of the word in the to-be-identified merchant text; if each word in the to-be-identified merchant text is not a feature word of the type, the minimum weight coefficient is determined as the weight coefficient of the word; The clustering unit is configured to: For each type of feature word, use a clustering model to perform clustering processing on the feature vector corresponding to the type for the to-be-identified merchant text and the feature vector corresponding to the type for the merchant texts in the sample library, to obtain a clustering result corresponding to the type; wherein the clustering model includes K-means clustering algorithm, mean shift clustering algorithm and density-based clustering algorithm; the clustering results of the three clustering algorithms are integrated into the clustering result corresponding to the type; Among a plurality of clustering results, the clustering result with the highest number of repeated occurrences is determined as the final clustering result, and the category to which the to-be-identified merchant text belongs is determined according to the final clustering result.

6. The identification device of claim 5, wherein The mining unit is further configured to: Add the to-be-identified merchant text to the sample library; The sample library after the merchant text to be identified is added is subjected to text mining to update any one or more types of feature words.

7. The identification device of claim 5, wherein The process of text mining of the merchant text in the sample library by the mining unit to obtain the key words includes: For each category of merchant text in the sample library, the word frequency and inverse document frequency of each word in the category of merchant text are counted, and the category feature weight of each word is calculated according to the word frequency and inverse document frequency of each word. For each category of merchant text in the sample library, the words in the category of merchant text whose category feature weight is greater than a second threshold value are selected as key words.

8. The identification device of claim 5, wherein, The process of text mining of the merchant text in the sample library by the mining unit to obtain the theme words includes: For each category of merchant text in the sample library, the first word frequency and the second word frequency of each word in the category of merchant text are determined, and the theme comprehensive weight of each word is determined according to the difference between the first word frequency and the second word frequency of each word; wherein the first word frequency is the word frequency of the word in the category of merchant text; and the second word frequency is the word frequency of the word in the merchant text of other categories except the category. For each category of merchant text in the sample library, N words are selected as theme words in the order from large to small according to the theme comprehensive weight of each word in the category of merchant text; wherein N is a preset positive integer.

9. A computer storage medium, characterized in that A computer program for storing is executed, specifically for implementing the merchant text identification method of any one of claims 1 to 4.

10. An electronic device, comprising: comprising a memory and a processor; wherein the memory is configured to store a computer program; the processor is configured to execute the computer program, specifically for implementing the merchant text identification method of any one of claims 1 to 4.

11. A computer program product, characterised in that, The computer program product comprises computer instructions, and the processor of the computer device executes the computer instructions, so that the computer device executes the merchant text identification method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Classification method and device based on artificial intelligence, terminal and storage medium

    CN111708888A

  • Text classification method and device

    CN112989761A

  • Theme-based semantic recognition method and device, electronic equipment and storage medium

    CN113095080A