The present invention relates to green knowledge recommendation methods, and more particularly to a green knowledge recommendation method based on characteristic similarity and user demands, an electronic device and a computer readable storage medium thereof.
In the green knowledge base, the traditional way for users to search for the desired knowledge is not accurate and the search time is too slow. Because users in the search process is often very broad but not accurate. The traditional way to respond to a user's search is to give a search result that is only large enough, rather than trying to determine how to reduce uncertainty in the user's broad knowledge. Traditional methods only give a broad range of results and let the user to slowly search for themselves, thereby reducing what is unnecessary knowledge. Such a search method is too slow, and the search results are not accurate enough to meet the needs of users.
The object of the present invention is to provide a green knowledge recommendation method based on characteristic similarity and user demands to solve the problem that the search results are not accurate enough to meet the needs of users. The green knowledge recommendation method acts as a template-based method and allows users to quickly find what they need, so as to avoid users' meaningless search, improve the search efficiency, and reduce the loss of useless time.
It is adopted by the present invention to realize with the following technical scheme.
A green knowledge recommendation method based on characteristic similarity and user demands includes following steps 1˜4.
Step 1, obtain a current-search text e and a historical-search-texts set Eu both from a user u, Eu={e1,u, e2,u . . . , en
Step 2, construct a topics dictionary and a subtopics dictionary, and decompose the current-search text e and the historical-search-texts set Eu on the basis of semantic decomposition. The step 2 includes steps 2.1˜2.6.
Step 2.1, construct a topics dictionary X of a green knowledge base, X={x1, x2, . . . , xn2, . . . . xN2}. Wherein the xn2 represents the n2 th topics, the N2 represents the total number of topics in the dictionary X.
Construct a subtopics dictionary Y of the green knowledge base, Y={y1, y2, . . . , yn3, . . . , yN3}. Wherein the yn3 represents the n3 th subtopics, the N3 represents the total number of subtopics in the dictionary Y.
Construct a daily-expressions dictionary C of a set of users, C={c1, c2, . . . , cn4, . . . , cN4}. Wherein the cn4 represents the n4 th daily expression, the N4 represents the total number of daily expressions in the dictionary C.
Step 2.2, decompose e and en1,u according to dictionaries X, Y, C to obtain two text-vector sets we and wn1 correspondingly. The we is about the current-search text e, we={w1e, w2e, . . . , wi
Wherein the wi
represents the i th word or the n1 the historical-search text en1,u; the In
Define ti, being the label of the wi
Define tin
If the tin
if it the tin
if the tin
otherwise define
Step 2.3, obtain the weight Lin
by the formula (1).
In the formula, the δ1 represents the first weight, the δ2 represents the second weight, and 0<δ2<δ1<1.
Step 2.4, obtain the weight Li
Step 2.5, obtain the similarity
between the wi
by the formula (2).
Step 2.6, obtain the similarities between each of the two words respectively from two text-vector sets we and wn1 by the same way of step 2.5. Collect words with the highest similarity to be a candidate-words set in which one candidate word would be select to be the n1 th word of the we. A valid-text set Vi
Step 3, according to the weight, pick words in the we and the Vi
Step 3.1, pick words in the we that belong to the dictionary X.
When wi
Step 3.2, pick words in the Vi
When vp,i
Step 3.3, a large-subject terms set Z is defined by the first words set and the second words set, Z={z1X, z2X, . . . , zn
Wherein the zn
Step 3.4, pick words in the we that belong to the dictionary Y. When wi
Step 3.5, pick words in the Vi
Step 3.6, a minor-subject terms set V is defined by the we and the Vi
Step 4, find the corresponding knowledge according to user satisfaction. The step 4 includes steps 4.1˜4.6.
Step 4.1, acquire a knowledge a to be identified, and calculate the frequency of each of the word appearing in the knowledge a after semantic decomposition under the dictionary X and the minor-subject terms set V,
represents the frequency of the n2 th topic xn
and the
represents the frequency of the n6 th subtopic vn
Step 4.2, assigns a value to each of the word in the minor-subject terms set V, and a weighting function H(vn
Step 4.3, a user-demand degree function Q(vn
In the formula, the K represents users' satisfaction, kϵ(0,100%).
Step 4.4, get a topic xuser required by the user in the topics dictionary X, and calculate the closing degree d1a between the topic xuser and the knowledge a, d1a=1−sx
Step 4.5, get the user's demand for each of the minor-subject term in the minor-subject terms set V, and calculate the user's closing degree dg to all of the minor-subject terms,
Step 4.6, calculate the closing degree da between the user's demand and the knowledge a, da=d1a+d2a, obtain all of the closing degree of all of the knowledge, and select some knowledge with less closing degree to fed to the user.
The present invention further provides an electronic device, including a memory and a processor. The memory is used to store programs that could support the processor to execute. Wherein the programs are programmed according to the green knowledge recommendation method.
The present invention further provides a computer readable storage medium, used to store programs that are programmed according to the green knowledge recommendation method.
Compared with the prior art, the beneficial effects of the present invention are as follows.
1. The present invention firstly divides the collected text into words, and also sets the weight to improve the usefulness of similarity calculation. The present invention secondly divides the text into two parts according to the dependency relationship between the user's demand for large type and small type, so that the user's idea is more specific and detailed, and in the demand degree model, the user's demand for different types can be combined to make the search results conform to the user's demand. According to the received knowledge, the word frequency obtained after the dictionaries and the sets, the present invention is compared with the demand function to find out the knowledge that best meets the needs of the user.
2. The present invention uses a similarity model to quickly obtain usable text. The use of demand degree model can make users combine different types of needs, so that the search results meet the needs of users. The present invention combines the demand of the user with the results of previous searches, so that the accuracy of the pushed results is greatly improved.
Referring to
Step 1, obtain a current-search text e and a historical-search-texts set Eu both from a user u, Eu={e1,u, e2,u . . . , en
Step 2, construct a topics dictionary and a subtopics dictionary, and decompose the current-search text e and the historical-search-texts set Eu on the basis of semantic decomposition. The step 2 includes steps 2.1˜2.6.
Step 2.1, construct a topics dictionary X of a green knowledge base, X={x1, x2, . . . , xn2, . . . , xN2}. Wherein the xn2 represents the n2 th topics, the N2 represents the total number of topics in the dictionary X. The topics can be cars, machine tools, refrigerators, and other big categories.
Construct a subtopics dictionary Y of the green knowledge base, Y={y1, y2, . . . , yn3, . . . , yN3}. Wherein the yn3 represents the n3 th subtopics, the N3 represents the total number of subtopics in the dictionary Y. The subtopics can be a small type under a large type such as a large car, bus, truck, or a component such as a chassis, engine, shell, or a lightweight, energy-saving, wear-resistant effect.
Construct a daily-expressions dictionary C of a set of users, C={c1, c2, . . . , cn4, . . . , cN4}. Wherein the cn4 represents the n4 th daily expression, the N4 represents the total number of daily expressions in the dictionary C. The daily expression can be I, you, he, or whatever, want such everyday words.
Step 2.2, decompose e and en1,u according to dictionaries X, Y, C to obtain two text-vector sets we and wn1 correspondingly. The we is about the current-search text e, we={w1e, w2e, . . . , wi
Wherein the wi
represents the i th word of the n1 th historical-search text en1,u; the In
Define ti
Define tin
If the tin
if the tin
Y; if the tin
otherwise define
Use labels to detect the dictionary that each word corresponds to, to simplify the identification of the relationship.
Step 2.3, obtain the weight Lin
by the formula (1).
In the formula, the δ1 represents the first weight, the δ2 represents the second weight, and 0<δ2<δ1<1. Set weights for words that fall under topics, subtopics, and daily-expressions.
Step 2.4, obtain the weight Li
Step 2.5, obtain the similarity
between the wi
by the formula (2).
The text vector set is converted into a numerical vector during the computation.
Step 2.6, obtain the similarities between each of the two words respectively from two text-vector sets we and wn1 by the same way of step 2.5.
Collect words with the highest similarity to be a candidate-words set in which one candidate word would be select to be the n1 th word of the we.
A valid-text set Vi
Wherein the vP,i
Step 3, according to the weight, pick words in the we and the Vi
Step 3.1, pick words in the we that belong to the dictionary X.
When wi
Step 3.2, pick words in the Vi
When vp,i
Step 3.3, a large-subject terms set Z is defined by the first words set and the second words set, Z={z1X, z2X, . . . , zn
Step 3.4, pick words in the we that belong to the dictionary Y. When wi
Step 3.5, pick words in the Vi
Step 3.6, a minor-subject terms set V is defined by the we and the Vi
Step 4, find the corresponding knowledge according to user satisfaction. The step 4 includes steps 4.1˜4.6.
Step 4.1, acquire a knowledge a to be identified, and calculate the frequency of each of the word appearing in the knowledge a after semantic decomposition under the dictionary X and the minor-subject terms set V,
represents the frequency of the n2 th topic xn
and the
represents the frequency of the n6 th subtopic vn6Y appearing in the knowledge a, 0≤
Step 4.2, assigns a value to each of the word in the minor-subject terms set V, and a weighting function H(vn6Y) of words in minor-subject terms set V is defined as formula (3). Here, word frequency is used to show the proportion of each feature in the knowledge a, and it is also the influence of each feature in the knowledge a.
Step 4.3, a user-demand degree function Q(vn6Y) is defined as formula (4).
In the formula, the K represents users' satisfaction, kϵ(0,100%).
Because there are some effects in the user's overall text that are more searched, this is obviously what the user wants more.
Step 4.4, get a topic xuser required by the user in the topics dictionary X, and calculate the closing degree da between the topic xuser and the knowledge a, d1a=1−sx
Step 4.5, get the user's demand for each of the minor-subject term in the minor-subject terms set V, and calculate the user's closing degree d2a to all of the minor-subject terms,
Because the semantic decomposition uses the minor-subject terms set V, the subscript of vn6Y is n6.
Step 4.6, calculate the closing degree da between the user's demand and the knowledge a, da=d1a+d2a, obtain all of the closing degree of all of the knowledge, and select some knowledge with less closing degree to fed to the user.
The present embodiment further provides an electronic device, including a memory and a processor. The memory is used to store programs that could support the processor to execute. Wherein the programs are programmed according to the green knowledge recommendation method.
The present embodiment further provides a computer readable storage medium, used to store programs that are programmed according to the green knowledge recommendation method.
Number | Date | Country | Kind |
---|---|---|---|
202310103329.X | Feb 2023 | CN | national |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2023/118564 | Sep 2023 | WO |
Child | 18964413 | US |