Method and device for classifying consumption scenarios

The method and device classify consumption scenarios using data preprocessing and advanced algorithms to enhance distribution efficiency and accuracy, addressing the challenge of timely delivery to users in need.

CN111882224BActive Publication Date: 2024-12-06SHANGJIAXIA INFORMATION TECH CHENGDU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010754949.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-30
Publication Date
2024-12-06
Estimated Expiration
2040-07-30

AI Technical Summary

Technical Problem

Existing methods struggle to distribute goods and services to users in need in a timely and efficient manner, leading to resource waste.

Method used

A method and device for classifying consumption scenarios by preprocessing and matching data information using regular statements, the longest common substring algorithm, and TF-IDF, combined with an xgboost model, to determine consumption categories based on user delivery addresses.

Benefits of technology

Accurately classifies consumption scenarios, reducing waste and improving distribution efficiency by leveraging external experiences and big data analysis to understand consumer behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111882224B_ABST
    Figure CN111882224B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for classifying consumption scenarios, the method comprising: obtaining data information under each category after classification; the data information comprises: scenario name, scenario type, province, city and address; performing data preprocessing on the data information; storing the preprocessed data information in a database; obtaining the delivery address of the current user's consumption; performing text matching between the address information of the preprocessed data information stored in the database and the delivery address of the user's consumption, and determining the consumption scenario category to which the delivery address of the current user's consumption belongs. This solution does not require changing the business process, the user only needs to fill in the delivery address according to the normal business process, and the user's non-perception of the wine scene behavior analysis can be realized, so that the operation personnel can improve the service process, analyze user needs and adjust the business strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method and device for classifying consumption scenarios. Background Art

[0002] In the past, it was very difficult to find people who needed the goods and services we produced and provided. The general practice was to advertise on a large scale, but the people notified were not necessarily the ones who needed these products and services. If the distribution was not good, it would be a huge waste of social resources.

[0003] People who provide goods and services also need to distribute services and goods to various regions. How to distribute them so that there is no waste and how to distribute them so that people who need them can enjoy the required services and goods in a timely manner are issues that need to be urgently addressed at this stage. Summary of the invention

[0004] In order to solve the problem in the prior art that produced products cannot be distributed to users in need in a timely manner, the present invention provides a method and device for classifying consumption scenarios.

[0005] In a first aspect, the present invention provides a method for classifying consumption scenarios, the method comprising:

[0006] Obtain the data information of each category after classification; the data information includes: scene name, scene type, province, city and address;

[0007] Perform data preprocessing on data information;

[0008] Storing the preprocessed data information in a database;

[0009] Get the delivery address of the current user's consumption;

[0010] The address information of the preprocessed data information stored in the database is matched with the delivery address of the user's consumption to determine the consumption scenario category to which the delivery address of the current user's consumption belongs.

[0011] Furthermore, the data information obtained under each category after classification includes:

[0012] Obtain data information corresponding to each category on the platform information website within the preset time.

[0013] Furthermore, preprocessing the data information includes:

[0014] Structuring and cleaning the data information to obtain processed data information;

[0015] Call the map interface to add longitude and latitude data to the address information in the processed data information.

[0016] Furthermore, text matching of the address information of the pre-processed data information stored in the database with the delivery address consumed by the user includes:

[0017] Use regular statements and the longest common substring algorithm to match the delivery address by scenario category;

[0018] If the match fails, the text with the regular statement and the longest common substring algorithm matching score greater than the preset threshold is selected as the training sample;

[0019] Use TF-IDF to split and extract the address text in the training samples;

[0020] Input the extracted text into the xgboost model for training and output the training results.

[0021] Furthermore, using regular statements and the longest common substring algorithm to match the scene category of the delivery address includes:

[0022] Use regular expressions to perform basic classification of delivery addresses and determine the scenario category; or

[0023] Obtain address information within a preset distance from the standard library, use the longest common substring algorithm to perform text matching on the longitude and latitude data of the delivery address and the address information within the preset distance, and determine the scenario category.

[0024] Furthermore, the method further comprises:

[0025] If the address information of the preprocessed data information stored in the database fails to match the text of the user's delivery address, the unmatched text is used as the target word vector and input into the xgboost model for training to predict the consumption scenario category.

[0026] Furthermore, using TF-IDF to split and extract the address text in the training sample includes:

[0027] Use TF-IDF to segment the address text in the training sample;

[0028] The weights of the words in the address text are assigned according to each scenario category, and the words that meet the preset weight threshold are extracted.

[0029] In a second aspect, the present invention provides a device for classifying consumption scenarios, the device comprising:

[0030] The data information acquisition module is used to obtain the data information of each category after classification; the data information includes: scene name, scene type, province, city and address;

[0031] A preprocessing module, used for preprocessing data information;

[0032] A storage module, used to store the pre-processed data information in a database;

[0033] Get the delivery address module, used to get the delivery address of the current user's consumption;

[0034] The text matching module is used to perform text matching on the address information of the pre-processed data information stored in the database with the delivery address consumed by the user, and determine the consumption scenario category to which the delivery address consumed by the current user belongs.

[0035] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for classifying consumption scenarios provided in the first aspect are implemented.

[0036] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for classifying consumption scenarios provided in the first aspect.

[0037] The present invention obtains data information under each category, performs text matching, text analysis algorithms and big data calculations, makes good use of the advantages of all parties, complements each other's deficiencies, and ensures the realization and stability of scene classification judgment. By using the acquired external experience, the external experience is combined with the internal data through text matching, and the analysis algorithm in this article makes up for the lack of accuracy of text matching; at the same time, through big data analysis methods, combined with information such as people's consumption behavior, the different consumption scenes in various regions are compared, which can help brands understand the consumption scenes of the target service groups, and provide effective data basis for products to reach consumers, so as to achieve a win-win situation for consumers and brands. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of a method flow for classifying consumption scenarios provided in an embodiment of the present invention;

[0040] Figure 2 A block diagram of a device for classifying consumption scenarios provided in an embodiment of the present invention;

[0041] Figure 3A block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0044] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0045] With the development of the Internet and the subsequent popularization of mobile Internet, almost everyone has become accustomed to being online at any time. As people can conveniently shop and socialize on various platforms, they have also left footprints on the Internet. For the production brands of alcoholic products, as product providers, they also hope to know where the people they need services are. The embodiments of the present invention can understand where the people who need it are by collating and classifying this information, combining the services provided with the characteristics of the products, so as to enable the provider to accurately reach the people it needs to serve, reduce waste and improve collaborative efficiency. More specifically, if Figure 1 , an embodiment of the present invention provides a method for classifying consumption scenarios, the method comprising:

[0046] Step S101, obtaining data information of each category after classification; the data information includes: scene name, scene type, province, city and address;

[0047] Step S102, performing data preprocessing on the data information;

[0048] Step S103, storing the preprocessed data information in a database;

[0049] Step S104, obtaining the delivery address of the current user's consumption;

[0050] Step S105, performing text matching on the address information of the pre-processed data information stored in the database and the delivery address consumed by the user to determine the consumption scenario category to which the delivery address consumed by the current user belongs.

[0051] Specifically, the embodiment of the present invention preferably classifies the consumption scenarios of alcoholic products. First, crawlers are used to crawl data information: the main wine consumption scene addresses are divided into three categories: office places, residences, and restaurants. The main platform information websites of each category are selected (including 58, Meituan, Dianping and other platforms), and crawler tasks are established one by one. The data is crawled regularly (or within a preset time) through the online server. The data includes: scene name, scene type, province, city and detailed address. The crawler data can continuously draw on external experience and obtain new data each time. In this way, samples are continuously accumulated through the text matching algorithm, and the accuracy of the text analysis algorithm is finally improved.

[0052] The crawled data is structured and stored in the online database, and preliminary data cleaning is performed through the scheduling process. Cleaning includes cleaning of duplicate data, garbled code, and special symbols. At the same time, common map interfaces such as Baidu Maps and Amap are called to obtain the address latitude and longitude data and save them to the database.

[0053] Obtain the target user's consumption delivery address, perform text matching on the address information of the preprocessed data information stored in the database with the user's consumption delivery address, and determine the consumption scenario category to which the current user's consumption delivery address belongs based on the text matching result.

[0054] The embodiment of the present invention obtains data information under each category, performs text matching, text analysis algorithms and big data calculations, and makes good use of the advantages of all parties, complements each other's deficiencies, and ensures the realization and stability of scene classification judgment. By using the acquired external experience, the external experience is combined with the internal data through text matching, and the analysis algorithm in this article makes up for the lack of accuracy of text matching; at the same time, through big data analysis methods, combined with information such as people's consumption behavior, different consumption scenes in various regions are compared, which can help brands understand the consumption scenes of the target service groups, and provide effective data basis for products to reach consumers, so as to achieve a win-win situation for consumers and brands.

[0055] Based on the contents of the above embodiments, as an optional embodiment: text matching the address information of the pre-processed data information stored in the database with the delivery address of the user's consumption includes:

[0056] Use regular statements and the longest common substring algorithm to match the delivery address by scenario category;

[0057] If the match fails, the text with the regular statement and the longest common substring algorithm matching score greater than the preset threshold is selected as the training sample;

[0058] Use TF-IDF to split and extract the address text in the training samples;

[0059] Input the extracted text into the xgboost model for training and output the training results.

[0060] Specifically, regular statements are used to perform basic classification on addresses with obvious classification. If the address contains certain words with obvious scene information (the main scene in the embodiment of the present invention is the wine scene), the address is classified as the scene, such as hot pot, skewers, KTV, etc., which can be classified as a catering scene type.

[0061] The longest common substring algorithm is used to match the scene category of the delivery address. It is mainly based on the latitude and longitude of the delivery, and matches the preset distance from the standard library, such as the address information within 1km nearby. Then, the longest common substring algorithm is used to calculate the similarity between the delivery address and these addresses one by one, and then the address with the highest similarity is obtained to determine the wine usage scene. The longest common string algorithm is to first obtain the longest common string in the two texts, and then calculate the length of the common string / the length of the longer text in the two texts, which is used as the address similarity.

[0062] If some addresses fail to match when the regular statement and the longest common substring algorithm are used to match the text of the delivery address, select the text whose matching score of the regular statement and the longest common substring algorithm is greater than the preset threshold as the training sample, such as selecting the text with a higher score (above 70 points) as the training sample, and then use TF-IDF to split and extract the address text in the training sample; input the extracted text into the xgboost model for training, and output the training results. Train the xgboost model. Select important parameters to construct a grid search and obtain the best model parameters, including: learning rate, maximum depth, estimator, and minimum leaf node sample weight. Use the best model parameters to train the model again, verify it in the test set, and store the model.

[0063] Based on the contents of the above embodiments, as an optional embodiment: using TF-IDF to split and extract address text in training samples includes:

[0064] Use TF-IDF to segment the address text in the training sample;

[0065] According to the weights assigned to the words in the address text for each scenario category, extract the words that meet the preset weight threshold.

[0066] Specifically, perform word segmentation on the address text in the selected training samples and remove the stop words in the word segmentation results. Stop words are, to a certain extent, equivalent to filtering words. Generally speaking, stop words can be roughly divided into the following two categories: 1. Some words that are used very widely or even overly frequently. For example, words like "i", "is", "what" in English and "我", "就" in Chinese will appear in almost every document; 2. Words that appear frequently in the text but have little actual meaning. This category mainly includes modal particles, adverbs, prepositions, conjunctions, etc. These words usually have no clear meaning by themselves and only have a certain role when placed in a complete sentence. Appropriately reducing the frequency of stop words can effectively help improve the keyword density.

[0067] Form a new result set according to the scenario type for the result after removing stop words, and then use TF-IDF to assign weights to the words in the address text according to each scenario category, and select the top 500 words to form a word vector. According to the word vector, reconstruct the samples and generate a training set. The TF-IDF method is to count the word frequency of a word in this text and compare it with the word frequency of the word in all texts to find the words that are more illustrative of this category. It should be noted that the words that are illustrative of the category refer to the words that can better represent the category type. For example, in the catering scenario category, words such as hot pot, base material, and beverage tend to be extracted and higher weight values are assigned to these words.

[0068] Based on the content of the above embodiments, as an alternative embodiment: The method further includes:

[0069] If the address information in the preprocessed data information stored in the database fails to match the delivery address of the user's consumption in text, then use the text of the failed match as the target word vector and input it into the xgboost model for training to predict the consumption scenario category.

[0070] Specifically, if there is still an address text that fails to match after the text address matching process of the foregoing embodiments, then use the text of the failed match as the target word vector and input it into the xgboost model for training to predict the consumption scenario category.

[0071] According to another aspect of the present invention, an embodiment of the present invention provides a device for classifying consumption scenarios. See Figure 2 , Figure 2A block diagram of a device for classifying consumption scenarios provided in an embodiment of the present invention. The device is used to complete the classification of consumption scenarios provided in the embodiments of the present invention in the aforementioned embodiments. Therefore, the description and definition of the method for classifying consumption scenarios provided in the embodiments of the present invention in the aforementioned embodiments can be used for understanding the various execution modules in the embodiments of the present invention.

[0072] The device includes:

[0073] The data information acquisition module 201 is used to acquire the data information of each category after classification; the data information includes: scene name, scene type, province, city and address;

[0074] A preprocessing module 202 is used to perform data preprocessing on the data information;

[0075] The storage module 203 is used to store the pre-processed data information in a database;

[0076] The delivery address acquisition module 204 is used to acquire the delivery address of the current user's consumption;

[0077] The text matching module 205 is used to perform text matching on the address information of the pre-processed data information stored in the database with the delivery address consumed by the user, and determine the consumption scenario category to which the delivery address consumed by the current user belongs.

[0078] Specifically, the specific process of each module in the device of this embodiment to realize its function can be found in the relevant description in the corresponding method embodiment, which will not be repeated here.

[0079] The embodiment of the present invention obtains data information under each category, performs text matching, text analysis algorithms and big data calculations, and makes good use of the advantages of all parties, complements each other's deficiencies, and ensures the realization and stability of scene classification judgment. By using the acquired external experience, the external experience is combined with the internal data through text matching, and the analysis algorithm in this article makes up for the lack of accuracy of text matching; at the same time, through big data analysis methods, combined with information such as people's consumption behavior, different consumption scenes in various regions are compared, which can help brands understand the consumption scenes of the target service groups, and provide effective data basis for products to reach consumers, so as to achieve a win-win situation for consumers and brands.

[0080] Figure 3 A block diagram of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, the device includes: a processor 301, a memory 302 and a bus 303;

[0081] Among them, the processor 301 and the memory 302 respectively complete mutual communication through the bus 303; the processor 301 is used to call the program instructions in the memory 302 to execute the method for classifying consumption scenarios provided by the above embodiment, for example, including: obtaining data information under each category after classification; the data information includes: scene name, scene type, province, city and address; performing data preprocessing on the data information; storing the preprocessed data information in the database; obtaining the delivery address of the current user's consumption; text matching the address information of the preprocessed data information stored in the database with the delivery address of the user's consumption, and determining the consumption scenario category to which the delivery address of the current user's consumption belongs.

[0082] An embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for classifying consumption scenarios are implemented. For example, it includes: obtaining data information under each category after classification; the data information includes: scene name, scene type, province, city and address; performing data preprocessing on the data information; storing the preprocessed data information in a database; obtaining the delivery address of the current user's consumption; text matching the address information of the preprocessed data information stored in the database with the delivery address of the user's consumption, and determining the consumption scenario category to which the delivery address of the current user's consumption belongs.

[0083] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0085] Finally, the present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for classifying consumption scenarios, characterized in that: The method comprises: Obtain the data information of each category after classification; the data information includes: scene name, scene type, province, city and address; Performing data preprocessing on the data information; Storing the preprocessed data information in a database; Get the delivery address of the current user's consumption; Perform text matching on the address information of the pre-processed data information stored in the database with the delivery address of the user's consumption to determine the consumption scenario category to which the delivery address of the current user's consumption belongs; Performing data preprocessing on the data information includes: Performing data structuring and data cleaning on the data information to obtain processed data information; Call the map interface to add longitude and latitude data to the address information in the processed data information; The text matching of the address information of the pre-processed data information stored in the database with the delivery address consumed by the user includes: Using regular statements and the longest common substring algorithm to match the scene category of the delivery address; If the match fails, the text with the regular statement and the longest common substring algorithm matching score greater than the preset threshold is selected as the training sample; Using TF-IDF to split and extract the address text in the training sample; Input the extracted text into the xgboost model for training and output the training results; The splitting and extracting of the address text in the training sample by using TF-IDF includes: Using TF-IDF to perform word segmentation on the address text in the training sample; The weights of the words in the address text are assigned according to each scenario category, and the words that meet the preset weight threshold are extracted.

2. The method according to claim 1, characterized in that The data information obtained after classification under each category includes: Obtain data information corresponding to each category on the platform information website within the preset time.

3. The method according to claim 1, characterized in that The matching of the scene category of the delivery address by using regular statements and the longest common substring algorithm includes: Perform basic classification of the delivery address using regular statements to determine the scenario category; or Obtain address information within a preset distance from the standard library, use the longest common substring algorithm to perform text matching on the longitude and latitude data of the delivery address and the address information within the preset distance, and determine the scenario category.

4. The method according to claim 1, characterized in that: The method further comprises: If the address information of the preprocessed data information stored in the database fails to match the text of the user's delivery address, the unmatched text is used as the target word vector and input into the xgboost model for training to predict the consumption scenario category.

5. A device for classifying consumption scenarios, characterized in that: The device comprises: The data information acquisition module is used to obtain the data information of each category after classification; the data information includes: scene name, scene type, province, city and address; A preprocessing module, used for performing data preprocessing on the data information; A storage module, used to store the pre-processed data information in a database; Get the delivery address module, used to get the delivery address of the current user's consumption; A text matching module is used to perform text matching between the address information of the pre-processed data information stored in the database and the delivery address of the user's consumption, so as to determine the consumption scenario category to which the delivery address of the current user's consumption belongs; Performing data preprocessing on the data information includes: Performing data structuring and data cleaning on the data information to obtain processed data information; Call the map interface to add longitude and latitude data to the address information in the processed data information; The text matching of the address information of the pre-processed data information stored in the database with the delivery address consumed by the user includes: Using regular statements and the longest common substring algorithm to match the scene category of the delivery address; If the match fails, the text with the regular statement and the longest common substring algorithm matching score greater than the preset threshold is selected as the training sample; Using TF-IDF to split and extract the address text in the training sample; Input the extracted text into the xgboost model for training and output the training results; The splitting and extracting of the address text in the training sample by using TF-IDF includes: Using TF-IDF to perform word segmentation on the address text in the training sample; The weights of the words in the address text are assigned according to each scenario category, and the words that meet the preset weight threshold are extracted.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for classifying consumption scenarios as described in any one of claims 1 to 4 are implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for classifying consumption scenarios as described in any one of claims 1 to 4 are implemented.