Sem keyword generation method, system, device and storage medium
By analyzing user search text and product text, and using word segmentation and attribute relationships to generate SEM keywords, the problem in existing technologies that SEM keywords do not conform to user search habits is solved, and automated and accurate keyword generation is achieved.
Patent Information
- Application Number
- CN202210061054.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-01-19
AI Technical Summary
In the existing technology, SEM keyword generation is easily affected by subjective factors of human intervention, resulting in inconsistency with user search habits.
By obtaining multiple search texts of the target product, using the preset word segmentation and attribute correspondence and neural network model to perform word segmentation, generating search word segmentation and attribute sequences, combining the product text to generate SEM keywords, and screening out keywords that meet user search habits.
Automatically generated SEM keywords more accurately match user search habits, reduce the subjectivity of manual intervention, and improve the effectiveness of keywords.
Smart Images

Figure CN114385778B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of text processing, in particular to a SEM (Search Engine Marketing) keyword generation method, system, device and storage medium. BACKGROUND
[0002] With the rapid development of the Internet, the network has become the largest information carrier and communication platform, and the search engine as an effective information acquisition tool is an important way for many people to obtain information. SEM (Search Engine Marketing) is to deliver product information to the target group as much as possible through the results returned by the search engine. In the prior art, SEM keywords are generated manually based on past experience or classified based on a pre-set template and then spliced to generate SEM keywords. However, both of these two methods need human intervention, and the generated SEM keywords are easily affected by subjective factors, so that many SEM keywords do not conform to the user's search habits. SUMMARY
[0003] The technical problem to be solved by the present application is to overcome the defect that the SEM keywords in the prior art do not conform to the user's search habits, and to provide a SEM keyword generation method, system, device and storage medium.
[0004] The present application solves the above technical problems by the following technical solutions:
[0005] According to a first aspect of the present application, a SEM keyword generation method is provided, comprising the following steps:
[0006] obtaining a plurality of search texts corresponding to a target product;
[0007] For each search text, performing word segmentation on the search text according to a pre-set correspondence between words and attributes to obtain search word segmentation and a first attribute corresponding to the search word segmentation;
[0008] generating a first attribute sequence corresponding to the search text based on the first attribute;
[0009] acquiring a product text of the target product;
[0010] generating a SEM keyword based on the product text, the search word segmentation and a second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search word segmentation and the first attribute sequence.
[0011] Preferably, the step of generating a SEM keyword based on the product text, the search word segmentation and the second attribute sequence comprises:
[0012] determining whether the product text has a direct corresponding product segmentation and a second attribute, if yes, obtaining the product segmentation and the second attribute; otherwise, performing segmentation on the product text according to a preset corresponding relationship between segmentation and attribute to obtain the product segmentation and a second attribute corresponding to the product segmentation;
[0013] filtering a second attribute sequence from the first attribute sequence, wherein the first attribute contained in the second attribute sequence covers the second attribute;
[0014] According to the attribute order of the second attribute sequence, the search segmentation and the product segmentation corresponding to the attributes of the second attribute sequence are spliced respectively to generate SEM keywords;
[0015] And / or, the step of generating SEM keywords based on the product text, the search segmentation and the second attribute sequence further includes pre-filtering the first attribute sequence and the search segmentation;
[0016] The step of pre-filtering the first attribute sequence and the search segmentation includes:
[0017] Respectively, the number of the first attribute sequence is counted;
[0018] Filtering the N first attribute sequences with the most number, wherein N is a positive integer;
[0019] Respectively, the number of the search segmentation under each first attribute in the N first attribute sequences is counted;
[0020] Filtering the K search segmentations with the most number, wherein K is a positive integer.
[0021] Preferably, the step of performing segmentation on the search text to obtain search segmentation and first attribute corresponding to the search segmentation includes:
[0022] Segmenting the search text by using a first segmentation process and / or a second segmentation process;
[0023] The first segmentation process includes:
[0024] Building a dictionary, the dictionary includes attributes and segmentations corresponding to the attributes;
[0025] Traversing the segmentations of the dictionary, one by one matching the search text to obtain the search segmentation;
[0026] Obtaining the first attribute corresponding to the search segmentation from the dictionary;
[0027] The second segmentation process includes:
[0028] acquiring attribute identifiers corresponding to each Chinese character in the search text through a pre-trained neural network model;
[0029] performing cluster analysis on the attribute identifiers to obtain a first attribute;
[0030] performing word segmentation on the search text according to the first attribute to obtain the search segmented text.
[0031] Preferably, when the search text is segmented by using the first word segmentation process and the second word segmentation process, the step of segmenting the search text further comprises:
[0032] respectively counting a first number of the first attribute obtained by using the first word segmentation process and a second number of the first attribute obtained by using the second word segmentation process;
[0033] determining whether the first number is not less than the second number, if yes, retaining the first attribute obtained by using the first word segmentation process and the search segmented text; otherwise, retaining the first attribute obtained by using the second word segmentation process and the search segmented text.
[0034] According to a second aspect of the present application, a SEM keyword generation system is provided, which comprises a first acquisition module, a word segmentation module, a first generation module, a second acquisition module and a second generation module:
[0035] The first acquisition module is configured to acquire a plurality of search texts corresponding to a target product;
[0036] The word segmentation module is configured to, for each search text, perform word segmentation on the search text according to a pre-set correspondence between segmented words and attributes, to obtain a search segmented text and a first attribute corresponding to the search segmented text;
[0037] The first generation module is configured to generate a first attribute sequence corresponding to the search text based on the first attribute;
[0038] The second acquisition module is configured to acquire a product text of the target product;
[0039] The second generation module is configured to generate a SEM keyword based on the product text, the search segmented text and a second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search segmented text and the first attribute sequence.
[0040] Preferably, the second generation module comprises a first determination unit, a first acquisition unit, a first word segmentation unit, a first screening unit and a splicing unit:
[0041] The first judging unit is configured to judge whether the product text has a directly corresponding product word segmentation and a second attribute, and if yes, the first obtaining unit is called; otherwise, the first word segmentation unit is called.
[0042] The first obtaining unit is configured to obtain the product word segmentation and the second attribute.
[0043] The first word segmentation unit is configured to perform word segmentation on the product text according to a preset corresponding relationship between word segmentation and attributes to obtain the product word segmentation and a second attribute corresponding to the product word segmentation.
[0044] The first screening unit is configured to screen a second attribute sequence from the first attribute sequence, wherein the first attribute contained in the second attribute sequence covers the second attribute.
[0045] The splicing unit is configured to splice the search word segmentation and the product word segmentation corresponding to the attributes of the second attribute sequence respectively according to the attribute order of the second attribute sequence to generate SEM keywords.
[0046] And / or, the SEM keyword generation system further comprises a screening module, which is configured to pre-screen the first attribute sequence and the search word segmentation.
[0047] The screening module comprises a second statistical unit, a second screening unit, a third statistical unit and a third screening unit.
[0048] The second statistical unit is configured to count the number of the first attribute sequence respectively.
[0049] The second screening unit is configured to screen N first attribute sequences with the largest number, wherein N is a positive integer.
[0050] The third statistical unit is configured to count the number of the search word segmentation under each first attribute in the N first attribute sequences respectively.
[0051] The third screening unit is configured to screen K search word segmentations with the largest number, wherein K is a positive integer.
[0052] Preferably, the word segmentation module is configured to perform word segmentation on the search text by using a first word segmentation process, and the word segmentation module comprises a construction unit, a matching unit and a second obtaining unit.
[0053] The construction unit is configured to construct a dictionary, and the dictionary comprises an attribute and a word segmentation corresponding to the attribute.
[0054] The matching unit is configured to traverse the word segmentation of the dictionary and one-by-one match the search text to obtain the search word segmentation.
[0055] The second acquisition unit is configured to acquire a first attribute corresponding to the search word segmentation from the dictionary.
[0056] The word segmentation module comprises a third acquisition unit, a merging unit and a second word segmentation unit when the word segmentation module is configured to segment the search text by using the second word segmentation process.
[0057] The second acquisition unit is configured to acquire an attribute identifier corresponding to each Chinese character in the search text by using a pre-trained neural network model.
[0058] The merging unit is configured to perform cluster analysis on the attribute identifiers to obtain the first attribute.
[0059] The second word segmentation unit is configured to segment the search text according to the first attribute to obtain the search word segmentation.
[0060] Preferably, the word segmentation module further comprises a first statistical unit, a second judgment unit, a first reservation unit and a second reservation unit.
[0061] The first statistical unit is configured to respectively count a first number of the first attribute obtained by using the first word segmentation process and a second number of the first attribute obtained by using the second word segmentation process.
[0062] The second judgment unit is configured to judge whether the first number is not less than the second number, and if yes, the first reservation unit is called; otherwise, the second reservation unit is called.
[0063] The first reservation unit is configured to reserve the first attribute and the search word segmentation obtained by using the first word segmentation process.
[0064] The second reservation unit is configured to reserve the first attribute and the search word segmentation obtained by using the second word segmentation process.
[0065] According to a third aspect of the present application, an electronic device is provided, comprising a memory and a processor connected to the memory, wherein the processor executes a computer program stored in the memory to implement the SEM keyword generation method.
[0066] According to a fourth aspect of the present application, a computer readable storage medium is provided, wherein a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to implement the SEM keyword generation method.
[0067] The positive progress effect of the present application is that:
[0068] Through a large number of analysis of user search text, search word segmentation and each search word segmentation corresponding attribute are obtained, and then the attribute sequence corresponding to the search text is generated through the attribute, wherein the attribute sequence and the search word segmentation under each attribute are used for representing the search habit of the user, for the product needing to generate the SEM keyword, the common attribute sequence corresponding to the product is screened out, then the common search word segmentation under each attribute in the attribute sequence is screened out, and the product and the search word segmentation are spliced based on the attribute sequence, so that the SEM keyword conforming to the search habit of the user is automatically generated. BRIEF DESCRIPTION OF DRAWINGS
[0069] Figure 1 It is a flowchart of the SEM keyword generation method of the embodiment 1 of the application.
[0070] Figure 2 It is a flowchart of the step S12 of the SEM keyword generation method of the embodiment 1 of the application.
[0071] Figure 3 It is a flowchart of the step S15 of the SEM keyword generation method of the embodiment 1 of the application.
[0072] Figure 4 It is a flowchart of the step S16 of the SEM keyword generation method of the embodiment 1 of the application.
[0073] Figure 5 It is a flowchart of the step S12 of the SEM keyword generation method of the embodiment 2 of the application.
[0074] Figure 6 It is a flowchart of the step S12 of the SEM keyword generation method of the embodiment 3 of the application.
[0075] Figure 7 It is a structural schematic diagram of the SEM keyword generation system of the embodiment 4 of the application.
[0076] Figure 8 It is a structural schematic diagram of the cutting module 22 of the SEM keyword generation system of the embodiment 4 of the application.
[0077] Figure 9 It is a structural schematic diagram of the screening module 25 of the SEM keyword generation system of the embodiment 4 of the application.
[0078] Figure 10 It is a structural schematic diagram of the second generation module 26 of the SEM keyword generation system of the embodiment 4 of the application.
[0079] Figure 11 It is a structural schematic diagram of the cutting module 22 of the SEM keyword generation system of the embodiment 5 of the application.
[0080] Figure 12 A structural schematic diagram of the cutting module 22 of the SEM keyword generation system of Embodiment 6 of the present application.
[0081] Figure 13 A structural schematic diagram of the electronic device of Embodiment 7 of the present application. DETAILED DESCRIPTION
[0082] The present application will be further described below by way of examples, but the present application is not limited to the scope of the examples.
[0083] Embodiment 1
[0084] The present embodiment provides a SEM keyword generation method, as shown in the figure, the SEM keyword generation method comprises the following steps: Figure 1
[0085] S11, obtaining a plurality of search texts corresponding to a target product.
[0086] For the convenience of description, it is assumed that the present embodiment is mainly applied to the OTA (online travel) industry, wherein the target product is used to represent a product for which a SEM keyword text is to be generated, including products related to cities, hotels, popular scenic spots, air tickets, tickets, etc. Users have different search behavior habits for different products, and of course the present embodiment is not limited to the above products.
[0087] As an optional implementation, the search text input by the user in the front-end interface search box in the search engine related to the OTA industry is obtained, and the search text is stored in the HIVE (data warehouse tool) database in the form of a log, so as to obtain a large amount of search log data. Then, the search log data of the user is read in batches by using SparkSQL (a module for structured data processing in a computing engine), and a large amount of search texts corresponding to the target product can be obtained from the search log data by setting a preset date range or a preset number, etc.
[0088] S12, for each search text, according to a preset correspondence between the word segmentation and the attribute, performing word segmentation on the search text to obtain search word segmentation and a first attribute corresponding to the search word segmentation.
[0089] Wherein, the word segmentation is used to represent a word, which can be a character or a plurality of characters, and the attribute in the present embodiment is used to represent the type corresponding to the word, such as the word "hotel", "inn", "bed and breakfast" corresponding to the hotel type word, and such as the word "in", "of", "at" corresponding to the grammar type word to ensure that the SEM keyword basically conforms to the grammar specification, etc.
[0090] As an optional implementation, the search text is segmented by using the first word segmentation process, as shown in Figure 2 The first cutting procedure specifically includes the following steps:
[0091] S121, a dictionary is constructed, which includes attributes and the cut words corresponding to the attributes.
[0092] In the dictionary, the cut words usually include special words commonly used in the OTA industry, and are divided into different attributes according to business needs. As an example, the dictionary constructed in this embodiment mainly includes 15 attributes, specifically: attribute A is a hotel type word, such as "hotel", "inn", etc.; attribute B is a hotel room type word, such as "double bed room", "twin bed room", etc.; attribute C is a hotel star word, such as "five-star", "5-star", etc.; attribute D is a hotel brand word, such as "Licheng", "Hilton", etc.; attribute E is a discount type word, such as "promotion", "discount", etc.; attribute F is a brand type word, such as "Qunar", "Where to go", etc.; attribute G is a network popular type word, such as "grass-planting", "check-in", etc.; attribute H is a product type word, such as "air ticket", "train ticket", etc.; attribute I is a holiday type word, such as "National Day", "Labor Day", etc.; attribute J is a sales policy type word, such as "free parking", "provide breakfast", etc.; attribute K is a direction type word, such as "nearby", "surrounding", etc.; attribute L is a grammar type word, such as "in", "of", etc.; attribute M is a city type word, such as "Shanghai", "Shanghai City", etc.; attribute N is a popular scenic spot type word, such as "People's Square", "Oriental Pearl", etc.; and attribute O is a type word that cannot be classified into the above attributes. Of course, the attributes and cut words in this embodiment are not limited to the above.
[0093] As an optional implementation, the initial basic dictionary is quickly generated by experts in the field, and in order to avoid subjectivity and limitations, the words corresponding to various attributes in the dictionary are selected from the search logs of users on the search engine and added to the dictionary, so as to continuously optimize and improve the dictionary, and the dictionary is stored in the HIVE database.
[0094] S122, the cut words of the dictionary are traversed, and the search text is matched one by one to obtain search cut words.
[0095] For each search text, the segmentation in the dictionary is traversed, and the search text is segmented by using the forward maximum matching, reverse maximum matching, and middle maximum matching algorithms in turn, until the three algorithms cannot match the segmentation in the dictionary. The forward maximum matching means matching from the beginning of the text, the reverse maximum matching means matching from the end of the text, and the middle maximum matching means matching from the middle of the text. As an optional implementation, the segmentation corresponding to the attributes A to O in the dictionary is matched by default, and the segmentation order is not limited to the above, and can be adjusted according to actual business requirements. Taking the search text "hotel near Shanghai People's Square" as an example, if the segmentation corresponding to the attribute A "hotel" is taken from the dictionary, the remaining text becomes "Shanghai People's Square near" after successfully matching "hotel" in "hotel near Shanghai People's Square" from the end; if the segmentation corresponding to the attribute M "Shanghai" is taken from the dictionary, the remaining text becomes "People's Square near hotel" after successfully matching "Shanghai" in "hotel near Shanghai People's Square" from the beginning; if the segmentation corresponding to the attribute N "People's Square" is taken from the dictionary, the remaining text becomes "Shanghai" and "near hotel" after unsuccessfully matching from the beginning and the end.
[0096] As an optional implementation, any matching algorithm can be started, and the three matching algorithms described above are continuously implemented on the search text by traversing all the words in the dictionary until the segmentation in the dictionary cannot be matched, so as to obtain the segmentation result. For example, the segmentation result of the search text "hotel near Shanghai People's Square" is five search segmentations "Shanghai", "People's Square", "near", "of", and "hotel".
[0097] It should be noted that the segmented segmentation should meet the principle of the longest segmentation, for example, "Shanghai" and "Shanghai City", and "Shanghai City" is preferred for matching and segmentation. As an optional implementation, the segmentations under each attribute in the dictionary are sorted in descending order of text length, so that the segmented segmentation is more accurate.
[0098] S123, obtaining the first attribute corresponding to the search segmentation from the dictionary.
[0099] When the segmentation result is obtained, the attribute value corresponding to the segmentation is queried from the dictionary, for example, "Shanghai" corresponds to attribute M, "People's Square" corresponds to attribute N, "near" corresponds to attribute K, "of" corresponds to attribute L, and "hotel" corresponds to attribute A.
[0100] S13, generate a first attribute sequence corresponding to the search text based on the first attribute.
[0101] Based on the order of each search word in the search text, the attributes corresponding to each search word are spliced to generate a word attribute sequence (i.e. the first attribute sequence), which is saved in the HIVE database in the form of an array. For example, the word attribute sequence obtained from the search text "hotels near Shanghai People's Square" is "[attribute M, attribute L, attribute K, attribute L, attribute A]". In this embodiment, the word attribute sequence corresponding to a search text represents a user's search behavior pattern. For example, when the search text is "hotels near People's Square Shanghai", although the search is for the same type of product, the corresponding attribute sequence is "[attribute L, attribute K, attribute L, attribute A, attribute M]". Based on this, the attribute sequence and the search words under each attribute in the attribute sequence can be used to represent the user's search habits.
[0102] S14, obtain the product text of the target product.
[0103] As an optional implementation, the text of the product itself is cleaned, such as removing redundant synonyms in the product text, and then removing prepositions and auxiliary words in the product text that are irrelevant to the actual content through differentiation of different word types. The product text obtained usually includes the main body of the product and the name of the product, etc.
[0104] S15, pre-screen the first attribute sequence and the search word.
[0105] Since the attribute sequence and the search word obtained from the search text are more, in order to better organize the user's search habits, the attribute sequence and the search word need to be pre-screened. As an optional implementation, the Spark (a computing engine) is used to read the attribute sequence and the search word stored in the HIVE data warehouse, and the result of reading is used for screening, as shown in Figure 3 , step S15 specifically includes the following steps:
[0106] S151, respectively count the number of first attribute sequences.
[0107] Based on Spark, the number of each attribute sequence is counted, such as the number of "[attribute M, attribute L, attribute K, attribute L, attribute A]", the number of "[attribute M, attribute A]", the number of "[attribute M, attribute O, attribute A]", etc.
[0108] S152, screen N first attribute sequences with the largest number, wherein N is a positive integer.
[0109] The first attribute sequence is sorted in descending order of quantity. As an example, assume that the quantity of "[attribute M, attribute A]" is 8 million, the quantity of "[attribute M, attribute L, attribute K, attribute L, attribute A]" is 1 million, and the quantity of "[attribute M, attribute O, attribute A]" is 0.5 million. The attribute sequences with high ranking are filtered out. As an optional implementation, the value of N can be set according to actual requirements, where N represents the top N attribute sequences. For example, in the above three attribute sequences, if N is set to 2, the attribute sequences obtained are "[attribute M, attribute A]" and "[attribute M, attribute L, attribute K, attribute L, attribute A]".
[0110] S153, respectively, the number of search terms under each first attribute in the N first attribute sequences is counted.
[0111] The attributes in the N first attribute sequences are traversed, and the number of search terms belonging to each attribute is counted. For example, assume that the N attribute sequences obtained are "[attribute M, attribute A]" and "[attribute M, attribute L, attribute K, attribute L, attribute A]", and the first attributes obtained include "attribute M", "attribute L", "attribute K", "attribute L", and "attribute A". Then, the number of different search terms under "attribute M", "attribute L", "attribute K", "attribute L", and "attribute A" is counted.
[0112] S154, filtering K search terms with the largest quantity, where K is a positive integer.
[0113] The search terms are sorted in descending order of quantity. Taking "attribute M" as an example, assume that the quantity of "Shanghai" belonging to "attribute M" is 5 million, and the quantity of "Hangzhou" is 4 million. The search terms with high ranking are filtered out. As an optional implementation, the value of K can be set according to actual requirements, where K represents the top K attribute sequences. For example, in the above two search terms, when K is set to 1, the search term obtained is "Shanghai".
[0114] It should be noted that the data in this embodiment is only a brief example, and the actual attribute sequences and search terms are filtered out by the actual attribute sequence quantity and search term quantity data. In addition, different business requirements have different search text focuses obtained through different channels. As an optional implementation, different focuses can be filtered out. For example, for city products, the attribute sequence must include attribute M. For example, for popular scenic spot products, the attribute sequence must include attribute N.
[0115] S16, generating the SEM keyword based on the product text, the search word segmentation, and the second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search word segmentation, and the first attribute sequence.
[0116] In the embodiment, the second attribute sequence is used to represent the attribute sequence of the target product, i.e., the search behavior mode when searching for the product. Referring to Figure 4 , step S16 specifically includes the following steps:
[0117] S161, determining whether the product text has a directly corresponding product word segmentation and a second attribute, if yes, performing step S162; otherwise, performing step S163.
[0118] Here, the product word segmentation refers to the text of the product itself as a word segmentation, and the attribute corresponding to the product text is the second attribute. For example, the city product and the popular scenic spot product, the text of the city product is generally the city name itself, such as "Shanghai" and "Hangzhou", and the corresponding attribute is attribute M, while the text of the popular scenic spot product is generally the scenic spot name itself, such as "People's Square" and "Oriental Pearl", and the corresponding attribute is attribute N.
[0119] S162, obtaining the product word segmentation and the second attribute, and then performing step S164.
[0120] When the product text has a directly corresponding product word segmentation and a second attribute, such as "Shanghai", the product word segmentation is directly obtained as "Shanghai", and the second attribute is attribute M.
[0121] S163, performing word segmentation on the product text according to a preset corresponding relationship between word segmentation and attribute to obtain the product word segmentation and the second attribute corresponding to the product word segmentation, and then performing step S164.
[0122] When the product text cannot be directly used as a word segmentation, word segmentation is performed on the product text. For example, the text of the hotel product is the hotel name, and the hotel name usually includes multiple different attributes, such as "Shanghai Hongqiao Hotel", which includes the word segmentation "Shanghai" belonging to attribute M, the word segmentation "hotel" belonging to attribute A, and the word segmentation "Hongqiao" belonging to attribute O. As an optional implementation, the product text is segmented using the first word segmentation process to obtain the product word segmentation and the second attribute corresponding to the product word segmentation, wherein the specific steps are completely identical to the steps of segmenting the search text using the first word segmentation process in step S12 of the embodiment.
[0123] S164, screening the second attribute sequence from the first attribute sequence, wherein the first attribute included in the second attribute sequence covers the second attribute.
[0124] Specifically, assuming that the product text to be generated SEM keyword is "Shanghai", and "Shanghai" itself belongs to attribute M, then when filtering the attribute sequence, it is required that the attribute sequence (i.e., the second attribute sequence) contains attribute M. For example, common search texts include "Shanghai hotel", "hotel in Shanghai", "Shanghai discount hotel", etc., and the corresponding attribute sequences are "[attribute M, attribute A]", "[attribute M, attribute L, attribute A]", or "[attribute M, attribute 5, attribute A]", etc.
[0125] Further assuming that the product text to be generated SEM keyword is "Shanghai Hongqiao hotel", the obtained second attributes include attribute M, attribute O, and attribute A, respectively. When filtering the attribute sequence, it is required that the attribute sequence contains attribute M, attribute O, and attribute A, and the order of the attributes in the attribute sequence is not limited. For example, the user's search habit can be "Hongqiao hotel Shanghai", and the corresponding attribute sequence is "[attribute O, attribute A, attribute M]". Of course, other attribute sequences are also included, such as search texts "Shanghai Hongqiao hotel", "Shanghai Hongqiao hotel with a large bed", "Hongqiao hotel free parking in Shanghai", etc., and the corresponding attribute sequences are "[attribute M, attribute O, attribute A]", "[attribute M, attribute O, attribute A, attribute B]", or "[attribute O, attribute A, attribute J, attribute M]", etc.
[0126] S165、According to the attribute order of the second attribute sequence, the search terms and product terms corresponding to the attributes of the second attribute sequence are spliced respectively to generate SEM keywords.
[0127] In this embodiment, the product term is taken as a fixed value in the second attribute sequence, and then spliced with the common search terms filtered out through Cartesian product, such as for the city product "Shanghai", attribute M in the attribute sequence "[attribute M, attribute A]" is the fixed value "Shanghai". Assuming that the common search terms filtered out for attribute A are "hotel", "inn", and "hostel", the product term "Shanghai" and the search terms "hotel", "inn", and "hostel" are spliced through Cartesian product, i.e., set A is {Shanghai}, set B is {hotel, inn, hostel}, then AxB={(Shanghai, hotel), (Shanghai, inn), (Shanghai, hostel)}, and thus the final generated SEM keywords are "Shanghai hotel", "Shanghai inn", and "Shanghai hostel".
[0128] For example, for the hotel product "Shanghai Hongqiao Hotel", in the attribute sequence "[attribute O, attribute A, attribute J, attribute M]", attribute O, attribute A and attribute M are fixed values. Assuming that the common search keywords screened by attribute J are "free parking" and "breakfast supply", the product keywords "Hongqiao", "hotel", "Shanghai" and the search keywords "free parking" and "breakfast supply" are spliced by Cartesian product, that is, set A is {Hongqiao, hotel, Shanghai}, set B is {free parking, breakfast supply}. In addition, it should be noted that the attribute sequence of the attribute sequence, such as the search keyword between the product keyword "hotel" and the product keyword "Shanghai", AxB={(Hongqiao, hotel, free parking, Shanghai), (Hongqiao, hotel, breakfast supply, Shanghai)}, so that the SEM keywords generated finally are "Hongqiao Hotel Free Parking Shanghai" and "Hongqiao Hotel Breakfast Supply Shanghai". As an optional implementation, the SEM keywords generated above are stored in a database for future use.
[0129] The embodiment analyzes a large amount of search text of users to obtain search keywords and attributes corresponding to each search keyword, and then generates an attribute sequence corresponding to the search text through the attributes. The attribute sequence and the search keywords under each attribute are used to represent the search habits of users. For a product that needs to generate SEM keywords, common attribute sequences corresponding to the product are screened, and then common search keywords under each attribute in the attribute sequence are screened. The product and the search keywords are spliced based on the attribute sequence, so as to automatically generate SEM keywords in line with the search habits of users.
[0130] Embodiment 2
[0131] The embodiment provides a SEM keyword generation method, as shown in Figure 1 The steps S11, S13, S14 and S15 of the embodiment are the same as the corresponding steps of the embodiment 1, and the difference lies in that the step S12 of the embodiment utilizes a second keyword segmentation process to segment the search text, as shown in Figure 5 The second keyword segmentation process specifically includes the following steps:
[0132] S124, obtaining the attribute identifier corresponding to each Chinese character in the search text through the pre-trained neural network model.
[0133] As an optional implementation, the neural network model can be a named entity model. Specifically, a LSTM (Long Short Term Memory)-based neural network and a CRF (Conditional Random Field)-based named entity recognition model are trained on a correctly labeled data set, and a named entity model is obtained after the training, and the search text is predicted and segmented by the named entity model. The labeled data set includes the id (unique identification number) number of each Chinese character and the attribute identification corresponding to the Chinese character. The input of the model is the id number corresponding to each Chinese character in the search text, and the output is the attribute identification corresponding to the Chinese character.
[0134] For a segmented word, assuming multiple characters, the "b-attribute" indicates the attribute identification of the start character of the segmented word, the "m-attribute" indicates the attribute identification of the middle character of the segmented word, and the "e-attribute" indicates the attribute identification of the end character of the segmented word. Assuming that the segmented word is a single character, the "s-attribute" directly indicates the attribute identification of the segmented word. Similarly, different attributes are labeled according to business needs. In this embodiment, the attributes mainly include hotel type words, hotel room type words, discount type words, brand type words, network popular type words, sold product type words, holiday type words, sold policy type words, direction type words, syntax type words, city type words, popular scenic spot type words, and other type words. Fifteen attributes are labeled as attribute A to attribute O. For example, the input "Shanghai City" to the named entity model obtains the model output result as "b-attribute M", "m-attribute M", "e-attribute M", "b-attribute N", "m-attribute N", "m-attribute N", "e-attribute N", "b-attribute K", "e-attribute K", "s-attribute L", "b-attribute A", and "e-attribute A".
[0135] S125, clustering analysis is performed on the attribute identification to obtain a first attribute.
[0136] Taking the search text "hotels near Shanghai People's Square" as an example, the attribute identification output by the above model is "b-attribute M", "e-attribute M", "b-attribute N", "m-attribute N", "m-attribute N", "e-attribute N", "b-attribute K", "e-attribute K", "s-attribute L", "b-attribute A", and "e-attribute A". The attribute identifications belonging to the same attribute are merged, and the first attributes obtained are attribute M, attribute N, attribute K, attribute L, and attribute A.
[0137] S126, the search text is segmented according to the first attribute to obtain search segmented words.
[0138] For example, in the above search text "hotels near Shanghai People's Square", the search text is segmented according to attribute M, attribute N, attribute K, attribute L, and attribute A, and the segmented search segmented words are "Shanghai", "People's Square", "near", "of", and "hotel".
[0139] In step S16, the steps S161, S162, S164 and S165 of the present embodiment are the same as the corresponding steps of Embodiment 1, except that step S163 uses the second word segmentation process to segment the product text to obtain product segmentation and second attributes corresponding to the product segmentation, wherein the specific steps are completely consistent with the steps of segmenting the search text using the second word segmentation process in step S12 of the present embodiment.
[0140] Embodiment 3
[0141] The present embodiment is a fusion of Embodiment 1 and Embodiment 2. The SEM keyword generation method of the present embodiment includes steps S11, S13, S14 and S15, which are the same as the corresponding steps of Embodiment 1. In step S12, the search text is segmented using the first word segmentation process and / or the second word segmentation process. The specific steps of segmenting the search text using the first word segmentation process are described in Embodiment 1, and the specific steps of segmenting the search text using the second word segmentation process are described in Embodiment 2. As an optional implementation, the search text can be segmented using the first word segmentation process and the second word segmentation process respectively at the same time, and the segmentation result with the most attributes is selected as the final result, as described in Figure 6 The steps after segmenting the search text using the first word segmentation process and the second word segmentation process specifically include:
[0142] S127, respectively, the first number of the first attribute obtained using the first word segmentation process and the second number of the first attribute obtained using the second word segmentation process are counted.
[0143] S128, determining whether the first number is not less than the second number, if yes, executing step S129; otherwise, executing step S1210.
[0144] S129, retaining the first attribute obtained using the first word segmentation process and the search segmentation.
[0145] S1210, retaining the first attribute obtained using the second word segmentation process and the search segmentation.
[0146] In step S16, the steps S161, S162, S164 and S165 of the present embodiment are the same as the corresponding steps of Embodiment 1. In step S163, the product text is segmented using the first word segmentation process and / or the second word segmentation process. The steps of segmenting the product text using the first word segmentation process in step S163 are the same as those of Embodiment 1, and the steps of segmenting the product text using the second word segmentation process in step S163 are the same as those of Embodiment 2.
[0147] As an optional implementation, when the first attribute and the search segmentation obtained by using the first segmentation process are retained in step S12, step S163 segments the product text by using the first segmentation process to obtain product segmentation and a second attribute corresponding to the product segmentation; when the first attribute and the search segmentation obtained by using the second segmentation process are retained in step S12, step S163 segments the product text by using the second segmentation process to obtain product segmentation and a second attribute corresponding to the product segmentation.
[0148] Embodiment 4
[0149] The embodiment provides a SEM keyword generation system, which is shown in Figure 7 The SEM keyword generation system comprises a first acquisition module 21, a segmentation module 22, a first generation module 23, a second acquisition module 24, a screening module 25 and a second generation module 26.
[0150] The first acquisition module 21 is configured to acquire a plurality of search texts corresponding to a target product. For ease of description, it is assumed that the embodiment is mainly applied to the OTA (Online Travel Agency) industry, wherein the target product is used to represent a product for which SEM keyword texts are to be generated, and the product includes a city, a hotel, a popular scenic spot, an air ticket, a ticket, etc. Different products have different search behavior habits of users, and the embodiment is not limited to the above products.
[0151] As an optional implementation, the first acquisition module 21 acquires search texts input by users in a front-end interface search box in an OTA industry-related search engine, and stores the search texts in a HIVE (Hadoop Data Warehouse) database in the form of logs, so as to obtain a large amount of search log data. The first acquisition module 21 reads the search log data of users in batches by using SparkSQL (a module for processing structured data in a computing engine), and can acquire a large amount of search texts corresponding to the target product from the search log data by setting a preset date range or a preset number, etc.
[0152] The segmentation module 22 is configured to segment each search text according to a preset correspondence between segmentation and attribute, to obtain search segmentation and a first attribute corresponding to the search segmentation. The segmentation is used to represent a word, which can be a character or a plurality of characters, and the attribute in the embodiment is used to represent a type corresponding to the word, such as a hotel type word corresponding to a word such as “hotel”, “inn” or “hostel”, and a grammar type word corresponding to a word such as “in”, “of” or “at” to ensure that the SEM keyword basically conforms to a grammar specification.
[0153] As an optional implementation, the segmentation module 22 segments the search text by using a first segmentation process, which is shown in Figure 8The word segmentation module 22 includes a constructing unit 221, a matching unit 222, and a second obtaining unit 223.
[0154] The constructing unit 221 is configured to construct a dictionary including attributes and words corresponding to the attributes. The words in the dictionary generally include special words commonly used in the OTA industry and are classified into different attributes according to business needs. As an example, the dictionary constructed in this embodiment mainly includes 15 attributes. Specifically, attribute A is a hotel type word such as “hotel”, “inn”, etc.; attribute B is a hotel room type word such as “double bed room”, “twin bed room”, etc.; attribute C is a hotel star rating word such as “five-star”, “5-star”, etc.; attribute D is a hotel brand word such as “Licheng”, “Hilton”, etc.; attribute E is a discount type word such as “promotion”, “discount”, etc.; attribute F is a brand type word such as “Qunar”, “Where to go”, etc.; attribute G is a popular network type word such as “grass planting”, “check-in”, etc.; attribute H is a product type word such as “air ticket”, “train ticket”, etc.; attribute I is a holiday type word such as “National Day”, “Labor Day”, etc.; attribute J is a sales policy type word such as “free parking”, “provide breakfast”, etc.; attribute K is a direction type word such as “nearby”, “surrounding”, etc.; attribute L is a grammar type word such as “in”, “of”, etc.; attribute M is a city type word such as “Shanghai”, “Shanghai City”, etc.; attribute N is a popular scenic spot type word such as “People’s Square”, “Oriental Pearl”, etc.; and attribute O is a type word that cannot be classified into the above attributes. Of course, the embodiment is not limited to the above attributes and words.
[0155] As an optional implementation, the initial basic dictionary is quickly generated by experts in the field. In order to avoid subjectivity and limitations, the constructing unit 221 screens the words corresponding to various attributes in the dictionary from the search logs of users on the search engine and adds them to the dictionary, thereby continuously optimizing and improving the dictionary. The dictionary is stored in the HIVE database.
[0156] The matching unit 222 is configured to traverse the dictionary to segment the search text to obtain search segments. For each search text, the matching unit 222 traverses the segments in the dictionary and uses the three matching algorithms of forward maximum matching, reverse maximum matching and middle maximum matching in turn to segment the search text in a loop until the three algorithms cannot match the segments in the dictionary. The forward maximum matching means matching from the beginning of the text, the reverse maximum matching means matching from the end of the text, and the middle maximum matching means matching from the middle of the text. As an optional implementation, the matching unit 222 matches according to the segment order corresponding to the attributes A to O in the dictionary by default, and the embodiment is not limited to the above segment order, and can be adjusted according to actual business requirements. Taking the search text "hotels near Shanghai People's Square" as an example, if the segment "hotel" corresponding to the attribute A is taken from the dictionary, the matching unit 222 matches from the end, and after successfully matching the "hotel" in "hotels near Shanghai People's Square", the remaining text becomes "Shanghai People's Square near the hotel"; if the segment "Shanghai" corresponding to the attribute M is taken from the dictionary, the matching unit 222 matches from the beginning, and after successfully matching the "Shanghai" in "hotels near Shanghai People's Square", the remaining text becomes "People's Square near the hotel"; if the segment "People's Square" corresponding to the attribute N is taken from the dictionary, when the forward matching and the reverse matching are both unsuccessful, the matching unit 222 matches from the middle, and after successfully matching the "People's Square" in "hotels near Shanghai People's Square", the remaining text becomes "Shanghai" and "near the hotel".
[0157] As an optional implementation, the matching unit 222 can start from any matching algorithm, and continuously implement the above three matching algorithms on the search text by traversing all the words in the dictionary until the segments in the dictionary cannot be matched, so as to obtain the segmentation result. For example, the segmentation result of the search text "hotels near Shanghai People's Square" is five search segments "Shanghai", "People's Square", "near", "the" and "hotel".
[0158] It should be noted that the segmented segments should satisfy the basic principle of the longest segment, for example, "Shanghai" and "Shanghai City", and "Shanghai City" is preferred to be matched and segmented. As an optional implementation, the segments under each attribute in the dictionary are sorted in descending order of text length, so that the segmented segments are more accurate.
[0159] The second obtaining unit 223 is configured to obtain the first attribute corresponding to the search word from the dictionary. When the segmentation result is obtained, the second obtaining unit 223 simultaneously queries the attribute value corresponding to the word from the dictionary, for example, the attribute M corresponding to "Shanghai", the attribute N corresponding to "People's Square", the attribute K corresponding to "nearby", the attribute L corresponding to "of", and the attribute A corresponding to "hotel".
[0160] The first generating module 23 is configured to generate the first attribute sequence corresponding to the search text based on the first attribute. Based on the order of each search word in the search text, the first generating module 23 splices the attribute corresponding to each search word to generate the word attribute sequence (i.e., the first attribute sequence), and saves the word attribute sequence in the form of an array to the HIVE database. For example, the word attribute sequence obtained from the search text "Shanghai People's Square nearby hotel" is "[attribute M, attribute L, attribute K, attribute L, attribute A]". In this embodiment, the word attribute sequence corresponding to one search text is used to represent one search behavior mode of the user. For example, when the search text is "People's Square nearby hotel Shanghai", although the search is performed on the same type of product, the attribute sequence is "[attribute L, attribute K, attribute L, attribute A, attribute M]". Based on this, the attribute sequence and the search word under each attribute in the attribute sequence can be used to represent the search habit of the user.
[0161] The second obtaining module 24 is configured to obtain the product text of the target product. As an optional implementation, the second obtaining module 24 cleans the text of the product itself, for example, removes the redundant synonyms in the product text, and then removes the prepositions and auxiliary words in the product text which are irrelevant to the actual content through the differentiation of different word types. Generally, the product text obtained includes the main body of the product and the name of the product.
[0162] The screening module 25 is configured to pre-screen the first attribute sequence and the search word. Since the attribute sequence and the search word obtained through the search text are relatively large, in order to better arrange the search habit of the user, the attribute sequence and the search word need to be pre-screened. As an optional implementation, the screening module 25 uses Spark (a kind of computing engine) to read the attribute sequence and the search word stored in the HIVE data warehouse, and screens through the reading result, as shown in Figure 9 The screening module 25 includes a second statistical unit 251, a second screening unit 252, a third statistical unit 253, and a third screening unit 254.
[0163] The second statistical unit 251 is configured to count the number of the first attribute sequences respectively. The second statistical unit 251 counts the number of each attribute sequence based on Spark, such as the number of the attribute sequence of “[attribute M, attribute L, attribute K, attribute L, attribute A]”, the number of the attribute sequence of “[attribute M, attribute A]”, the number of the attribute sequence of “[attribute M, attribute O, attribute A]”, and the like.
[0164] The second screening unit 252 is configured to screen N first attribute sequences with the largest number, where N is a positive integer. The second screening unit 252 sorts the first attribute sequences in descending order of the number, and as an example, assuming that the number of the attribute sequence of “[attribute M, attribute A]” is 8 million, the number of the attribute sequence of “[attribute M, attribute L, attribute K, attribute L, attribute A]” is 1 million, and the number of the attribute sequence of “[attribute M, attribute O, attribute A]” is 0.5 million, the attribute sequences at the top of the sorting are screened out. As an optional implementation, the second screening unit 252 can set the value of N according to actual needs, where N is used to represent the top N attribute sequences, such as in the above three attribute sequences, setting N as 2, and then the attribute sequences screened out are “[attribute M, attribute A]” and “[attribute M, attribute L, attribute K, attribute L, attribute A]”.
[0165] The third statistical unit 253 is configured to count the number of search terms under each first attribute in the N first attribute sequences respectively. The attributes in the N first attribute sequences are traversed, and then the third statistical unit 253 counts the number of search terms belonging to each attribute respectively, such as assuming that the N attribute sequences obtained are “[attribute M, attribute A]” and “[attribute M, attribute L, attribute K, attribute L, attribute A]”, the first attributes obtained include “attribute M”, “attribute L”, “attribute K”, “attribute L”, and “attribute A”, and then the number of different search terms under “attribute M”, “attribute L”, “attribute K”, “attribute L”, and “attribute A” is counted respectively.
[0166] The third screening unit 254 is configured to screen K search terms with the largest number, where K is a positive integer. The third screening unit 254 sorts the search terms in descending order of the number, and as an example of “attribute M”, assuming that the number of “Shanghai” belonging to attribute M is 5 million, and the number of “Hangzhou” is 4 million, the search terms at the top of the sorting are screened out. As an optional implementation, the third screening unit 254 can set the value of K according to actual needs, where K is used to represent the top K search terms, such as in the above two search terms, when K is set as 1, the search term screened out is “Shanghai”.
[0167] It should be noted that the data in this embodiment is only a brief example, and the actual attribute sequence and search word are filtered by the actual attribute sequence number and search word number data. In addition, different business needs and search text obtained through different channels have different emphases. As an optional implementation, the filtering module 25 can filter according to different emphases, such as city products, which must include attribute M in the attribute sequence, and hot spot products, which must include attribute N in the attribute sequence.
[0168] The second generation module 26 is configured to generate SEM keywords based on the product text, the search word, and the second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search word, and the first attribute sequence. In this embodiment, the second attribute sequence is used to represent the attribute sequence that meets the target product, that is, the search behavior mode when searching for the product. Referring to Figure 10 , the second generation module 26 includes a first judgment unit 261, a first acquisition unit 262, a first cutting unit 263, a first filtering unit 264, and a splicing unit 265.
[0169] The first judgment unit 261 is configured to determine whether the product text has a directly corresponding product word and a second attribute. If yes, the first acquisition unit 262 is called; otherwise, the first cutting unit 263 is called. Here, the product word refers to the text of the product itself, which can be a word. The attribute corresponding to the product text is the second attribute. For example, city products and hot spot products, the product text of the city product is generally the city name itself, such as “Shanghai” and “Hangzhou”, and the corresponding attribute is attribute M. The text of the hot spot product is generally the name of the scenic spot itself, such as “People's Square” and “Oriental Pearl”, and the corresponding attribute is attribute N.
[0170] The first acquisition unit 262 is configured to acquire the product word and the second attribute, and then call the first filtering unit 264. When the product text has a directly corresponding product word and a second attribute, such as “Shanghai”, the first acquisition unit 262 directly acquires the product word “Shanghai” and the second attribute M.
[0171] The first cutting unit 263 is configured to cut the product text according to a preset correspondence between segmentation and attributes, to obtain product segmentation and second attributes corresponding to the product segmentation, and then call the first screening unit 264. When the product text cannot be directly used as a segmentation, the cutting operation is performed on the product text. For example, the text of a hotel product is the name of the hotel, and the name of the hotel usually includes multiple different attributes, such as "Shanghai Hongqiao Hotel", which includes the segmentation "Shanghai" belonging to attribute M, the segmentation "hotel" belonging to attribute A, and the segmentation "Hongqiao" belonging to attribute O. As an optional implementation, the first cutting unit 263 cuts the product text by using the first cutting process to obtain product segmentation and second attributes corresponding to the product segmentation, and the specific steps are the same as those of cutting the search text by using the first cutting process in the cutting module 22 of the embodiment.
[0172] The first screening unit 264 is configured to screen the second attribute sequence from the first attribute sequence, wherein the first attribute included in the second attribute sequence covers the second attribute. Specifically, assuming that the product text to be generated into the SEM keyword is "Shanghai", and "Shanghai" itself belongs to attribute M, the first screening unit 264 requires that the attribute sequence (i.e., the second attribute sequence) includes attribute M when screening the attribute sequence. For example, common search texts include "Shanghai Hotel", "Shanghai Hotel", "Shanghai Discount Hotel", etc., and the corresponding attribute sequences include "[attribute M, attribute A]", "[attribute M, attribute L, attribute A]", or "[attribute M, attribute 5, attribute A]", etc.
[0173] Further assuming that the product text to be generated into the SEM keyword is "Shanghai Hongqiao Hotel", the obtained second attributes include attribute M, attribute O, and attribute A, and the first screening unit 264 requires that the attribute sequence must include attribute M, attribute O, and attribute A when screening the attribute sequence, and the order of the attributes in the attribute sequence is not limited. For example, the user's search habit can be "Hongqiao Hotel Shanghai", and the corresponding attribute sequence is "[attribute O, attribute A, attribute M]". Of course, other attribute sequences are also included, such as "Shanghai Hongqiao Hotel", "Shanghai Hongqiao Hotel Double Room", "Hongqiao Hotel Free Parking Shanghai", etc., and the corresponding attribute sequences are "[attribute M, attribute O, attribute A]", "[attribute M, attribute O, attribute A, attribute B]", or "[attribute O, attribute A, attribute J, attribute M]", etc.
[0174] The splicing unit 265 is configured to splice the search segmentation and the product segmentation corresponding to the attributes of the second attribute sequence according to the order of the attributes of the second attribute sequence, to generate the SEM keyword.
[0175] In this embodiment, the splicing unit 265 takes the product token as a fixed value in the second attribute sequence, and then performs Cartesian product splicing with the common search tokens screened out, for example, for the city product "Shanghai", the attribute M in the attribute sequence "[attribute M, attribute A]" is the fixed value "Shanghai", and assuming that the common search tokens screened out for attribute A are "hotel", "inn", and "homestay", the splicing unit 265 splices the product token "Shanghai" and the search tokens "hotel", "inn", and "homestay" through Cartesian product, that is, set A is {Shanghai}, set B is {hotel, inn, homestay}, and then AxB={(Shanghai, hotel), (Shanghai, inn), (Shanghai, homestay)}, so that the SEM keywords finally generated are "Shanghai hotel", "Shanghai inn", and "Shanghai homestay".
[0176] For example, for the hotel product "Shanghai Hongqiao Hotel", the attributes "attribute O", "attribute A", and "attribute M" in the attribute sequence "[attribute O, attribute A, attribute J, attribute M]" are fixed values, and assuming that the common search tokens screened out for attribute J are "free parking" and "breakfast supply", the splicing unit 265 splices the product tokens "Hongqiao", "hotel", and "Shanghai" and the search tokens "free parking" and "breakfast supply" through Cartesian product, that is, set A is {Hongqiao, hotel, Shanghai}, set B is {free parking, breakfast supply}, and in addition, it needs to be noted that the attribute order of the attribute sequence, for example, the search token is between the product token "hotel" and the product token "Shanghai", and then AxB={(Hongqiao, hotel, free parking, Shanghai), (Hongqiao, hotel, breakfast supply, Shanghai)}, so that the SEM keywords finally generated are "Hongqiao hotel free parking Shanghai" and "Hongqiao hotel breakfast supply Shanghai". As an optional implementation, the SEM keywords generated by the splicing unit 265 are stored in a database for delivery.
[0177] Embodiment 5
[0178] This embodiment provides a SEM keyword generation system, as shown in Figure 7 The SEM keyword generation system of this embodiment includes a first acquisition module 21, a tokenization module 22, a first generation module 23, a second acquisition module 24, a screening module 25, and a second generation module 26. The first acquisition module 21, the first generation module 23, the second acquisition module 24, and the screening module 25 are the same as the corresponding modules of Embodiment 4, and the difference is that the tokenization module 22 of this embodiment tokenizes the search text by using a second tokenization process, as shown in Figure 11 The tokenization module 22 includes a third acquisition unit 224, a merging unit 225, and a second tokenization unit 226.
[0179] The third obtaining unit 224 is configured to obtain the attribute identifier corresponding to each Chinese character in the search text by using a pre-trained neural network model. As an optional implementation, the neural network model can be a named entity model. Specifically, the named entity model is trained by using a neural network based on LSTM (Long Short Term Memory) and a named entity recognition model based on CRF (Conditional Random Field) on a correctly labeled data set. After the training is completed, the named entity model is obtained, and the third obtaining unit 224 performs prediction segmentation on the search text by using the named entity model. The labeled data set includes the id (unique identifier) number of each Chinese character and the attribute identifier corresponding to the Chinese character. The input of the model is the id number corresponding to each Chinese character in the search text, and the output is the attribute identifier corresponding to the Chinese character.
[0180] For a segmented word, assuming that it is multiple characters, the third obtaining unit 224 sets “b-attribute” to represent the attribute identifier of the start character of the segmented word, “m-attribute” to represent the attribute identifier of the middle character of the segmented word, and “e-attribute” to represent the attribute identifier of the end character of the segmented word. Assuming that the segmented word is a single character, “s-attribute” is used to directly represent the attribute identifier of the segmented word. Similarly, different attributes are labeled according to business needs. In this embodiment, the attributes mainly include hotel type words, hotel room type words, discount type words, brand type words, network popular type words, product sales type words, holiday type words, sales policy type words, direction type words, syntax type words, city type words, popular scenic spot type words, and other type words, which are fifteen attributes and are labeled as attribute A to attribute O in turn. For example, the input “Shanghai City” is input to the named entity model, and the model output result obtained by the third obtaining unit 224 is “b-attribute M”, “m-attribute M”, “e-attribute M”, “b-attribute N”, “m-attribute N”, “m-attribute N”, “e-attribute N”, “b-attribute K”, “e-attribute K”, “s-attribute L”, “b-attribute A”, and “e-attribute A” in turn.
[0181] The merging unit 225 is configured to perform clustering analysis on the attribute identifiers to obtain the first attribute. Taking the search text “hotel near Shanghai People's Square” as an example, the attribute identifiers output by the third obtaining unit 224 are “b-attribute M”, “e-attribute M”, “b-attribute N”, “m-attribute N”, “m-attribute N”, “e-attribute N”, “b-attribute K”, “e-attribute K”, “s-attribute L”, “b-attribute A”, and “e-attribute A” respectively. The merging unit 225 merges the attribute identifiers belonging to the same attribute, so that the first attributes obtained are attribute M, attribute N, attribute K, attribute L, and attribute A respectively.
[0182] The second segmentation unit 226 is used to segment the search text according to the first attribute to obtain search segmented words. For example, in the above search text "hotels near Shanghai People's Square", the second segmentation unit 226 segments the search text according to attribute M, attribute N, attribute K, attribute L and attribute A, so that the segmented search segmented words are "Shanghai", "People's Square", "near", "of" and "hotel".
[0183] In addition, in the second generation module 26, the first judgment unit 261, the first acquisition unit 262, the first screening unit 264 and the splicing unit 265 of this embodiment are the same as the corresponding units of Example 4. The first word segmentation unit 263 uses the second word segmentation process to segment the product text to obtain the product word segmentation and the second attribute corresponding to the product word segmentation. For the specific process, refer to the description of the word segmentation process 22 of this embodiment using the second word segmentation process to segment the search text.
[0184] Example 6
[0185] This embodiment is a fusion of embodiment 4 and embodiment 5. Figure 7 As shown, the SEM keyword generation system of this embodiment includes a first acquisition module 21, a segmentation module 22, a first generation module 23, a second acquisition module 24, a screening module 25, and a second generation module 26. Among them, the first acquisition module 21, the first generation module 23, the second acquisition module 24, and the screening module 25 are the same as the corresponding modules of Example 4. The segmentation module 22 segments the search text using the first segmentation process and / or the second segmentation process, see Figure 10 The word segmentation module 22 includes a construction unit 221 , a matching unit 222 , a second acquisition unit 223 , a third acquisition unit 224 , a merging unit 225 and a second word segmentation unit 226 .
[0186] The specific process of the construction unit 221, the matching unit 222, and the second acquisition unit 223 using the first segmentation process to segment the search text is described in Example 4, and the specific process of the third acquisition unit 224, the merging unit 225, and the second segmentation unit 226 using the second segmentation process to segment the search text is described in Example 5. As an optional implementation, the segmentation module 22 can simultaneously use the first segmentation process and the second segmentation process to segment the search text, and select the segmentation result with the most attributes as the final result, see Figure 12 The word segmentation module 22 further includes a first statistical unit 227 , a second judgment unit 228 , a first retention unit 229 and a second retention unit 2210 .
[0187] The first statistical unit 227 is configured to count a first number of the first attribute obtained by using the first segmentation procedure and a second number of the first attribute obtained by using the second segmentation procedure, respectively.
[0188] The second judging unit 228 is configured to judge whether the first number is not less than the second number, and if yes, call the first reservation unit 229; otherwise, call the second reservation unit 2210.
[0189] The first reservation unit 229 is configured to reserve the first attribute obtained by using the first segmentation procedure and the search segmentation.
[0190] The second reservation unit 2210 is configured to reserve the first attribute obtained by using the second segmentation procedure and the search segmentation.
[0191] In addition, in the second generation module 26, the first judging unit 261, the first acquisition unit 262, the first screening unit 264 and the splicing unit 265 of the embodiment are the same as the corresponding units of the embodiment 4. The first segmentation unit 263 segments the product text by using the first segmentation procedure and / or the second segmentation procedure, wherein the specific process of the first segmentation unit 263 segmenting the product text by using the first segmentation procedure can refer to the description of the embodiment 4, and the specific process of the first segmentation unit 263 segmenting the product text by using the second segmentation procedure can refer to the embodiment 5.
[0192] As an optional implementation, if the segmentation module 22 reserves the first attribute obtained by using the first segmentation procedure and the search segmentation, the first segmentation unit 263 segments the product text by using the first segmentation procedure to obtain the product segmentation and the second attribute corresponding to the product segmentation; if the segmentation module 22 reserves the first attribute obtained by using the second segmentation procedure and the search segmentation, the first segmentation unit 263 segments the product text by using the second segmentation procedure to obtain the product segmentation and the second attribute corresponding to the product segmentation.
[0193] Embodiment 7
[0194] The embodiment provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the SEM keyword generation method of the embodiment 1, the embodiment 2 or the embodiment 3 when executing the program.
[0195] As Figure 13 shown in the electronic device 30 is only an example, and should not bring any limitation to the function and use range of the embodiment of the present application.
[0196] The electronic device 30 can be in the form of a general computing device, for example, it can be a server device. The components of the electronic device 30 can include, but are not limited to, the at least one processor 31 described above, the at least one memory 32 described above, a bus 33 connecting different system components, including the memory 32 and the processor 31.
[0197] The bus 33 includes a data bus, an address bus, and a control bus.
[0198] The memory 32 can include volatile memory, such as random access memory (RAM) 321 and cache memory 322, and can further include non-volatile memory, such as read-only memory (ROM) 323.
[0199] The memory 32 can further include a program tool 325 having a set of (at least one) program modules 324, such as an operating system, one or more application programs, other program modules, and program data, and each of these examples, or some combination thereof, can include implementation of a network environment.
[0200] The processor 31 performs various function applications and data processing by running the computer programs stored in the memory 32, such as the SEM keyword generation method of the embodiment 1, the embodiment 2 or the embodiment 3 of the present application.
[0201] The electronic device 30 can also communicate with one or more external devices 34. Such communication can occur via the input / output (I / O) interface 35. Still yet, such communication can occur electronically over a network 37a through the network adapter 36. As an example, the network adapter 36 can be capable of communicating with an Internet network through a wired or wireless communication source. Figure 13 As shown, the network adapter 36 communicates with the other modules of the model generation device 30 through the bus 33. It should be appreciated that the network adapter 36 can be a part of the bus 33, or a separate component in communication with the bus 33. Figure 13 It should be appreciated that, although not shown, other hardware and / or software modules can be used in connection with the model generation device 30, including but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Array of Independent Disks) systems, tape drives, and data archival storage systems, etc.
[0202] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the foregoing detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for embodiment.
[0203] Embodiment 8
[0204] The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the SEM keyword generation method in the embodiment 1, the embodiment 2 or the embodiment 3.
[0205] More specifically, the readable storage medium can include, but is not limited to, a portable disc, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0206] In an alternative implementation, the application can also be implemented in the form of a program product, which includes program codes for causing terminal equipment to execute the SEM keyword generation method in the embodiment 1, the embodiment 2 or the embodiment 3 when the program product is run on the terminal equipment.
[0207] The program codes for executing the application can be written in any combination of one or more programming languages, and can be executed completely on the user equipment, partially on the user equipment, as a separate software package, partially on the user equipment and partially on a remote device, or completely on a remote device.
[0208] Although the specific implementation of the application is described above, those skilled in the art should understand that this is only an example, and the protection scope of the application is defined by the appended claims. Those skilled in the art can make various changes or modifications to the embodiments without departing from the principles and essence of the application, and these changes and modifications all fall within the protection scope of the application.
Claims
1. A SEM keyword generation method, characterized in that: The following steps are involved: Obtain multiple search texts corresponding to the target product; For each search text, segment the search text according to a preset correspondence between segmented words and attributes to obtain a search segmented word and a first attribute corresponding to the search segmented word; generating a first attribute sequence corresponding to the search text based on the first attribute; Obtain product text of the target product; generating SEM keywords based on the product text, the search terms, and a second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search terms, and the first attribute sequence; The step of generating SEM keywords based on the product text, the search segmentation words and the second attribute sequence includes: Determine whether the product text has a directly corresponding product segmentation and a second attribute. If so, obtain the product segmentation and the second attribute. Otherwise, segment the product text according to a preset correspondence between segmentations and attributes to obtain the product segmentation and the second attribute corresponding to the product segmentation. Filtering a second attribute sequence from the first attribute sequence, wherein the first attribute included in the second attribute sequence covers the second attribute; According to the attribute order of the second attribute sequence, the search segmentation words and the product segmentation words corresponding to the attributes of the second attribute sequence are respectively spliced to generate SEM keywords; Before the step of generating SEM keywords based on the product text, the search word and the second attribute sequence, the step further includes pre-screening the first attribute sequence and the search word; The step of pre-screening the first attribute sequence and the search word comprises: Counting the number of the first attribute sequences respectively; Filter the N first attribute sequences with the largest number, where N is a positive integer; Counting the number of search terms under each first attribute in the N first attribute sequences respectively; Filter the K search terms with the largest number, where K is a positive integer.
2. The SEM keyword generation method according to claim 1, characterized in that: The step of segmenting the search text to obtain search words and a first attribute corresponding to the search words includes: segmenting the search text using the first segmentation process and / or the second segmentation process; The first word segmentation process includes: Building a dictionary, the dictionary including attributes and word segments corresponding to the attributes; Traversing the word segments of the dictionary, and matching the search text one by one to obtain the search word segment; Acquire a first attribute corresponding to the search word from the dictionary; The second word segmentation process includes: Obtaining attribute identifiers corresponding to each Chinese character in the search text through a pre-trained neural network model; Performing cluster analysis on the attribute identifier to obtain a first attribute; The search text is segmented according to the first attribute to obtain the search segmented words.
3. The SEM keyword generation method according to claim 2, characterized in that: When the search text is segmented using the first segmentation process and the second segmentation process, the step of segmenting the search text further includes: respectively counting a first number of the first attributes obtained by the first word segmentation process and a second number of the first attributes obtained by the second word segmentation process; Determine whether the first number is not less than the second number. If so, retain the first attribute and the search word obtained using the first word segmentation process; otherwise, retain the first attribute and the search word obtained using the second word segmentation process.
4. A SEM keyword generation system, characterized in that: The SEM keyword generation system includes a first acquisition module, a word segmentation module, a first generation module, a second acquisition module and a second generation module: The first acquisition module is used to acquire multiple search texts corresponding to the target product; The word segmentation module is used to segment each search text according to a preset correspondence between word segments and attributes to obtain a search word segment and a first attribute corresponding to the search word segment; The first generating module is used to generate a first attribute sequence corresponding to the search text based on the first attribute; The second acquisition module is used to acquire the product text of the target product; The second generating module is used to generate SEM keywords based on the product text, the search word and the second attribute sequence, wherein the second attribute sequence is obtained based on the product text, the search word and the first attribute sequence; The second generation module includes a first judgment unit, a first acquisition unit, a first word segmentation unit, a first screening unit and a splicing unit: The first judgment unit is used to judge whether the product text has a directly corresponding product segmentation and second attribute, and if so, call the first acquisition unit; otherwise, call the first segmentation unit; The first acquisition unit is used to acquire the product segmentation and the second attribute; The first segmentation unit is used to segment the product text according to a preset correspondence between segmentation and attributes to obtain the product segmentation and the second attribute corresponding to the product segmentation; The first screening unit is configured to screen a second attribute sequence from the first attribute sequence, wherein the first attribute included in the second attribute sequence covers the second attribute; The splicing unit is used to splice the search segmentation words and the product segmentation words corresponding to the attributes of the second attribute sequence according to the attribute order of the second attribute sequence to generate SEM keywords; The SEM keyword generation system further includes a screening module, the screening module being used to pre-screen the first attribute sequence and the search segmentation word; The screening module includes a second statistical unit, a second screening unit, a third statistical unit and a third screening unit: The second statistical unit is used to count the number of the first attribute sequences respectively; The second screening unit is used to screen the largest number of N first attribute sequences, where N is a positive integer; The third statistical unit is used to count the number of search terms under each first attribute in the N first attribute sequences; The third screening unit is used to screen the largest number of K search terms, where K is a positive integer.
5. The SEM keyword generation system according to claim 4, characterized in that: The word segmentation module is used to segment the search text using the first word segmentation process, and the word segmentation module includes a construction unit, a matching unit, and a second acquisition unit: The construction unit is used to construct a dictionary, wherein the dictionary includes attributes and word segments corresponding to the attributes; The matching unit is used to traverse the word segments of the dictionary and perform one-to-one matching on the search text to obtain the search word segment; The second acquiring unit is configured to acquire a first attribute corresponding to the search word from the dictionary; And / or, the word segmentation module is used to segment the search text using a second word segmentation process, and the word segmentation module includes a third acquisition unit, a merging unit, and a second word segmentation unit: The second acquisition unit is used to acquire the attribute identifier corresponding to each Chinese character in the search text through a pre-trained neural network model; The merging unit is used to perform cluster analysis on the attribute identifier to obtain the first attribute; The second segmentation unit is used to segment the search text according to the first attribute to obtain the search segmentation.
6. The SEM keyword generation system according to claim 5, characterized in that: The word segmentation module further includes a first statistical unit, a second judgment unit, a first retention unit and a second retention unit: The first statistical unit is used to respectively count a first number of the first attribute obtained by the first word segmentation process and a second number of the first attribute obtained by the second word segmentation process; The second judging unit is configured to judge whether the first quantity is not less than the second quantity, and if so, call the first reserving unit; Otherwise, the second reservation unit is called; The first retaining unit is used to retain the first attribute and the search word obtained by the first word segmentation process; The second retaining unit is used to retain the first attribute and the search segmentation obtained by using the second segmentation process.
7. An electronic device, characterized in that: The method comprises a memory and a processor connected to the memory, and the processor implements the SEM keyword generation method according to any one of claims 1 to 3 when executing a computer program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the SEM keyword generating method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Semantic advertising selection from lateral concepts and topics
CN102763103A
Headline keyword recommendation method and system
CN103377232A