Identification method and device
By obtaining the product word set from the text to be processed, and using the relational subgraph of the graph database to calculate and identify the core product words, the problem of low recognition efficiency and low accuracy in the existing technology is solved, and efficient and accurate automatic recognition is achieved.
Patent Information
- Application Number
- CN201911158038.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-22
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-11-22
AI Technical Summary
Existing recognition methods have problems such as low recognition efficiency and low accuracy. Workers have limited energy and limited knowledge, making it difficult to accurately identify core product words in a large amount of text to be processed.
By obtaining the product word set from the text to be processed, obtaining the subgraph of the relationship between parameters and product words according to the graph database, calculating the second product word set, and identifying the core product words from the intersection, using the relationship between multiple parameters to improve the recognition accuracy .
It improves the accuracy and efficiency of recognition, realizes automatic recognition without manual participation, and can accurately identify the core product words of the text to be processed.
Smart Images

Figure CN112835990B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an identification method and device. Background Art
[0002] Existing identification methods include: staff manually identifying core product words of the text to be processed based on personal experience.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] The staff's energy is limited, and it is unrealistic to recognize a large amount of text to be processed by manpower. Therefore, the existing technology has the problem of low recognition efficiency;
[0005] The staff have limited knowledge and cannot achieve accurate identification in every field. Therefore, the existing technology still has the problem of low recognition accuracy. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a recognition method and device, which improves the recognition accuracy and efficiency.
[0007] To achieve the above objective, according to one aspect of an embodiment of the present invention, an identification method is provided.
[0008] An identification method according to an embodiment of the present invention includes:
[0009] Acquire a first product word set from the text to be processed, and acquire a relationship subgraph between multiple parameters of the text to be processed and product words according to the text to be processed and a graph database;
[0010] Calculate according to the relationship subgraph between the multiple parameters of the text to be processed and the product words to obtain a second product word set;
[0011] According to the graph database, core product words of the text to be processed are identified from the intersection of the first product word set and the second product word set.
[0012] In one embodiment, a first set of product words is obtained from the text to be processed, and a relationship subgraph between multiple parameters of the text to be processed and product words is obtained according to the text to be processed and a graph database, including:
[0013] Acquire a title and a first category from the text to be processed, and parse the first product word set, the first attribute set, and the first brand set from the title;
[0014] Querying the graph database according to the first attribute set, the first brand set, and the first category to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word;
[0015] A relationship subgraph between the title and the first product word is generated according to the first product word set and the title.
[0016] In one embodiment, identifying the core product words of the text to be processed from the intersection of the first product word set and the second product word set according to the graph database includes:
[0017] The intersection of the first product word set and the second product word set is used as a product word set to be selected;
[0018] Calculating the probability of each product word to be selected in the product word set to be selected according to the product word set to be selected and the graph database;
[0019] From the set of candidate product words, a candidate product word with the highest probability is selected as the core product word of the text to be processed.
[0020] In one embodiment, calculating the probability of the product word to be selected includes:
[0021] For each first attribute in the first attribute set, divide the number of times the first attribute and the product word to be selected appear together in the graph database by the total number of times the first attribute appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first attribute;
[0022] For each first brand in the first brand set, the number of times the first brand and the product word to be selected appear together in the graph database is divided by the total number of times the first brand appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first brand;
[0023] The number of times the first category and the product word to be selected appear together in the graph database is divided by the total number of times the first category appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first category;
[0024] Multiply the probability of the product word to be selected under the condition of each first attribute, the probability of the product word to be selected under the condition of each first brand, the probability of the product word to be selected under the condition of the first category, and the number of times the product word to be selected appears in the title to obtain the product, and use the logarithm of the product as the probability of the product word to be selected.
[0025] In one embodiment, a second set of product words is obtained by calculating according to a relationship subgraph between multiple parameters of the text to be processed and the product words, including:
[0026] Merging the relationship subgraph between each first attribute in the first attribute set and its corresponding product word, the relationship subgraph between each first brand in the first brand set and its corresponding product word, the relationship subgraph between the first category and its corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph;
[0027] The relationship graph is used as an input of a nearest common ancestor algorithm to perform calculations to obtain the second product word set.
[0028] In one embodiment, before obtaining the first product word set from the text to be processed, the process includes:
[0029] Extracting, from each log in the log set, each second attribute in the second attribute set and its corresponding product word, each second brand in the second brand set and its corresponding product word, and the second category and its corresponding product word;
[0030] The number of times the second attribute and the corresponding product word co-occur in the log set, the second attribute, the corresponding product word and the corresponding relationship are saved in the graph database;
[0031] The number of times the second brand and the product word corresponding thereto co-occur in the log set, the second brand, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0032] The number of times the second category and the product word corresponding thereto co-occur in the log set, the second category, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0033] The log includes text selected by a user from a plurality of texts, and the plurality of texts are searched based on a search term input by the user.
[0034] To achieve the above objective, according to another aspect of an embodiment of the present invention, an identification device is provided.
[0035] An identification device according to an embodiment of the present invention includes:
[0036] An acquisition unit, configured to acquire a first set of product words from the text to be processed, and acquire a relationship subgraph between a plurality of parameters of the text to be processed and product words according to the text to be processed and a graph database;
[0037] A calculation unit, configured to calculate according to a relationship subgraph between a plurality of parameters of the text to be processed and the product words, to obtain a second product word set;
[0038] An identification unit is used to identify core product words of the text to be processed from the intersection of the first product word set and the second product word set according to the graph database.
[0039] In one embodiment, the acquisition unit is used to:
[0040] Acquire a title and a first category from the text to be processed, and parse the first product word set, the first attribute set, and the first brand set from the title;
[0041] Querying the graph database according to the first attribute set, the first brand set, and the first category to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word;
[0042] A relationship subgraph between the title and the first product word is generated according to the first product word set and the title.
[0043] In one embodiment, the identification unit is used to:
[0044] The intersection of the first product word set and the second product word set is used as a product word set to be selected;
[0045] Calculating the probability of each product word to be selected in the product word set to be selected according to the product word set to be selected and the graph database;
[0046] From the set of candidate product words, a candidate product word with the highest probability is selected as the core product word of the text to be processed.
[0047] In one embodiment, the identification unit is used to:
[0048] For each first attribute in the first attribute set, divide the number of times the first attribute and the product word to be selected appear together in the graph database by the total number of times the first attribute appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first attribute;
[0049] For each first brand in the first brand set, the number of times the first brand and the product word to be selected appear together in the graph database is divided by the total number of times the first brand appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first brand;
[0050] The number of times the first category and the product word to be selected appear together in the graph database is divided by the total number of times the first category appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first category;
[0051] Multiply the probability of the product word to be selected under the condition of each first attribute, the probability of the product word to be selected under the condition of each first brand, the probability of the product word to be selected under the condition of the first category, and the number of times the product word to be selected appears in the title to obtain the product, and use the logarithm of the product as the probability of the product word to be selected.
[0052] In one embodiment, the computing unit is configured to:
[0053] Merging the relationship subgraph between each first attribute in the first attribute set and its corresponding product word, the relationship subgraph between each first brand in the first brand set and its corresponding product word, the relationship subgraph between the first category and its corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph;
[0054] The relationship graph is used as an input of a nearest common ancestor algorithm to perform calculations to obtain the second product word set.
[0055] In one embodiment, the acquisition unit is used to:
[0056] Before obtaining the first product word set from the text to be processed, extracting each second attribute in the second attribute set and the corresponding product word, each second brand in the second brand set and the corresponding product word, and the second category and the corresponding product word from each log in the log set;
[0057] The number of times the second attribute and the corresponding product word co-occur in the log set, the second attribute, the corresponding product word and the corresponding relationship are saved in the graph database;
[0058] The number of times the second brand and the product word corresponding thereto co-occur in the log set, the second brand, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0059] The number of times the second category and the product word corresponding thereto co-occur in the log set, the second category, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0060] The log includes text selected by a user from a plurality of texts, and the plurality of texts are searched based on a search term input by the user.
[0061] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0062] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the identification method provided by the embodiment of the present invention.
[0063] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0064] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the identification method provided by the embodiment of the present invention is implemented.
[0065] One embodiment of the above invention has the following advantages or beneficial effects: obtaining a first set of product words from the text to be processed, obtaining a subgraph of the relationship between multiple parameters of the text to be processed and product words based on the text to be processed and the graph database; calculating according to the subgraph of the relationship between multiple parameters of the text to be processed and product words to obtain a second set of product words; identifying the core product words of the text to be processed from the intersection of the first set of product words and the second set of product words based on the graph database. The core product words are related to most of the multiple parameters, and the core product words are identified using the relationship. Thereby improving the accuracy of recognition. Automatic recognition without human intervention improves the efficiency of recognition.
[0066] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0068] Figure 1 is a schematic diagram of the main process of the identification method according to an embodiment of the present invention;
[0069] Figure 2 is an example of a relationship diagram in an identification method according to an embodiment of the present invention;
[0070] Figure 3 This is an application scenario of the identification method according to an embodiment of the present invention;
[0071] Figure 4 is an example of a graph structure in a recognition method according to an embodiment of the present invention;
[0072] Figure 5 is a schematic diagram of main units of an identification device according to an embodiment of the present invention;
[0073] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0074] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0076] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.
[0077] In order to solve the problems existing in the prior art, the embodiment of the present invention provides an identification method, such as Figure 1 As shown, the method includes:
[0078] Step S101: Obtain a first set of product words from the text to be processed, and obtain a relationship subgraph between multiple parameters of the text to be processed and product words based on the text to be processed and a graph database.
[0079] In this step, the text to be processed may be a product details page.
[0080] Step S102: Calculate according to the relationship subgraph between the multiple parameters of the text to be processed and the product words to obtain a second product word set.
[0081] Step S103: Identify core product words in the text to be processed from the intersection of the first product word set and the second product word set according to the graph database.
[0082] It should be noted that the implementation of this embodiment is described in detail below and will not be repeated here.
[0083] In the embodiment of the present invention, step S101 may include:
[0084] Acquire a title and a first category from the text to be processed, and parse the first product word set, the first attribute set, and the first brand set from the title;
[0085] Querying the graph database according to the first attribute set, the first brand set, and the first category to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word;
[0086] A relationship subgraph between the title and the first product word is generated according to the first product word set and the title.
[0087] It should be noted that the categories are set up by the Internet e-commerce platform.
[0088] If only one first product word is parsed from the title, the first product word is used as the core product word of the text to be processed. Of course, the core product word of the text to be processed can also be identified according to the process described in the embodiment of the present invention, and the identified core product word of the text to be processed is also the first product word.
[0089] Parameter types include: attributes, brands, categories and titles. It should be understood that those skilled in the art can flexibly set parameter types according to business forms without affecting the embodiments of the present invention. For example, parameter types include: attributes, brands, categories, titles and merchants.
[0090] The following is a specific example of parsing the first product word set, the first attribute set, and the first brand set from the title:
[0091] Titles include: Tulas headphones wired in-ear headset for gaming PUBG computer music mobile phone iPhone Apple [Glossy Black] Metal cavity | comes with a genuine leather storage bag.
[0092] Parsed as: Tulas [brand] headphones [product word] wired [attribute] in-ear [attribute] headset [product word] game PUBG computer music mobile phone [product word] iPhone [product word] Apple [product word] [gloss black] metal cavity | comes with a genuine leather storage bag [product word].
[0093] In the specific implementation, the training set is labeled to obtain a labeled training set; the labeled training set is used to train a named entity recognition model; and the trained named entity recognition model is used to parse a first product word set, a first attribute set, and a first brand set from the title.
[0094] Named entity recognition models include: long short-term memory neural network (LSTM) + conditional random field (CRF), Bert+fine-tune, or ERNIE+fine-tune.
[0095] ERNIE: Full name of Enhanced Representation from kNowledge IntEgration. It is a type of pre-trained model.
[0096] Bert: Bidirectional Encoder Representations from Transformer. It is also a type of pre-training model. Bert's goal is to use large-scale unlabeled corpus training to obtain a representation of the text that contains rich semantic information, that is, the semantic representation of the text, and then fine-tune the semantic representation of the text in a specific NLP task, and finally apply it to the NLP task.
[0097] Fine-tune: A method of using a model that can be run on a pre-trained model by slightly modifying the corresponding script according to the text classification and part-of-speech tagging.
[0098] Named Entity Recognition: Named Entity Recognition is an important basic tool in application fields such as information extraction, question-answering systems, syntactic analysis, machine translation, and metadata annotation for the Semantic Web. It plays an important role in the process of natural language processing technology becoming practical. Generally speaking, the task of named entity recognition is to identify three major categories (entity category, time category, and number category) and seven minor categories (personal name, organization name, place name, time, date, currency, and percentage) of named entities in the text to be processed.
[0099] In this embodiment, based on the text to be processed and the graph database, a relationship subgraph of each dimension (each dimension includes attributes, brands, categories and titles) is obtained, thereby obtaining a set of product words pointed to by the relationship, and then the core product words are identified from the intersection of the second product word set and the first product word set, further improving the recognition accuracy.
[0100] In the embodiment of the present invention, step S103 may include:
[0101] The intersection of the first product word set and the second product word set is used as a product word set to be selected.
[0102] The probability of each product word to be selected in the product word set to be selected is calculated according to the product word set to be selected and the graph database.
[0103] From the set of candidate product words, a candidate product word with the highest probability is selected as the core product word of the text to be processed.
[0104] In this embodiment, it should be understood that if the intersection of the first product word set and the second product word set is an empty set, the method of the embodiment of the present invention cannot identify the core product words of the text to be processed. The data in the graph database is supplemented accordingly according to the text to be processed. After the supplementation, the method of the embodiment of the present invention can be used to identify the core product words of the text to be processed.
[0105] In the embodiment of the present invention, calculating the probability of the product word to be selected includes:
[0106] For each first attribute in the first attribute set, divide the number of times the first attribute and the product word to be selected appear together in the graph database by the total number of times the first attribute appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first attribute;
[0107] For each first brand in the first brand set, the number of times the first brand and the product word to be selected appear together in the graph database is divided by the total number of times the first brand appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first brand;
[0108] The number of times the first category and the product word to be selected appear together in the graph database is divided by the total number of times the first category appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first category;
[0109] Multiply the probability of the product word to be selected under the condition of each first attribute, the probability of the product word to be selected under the condition of each first brand, the probability of the product word to be selected under the condition of the first category, and the number of times the product word to be selected appears in the title to obtain the product, and use the logarithm of the product as the probability of the product word to be selected.
[0110] In this embodiment, during specific implementation, the probability of the product word to be selected is expressed as:
[0111] P(title|A)=∑lnP(A|B i )
[0112] Among them, A represents the product word to be selected; B i It represents all the first attributes in the first attribute set, all the first brands in the first brand set, any one of the first category and title; P(title|A) represents the probability of the title under the condition of product word A (it also represents the logarithm of the joint probability that product word A is the core product word of the title); P(A|first category) represents the probability of the selected product word under the condition of the first category.
[0113] It should be noted that the number of times the candidate product word appears in the title is equivalent to the probability of the candidate product word under the condition of the title.
[0114] The following is a specific example to illustrate this embodiment:
[0115] The set of product words to be selected includes headphones and headsets;
[0116] Headphones and Tulas appear together 700 times in the graph database; the total number of times Tulas appears in the graph database is 1000 times; P(headphones|Tulas)=700 / 1000=0.7.
[0117] The number of times the word "headphones" appears in the title is 1, so P(headphones|title)=1.
[0118] Headphones and in-ear headphones appear together 500 times in the graph database, and in-ear headphones appear a total of 1000 times in the graph database. P(headphones|in-ear headphones) = 500 / 1000 = 0.5.
[0119] P(headphone|headphone)=ln(P(headphone|Tolas)×P(headphone|headphone)×P(headphone|in-ear))=ln(0.7×1×0.5).
[0120] Similarly, we get P(title|headphones). If P(title|headphones) is greater than P(title|headphones), the core product word of the text to be processed is headphones; if P(title|headphones) is less than P(title|headphones), the core product word of the text to be processed is headphones.
[0121] It should be understood that the total number of times Tulas appears in the graph database = the number of times headphones and Tulas appear together in the graph database + the number of times words other than headphones and Tulas appear together in the graph database.
[0122] It should be noted that if the number of times the product word to be selected appears in the title is 0, the probability of the product word to be selected is 0.
[0123] In this embodiment, the probability of the selected product word represents the degree of relationship between the selected product word and each dimension (each dimension includes attribute, brand, category and title), and the selected product word with the highest degree of relationship is used as the core product word, which further improves the recognition accuracy.
[0124] In the embodiment of the present invention, step S102 may include:
[0125] Merging the relationship subgraph between each first attribute in the first attribute set and its corresponding product word, the relationship subgraph between each first brand in the first brand set and its corresponding product word, the relationship subgraph between the first category and its corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph;
[0126] The relationship graph is used as an input of a nearest common ancestor algorithm to perform calculations to obtain the second product word set.
[0127] In this embodiment, a specific example is used to illustrate the embodiment below:
[0128] exist Figure 2 In the diagram, each circle represents a node, which can be the first brand, product word, first category, first attribute, title, etc. The arrow indicates that the nodes at both ends of the arrow have a corresponding relationship.
[0129] By querying the graph database according to Tulas (the first brand), the product words corresponding to Tulas include: charger, mobile phone case, holder, data cable, earphone, headset, storage bag, iphone, mobile phone and apple, and then the relationship subgraph between Tulas and its corresponding product words is obtained.
[0130] The graph database is queried according to in-ear style (ie, the first attribute), and the product words corresponding to in-ear style are obtained, including earphones and headsets, and then a relationship subgraph between in-ear style and the corresponding product words is obtained.
[0131] Similarly, the graph database is queried according to earphones / headphones (ie, the first category) to obtain a relational subgraph between the first category and its corresponding product words.
[0132] A relationship subgraph between the title and the first product word is generated according to the first product word set and the title.
[0133] like Figure 2 As shown, the existing merging technology is used to merge the relationship subgraph between each first attribute in the first attribute set and its corresponding product word, the relationship subgraph between each first brand in the first brand set and its corresponding product word, the relationship subgraph between the first category and its corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph.
[0134] The relationship graph is used as the input of the nearest common ancestor algorithm, and calculation is performed to obtain the second product word set.
[0135] It should be noted that each second product word in the second product word set calculated by the latest common ancestor algorithm is a product word pointed to by the relationship in the relationship graph.
[0136] In this embodiment, the relationship subgraphs of various dimensions are merged to obtain a relationship graph, and the nearest common ancestor algorithm is used for calculation to obtain the product word set pointed to by the relationship, that is, the second product word set, and then the core product words are identified from the intersection of the second product word set and the first product word set, thereby further improving the recognition accuracy.
[0137] In the embodiment of the present invention, Figure 3 As shown, before step S101, the following steps are included:
[0138] Step S301, extracting from each log in the log set each second attribute in the second attribute set and its corresponding product word, each second brand in the second brand set and its corresponding product word, and the second category and its corresponding product word; wherein the log includes text selected by a user from multiple texts, and the multiple texts are searched based on the search word input by the user.
[0139] Step S302: Save the number of times the second attribute and the corresponding product word appear together in the log set, the second attribute, the corresponding product word and the corresponding relationship to the graph database.
[0140] Step S303: Save the number of times the second brand and its corresponding product word appear together in the log set, the second brand, its corresponding product word and the corresponding relationship to the graph database.
[0141] Step S304: save the number of co-occurrences of the second category and the corresponding product word in the log set, the second category, the corresponding product word and the corresponding relationship to the graph database.
[0142] In this embodiment, the graph database stores the co-occurrence times and the corresponding relationships.
[0143] The following is a specific example of logs: User A enters the search term: Huawei mobile phone. The e-commerce platform searches for multiple texts based on the search term and returns them to the terminal of User A. User A clicks on the text titled "Huawei HUAWEI nova 5i rear AI quad-camera extreme full screen front 24 million HD camera 8GB+128GB", so the log includes the text. Specifically, the log includes user ID, search term, clicked product number, product name, product brand, product attributes, category, etc.
[0144] It should be noted that in one log, the product word corresponding to the second attribute, the product word corresponding to the second brand, and the product word corresponding to the second category can be determined in an existing manner. Of course, they can also be determined manually.
[0145] The following is a specific example to illustrate this embodiment:
[0146] The log includes: search term: Huawei mobile phone; text title: Huawei HUAWEI nova5i rear AI quad-camera extreme full screen front 24 million HD camera 8GB+128GB.
[0147] Extract from the log:
[0148] The second brand: Huawei, the product word corresponding to Huawei: mobile phone;
[0149] The second attribute: 24 million, the product word corresponding to 24 million: mobile phone;
[0150] The second category: mobile phones, and the product word corresponding to the second category is mobile phones: mobile phones.
[0151] Count the number of times Huawei and mobile phones appear together in the log collection, and save the number of times Huawei and mobile phones appear together in the log collection, Huawei, mobile phones, and the corresponding relationship to the graph database;
[0152] Count the number of times 24 million and mobile phone appear together in the log set, and save the number of times 24 million and mobile phone appear together in the log set, 24 million, mobile phone, and the corresponding relationship to the graph database;
[0153] The number of times the second category is mobile phone and mobile phone appear together in the log set is counted, and the number of times the second category is mobile phone and mobile phone appear together in the log set, the second category is mobile phone, mobile phone and the corresponding relationship are saved in the graph database.
[0154] The following is a specific example to illustrate the process of saving to a graph database:
[0155] According to the format required by the graph database, the number of times the second category and its corresponding product words appear together in the log set, the second category and its corresponding product words, are saved in the following table:
[0156] Second category Product Word Co-occurrence count date type Creative Gifts meter 4915 2019-09-02 Category and product words Sports shoes One-step 270677 2019-09-02 Category and product words Labor protection products Door locks 13782 2019-09-02 Category and product words … … … … …
[0157] Table 1 Table of the second category and product words
[0158] Send Table 1 to the graph database. The graph database stores the data in Table 1.
[0159] It should be noted that the update time of the graph database can be determined according to the date in Table 1.
[0160] Graph databases can use neo4j (neo4j is a high-performance NOSQL graph database that stores structured data on the network instead of in tables) or HugeGraph (HugeGraph is a graph database system open sourced by Baidu that can store massive amounts of vertices (Vertex) and edges (Edge), based on the Apache Tinker Pop 3 framework, and supports the Gremlin query language).
[0161] Graph database, also known as graph database. Graph database is a type of NoSQL database that uses graph theory to store relationship information between entities. Graph database is a non-relational database that uses graph theory to store relationship information between entities. The most common example is the relationship between people in a social network. Relational databases are not very effective in storing "relational" data. Their queries are complex, slow, and beyond expectations. The unique design of graph databases makes up for this shortcoming.
[0162] It should be understood that if there is no attribute in the individual log, each second attribute in the second attribute set and the corresponding product word cannot be extracted. Similarly, if there is no brand in the individual log, each second brand in the second brand set and the corresponding product word cannot be extracted.
[0163] In this embodiment, the corresponding relationship is extracted from the log collection, and the corresponding relationship and the number of co-occurrences are pre-saved in a graph database, so that the core product words of the text to be processed are identified by querying the graph database and combining the relationship and the number of co-occurrences, thereby further improving the recognition accuracy.
[0164] On large-scale Internet e-commerce platforms, tens of thousands of merchants publish tens of millions of products every day. In order to get more traffic for their products, merchants will introduce multiple product words and words related or unrelated to product words in the title of the published text based on the existing search exposure principles. For example, the title: [Buy One Get One Free] Tulas Apple X / XS / XR Tempered Film iPhone XS Max Full Screen Cover Anti-Blue Light Glass Mobile Phone. The product words in the title include: tempered film and mobile phone, and the core product word in the title is tempered film. When users search for mobile phones, the text is recalled by the search engine and displayed to users. The text displayed to users is not what users need, and the user experience is poor; it will also bring invalid traffic to merchants; it is not conducive to identifying core product words, affecting the data ecology of the entire e-commerce platform.
[0165] The following is a specific example to illustrate the existing recognition method: the title of the text includes: [Buy One Get One Free] Tulas Apple X / XS / XR Tempered Film iPhone XS Max Full Screen Cover Anti-Blue Light Glass Mobile Phone. The staff determined that the product words in the title include: Apple, tempered film, and mobile phone. Based on personal experience, the staff concluded that the core product word of the text is tempered film. It should be understood that for fields that the staff are familiar with, the accuracy of manually identifying the core product words of the text is reliable, but the staff is not familiar with every field, so the recognition accuracy is not high.
[0166] The embodiment of the present invention automatically identifies the core product words in the text, and the recognition accuracy and stability are high; for merchants, it guides effective traffic (effective traffic refers to the number of visits by users who are interested in the merchant's products) to improve conversion; for the e-commerce platform ecosystem, it can obtain cleaner data; for users, it improves search accuracy and improves user experience. In addition, after identifying the core product words in the text, category classification, search recommendations or concise titles, etc. can be performed.
[0167] Graph structure is a nonlinear data structure. There are many examples of graphs in real life, such as transportation networks, subway networks, social networks, state execution (automaton) in computers, etc., which can be abstracted into graph structures. Graph structure is a nonlinear structure that is more complex than tree structure. Figure 4 As shown, the graph is mainly composed of nodes and edges. The embodiment of the present invention stores the relationship between attributes and product words, the relationship between brands and product words, and the relationship between categories and product words in the form of a graph structure in a graph database.
[0168] In addition, the identification of core product words is based on a large amount of accurate prior knowledge, which is the data stored in the graph database. Therefore, the data stored in the graph database must be updated regularly.
[0169] In order to solve the problems existing in the prior art, an embodiment of the present invention provides an identification device, such as Figure 5 As shown, the device comprises:
[0170] The acquisition unit 501 is used to acquire a first set of product words from the text to be processed, and acquire a relationship subgraph between multiple parameters of the text to be processed and product words based on the text to be processed and a graph database.
[0171] The calculation unit 502 is used to calculate according to the relationship subgraph between the multiple parameters of the text to be processed and the product words to obtain a second product word set.
[0172] The identification unit 503 is used to identify the core product words of the text to be processed from the intersection of the first product word set and the second product word set according to the graph database.
[0173] In the embodiment of the present invention, the acquisition unit 501 is used to:
[0174] Acquire a title and a first category from the text to be processed, and parse the first product word set, the first attribute set, and the first brand set from the title;
[0175] Querying the graph database according to the first attribute set, the first brand set, and the first category to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word;
[0176] A relationship subgraph between the title and the first product word is generated according to the first product word set and the title.
[0177] In the embodiment of the present invention, the identification unit 503 is used to:
[0178] The intersection of the first product word set and the second product word set is used as a product word set to be selected;
[0179] Calculating the probability of each product word to be selected in the product word set to be selected according to the product word set to be selected and the graph database;
[0180] From the set of candidate product words, a candidate product word with the highest probability is selected as the core product word of the text to be processed.
[0181] In the embodiment of the present invention, the identification unit 503 is used to:
[0182] For each first attribute in the first attribute set, divide the number of times the first attribute and the product word to be selected appear together in the graph database by the total number of times the first attribute appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first attribute;
[0183] For each first brand in the first brand set, the number of times the first brand and the product word to be selected appear together in the graph database is divided by the total number of times the first brand appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first brand;
[0184] The number of times the first category and the product word to be selected appear together in the graph database is divided by the total number of times the first category appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first category;
[0185] Multiply the probability of the product word to be selected under the condition of each first attribute, the probability of the product word to be selected under the condition of each first brand, the probability of the product word to be selected under the condition of the first category, and the number of times the product word to be selected appears in the title to obtain the product, and use the logarithm of the product as the probability of the product word to be selected.
[0186] In the embodiment of the present invention, the calculation unit 502 is used to:
[0187] Merging the relationship subgraph between each first attribute in the first attribute set and its corresponding product word, the relationship subgraph between each first brand in the first brand set and its corresponding product word, the relationship subgraph between the first category and its corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph;
[0188] The relationship graph is used as an input of a nearest common ancestor algorithm to perform calculations to obtain the second product word set.
[0189] In the embodiment of the present invention, the acquisition unit 501 is used to:
[0190] Before obtaining the first product word set from the text to be processed, extracting each second attribute in the second attribute set and the corresponding product word, each second brand in the second brand set and the corresponding product word, and the second category and the corresponding product word from each log in the log set;
[0191] The number of times the second attribute and the corresponding product word co-occur in the log set, the second attribute, the corresponding product word and the corresponding relationship are saved in the graph database;
[0192] The number of times the second brand and the product word corresponding thereto co-occur in the log set, the second brand, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0193] The number of times the second category and the product word corresponding thereto co-occur in the log set, the second category, the product word corresponding thereto and the corresponding relationship are saved in the graph database;
[0194] The log includes text selected by a user from a plurality of texts, and the plurality of texts are searched based on a search term input by the user.
[0195] It should be understood that the functions performed by the various components of the identification device provided in the embodiment of the present invention have been introduced in detail in the identification method of the above embodiment, and will not be repeated here.
[0196] Figure 6 An exemplary system architecture 600 to which the identification method or identification device according to the embodiment of the present invention can be applied is shown.
[0197] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0198] Users can use terminal devices 601, 602, and 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0199] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0200] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0201] It should be noted that the identification method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the identification device is generally disposed in the server 605 .
[0202] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0203] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0204] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0205] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0206] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0207] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0208] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0209] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, may be described as: a processor includes an acquisition unit, a calculation unit and an identification unit. The names of these units do not constitute a limitation on the units themselves in certain cases. For example, the calculation unit may also be described as "a unit that calculates according to a subgraph of the relationship between multiple parameters of the text to be processed and the product words to obtain a second product word set".
[0210] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a first product word set from the text to be processed, obtaining a relationship subgraph between multiple parameters of the text to be processed and product words based on the text to be processed and a graph database; calculating according to the relationship subgraph between multiple parameters of the text to be processed and product words to obtain a second product word set; identifying the core product words of the text to be processed from the intersection of the first product word set and the second product word set based on the graph database.
[0211] According to the technical solution of the embodiment of the present invention, a first set of product words is obtained from the text to be processed, and a subgraph of the relationship between multiple parameters of the text to be processed and product words is obtained based on the text to be processed and the graph database; a second set of product words is obtained according to the subgraph of the relationship between multiple parameters of the text to be processed and product words; and the core product words of the text to be processed are identified from the intersection of the first set of product words and the second set of product words based on the graph database. The core product words are related to most of the multiple parameters, and the core product words are identified using the relationship. This improves the accuracy of recognition. Automatic recognition without human intervention improves the efficiency of recognition.
[0212] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A recognition method, It is characterized in that include: Acquire a first set of product words from the text to be processed, and acquire a relationship subgraph between multiple parameters of the text to be processed and product words according to the text to be processed and a graph database; wherein acquiring the first set of product words from the text to be processed includes: acquiring a title and a first category from the text to be processed, and parsing the first set of product words, a first set of attributes, and a first set of brands from the title; The second product word set is obtained by calculating the relationship subgraph between the multiple parameters of the text to be processed and the product words; specifically, the relationship subgraph between each first attribute in the first attribute set and the corresponding product words, the relationship subgraph between each first brand in the first brand set and the corresponding product words, the relationship subgraph between the first category and the corresponding product words, and the relationship subgraph between the title and the first product words are merged to obtain a relationship graph; the relationship graph is used as the input of the nearest common ancestor algorithm to calculate to obtain the second product word set; According to the graph database, the core product words of the text to be processed are identified from the intersection of the first product word set and the second product word set; specifically, the method includes: taking the intersection of the first product word set and the second product word set as the to-be-selected product word set; calculating the probability of each to-be-selected product word in the to-be-selected product word set according to the to-be-selected product word set and the graph database; and selecting the to-be-selected product word with the highest probability from the to-be-selected product word set as the core product word of the text to be processed; The step of obtaining a relationship subgraph between multiple parameters of the text to be processed and product words according to the text to be processed and a graph database includes: Querying the graph database according to the first attribute set, the first brand set, and the first category to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word; generating a relationship subgraph between the title and the first product word according to the first product word set and the title; The calculating the probability of each product word to be selected in the product word set to be selected according to the product word set to be selected and the graph database includes: Each first attribute in the first attribute set, each first brand in the first brand set, and the first category are respectively used as a dimension; Calculate the probability of the product word to be selected under the dimension according to the number of times the dimension and the product word to be selected appear together in the graph database and the total number of times the dimension appears in the graph database; The probability of the product word to be selected under each dimension and the number of times the product word to be selected appears in the title are used to calculate the probability of the product word to be selected.
2. The method according to claim 1, It is characterized in that Each first attribute in the first attribute set, each first brand in the first brand set, and the first category are respectively used as a dimension, and according to the number of times the dimension and the product word to be selected appear together in the graph database, and the total number of times the dimension appears in the graph database, the probability of the product word to be selected under the dimension is calculated, including: For each first attribute in the first attribute set, divide the number of times the first attribute and the product word to be selected appear together in the graph database by the total number of times the first attribute appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first attribute; For each first brand in the first brand set, the number of times the first brand and the product word to be selected appear together in the graph database is divided by the total number of times the first brand appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first brand; The number of times the first category and the product word to be selected appear together in the graph database is divided by the total number of times the first category appears in the graph database, and the resulting value is used as the probability of the product word to be selected under the condition of the first category; The calculating the probability of the product word to be selected by using the probability of the product word to be selected under each dimension and the number of times the product word to be selected appears in the title includes: Multiply the probability of the product word to be selected under the condition of each first attribute, the probability of the product word to be selected under the condition of each first brand, the probability of the product word to be selected under the condition of the first category, and the number of times the product word to be selected appears in the title to obtain the product, and use the logarithm of the product as the probability of the product word to be selected.
3. The method according to claim 1 or 2, It is characterized in that Before obtaining the first product word set from the text to be processed, it includes: Extracting, from each log in the log set, each second attribute in the second attribute set and its corresponding product word, each second brand in the second brand set and its corresponding product word, and the second category and its corresponding product word; The number of times the second attribute and the corresponding product word co-occur in the log set, the second attribute, the corresponding product word and the corresponding relationship are saved in the graph database; The number of times the second brand and the product word corresponding thereto co-occur in the log set, the second brand, the product word corresponding thereto and the corresponding relationship are saved in the graph database; The number of times the second category and the product word corresponding thereto co-occur in the log set, the second category, the product word corresponding thereto and the corresponding relationship are saved in the graph database; The log includes text selected by a user from a plurality of texts, and the plurality of texts are searched based on a search term input by the user.
4. An identification device, It is characterized in that include: An acquisition unit is used to acquire a first product word set from the text to be processed, and acquire a relationship subgraph between multiple parameters of the text to be processed and product words according to the text to be processed and a graph database; specifically, it is used to: acquire a title and a first category from the text to be processed, and parse the first product word set, the first attribute set and the first brand set from the title; a calculation unit, configured to calculate a relationship subgraph between the plurality of parameters of the text to be processed and the product words to obtain a second product word set; specifically configured to: merge the relationship subgraph between each first attribute in the first attribute set and the corresponding product word, the relationship subgraph between each first brand in the first brand set and the corresponding product word, the relationship subgraph between the first category and the corresponding product word, and the relationship subgraph between the title and the first product word to obtain a relationship graph; and use the relationship graph as an input of the nearest common ancestor algorithm to perform calculation to obtain the second product word set; an identification unit, configured to identify the core product words of the text to be processed from the intersection of the first product word set and the second product word set according to the graph database; specifically configured to: use the intersection of the first product word set and the second product word set as the product word set to be selected; calculate the probability of each product word to be selected in the product word set to be selected according to the product word set to be selected and the graph database; and select the product word to be selected with the highest probability from the product word set to be selected as the core product word of the text to be processed; an acquisition unit, further configured to query the graph database according to the first attribute set, the first brand set, and the first category, to obtain a relationship subgraph between each first attribute in the first attribute set and its corresponding product word, a relationship subgraph between each first brand in the first brand set and its corresponding product word, and a relationship subgraph between the first category and its corresponding product word; and to generate a relationship subgraph between the title and the first product word according to the first product word set and the title; An identification unit is further configured to use each first attribute in the first attribute set, each first brand in the first brand set, and the first category as a dimension; Calculate the probability of the product word to be selected under the dimension according to the number of times the dimension and the product word to be selected appear together in the graph database and the total number of times the dimension appears in the graph database; The probability of the product word to be selected under each dimension and the number of times the product word to be selected appears in the title are used to calculate the probability of the product word to be selected.
5. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.
6. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
