Method, system, device and storage medium for matching objects for articles
By calculating the word vector similarity and TF-IDF of articles and objects, articles and objects are automatically matched, which solves the problem of low efficiency in the existing technology, achieves accurate matching of articles and objects, and improves the efficiency of automatic copywriting generation.
Patent Information
- Application Number
- CN201810682104.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-06-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2038-06-27
AI Technical Summary
In the existing technology, the method of automatically matching objects for automatically generated articles is inefficient, resulting in a heavy manual matching workload and inability to quickly and accurately match.
By obtaining objects under the article category, extracting selling point words and keywords, calculating word vector similarity and TF-IDF, automatically matching the similarity scores between articles and objects, achieving automatic and accurate matching.
It significantly reduces the time required to manually match objects, improves the efficiency of automatic copywriting generation, and achieves accurate matching of articles and objects.
Smart Images

Figure CN110717092B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method, system, device and storage medium for matching objects for articles. Background Art
[0002] In the Internet field, a large number of objects require recommendation articles to introduce the advantages and disadvantages of the object and the cost-effectiveness, etc., for the target group to refer to when making a choice. However, editing a large number of recommendation articles consumes a lot of time and economic costs. Therefore, automatic recommendation article generation, especially the automatic matching technology between the automatically generated articles and the target objects, is crucial.
[0003] In the existing technology, experts mainly write recommendation articles for corresponding objects according to application scenarios and topics. In addition, there are some methods that can realize automatic batch generation of articles by machines. For batch-generated recommendation articles, if the objects are matched manually, the workload is large and the efficiency is low. How to automatically match the corresponding objects for these automatically generated articles is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art of manually matching corresponding objects for a large number of articles, which is labor-intensive and inefficient, and to provide a method, system, device and storage medium for article matching objects that can automatically and quickly accurately match a group of objects for recommended articles.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] The present invention provides a method for matching objects for articles, each of the articles corresponds to a corresponding category, and the method comprises:
[0007] Get all objects under the category;
[0008] Extracting at least one selling point word for each of the objects under the category;
[0009] Extract at least one keyword from the article to be matched;
[0010] Obtain the word vector corresponding to each of the keywords in the article to be matched, recorded as the keyword word vector;
[0011] Obtain a word vector corresponding to each of the selling point words of each of the objects, recorded as a selling point word vector;
[0012] Using the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient;
[0013] Calculate the TF-IDF (term frequency-inverse term frequency) of each of the keywords;
[0014] Calculate the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword;
[0015] The objects with the highest similarity scores are used as the final matching objects of the article to be matched.
[0016] In this solution, hot words are extracted from all objects under the category to which the matching article belongs, and keywords are extracted from the matching article. The extracted word vectors are then used to calculate similarity, and the TF-IDF of the keywords is combined to calculate a group of objects with the highest similarity to the article to be matched as the final matching objects.
[0017] This solution provides a method for automatically and accurately matching a group of objects to articles to be matched, which can significantly reduce the time spent on manually selecting objects for articles to be matched and improve the efficiency of automatic copywriting generation.
[0018] Preferably, each of the selling point words of the object and the keywords in the article to be matched include a main word-modifier word pair and / or an independent word, wherein the main word-modifier word pair is a word pair consisting of a main word and a corresponding modifier that appear in pairs, and the independent word is a word that exists alone except the main word and the modifier;
[0019] The using the keyword word vector and the selling point word vector of each of the objects to perform similarity calculation to obtain a corresponding similarity coefficient includes:
[0020] Find the subject words that are shared by the article to be matched and each of the objects, assuming that the shared subject words are the same subject words, and the remaining subject words are different subject words;
[0021] Performing cosine similarity calculation using the word vector of the modifier word corresponding to the same main word of the article to be matched and the word vector of the modifier word corresponding to the same main word of the corresponding object to obtain a similarity coefficient A1 between the article to be matched and the same main word corresponding to the corresponding object;
[0022] Select at least one word with the highest TF-IDF from all the different main words of the article to be matched as a similar main word, use the word vector of the similar main word of the article to be matched and the word vector of the different main word of the corresponding object to perform distance calculation to obtain the corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main word of the corresponding object to perform distance calculation to obtain the corresponding similar main word modifier word distance B;
[0023] The calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword includes:
[0024] The TF-IDF of each of the same subject words in the article to be matched is represented as W1, and the score of the same subject words corresponding to the article to be matched and the corresponding object is set to W1*A1;
[0025] Find the independent words that are shared by the article to be matched and each of the objects, and assume that the shared independent words are the same independent words, and the remaining independent words are different independent words;
[0026] The TF-IDF of each of the identical independent words in the article to be matched is represented as V1, and the score of the identical independent words in the article to be matched and the corresponding object is set as V1;
[0027] The TF-IDF of each similar subject word of the article to be matched is represented as W2, and the score of the similar subject word corresponding to the article to be matched and the corresponding object is set to W2*A2*B;
[0028] Select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word in the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented as V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C;
[0029] The similarity score between the article to be matched and each of the objects is calculated according to the corresponding W1*A1, V1, W2*A2*B and V2*C.
[0030] Preferably, the method further comprises the following steps:
[0031] Counting the independent words of all objects under the category, removing words whose co-occurrence rate is within a preset interval, and the remaining independent words form a category independent word set, wherein the co-occurrence rate represents the percentage of the independent words appearing in all objects;
[0032] Among the subject word-modifier word pairs of all objects, the subject word-modifier word pairs with invalid modifiers are removed, and the remaining subject word-modifier word pairs form a category subject word-modifier word pair set;
[0033] Before the step of using the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient, the following steps are also included:
[0034] Cleaning the subject word-modifier word pairs of each of the objects under the category to remove the subject word-modifier word pairs in each of the objects that are not included in the subject word-modifier word pair set of the category;
[0035] Cleaning the independent words of each of the objects under the category to remove the independent words in each of the objects that are not included in the independent word set;
[0036] Cleaning the subject word-modifier word pairs of the article to be matched, so as to remove the subject word-modifier word pairs in the article to be matched that are not included in the subject word-modifier word pair set of the category;
[0037] The independent words of the article to be matched are cleaned to remove the independent words in the article to be matched that are not included in the independent word set.
[0038] In this solution, the co-occurrence rate indicates the percentage of objects in which an independent word appears in all objects. Before similarity calculation, the independent words of all objects in the category are removed from the words with a co-occurrence rate within a preset range, and all the remaining independent words form the category independent word set. That is, retaining the words with a co-occurrence rate outside the preset range can reduce the subsequent calculation amount and reduce the calculation complexity.
[0039] In this solution, the same principle is used to process the main words of all objects under the category, and the word pairs corresponding to the invalid modifiers corresponding to the main words are removed to obtain the category main word-modifier word pair set. This solution can further reduce the subsequent calculation amount and reduce the calculation complexity.
[0040] In this solution, the category independent word set and the category main word-modifier word pair set are used to clean the independent words and main word-modifier word pairs corresponding to each object under the category and the article to be matched, so as to remove the words that do not belong to the set. These remaining words are used for subsequent similarity calculation and similarity score calculation. This solution can further reduce the subsequent calculation amount and reduce the calculation complexity.
[0041] Preferably, before calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword, the following steps are also included:
[0042] The objects corresponding to the same main words whose similarity coefficient A1 is negative are cleaned out.
[0043] In this solution, before calculating the similarity score, objects that have the same main word as the article to be matched but whose modifiers corresponding to the same main word have opposite meanings to those in the article to be matched are cleaned out. These objects are no longer used in the subsequent similarity score calculation, thereby further reducing the subsequent calculation amount and reducing the calculation complexity.
[0044] Preferably, the extracting at least one selling point word of each of the objects under the category includes:
[0045] Taking the title, attributes, and historical recommended articles of the object as materials, performing word segmentation and dependency syntactic analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category;
[0046] The step of extracting at least one keyword from the article to be matched includes:
[0047] The article to be matched is segmented and dependency parsed to mark the relationship between each word, so as to obtain at least one keyword in the article to be matched.
[0048] In this scheme, the titles, attributes, and historical recommended articles of all objects under the category to which the to-be-matched article belongs are used as materials. These materials are segmented and dependency parsed to mark the relationship between each word, and the subject word-modifier word pairs and independent words are extracted from them, where independent words are other words that exist independently except the subject word and the modifier. Similar extraction operations are performed on the to-be-matched article, that is, segmentation and dependency parsed to mark the relationship between each word, and the subject word-modifier word pairs and corresponding independent words are extracted from them.
[0049] Preferably, the preset interval is greater than 50% or less than 0.1%.
[0050] The present invention also provides a system for matching articles to objects, each of the articles has a corresponding category, and the system includes:
[0051] An object acquisition module, used to acquire all objects under the category;
[0052] A selling point word extraction module, used to extract at least one selling point word for each of the objects in the category;
[0053] A keyword extraction module, used to extract at least one keyword from the article to be matched;
[0054] A keyword word vector acquisition module is used to obtain the word vector corresponding to each keyword in the article to be matched, which is recorded as the keyword word vector;
[0055] A selling point word vector acquisition module is used to acquire a word vector corresponding to each selling point word of each object, which is recorded as a selling point word vector;
[0056] A similarity calculation module, used to perform similarity calculation using the keyword word vector and the selling point word vector of each object to obtain a corresponding similarity coefficient;
[0057] A word frequency inverse word frequency calculation module, used to calculate the TF-IDF of each of the keywords;
[0058] A similarity score calculation module, used for calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword;
[0059] The matching module is used to select the objects with the highest similarity scores as the final matching objects of the article to be matched.
[0060] Preferably, each of the selling point words of the object and the keywords in the article to be matched include a main word-modifier word pair and / or an independent word, wherein the main word-modifier word pair is a word pair consisting of a main word and a corresponding modifier that appear in pairs, and the independent word is a word that exists alone except the main word and the modifier;
[0061] The similarity calculation module comprises:
[0062] A search module, used for searching the subject words common to the article to be matched and each object, assuming that the common subject words are the same subject words, and the remaining subject words are different subject words;
[0063] A cosine similarity calculation module, used to perform cosine similarity calculation using the word vector of the modifier word corresponding to the same main word of the article to be matched and the word vector of the modifier word corresponding to the same main word of the corresponding object, so as to obtain a similarity coefficient A1 between the article to be matched and the same main word corresponding to the corresponding object;
[0064] A distance calculation module is used to select at least one word with the highest TF-IDF from all the different main words of the article to be matched as a similar main word, use the word vector of the similar main word of the article to be matched and the word vector of the different main words of the corresponding object to perform distance calculation to obtain a corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main word of the corresponding object to perform distance calculation to obtain a corresponding similar main word modifier word distance B;
[0065] The similarity score calculation module comprises:
[0066] A first score calculation module, used for representing the TF-IDF of each of the same subject words in the article to be matched as W1, and setting the score of the same subject words corresponding to the article to be matched and the corresponding object as W1*A1;
[0067] An independent word search module, used for searching the independent words shared by the article to be matched and each of the objects, assuming that the shared independent words are identical independent words, and the remaining independent words are different independent words;
[0068] A second score calculation module is used to represent the TF-IDF of each of the identical independent words in the article to be matched as V1, and set the score of the identical independent words in the article to be matched and the corresponding object as V1;
[0069] A third score calculation module is used to represent the TF-IDF of each similar subject word of the article to be matched as W2, and set the score of the similar subject word corresponding to the article to be matched and the corresponding object as W2*A2*B;
[0070] A fourth score calculation module is used to select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word of the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented by V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C;
[0071] The total score calculation module is used to calculate the similarity score between the article to be matched and each of the objects according to the corresponding W1*A1, V1, W2*A2*B and V2*C.
[0072] Preferably, the system further comprises:
[0073] An independent word removal module, used to count the independent words of all objects under the category, remove words with a co-occurrence rate within a preset interval, and the remaining independent words form a category independent word set, and the co-occurrence rate represents the percentage of the independent words appearing in all objects;
[0074] A word pair removal module, used to remove the subject word-modifier word pairs with invalid modifiers from the subject word-modifier word pairs of all objects, and the remaining subject word-modifier word pairs constitute a category subject word-modifier word pair set;
[0075] A word pair cleaning module, used for cleaning the subject word-modifier word pairs of each of the objects under the category before calling the similarity calculation module, so as to remove the subject word-modifier word pairs in each of the objects that are not included in the subject word-modifier word pair set of the category; and cleaning the subject word-modifier word pairs of the articles to be matched, so as to remove the subject word-modifier word pairs in the articles to be matched that are not included in the subject word-modifier word pair set of the category;
[0076] An independent word cleaning module is used to clean the independent words of each object under the category before calling the similarity calculation module to remove the independent words in each object that are not included in the independent word set; and to clean the independent words of the article to be matched to remove the independent words in the article to be matched that are not included in the independent word set.
[0077] Preferably, the system further comprises:
[0078] The object cleaning module is used to clean the objects corresponding to the same subject words whose similarity coefficient A1 is negative before calling the similarity score calculation module.
[0079] Preferably, the selling point word extraction module is used to use the title, attributes, and historical recommended articles of the object as materials, perform word segmentation and dependency syntax analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category;
[0080] The keyword extraction module is used to perform word segmentation and dependency syntactic analysis on the article to be matched to mark the relationship between each word, so as to obtain at least one keyword in the article to be matched.
[0081] Preferably, the preset interval is greater than 50% or less than 0.1%.
[0082] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned method for matching objects to articles when executing the computer program.
[0083] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the aforementioned method for matching objects to articles are implemented.
[0084] The positive and progressive effect of the present invention is that the method, system, device and storage medium for article matching provided by the present invention extract hot words from all objects under the category to which the matching article belongs, extract keywords from the matching article, and then use the extracted word vectors to perform similarity calculation, and then combine the TF-IDF of the keywords to calculate a group of objects with the highest similarity to the article to be matched as the final matching objects. The present invention realizes automatic and accurate matching of a group of objects for the article to be matched, which can significantly reduce the time spent on manually selecting objects for the article to be matched, and improve the efficiency of automatic copywriting generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 This is a flowchart of a method for matching objects for articles according to Embodiment 1 of the present invention.
[0086] Figure 2 This is a module diagram of a system for article matching objects according to Embodiment 2 of the present invention.
[0087] Figure 3 for Figure 2 Module diagram of the similarity calculation module.
[0088] Figure 4 for Figure 2 Module diagram of the similarity score calculation module in .
[0089] Figure 5 This is a schematic diagram of the structure of an electronic device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0090] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0091] Example 1
[0092] like Figure 1 As shown, this embodiment provides a method for matching objects for articles, each of the articles corresponds to a corresponding category, and the method includes the following steps:
[0093] Step 101: Get all objects under the category.
[0094] Step 102: extract at least one selling point word for each of the objects in the category.
[0095] Specifically, this step is to use the title, attributes, and historical recommended articles of the object as materials, perform word segmentation and dependency syntactic analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category.
[0096] Step 103: extract at least one keyword from the article to be matched.
[0097] Specifically, this step includes performing word segmentation and dependency syntactic analysis on the article to be matched to mark the relationship between each word, so as to obtain at least one of the keywords in the article to be matched.
[0098] In this embodiment, the selling point words of each of the objects and the keywords in the article to be matched include main word-modifier word pairs and / or independent words. The main word-modifier word pairs are word pairs consisting of main words and corresponding modifier words that appear in pairs, and the independent words are words that exist alone except for the main words and the modifier words.
[0099] Step 104: Count the independent words of all objects under the category, remove words with a co-occurrence rate within a preset interval, and the remaining independent words form a category independent word set, where the co-occurrence rate represents the percentage of the independent words appearing in all objects; in this embodiment, the preset interval is greater than 50% or less than 0.1%. Among the main word-modifier word pairs of all objects, remove the main word-modifier word pairs with invalid modifiers, and the remaining main word-modifier word pairs form a category main word-modifier word pair set.
[0100] Step 105, clean the subject word-modifier word pairs of each object under the category to remove the subject word-modifier word pairs in each object that are not included in the subject word-modifier word pair set of the category; clean the independent words of each object under the category to remove the independent words in each object that are not included in the independent word set; clean the subject word-modifier word pairs of the article to be matched to remove the subject word-modifier word pairs in the article to be matched that are not included in the subject word-modifier word pair set of the category; clean the independent words of the article to be matched to remove the independent words in the article to be matched that are not included in the independent word set.
[0101] Step 106: Obtain the word vector corresponding to each of the keywords in the article to be matched, recorded as the keyword word vector; obtain the word vector corresponding to each of the selling point words of each of the objects, recorded as the selling point word vector.
[0102] Step 107: Use the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient.
[0103] Wherein, step 107 specifically includes the following steps:
[0104] Find the subject words that are shared by the article to be matched and each of the objects, assuming that the shared subject words are the same subject words, and the remaining subject words are different subject words;
[0105] Use the word vector of the modifier word corresponding to the same main word of the article to be matched and the word vector of the modifier word corresponding to the same main word of the corresponding object to perform cosine similarity calculation to obtain the similarity coefficient A1 of the same main word corresponding to the article to be matched and the corresponding object; remove the objects corresponding to the same main word whose similarity coefficient A1 is negative;
[0106] Select at least one word with the highest TF-IDF from all the different main words in the article to be matched as the similar main word, use the word vector of the similar main word in the article to be matched and the word vector of the corresponding different main word of the object to perform distance calculation to obtain the corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main word of the corresponding object to perform distance calculation to obtain the corresponding similar main word modifier word distance B.
[0107] Step 108: Calculate the TF-IDF of each of the keywords.
[0108] Step 109: Calculate the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword.
[0109] Wherein, step 109 specifically includes the following steps:
[0110] Denote the TF-IDF of each of the same subject words in the article to be matched as W1, and set the score of the same subject words corresponding to the article to be matched and the corresponding object as W1*A1;
[0111] Find the independent words that are shared by the article to be matched and each of the objects, and assume that the shared independent words are the same independent words, and the remaining independent words are different independent words;
[0112] Denote the TF-IDF of each of the identical independent words in the article to be matched as V1, and set the score of the identical independent words in the article to be matched and the corresponding object as V1;
[0113] Denote the TF-IDF of each similar subject word of the article to be matched as W2, and set the score of the similar subject word corresponding to the article to be matched and the corresponding object as W2*A2*B;
[0114] Select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word in the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented as V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C;
[0115] The similarity score between the article to be matched and each of the objects is calculated based on the corresponding W1*A1, V1, W2*A2*B and V2*C. In this embodiment, the step takes the sum of W1*A1, V1, W2*A2*B and V2*C as the similarity score.
[0116] Step 110: taking the objects with the highest similarity scores as the final matching objects of the article to be matched.
[0117] In this embodiment, hot words are extracted from all objects under the category to which the matching article belongs, and keywords are extracted from the matching article. Then, similarity is calculated using the extracted word vectors, and then a group of objects with the highest similarity to the article to be matched is calculated in combination with the TF-IDF of the keywords as the final matching objects.
[0118] In this embodiment, the co-occurrence rate represents the percentage of the number of objects in which an independent word appears among all objects. Before similarity calculation, the independent words of all objects under the category are removed from the words with a co-occurrence rate within a preset interval, and all the remaining independent words constitute the category independent word set. That is, retaining the words with a co-occurrence rate outside the preset interval can reduce the subsequent calculation amount and reduce the calculation complexity. The same principle is used to process the main words of all objects under the category, remove the word pairs corresponding to the invalid modifiers corresponding to the main words, and obtain the category main word-modifier word pair set, which can also further reduce the subsequent calculation amount and reduce the calculation complexity.
[0119] In this embodiment, the category independent word set and the category main word-modifier word pair set are used to clean the independent words and main word-modifier word pairs corresponding to each object under the category and the article to be matched, so as to remove the words that do not belong to the set, and the remaining words are used for subsequent similarity calculation and similarity score calculation, thereby further reducing the subsequent calculation amount and reducing the calculation complexity.
[0120] In this embodiment, before calculating the similarity score, objects that have the same main word as the article to be matched but whose modifiers corresponding to the same main word have opposite meanings to those in the article to be matched are cleaned out. These objects are no longer used in the subsequent similarity score calculation, thereby further reducing the subsequent calculation amount and reducing the calculation complexity.
[0121] This embodiment provides a method for automatically and accurately matching a group of objects for an article to be matched, which can significantly reduce the time spent on manually selecting objects for the article to be matched and improve the efficiency of automatic copywriting generation.
[0122] Example 2
[0123] like Figure 2 The present embodiment provides a system for matching objects for articles, each of the articles corresponds to a corresponding category, and the system includes: an object acquisition module 1, a selling point word extraction module 2, a keyword extraction module 3, an independent word removal module 4, a word pair removal module 5, a word pair cleaning module 6, an independent word cleaning module 7, a keyword word vector acquisition module 8, a selling point word vector acquisition module 9, a similarity calculation module 10, a word frequency inverse word frequency calculation module 11, a similarity score calculation module 12, a matching module 13 and an object cleaning module 14.
[0124] The object acquisition module 1 is used to acquire all objects under the category.
[0125] The selling point word extraction module 2 is used to extract at least one selling point word for each of the objects under the category; specifically, it is used to use the title, attributes, and historical recommended articles of the object as materials, perform word segmentation and dependency syntactic analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category.
[0126] The keyword extraction module 3 is used to extract at least one keyword in the article to be matched, and is specifically used to perform word segmentation and dependency syntactic analysis on the article to be matched to mark the relationship between each word, so as to obtain at least one keyword in the article to be matched.
[0127] In this embodiment, the selling point words of each of the objects and the keywords in the article to be matched include main word-modifier word pairs and / or independent words. The main word-modifier word pairs are word pairs consisting of main words and corresponding modifier words that appear in pairs, and the independent words are words that exist alone except for the main words and the modifier words.
[0128] The independent word removal module 4 is used to count the independent words of all objects under the category, remove words with a co-occurrence rate within a preset interval, and the remaining independent words form a category independent word set. The co-occurrence rate represents the percentage of the independent words appearing in all objects. In this embodiment, the preset interval is greater than 50% or less than 0.1%.
[0129] The word pair removal module 5 is used to remove the subject word-modifier word pairs with invalid modifiers from the subject word-modifier word pairs of all objects, and the remaining subject word-modifier word pairs constitute a category subject word-modifier word pair set.
[0130] The word pair cleaning module 6 is used to clean the subject word-modifier word pairs of each object under the category before calling the similarity calculation module 10, so as to remove the subject word-modifier word pairs in each object that are not included in the subject word-modifier word pair set of the category; and to clean the subject word-modifier word pairs of the article to be matched, so as to remove the subject word-modifier word pairs in the article to be matched that are not included in the subject word-modifier word pair set of the category.
[0131] The independent word cleaning module 7 is used to clean the independent words of each object under the category before calling the similarity calculation module 10, so as to remove the independent words in each object that are not included in the independent word set; and to clean the independent words of the article to be matched, so as to remove the independent words in the article to be matched that are not included in the independent word set.
[0132] The keyword word vector acquisition module 8 is used to obtain the word vector corresponding to each keyword in the article to be matched, which is recorded as the keyword word vector.
[0133] The selling point word vector acquisition module 9 is used to obtain the word vector corresponding to each selling point word of each object, which is recorded as the selling point word vector.
[0134] The similarity calculation module 10 is used to use the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient.
[0135] The word frequency inverse word frequency calculation module 11 is used to calculate the TF-IDF of each of the keywords.
[0136] The similarity score calculation module 12 is used to calculate the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword.
[0137] The matching module 13 is used to select the objects with the highest similarity scores as the final matching objects of the article to be matched.
[0138] like Figure 3 As shown, in this embodiment, the similarity calculation module 10 includes a search module 1001 , a cosine similarity calculation module 1002 and a distance calculation module 1003 .
[0139] Among them, the search module 1001 is used to search for the main words shared by the article to be matched and each of the objects, assuming that the shared main words are the same main words, and the remaining main words are different main words. The cosine similarity calculation module 1002 is used to perform cosine similarity calculation using the word vector of the modifier corresponding to the same main word of the article to be matched and the word vector of the modifier corresponding to the same main word of the corresponding object, so as to obtain the similarity coefficient A1 of the same main word corresponding to the article to be matched and the corresponding object. Among them, the object cleaning module 14 is used to clean the objects corresponding to the same main words whose similarity coefficient A1 is negative before calling the similarity score calculation module 12. The distance calculation module 1003 is used to select at least one word with the highest TF-IDF from all the different main words in the article to be matched as a similar main word, use the word vector of the similar main word in the article to be matched and the word vector of the corresponding different main words of the object to perform distance calculation to obtain the corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main words of the corresponding object to perform distance calculation to obtain the corresponding similar main word modifier word distance B.
[0140] like Figure 4 As shown, in this embodiment, the similarity score calculation module 12 includes a first score calculation module 1201, an independent word search module 1202, a second score calculation module 1203, a third score calculation module 1204, a fourth score calculation module 1205 and a total score calculation module 1206.
[0141] Among them, the first score calculation module 1201 is used to represent the TF-IDF of each of the same main words in the article to be matched as W1, and set the score of the same main words corresponding to the article to be matched and the corresponding object to W1*A1. The independent word search module 1202 is used to find the independent words shared by the article to be matched and each of the objects, and set the shared independent words to be the same independent words, and the remaining independent words to be different independent words. The second score calculation module 1203 is used to represent the TF-IDF of each of the same independent words in the article to be matched as V1, and set the score of the same independent words in the article to be matched and the corresponding object to V1. The third score calculation module 1204 is used to represent the TF-IDF of each of the similar main words in the article to be matched as W2, and set the score of the similar main words corresponding to the article to be matched and the corresponding object to W2*A2*B. The fourth score calculation module 1205 is used to select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word of the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented by V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C. The total score calculation module 1206 is used to calculate the similarity score between the article to be matched and each object according to the corresponding W1*A1, V1, W2*A2*B and V2*C.
[0142] This embodiment provides a system for automatically and accurately matching a group of objects for an article to be matched, which can significantly reduce the time spent on manually selecting objects for the article to be matched and improve the efficiency of automatic copy generation.
[0143] Example 3
[0144] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the method for matching objects for articles in Embodiment 1 is implemented when the processor executes the program. Figure 5The electronic device 30 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.
[0145] like Figure 5 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).
[0146] The bus 33 includes a data bus, an address bus, and a control bus.
[0147] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .
[0148] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0149] The processor 31 executes various functional applications and data processing by running the computer program stored in the memory 32, such as the method for matching articles with objects provided in Embodiment 1 of the present invention.
[0150] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model-generated device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via a bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0151] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, 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 to be embodied.
[0152] Example 4
[0153] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for matching objects to articles provided in Embodiment 1 are implemented.
[0154] The readable storage medium may include but is not limited to: a portable disk, 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.
[0155] In a possible implementation, the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps in the method for matching objects for articles described in Example 1.
[0156] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0157] The following further illustrates the technical solution and technical effects of the present invention through specific examples.
[0158] This example is a method for accurately matching a group of products for a recommended article based on the technical concept of the present invention, which includes:
[0159] S1. Aggregate category products according to the category to which the recommended article belongs, extract a category selling point word set, and extract selling point words for each product, specifically including the following steps:
[0160] Step 1: Cluster the products in the category. Use product titles, attributes, and product recommendation articles as materials, perform word segmentation and dependency syntax analysis to mark the relationship between each word, and extract the main word-modifier word pairs and other words from them.
[0161] Step 2: Count other words in the category products, remove words with a co-occurrence rate (indicates the frequency of occurrence of words in the category products, not the word frequency, but the number of products) greater than 50% or less than 0.1%, that is, retain words with a co-occurrence rate between [0.1%, 50%]; process the category main words in the same principle and remove invalid modifiers of the main words; in this way, you will get the category main word-modifier word pair set and other word sets, and the other word set is also the category keyword set.
[0162] Step 3: Clean the main word-modifier word pairs and other words of the category products through the category main word-modifier word pair set and the category keyword set to obtain the key main word-modifier word pairs and keywords of the category products.
[0163] S2, extracting the subject word-modifier word pairs and key words in the recommended articles; specifically comprising the following steps:
[0164] Step 1: Perform word segmentation and dependency syntactic analysis on the recommended articles to mark the relationship between each word, and extract the main word-modifier word pairs and other words from them.
[0165] Step 2: Based on the previous process, the category main word-modifier word pair set and keyword set are obtained to clean the keywords of the recommended articles, and the key main word-modifier word pairs and keywords of the recommended articles are obtained.
[0166] Step 3: Calculate the TF-IDF of all keywords in the recommended articles.
[0167] S3, matching products to recommended articles, specifically including the following steps:
[0168] Step 1: Remove products that have the same main words as the recommended articles and whose modifier word vector cosine similarity is negative to reduce computational complexity.
[0169] Step 2: Find the main words and keywords shared by the recommended articles and products, calculate the cosine similarity A of the modifiers of the main words, the TF-IDF of the main words is W, that is, the score of each identical main word is WA, the TF-IDF of the keywords is V, that is, the score of each identical keyword is V, and the sum is S1.
[0170] Step 3: Sort the words left in the recommended articles by TF-IDF scores from high to low, and find the closest and non-negative main words and keywords from the products. The distance of similar main words is recorded as A, the distance of similar main word modifiers is recorded as B, and the TF-IDF of the main word is W, that is, the score of each main word is WAB. Similarly, the distance of the keyword is recorded as C, the TF-IDF of the keyword is V, that is, the score of each keyword is VC. Sum them up to get S2.
[0171] Step 4: Calculate the similarity score between the recommended article and the product, that is, S=S1+S2, and sort to find the top 16 products.
[0172] This example provides a method for automatically and accurately matching a group of products to recommended articles, which can significantly reduce the time spent on manually selecting products for recommended articles and improve the efficiency of automatic copy generation.
[0173] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A method for matching articles to objects, wherein each article has a corresponding category, characterized in that: The method comprises: Get all objects under the category; Extracting at least one selling point word for each of the objects under the category; Extract at least one keyword from the article to be matched; Obtain the word vector corresponding to each of the keywords in the article to be matched, recorded as the keyword word vector; Obtain a word vector corresponding to each of the selling point words of each of the objects, recorded as a selling point word vector; Using the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient; Calculate the TF-IDF of each of the keywords; Calculate the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword; The objects with the highest similarity scores are used as the final matching objects of the article to be matched.
2. The method for matching objects to articles according to claim 1, characterized in that: Each of the selling point words of the object and the keywords in the article to be matched include a subject word-modifier word pair and / or an independent word, wherein the subject word-modifier word pair is a word pair consisting of a subject word and a corresponding modifier that appear in pairs, and the independent word is a word that exists alone except the subject word and the modifier; The using the keyword word vector and the selling point word vector of each of the objects to perform similarity calculation to obtain a corresponding similarity coefficient includes: Find the subject words that are shared by the article to be matched and each of the objects, assuming that the shared subject words are the same subject words, and the remaining subject words are different subject words; Performing cosine similarity calculation using the word vector of the modifier word corresponding to the same main word of the article to be matched and the word vector of the modifier word corresponding to the same main word of the corresponding object to obtain a similarity coefficient A1 between the article to be matched and the same main word corresponding to the corresponding object; Select at least one word with the highest TF-IDF from all the different main words of the article to be matched as a similar main word, use the word vector of the similar main word of the article to be matched and the word vector of the different main word of the corresponding object to perform distance calculation to obtain the corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main word of the corresponding object to perform distance calculation to obtain the corresponding similar main word modifier word distance B; The calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword includes: The TF-IDF of each of the same subject words in the article to be matched is represented as W1, and the score of the same subject words corresponding to the article to be matched and the corresponding object is set to W1*A1; Find the independent words that are shared by the article to be matched and each of the objects, and assume that the shared independent words are the same independent words, and the remaining independent words are different independent words; The TF-IDF of each of the identical independent words in the article to be matched is represented as V1, and the score of the identical independent words in the article to be matched and the corresponding object is set as V1; The TF-IDF of each similar subject word of the article to be matched is represented as W2, and the score of the similar subject word corresponding to the article to be matched and the corresponding object is set as W2*A2*B; Select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word in the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented as V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C; The similarity score between the article to be matched and each of the objects is calculated according to the corresponding W1*A1, V1, W2*A2*B and V2*C.
3. The method for matching objects to articles according to claim 2, characterized in that: The method further comprises the following steps: Counting the independent words of all objects under the category, removing words whose co-occurrence rate is within a preset interval, and the remaining independent words form a category independent word set, wherein the co-occurrence rate represents the percentage of the independent words appearing in all objects; Among the subject word-modifier word pairs of all objects, the subject word-modifier word pairs with invalid modifiers are removed, and the remaining subject word-modifier word pairs form a category subject word-modifier word pair set; Before the step of using the keyword word vector and the selling point word vector of each object to perform similarity calculation to obtain a corresponding similarity coefficient, the following steps are also included: Cleaning the subject word-modifier word pairs of each of the objects under the category to remove the subject word-modifier word pairs in each of the objects that are not included in the subject word-modifier word pair set of the category; Cleaning the independent words of each of the objects under the category to remove the independent words in each of the objects that are not included in the independent word set; Cleaning the subject word-modifier word pairs of the article to be matched, so as to remove the subject word-modifier word pairs in the article to be matched that are not included in the subject word-modifier word pair set of the category; The independent words of the article to be matched are cleaned to remove the independent words in the article to be matched that are not included in the independent word set.
4. The method for matching objects to articles according to claim 2, characterized in that: Before the step of calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword, the following steps are also included: The objects corresponding to the same main words whose similarity coefficient A1 is negative are cleaned out.
5. The method for matching objects to articles according to claim 1, characterized in that: The extracting at least one selling point word of each of the objects under the category includes: Taking the title, attributes, and historical recommended articles of the object as materials, performing word segmentation and dependency syntactic analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category; The step of extracting at least one keyword from the article to be matched includes: The article to be matched is segmented and dependency parsed to mark the relationship between each word, so as to obtain at least one keyword in the article to be matched.
6. The method for matching objects to articles according to claim 3, characterized in that: The preset interval is greater than 50% or less than 0.1%.
7. A system for matching articles to objects, each of which has a corresponding category, characterized in that: The system comprises: An object acquisition module, used to acquire all objects under the category; A selling point word extraction module, used to extract at least one selling point word for each of the objects in the category; A keyword extraction module, used to extract at least one keyword from the article to be matched; A keyword word vector acquisition module is used to obtain the word vector corresponding to each keyword in the article to be matched, which is recorded as the keyword word vector; A selling point word vector acquisition module is used to acquire a word vector corresponding to each selling point word of each object, which is recorded as a selling point word vector; A similarity calculation module, used to perform similarity calculation using the keyword word vector and the selling point word vector of each object to obtain a corresponding similarity coefficient; A word frequency inverse word frequency calculation module, used to calculate the TF-IDF of each of the keywords; A similarity score calculation module, used for calculating the similarity score between the article to be matched and each of the objects according to the similarity coefficient and the TF-IDF of the corresponding keyword; The matching module is used to select the objects with the highest similarity scores as the final matching objects of the article to be matched.
8. The system for matching articles to objects according to claim 7, characterized in that: Each of the selling point words of the object and the keywords in the article to be matched include a subject word-modifier word pair and / or an independent word, wherein the subject word-modifier word pair is a word pair consisting of a subject word and a corresponding modifier that appear in pairs, and the independent word is a word that exists alone except the subject word and the modifier; The similarity calculation module comprises: A search module, used for searching the subject words common to the article to be matched and each object, assuming that the common subject words are the same subject words, and the remaining subject words are different subject words; A cosine similarity calculation module, used to perform cosine similarity calculation using the word vector of the modifier word corresponding to the same main word of the article to be matched and the word vector of the modifier word corresponding to the same main word of the corresponding object, so as to obtain a similarity coefficient A1 between the article to be matched and the same main word corresponding to the corresponding object; A distance calculation module is used to select at least one word with the highest TF-IDF from all the different main words of the article to be matched as a similar main word, use the word vector of the similar main word of the article to be matched and the word vector of the different main words of the corresponding object to perform distance calculation to obtain a corresponding similar main word distance A2, use the word vector of the modifier word corresponding to the similar main word and the word vector of the modifier word corresponding to the different main word of the corresponding object to perform distance calculation to obtain a corresponding similar main word modifier word distance B; The similarity score calculation module comprises: A first score calculation module, used for representing the TF-IDF of each of the same subject words in the article to be matched as W1, and setting the score of the same subject words corresponding to the article to be matched and the corresponding object as W1*A1; An independent word search module, used for searching the independent words shared by the article to be matched and each of the objects, assuming that the shared independent words are identical independent words, and the remaining independent words are different independent words; A second score calculation module is used to represent the TF-IDF of each of the identical independent words in the article to be matched as V1, and set the score of the identical independent words in the article to be matched and the corresponding object as V1; A third score calculation module is used to represent the TF-IDF of each similar subject word of the article to be matched as W2, and set the score of the similar subject word corresponding to the article to be matched and the corresponding object as W2*A2*B; A fourth score calculation module is used to select at least one word with the highest TF-IDF from all the different independent words in the article to be matched as a similar independent word, use the word vector of the similar independent word in the article to be matched and the word vector of the different independent word of the corresponding object to perform distance calculation to obtain a similar independent word distance C, the TF-IDF of the similar independent word in the article to be matched is represented by V2, and the score of the similar independent word corresponding to the article to be matched and the corresponding object is set to V2*C; The total score calculation module is used to calculate the similarity score between the article to be matched and each of the objects according to the corresponding W1*A1, V1, W2*A2*B and V2*C.
9. The system for matching articles to objects according to claim 8, characterized in that: The system further comprises: An independent word removal module, used to count the independent words of all objects under the category, remove words with a co-occurrence rate within a preset interval, and the remaining independent words form a category independent word set, and the co-occurrence rate represents the percentage of the independent words appearing in all objects; A word pair removal module, used to remove the subject word-modifier word pairs with invalid modifiers from the subject word-modifier word pairs of all objects, and the remaining subject word-modifier word pairs constitute a category subject word-modifier word pair set; A word pair cleaning module, used for cleaning the subject word-modifier word pairs of each of the objects under the category before calling the similarity calculation module, so as to remove the subject word-modifier word pairs in each of the objects that are not included in the subject word-modifier word pair set of the category; and cleaning the subject word-modifier word pairs of the articles to be matched, so as to remove the subject word-modifier word pairs in the articles to be matched that are not included in the subject word-modifier word pair set of the category; An independent word cleaning module is used to clean the independent words of each object under the category before calling the similarity calculation module to remove the independent words in each object that are not included in the independent word set; and to clean the independent words of the article to be matched to remove the independent words in the article to be matched that are not included in the independent word set.
10. The system for matching articles to objects according to claim 8, characterized in that: The system further comprises: The object cleaning module is used to clean the objects corresponding to the same subject words whose similarity coefficient A1 is negative before calling the similarity score calculation module.
11. The system for matching articles to objects according to claim 7, characterized in that: The selling point word extraction module is used to use the title, attributes, and historical recommended articles of the object as materials, perform word segmentation and dependency syntax analysis on the materials to mark the relationship between each word, so as to obtain at least one selling point word for each of the objects under the category; The keyword extraction module is used to perform word segmentation and dependency syntactic analysis on the article to be matched to mark the relationship between each word, so as to obtain at least one keyword in the article to be matched.
12. The system for matching articles to objects according to claim 9, characterized in that: The preset interval is greater than 50% or less than 0.1%.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for matching objects for articles according to any one of claims 1 to 6 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for matching objects for articles according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Information processing method and device
CN106933878A
Text similarity computing method and device
CN107644010A
Text classification method and apparatus, and electronic device
CN107766426A
Text classification method and device
CN108021667A
An automatic method for classifying documents by using presentative words and similarity
KR101681109B1
