Beverage product design method and system based on knowledge graph
By building a beverage product design system based on knowledge graphs, the problem of information dispersion and limited design decision-making basis is solved, and more scientific and accurate design decisions are achieved, which can identify consumers' hidden needs and design products more in line with consumers' preferences.
Patent Information
- Application Number
- CN202410958075.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In beverage product design, information is scattered and design decision-making basis is limited, resulting in prediction fluctuations.
Using a knowledge graph-based design method, entity recognition and relationship extraction are performed through IDF algorithm and random forest model to build a complete knowledge graph, and a collaborative filtering algorithm is used to filter the beverage formulas and tastes that users like.
It realizes in-depth integration and analysis of data, provides more scientific and accurate design decisions, can identify consumers' hidden needs and design products that are more in line with consumers' preferences.
Smart Images

Figure CN118939883B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of beverage product design, and in particular, to a beverage product design method and system based on a knowledge graph. Background Art
[0002] In the product design of beverages, the design team relies on traditional market research reports, consumer surveys, internal sales data, etc. This information is often isolated, lacks structured connections, and is difficult to quickly analyze comprehensively. Design decisions are more based on intuition, experience, and limited market data. It is difficult to fully consider factors such as consumer preferences, competitor dynamics, and supply chain conditions. The extreme weights lead to forecast fluctuations. The knowledge graph integrates a wide range of market data, consumer behavior, supply chain information, regulatory standards, etc., and provides in-depth market trend and consumer demand analysis through the links between entities and relationships. Analysis tools based on knowledge graphs can provide data-driven decision support, including market segmentation, product positioning, pricing strategies, etc., making design decisions more scientific and accurate. Therefore, a beverage product design method and system based on knowledge graphs is provided. Summary of the invention
[0003] The purpose of the present invention is to provide a beverage product design method and system based on knowledge graph to solve the problems of information dispersion in product design, limited basis for design decisions, and prediction fluctuations caused by extreme weight values raised in the above background technology.
[0004] To achieve the above object, the present invention aims to provide a beverage product design method based on a knowledge graph, comprising the following steps:
[0005] S1. Collect text data on raw material information, production process, and nutritional ingredients of beverages;
[0006] S2. Use the IDF algorithm to identify entities in beverage data information, use the random forest model to extract relationships from the data, convert the data into nodes and edges in the knowledge graph, add weights for text features, and introduce a saturation function;
[0007] After adding text weight and introducing saturation function optimization, the IDF algorithm is:
[0008]
[0009] Among them, w represents word, d represents text data, SID (w,d) is the text feature after weighting and introducing the saturation function, TF(w, d) represents the frequency of word w in text data d, log(1+TF(w, d)) represents the frequency value after introducing the saturation function, N represents the total number of text data, df wIndicates the frequency of text data; S3. Use knowledge fusion technology to integrate data information and build a complete knowledge graph;
[0010] S4. Use collaborative filtering algorithm to filter out beverage recipes and flavors popular with users from the knowledge graph based on user historical preferences.
[0011] As a further improvement of the technical solution, in S2, identifying nodes in the graph by entity recognition technology includes the following steps:
[0012] A2.1. Build a text dataset containing beverage product descriptions, ingredient lists, nutritional information, and user reviews, and preprocess the data.
[0013] A2.2. Use the IDF algorithm to extract features from the text. The features include part-of-speech tagging, contextual vocabulary, and location information. A saturation function is introduced to optimize the IDF algorithm.
[0014] A2.3. Use Hidden Markov Model (HMM) to identify entities in text;
[0015] A2.4. After identifying the entities, they are classified into the same categories, and the categories constitute the nodes in the knowledge graph.
[0016] As a further improvement of the technical solution, in A2.2, the IDF algorithm before optimization is specifically:
[0017]
[0018] Among them, w represents word, d represents text data, ID (w,d) is the weighted text feature, TF(w, d) represents the frequency of word w in text data d, N represents the total number of text data, df w Indicates the frequency of text data.
[0019] As a further improvement of the technical solution, in A2.3, using a hidden Markov model HMM to identify and classify entities from text includes the following steps:
[0020] A2.31. Build a dataset with entity labels. Each word in the dataset will be marked with a label.
[0021] A2.32. Estimate state transition probabilities and observation emission probabilities using the maximum likelihood estimation algorithm;
[0022] A2.33. Two parameters for training HMM: state transition probability and observation emission probability;
[0023] A2.34. Use the Viterbi algorithm to find the entity tag sequence by inputting text data, and post-process the tag sequence output by the Viterbi algorithm through the usual advantage rule.
[0024] As a further improvement of the technical solution, in A2.33, the state transition probability and the observation emission probability are specifically:
[0025] A2.331, State transition probability:
[0026]
[0027] Among them, i and j represent entity categories, a ij represents the entity category transition probability, N ij N represents the number of times entity category j appears immediately after entity category i; i Represents the total number of occurrences of entity category i;
[0028] A2.332. Observed emission probability:
[0029]
[0030] Among them, b jk represents the probability of observing word k in the text under entity category j, N j,k N represents the number of times word k is observed in the text under the premise of entity category j; j Represents the total number of occurrences of entity category j.
[0031] As a further improvement of the technical solution, in S2, identifying and extracting the association between entities by using the relationship extraction technology includes the following steps:
[0032] B2.1. Collect a set of text data that has undergone entity recognition and extract features for each pair of entities in the text. The features include the location information, context words, and part-of-speech tags of the entity pairs.
[0033] B2.2. Select the random forest model for training and use it for relationship extraction;
[0034] B2.3. Apply the trained random forest model to the unlabeled entity pairs. The model will output the predicted relationship type.
[0035] B2.4. Use the identified relationship types as edges to connect related entity nodes in the knowledge graph.
[0036] As a further improvement of the technical solution, in B2.2, building a decision tree through a random forest model to identify the relationship between entities in the text includes the following steps:
[0037] B2.21. Preprocess the text data to generate labeled data and divide the data into training data and test data;
[0038] B2.22. Extract semantic features from text as input to the random forest model;
[0039] B2.23. Train the random forest model using the training data;
[0040] B2.24. Use the trained model to extract entity relationships from text.
[0041] As a further improvement of the technical solution, in S3, the data information from different sources, different formats and different semantic levels is integrated by using knowledge fusion technology to construct a complete knowledge graph, including the following steps:
[0042] S3.1. Associate the attribute values of the features identified by the relation extraction technology with the entity to form an attribute list of the entity;
[0043] S3.2. Unify the schema and definition of different data sources and integrate data from different sources;
[0044] S3.3. Use the graph processing tool Neo4j to build a knowledge graph based on entities, attributes and relationships.
[0045] As a further improvement of the technical solution, in S4, the collaborative filtering algorithm is used to filter user preferences according to the knowledge graph, including the following steps:
[0046] S4.1. Obtain user behavior data from the knowledge graph, which includes the beverages consumed, behavior type, and timestamp;
[0047] S4.2. Create a matrix;
[0048] The rows represent users, the columns represent drinks, and the cell values represent the number of purchases;
[0049] S4.3, using cosine similarity to calculate the similarity between beverages and using logistic regression to predict the user's potential rating for untried beverages;
[0050] S4.4. Sort beverages according to the predicted scores, and filter out beverage recipes and flavors that are popular with users based on the relationships in the knowledge graph.
[0051] On the other hand, the present invention provides a beverage product design system based on a knowledge graph, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the above-mentioned beverage product design methods based on a knowledge graph.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1. In the beverage product design method and system based on knowledge graph, a large amount of market data can be integrated through knowledge graph. By analyzing data from social media, online comments, forums and other sources, the knowledge graph can identify consumers' hidden needs, understand their lifestyles and values, and thus design products that are more in line with consumer preferences. The entities and relationships in the knowledge graph can reveal the connections between different ingredients, flavors, packaging designs, brand stories and other elements, providing inspiration for product design.
[0054] 2. In the beverage product design method and system based on knowledge graph, unstructured or semi-structured text data is converted into structured entity information through entity recognition, which is convenient for subsequent information integration and processing. In the text, the same word may refer to different entities. Entity recognition needs to determine the specific reference object of each mention, which is crucial to the accuracy of the knowledge graph; by extracting multiple relationships between entities through relationship extraction technology, the knowledge graph can construct a more complex and detailed network, provide a more comprehensive information view, and provide deeper semantic information, which improves the system's understanding and generation capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 The figure is a flow chart of the overall method of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] Embodiment 1:
[0058] See also Figure 1 As shown, this embodiment provides a beverage product design method based on a knowledge graph, comprising the following steps:
[0059] S1. Collect text data on raw material information, production process, and nutritional ingredients of beverages;
[0060] S2. Use the IDF algorithm to identify entities in beverage data information, use the random forest model to extract relationships from the data, and convert the data into nodes and edges in the knowledge graph;
[0061] In this embodiment, the nodes in the graph are identified by entity recognition technology. Entity recognition technology can accurately identify meaningful entities from a large amount of unstructured or semi-structured data, which helps to ensure that the construction of the knowledge graph is based on high-quality data and reduce errors and ambiguities; it helps to extract entity information from data from multiple sources. This information can be further integrated into a unified knowledge graph to form a more comprehensive and coherent knowledge representation. Through entity recognition technology, new entities and relationships can be continuously added to the knowledge graph to make it richer and more detailed, including the following steps:
[0062] A2.1. Construct a text dataset containing beverage product descriptions, ingredient lists, nutritional information, and user reviews, and preprocess the data. Data preprocessing involves removing stop words, punctuation, converting uppercase and lowercase letters, etc. to ensure the accuracy of subsequent processing;
[0063] A2.2. Use the IDF algorithm to extract features from the text. The features include part-of-speech tagging, contextual vocabulary, and location information. A saturation function is introduced to optimize the IDF algorithm.
[0064] Among them, the IDF algorithm before optimization is specifically:
[0065]
[0066] Among them, w represents word, d represents text data, ID (w,d) is the weighted text feature, TF(w, d) represents the frequency of word w in text data d, N represents the total number of text data, df w Indicates the frequency of text data.
[0067] Furthermore, adding weights to text features and introducing saturation functions can prevent the influence of high-frequency words in long text data and improve the accuracy of entity recognition. When processing the weights of text features, introducing saturation functions can limit the extreme values of weights and prevent the model from over-relying on individual features. Saturation functions can make the model's predictions smoother and reduce prediction fluctuations caused by extreme weight values. It can prevent any single feature from having too much influence on the model's decision. For processing high-frequency words in text data, it ensures that the model does not over-rely on these words.
[0068] After adding text weights and introducing saturation functions, the text features are:
[0069]
[0070] Among them, w represents word, d represents text data, SID (w,d)is the text feature after weighting and introducing the saturation function, TF(w, d) represents the frequency of word w in text data d, log(1+TF(w, d)) represents the frequency value after introducing the saturation function, N represents the total number of text data, df w Indicates the frequency of text data; A2.3, using Hidden Markov Model HMM to identify entities in text;
[0071] Among them, the hidden Markov model HMM is used to describe a process with unobserved states, which includes state space, observation space, state transition probability matrix, observation emission probability matrix, initial state probability vector, and the HMM model has a clear structure and is easy to understand and implement. It regards words in the text as observation values and entity types as hidden states. This modeling method directly maps the task requirements of named entity recognition; it can capture the contextual dependencies of entity labels in the sequence, and reflect the coherence and regularity of entity types through state transition probabilities. Using the hidden Markov model HMM to identify and classify entities from text includes the following steps:
[0072] A2.31. Build a dataset with entity labels. Each word in the dataset will be marked with a label.
[0073] A2.32. Estimate state transition probabilities and observation emission probabilities using the maximum likelihood estimation algorithm;
[0074] Among them, the maximum likelihood estimation algorithm is used to find the parameters that maximize the transition probability and emission probability. The maximum likelihood estimation is based on an intuitive principle, that is, to select those parameters that maximize the probability of the observed data. This method is easy to understand and can give reasonable parameter estimates in many cases; when the sample size is large enough, the maximum likelihood estimation is usually consistent, which means that as the sample size increases, the estimated parameters tend to the value of the true parameter; under the same sample size, the maximum likelihood estimation is more accurate, including the following steps:
[0075] A2.321. Traverse the data set and record the number of times the entity tag appears in each text data to calculate the transition probability denominator;
[0076] A2.322. Record the number of occurrences of each pair of adjacent entity labels to calculate the transition probability numerator;
[0077] A2.323. The words and their number of occurrences under each entity tag are used to calculate the emission probability;
[0078] A2.324. Convert the statistically obtained frequencies into probabilities to obtain the parameters of the HMM.
[0079] A2.33. Two parameters for training HMM: state transition probability and observation emission probability;
[0080] Furthermore, A2.331, the state transition probability describes the probability of transitioning from one state to another. In named entity recognition, states usually represent different entity types, specifically:
[0081]
[0082] Among them, i and j represent entity categories, a ij represents the entity category transition probability, N ij N represents the number of times entity category j appears immediately after entity category i; i Represents the total number of occurrences of entity category i;
[0083] A2.332 The observation emission probability describes the probability of observing a specific observation under a given state, specifically:
[0084]
[0085] Among them, b jk represents the probability of observing word k in the text under entity category j, N j,k N represents the number of times word k is observed in the text under the premise of entity category j; j Represents the total number of occurrences of entity category j;
[0086] A2.34. Use the Viterbi algorithm to find the entity tag sequence by inputting text data, and post-process the tag sequence output by the Viterbi algorithm through the usual advantage rule;
[0087] Among them, the common advantage rule is used to find the most likely hidden state sequence according to the dynamic rule, and the possible misclassification is screened out by setting the probability threshold. It has strict probability test and flexible probability adjustment to enhance the stability and quality of the final entity recognition result.
[0088] Furthermore, the Viterbi algorithm before post-processing the tag sequence includes the following steps:
[0089] A2.341. For the position t of the word in the initial text sequence, for each entity category i, calculate the entity label sequence from the initial category to category i, denoted as V t (i) specifically:
[0090] V t (i) = P(o t |q t =i)·P(q t =i)
[0091] Among them, q trepresents the entity category under the word position t in the text sequence, o t represents the observed state at word position t in the text sequence, P(o t |q t =i) represents the observed emission probability, P(q t =i) represents the initial state probability;
[0092] A2.342. For t>1, for each entity category j, calculate the cumulative maximum probability of entity category j and the most likely entity label sequence, denoted as V t (j) and Specifically:
[0093] V t (j) = max i [V t-1 (i)·P(q t =j|q t-1 =i)·P(o t |q t =j)]
[0094]
[0095] Among them, P(q t =j|q t-1 =i) is the state transition probability, which indicates the probability that entity category j appears immediately after entity category i;
[0096] A2.343. Find the entity category with the maximum cumulative probability through the word position T in the final text sequence, and trace back through Get the entire optimal entity tag sequence.
[0097] The Viterbi algorithm after post-processing the tag sequence by the usual advantage rule includes the following steps:
[0098] A2.344. Define a probability threshold θ, which is used to determine whether the probability of state transition and observation emission is high enough to be accepted;
[0099] A2.345. After the optimal entity label sequence is determined, traverse each step on the entity label sequence and check whether the transition probability from state i to state j and the corresponding observation probability are both higher than θ. If the probability of a transition or observation is lower than the threshold, mark the part of the path as pending.
[0100] A2.346. For the low-probability part of the mark, consider the transition probability and observation probability of the adjacent states, and use weighted average to adjust the probability value of this part;
[0101] A2.347. Check the consistency of the entire entity tag sequence again to ensure that the modified entity tag sequence is logically reasonable and does not violate domain knowledge or cause incoherent entity tag sequences;
[0102] A2.348. For the modified part, recalculate the cumulative probability of the entity label sequence to ensure that the modified entity label sequence still has a high confidence level;
[0103] A2.349. Based on the adjusted probability, reconfirm the optimal path and perform multiple iterations until there are no more low-probability parts to be processed.
[0104] A2.4. After identifying the entities, they are classified into the same categories, and the categories constitute the nodes in the knowledge graph.
[0105] Furthermore, the relationship between entities is identified and extracted through relationship extraction technology. By identifying the relationship between entities, relationship extraction technology helps to build and enrich the knowledge graph. By capturing the relationship between entities, relationship extraction enhances the understanding of text semantics, goes beyond simple keyword matching, and can more accurately parse the deep meaning of the text. The following steps are included:
[0106] B2.1. Collect a set of text data that has undergone entity recognition and extract features for each pair of entities in the text. The features include the location information, context words, and part-of-speech tags of the entity pairs.
[0107] B2.2. Select the random forest model for training and use it for relationship extraction;
[0108] Among them, a decision tree is constructed through a random forest model to identify the relationship between entities in the text. Random forest can reduce the overfitting problem that may occur in a single decision tree by constructing multiple decision trees and performing majority voting during prediction, making the model more stable and reliable when facing noisy data or outliers. Its training can be processed in parallel because each tree is constructed independently; this is especially important when processing large-scale data sets, which can greatly shorten the training time. The following steps are included:
[0109] B2.21. Preprocess text data to generate labeled data and divide the data into training data and test data, remove noise, process missing values, and unify text formats to ensure data quality and consistency;
[0110] B2.22. Extract semantic features from text as input to the random forest model;
[0111] B2.23. Use the training data to train the random forest model. During the training process, the model will learn how to predict the relationship between entities based on the input text features;
[0112] B2.24. Use the trained model to extract entity relationships from the text. The model will predict the relationship between entities based on the features of the input text, thereby achieving the goal of relationship extraction.
[0113] B2.3. Apply the trained random forest model to the unlabeled entity pairs. The model will output the predicted relationship type.
[0114] B2.4. Use the identified relationship types as edges to connect related entity nodes in the knowledge graph.
[0115] S3. Use knowledge fusion technology to integrate data information and build a complete knowledge graph;
[0116] In this embodiment, knowledge fusion technology is used to integrate data information from different sources, different formats and different semantic levels to build a complete knowledge graph. Knowledge fusion technology can bring together data from multiple channels, including structured, semi-structured and unstructured data, so as to build a more comprehensive and detailed knowledge graph, ensuring that the graph covers a wider range of topics and entities. By unifying data formats and semantics, knowledge fusion technology solves the differences between data sources, improves data consistency and interoperability, and enables data from different backgrounds to be seamlessly connected to form a coherent whole. Knowledge fusion technology can identify and connect implicit relationships between entities, even if these entities originally appear in completely different data sources, which helps to discover potential connections between data, enrich the connotation of the knowledge graph and improve its value, including the following steps:
[0117] S3.1. Associate the attribute values of the features identified by the relation extraction technology with the entity to form an attribute list of the entity;
[0118] S3.2. Unify the schema and definition of different data sources and integrate data from different sources;
[0119] The specific process is:
[0120] S3.21. Collect data sources, including beverage recipe reports, user preference reports, and beverage taste reports;
[0121] S3.22. Create a common ontology: define core concepts, including beverage recipes, users, and beverage flavors. Define attributes for each concept, including that beverage flavors have sour and sweet attributes. Define relationships. Users and beverage flavors may have a like relationship.
[0122] S3.23, map the beverage names in the beverage recipe report to the beverage recipe concepts in the ontology, map the user list attributes in the user favorite report to the user attributes of the ontology, and map the user favorites in the beverage flavor report to the like relationship of the ontology;
[0123] S3.3. Use the graph processing tool Neo4j to build a knowledge graph based on entities, attributes and relationships to achieve structured storage of data.
[0124] S4. Use collaborative filtering algorithm to filter out beverage recipes and flavors popular with users from the knowledge graph based on user historical preferences.
[0125] In this embodiment, a collaborative filtering algorithm is used to filter user preferences based on a knowledge graph. By combining the knowledge graph, the collaborative filtering algorithm can use the relationship between entities to recommend new products, even if these products do not have enough user feedback. The knowledge graph provides rich background information, such as ingredients, nutritional value, origin, etc. The collaborative filtering algorithm can use this information to enhance the accuracy of the recommendation, including the following steps:
[0126] S4.1. Obtain user behavior data from the knowledge graph, which includes the beverages consumed, behavior type, and timestamp;
[0127] S4.2. Create a matrix;
[0128] The rows represent users, the columns represent drinks, and the cell values represent the number of purchases;
[0129] S4.3, using cosine similarity to calculate the similarity between beverages and using logistic regression to predict the user's potential rating for untried beverages;
[0130] S4.4. Sort beverages according to the predicted scores, and filter out beverage recipes and flavors that are popular with users based on the relationships in the knowledge graph.
[0131] Embodiment 2:
[0132] This embodiment provides a beverage product design system based on a knowledge graph, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the above-mentioned beverage product design methods based on a knowledge graph.
[0133] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A beverage product design method based on knowledge graph, characterized in that: The following steps are involved: S1. Collect text data on raw material information, production process, and nutritional ingredients of beverages; S2. Use the IDF algorithm to identify entities in beverage data information, use the random forest model to extract relationships from the data, convert the data into nodes and edges in the knowledge graph, add weights for text features, and introduce a saturation function; In S2, the nodes in the graph are identified by entity recognition technology, including the following steps: A2.
1. Build a text dataset containing beverage product descriptions, ingredient lists, nutritional information, and user reviews, and preprocess the data. A2.
2. Use the IDF algorithm to extract features from the text. The features include part-of-speech tagging, contextual vocabulary, and location information. A saturation function is introduced to optimize the IDF algorithm. A2.
3. Use Hidden Markov Model (HMM) to identify entities in text; A2.
4. After identifying the entities, they are classified into the same categories, and the categories constitute the nodes in the knowledge graph; After adding text weight and introducing saturation function optimization, the IDF algorithm is: in, Indicative words, Represents text data, To weight the text features after introducing the saturation function, Expressive words In text data The word frequency in represents the word frequency value after the saturation function is introduced, Indicates the total amount of text data, Indicates the frequency of text data; S3. Use knowledge fusion technology to integrate data information and build a complete knowledge graph; S4. Use collaborative filtering algorithm to filter out beverage recipes and flavors popular with users from the knowledge graph based on user historical preferences.
2. The beverage product design method based on knowledge graph according to claim 1, characterized in that: In A2.2, the IDF algorithm before optimization is specifically: in, Indicative words, Represents text data, is the weighted text feature, Expressive words In text data The word frequency in Indicates the total amount of text data, Indicates the frequency of text data.
3. The beverage product design method based on knowledge graph according to claim 2 is characterized by: In A2.3, the hidden Markov model HMM is used to identify and classify entities from text, including the following steps: A2.
31. Build a dataset with entity labels. Each word in the dataset will be marked with a label. A2.
32. Estimate state transition probabilities and observation emission probabilities using the maximum likelihood estimation algorithm; A2.
33. Two parameters for training HMM: state transition probability and observation emission probability; A2.
34. Use the Viterbi algorithm to find the entity tag sequence by inputting text data, and post-process the tag sequence output by the Viterbi algorithm through the usual advantage rule.
4. The beverage product design method based on knowledge graph according to claim 3 is characterized by: In A2.33, the state transition probability and the observation emission probability are specifically: A2.331, State transition probability: in, and Represents the entity category, represents the entity category transition probability, Represented in entity class followed by the entity class The number of times; Represents entity category Total number of occurrences; A2.
332. Observed emission probability: in, Represented in entity class Observe that the word in the text The probability of Represented in entity class Under the premise, we observe that the word The number of times; Represents entity category The total number of occurrences.
5. The beverage product design method based on knowledge graph according to claim 4 is characterized in that: In S2, the associations between entities are identified and extracted by using the relationship extraction technology, including the following steps: B2.
1. Collect a set of text data that has undergone entity recognition and extract features for each pair of entities in the text. The features include the location information, context words, and part-of-speech tags of the entity pairs. B2.
2. Select the random forest model for training and use it for relationship extraction; B2.
3. Apply the trained random forest model to the unlabeled entity pairs. The model will output the predicted relationship type. B2.
4. Use the identified relationship types as edges to connect related entity nodes in the knowledge graph.
6. The beverage product design method based on knowledge graph according to claim 5 is characterized by: In B2.2, a decision tree is constructed by a random forest model to identify the relationship between entities in the text, including the following steps: B2.
21. Preprocess the text data to generate labeled data and divide the data into training data and test data; B2.
22. Extract semantic features from text as input to the random forest model; B2.
23. Train the random forest model using the training data; B2.
24. Use the trained model to extract entity relationships from text.
7. The beverage product design method based on knowledge graph according to claim 6 is characterized by: In S3, the data information from different sources, different formats and different semantic levels are integrated by using knowledge fusion technology to construct a complete knowledge graph, including the following steps: S3.
1. Associate the attribute values of the features identified by the relation extraction technology with the entity to form an attribute list of the entity; S3.
2. Unify the schema and definition of different data sources and integrate data from different sources; S3.
3. Use the graph processing tool Neo4j to build a knowledge graph based on entities, attributes and relationships.
8. The beverage product design method based on knowledge graph according to claim 7 is characterized in that: In S4, the collaborative filtering algorithm is used to filter user preferences according to the knowledge graph, including the following steps: S4.
1. Obtain user behavior data from the knowledge graph, which includes the beverages consumed, behavior type, and timestamp; S4.
2. Create a matrix; The rows represent users, the columns represent drinks, and the cell values represent the number of purchases; S4.3, using cosine similarity to calculate the similarity between beverages and using logistic regression to predict the user's potential rating for untried beverages; S4.
4. Sort beverages according to the predicted scores, and filter out beverage recipes and flavors that are popular with users based on the relationships in the knowledge graph.
9. A beverage product design system based on a knowledge graph, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes a computer program to implement the beverage product design method based on the knowledge graph as described in any one of claims 1-8.