Recommendation method, recommendation device, electronic device and storage medium
By converting the target data format and extracting features, combining a priori and posterior inference models, using knowledge graph technology to perform user preference inference, the problem of low recommendation accuracy is solved and personalized high-accuracy recommendation is achieved.
Patent Information
- Application Number
- CN202210582875.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-05-26
AI Technical Summary
The existing recommendation methods are not very accurate in user preference reasoning, which affects the accuracy of recommendations.
By obtaining the target data, format conversion and feature extraction, using a priori and posterior inference models for relationship prediction, combining knowledge graph technology for inference, and filtering out the target objects for recommendation.
Improve the accuracy and personalization of recommendations to meet users' access preferences.
Smart Images

Figure CN114896504B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a recommendation method, a recommendation device, an electronic device, and a storage medium. Background Art
[0002] Currently, the recommendation process often requires inferring user preferences based on user access data, and then selecting candidate objects that meet user needs for recommendation based on the inference results. However, the recommendation methods of related technologies often have the problem of low inference accuracy, which affects the accuracy of recommendations. Therefore, how to improve the accuracy of recommendations has become a technical problem that needs to be solved urgently. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to provide a recommendation method, a recommendation device, an electronic device and a storage medium, aiming to improve the accuracy of recommendations.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a recommendation method, which includes:
[0005] Acquire target data, where the target data is access data of a target user;
[0006] Performing format conversion on the target data to obtain target triplet data;
[0007] Performing feature extraction on the target triple data to obtain entity reasoning features;
[0008] Performing a first relationship prediction on the entity reasoning feature through a preset priori reasoning model to obtain first prediction data;
[0009] Performing a second relationship prediction on the entity reasoning feature through a preset posterior reasoning model to obtain second prediction data;
[0010] Obtaining target inference data based on the first prediction data and the second prediction data;
[0011] The preset candidate objects are screened according to the target inference data to obtain a target object, and the target object is pushed to the target user.
[0012] In some embodiments, the target data includes structured data and unstructured data, the target triple data includes first triple data and second triple data, and the step of formatting the target data to obtain the target triple data includes:
[0013] Performing format conversion on the structured data according to a preset format type to obtain the first triplet data;
[0014] Feature extraction is performed on the unstructured data using a preset knowledge extraction model to obtain triple features, and the second triple data is constructed based on the triple features.
[0015] In some embodiments, the entity inference feature includes a first entity feature and a second entity feature, and the step of extracting features from the target triple data to obtain the entity inference feature includes:
[0016] Performing character matching on the target triple data using a preset entity dictionary to obtain the first entity feature;
[0017] The target triplet data is subjected to feature extraction through a preset sequence prediction model to obtain the second entity feature.
[0018] In some embodiments, the step of performing a first relationship prediction on the entity reasoning feature using a preset priori reasoning model to obtain first prediction data includes:
[0019] Constructing a relationship between each two entity reasoning features to obtain an initial entity pair;
[0020] Perform entity alignment on the initial entity pairs using the knowledge base of the prior reasoning model to obtain target entity pairs;
[0021] Compare and analyze the target entity pair with the reference entity pair to obtain the first prediction data.
[0022] In some embodiments, the step of performing a second relationship prediction on the entity reasoning feature using a preset posterior inference model to obtain second prediction data includes:
[0023] Obtaining candidate matching features corresponding to the entity reasoning features, wherein the candidate matching features include candidate relationship features or candidate entity features;
[0024] The entity reasoning feature and the candidate matching feature are predicted and processed through the ternary knowledge graph of the posterior reasoning model to obtain the second prediction data.
[0025] In some embodiments, the step of obtaining target inference data based on the first prediction data and the second prediction data includes:
[0026] Comparing and analyzing the first prediction data and the second prediction data to obtain an analysis result;
[0027] If the analysis result shows that the first prediction data and the second prediction data are the same, using the first prediction data or the second prediction data as target inference data;
[0028] If the analysis result is that the first prediction data and the second prediction data are different, the priorities of the first prediction data and the second prediction data are obtained, and the first prediction data or the second prediction data is used as target inference data according to the priorities.
[0029] In some embodiments, the target data includes structured data and unstructured data, and the step of obtaining the target data includes:
[0030] Crawling a preset data source through a web crawler to obtain the unstructured data;
[0031] The structured data is obtained from the target database through a preset API interface.
[0032] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a recommendation device, comprising:
[0033] A data acquisition module is used to acquire target data, wherein the target data is access data of a target user;
[0034] a format conversion module, configured to perform format conversion on the target data to obtain target triplet data;
[0035] A feature extraction module is used to extract features from the target triple data to obtain entity reasoning features;
[0036] A first prediction module, configured to perform a first relationship prediction on the entity reasoning feature using a preset priori reasoning model to obtain first prediction data;
[0037] A second prediction module is used to perform a second relationship prediction on the entity reasoning feature through a preset posterior reasoning model to obtain second prediction data;
[0038] a comparison module, configured to obtain target inference data based on the first prediction data and the second prediction data;
[0039] The recommendation module is used to screen the preset candidate objects according to the target inference data to obtain the target object, and push the target object to the target user.
[0040] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored on the memory and runnable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the method described in the first aspect above is implemented.
[0041] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the first aspect above.
[0042] The recommendation method, recommendation device, electronic device and storage medium proposed in the present application obtain target data, convert the format of the target data to obtain target triple data; and extract features from the target triple data to obtain entity reasoning features. By converting the target user's access data into triple data, the concept of knowledge graph is integrated into the reasoning process, so that sentence relationships can be reasoned based on entity features, thereby improving the reasoning accuracy. Furthermore, a first relationship prediction is performed on the entity reasoning features using a preset a priori reasoning model to obtain first prediction data; a second relationship prediction is performed on the entity reasoning features using a preset a posteriori reasoning model to obtain second prediction data; and target reasoning data is obtained based on the first prediction data and the second prediction data. This method combines a priori reasoning and a posteriori reasoning, which can effectively improve the accuracy of the reasoning results. Finally, the preset candidate objects are screened and processed according to the target reasoning data to obtain the target object, and the target object is pushed to the target user. Targeted recommendations can be made based on the target user's access preferences, meeting the personalized needs of recommendations and improving the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flowchart of the recommended method provided in the embodiment of the present application;
[0044] Figure 2 yes Figure 1 Flowchart of step S101 in FIG.
[0045] Figure 3 yes Figure 1 Flowchart of step S102 in FIG.
[0046] Figure 4 yes Figure 1 Flowchart of step S103 in FIG.
[0047] Figure 5 yes Figure 1 Flowchart of step S104 in FIG.
[0048] Figure 6 yes Figure 1 Flowchart of step S105 in FIG.
[0049] Figure 7 yes Figure 1 Flowchart of step S106 in FIG.
[0050] Figure 8 It is a structural diagram of the recommended device provided in the embodiment of the present application;
[0051] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0053] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0055] First, let’s analyze some of the terms used in this application:
[0056] Artificial Intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and create new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses theories, methods, technologies, and application systems that use digital computers or digital computer-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0057] Natural Language Processing (NLP): NLP uses computers to process, understand, and apply human languages (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0058] Information Extraction: A text processing technology that extracts specified types of entity, relationship, event, and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data is all text information extraction. Of course, the information extracted by text information extraction technology can be of various types.
[0059] The conditional random field algorithm (CRF) is a mathematical algorithm that combines the characteristics of the maximum entropy model and the hidden Markov model. It is an undirected graph model that has achieved excellent results in recent years in sequence labeling tasks such as word segmentation, part-of-speech tagging, and named entity recognition. The conditional random field is a typical discriminant model, and its joint probability can be expressed as the product of several potential functions, the most commonly used of which is the linear chain conditional random field. If x = (x1, x2, ... xn) represents the observed input data sequence and y = (y1, y2, ... yn) represents a state sequence, given an input sequence, the linear chain CRF model defines the joint conditional probability of the state sequence as p(y|x) = exp{}(2-14); Z(x) = {}(2-15), where Z is the probability normalization factor conditioned on the observation sequence x, and fj(yi-1, yi, x, i) is an arbitrary feature function.
[0060] BERT (Bidirectional Encoder Representations from Transformers): is a language representation model. BERT uses Transformer Encoder blocks for connection and is a typical bidirectional encoding model. The BERT model can further increase the generalization ability of word vector models, fully describing the characteristics of character-level, word-level, sentence-level and even inter-sentence relations, and is built based on Transformer. There are three types of embeddings in BERT, namely Token Embedding, Segment Embedding, and Position Embedding; Token Embeddings are word vectors, and the first word is the CLS mark, which can be used for subsequent classification tasks; Segment Embeddings are used to distinguish between two sentences, because pre-training not only does LM but also does classification tasks with two sentences as input; Position Embeddings, the position word vector here is not the trigonometric function in Transfor, but is learned by BERT through training. However, BERT directly trains a position embedding to retain position information. It randomly initializes a vector for each position, adds it to the model training, and finally obtains an embedding containing position information. Finally, in terms of the combination of this position embedding and word embedding, BERT chooses to directly splice them.
[0061] The knowledge graph is a modern theory that achieves multidisciplinary integration by combining theories and methods from applied mathematics, graphics, information visualization, and information science with methods like citation analysis and co-occurrence analysis. The concept uses visual graphs to vividly display the core structure, development history, cutting-edge fields, and overall knowledge architecture of a discipline. The primary goal of a knowledge graph is to describe various entities and concepts in the real world, as well as the strong relationships between them. Relationships are used to describe the association between two entities. From a web perspective, a knowledge graph, like hyperlinks between simple text, supports semantic search by establishing semantic links between data. From a natural language processing perspective, a knowledge graph extracts semantic and structured data from text. From an artificial intelligence perspective, a knowledge graph is a tool that uses knowledge bases to assist in understanding human language. From a database perspective, a knowledge graph is a method for storing knowledge using graphs. A knowledge graph is a relatively general formal description framework for semantic knowledge, using nodes to represent semantic symbols and edges to represent relationships between semantics. Knowledge graphs aim to describe various entities or concepts in the real world and their relationships. They form a vast semantic network diagram, with nodes representing entities or concepts and edges consisting of attributes or relationships. Knowledge graphs are now used to refer to a wide range of large-scale knowledge bases. Knowledge graphs, also known as semantic networks, have driven graph-based knowledge representation since its early days. For example, in the development of the RDF standard, such graph-based knowledge representation systems use entities as nodes and links between nodes as relationships. When building knowledge graphs, text vectorization is often necessary, leading to the emergence of Word2Vec, a text-based language model. Word2Vec uses a shallow neural network language model to represent each word as a vector. By constructing input, mapping, and output layers, the neural network learns to predict the words with the highest probability of appearing in the context of a word. Text is converted into vectors in an n-dimensional vector space through training on a text vocabulary, and the cosine similarity in this space is used to represent the semantic proximity of words.
[0062] Entity: A distinct, independently existing thing. Examples include a person, a city, a plant, or a commodity. Everything in the world is composed of specific things, referred to as entities. Entities are the most basic elements in a knowledge graph, and different entities have different relationships with each other.
[0063] Concept: A collection of entities of a certain type.
[0064] Semantic class (concept): A collection of entities with similar characteristics, such as countries, ethnic groups, books, computers, etc. Concepts mainly refer to collections, categories, object types, and types of things, such as people and geography.
[0065] Relationship: A relationship between entities, between concepts, or between concepts and entities. A relationship is formalized as a function that maps k nodes to a Boolean value. In a knowledge graph, a relationship is a function that maps k graph nodes (entities, semantic classes, attribute values) to Boolean values.
[0066] Triples: Triples ({E, R}) are a common representation of knowledge graphs; basic triples include (entity 1 - relationship - entity 2) and (entity - attribute - attribute value). Each entity (the extension of a concept) can be identified by a globally unique ID, each attribute-value pair (AVP) can be used to characterize the intrinsic characteristics of an entity, and a relationship can be used to connect two entities and characterize the relationship between them. For example, in a knowledge graph, China is an entity, Beijing is an entity, and China-capital-Beijing is an example of an (entity-relationship-entity) triple.
[0067] Currently, the recommendation process often requires inferring user preferences based on user access data, and then selecting candidate objects that meet user needs for recommendation based on the inference results. However, the recommendation methods of related technologies often have the problem of low inference accuracy, which affects the accuracy of recommendations. Therefore, how to improve the accuracy of recommendations has become a technical problem that needs to be solved urgently.
[0068] Based on this, embodiments of the present application provide a recommendation method, a recommendation device, an electronic device, and a storage medium, aiming to improve the accuracy of recommendations.
[0069] The recommendation method, recommendation device, electronic device, and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the recommendation method in the embodiments of the present application is described.
[0070] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0071] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0072] The recommendation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The recommendation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms; the software can be an application that implements the recommendation method, etc., but is not limited to the above forms.
[0073] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0074] Figure 1 This is an optional flowchart of the recommended method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S107.
[0075] Step S101, obtaining target data, which is the access data of the target user;
[0076] Step S102, converting the target data into a format to obtain target triplet data;
[0077] Step S103, extracting features from the target triplet data to obtain entity reasoning features;
[0078] Step S104, performing a first relationship prediction on the entity reasoning feature using a preset priori reasoning model to obtain first prediction data;
[0079] Step S105, performing a second relationship prediction on the entity reasoning feature using a preset posterior reasoning model to obtain second prediction data;
[0080] Step S106, obtaining target inference data based on the first prediction data and the second prediction data;
[0081] Step S107 , screening the preset candidate objects according to the target inference data to obtain the target object, and pushing the target object to the target user.
[0082] In the steps S101 to S107 shown in the embodiment of the present application, by acquiring the target data and converting the format of the target data to obtain the target triple data; and extracting the features of the target triple data to obtain the entity reasoning features, it is possible to convert the target user's access data into triple data and integrate the concept of the knowledge graph into the reasoning process, so that the sentence relationship can be inferred based on the entity features, thereby improving the reasoning accuracy. Furthermore, the entity reasoning features are predicted to have a first relationship through a preset a priori reasoning model to obtain the first prediction data; the entity reasoning features are predicted to have a second relationship through a preset a posteriori reasoning model to obtain the second prediction data; and the target reasoning data is obtained based on the first prediction data and the second prediction data. This method combines a priori reasoning and a posteriori reasoning, so that the a priori reasoning and the a posteriori reasoning can complement each other and effectively improve the accuracy of the reasoning results. Finally, the preset candidate objects are screened and processed according to the target reasoning data to obtain the target object, and the target object is pushed to the target user. It can be recommended in a targeted manner according to the target user's access preferences, meet the personalized needs of the recommendation, and improve the accuracy of the recommendation.
[0083] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's target personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0084] See also Figure 2 In some embodiments, the target data includes structured data and unstructured data, and step S101 may include but is not limited to steps S201 to S202:
[0085] Step S201: crawling a preset data source using a web crawler to obtain unstructured data;
[0086] Step S202: Obtain structured data from the target database through a preset API interface.
[0087] In step S201 of some embodiments, a web crawler can be written, and after setting up a data source, the data from the data source can be crawled in a targeted manner to obtain unstructured data. Unstructured data can also be obtained through other means, but is not limited to these. The data source can be various types of online platforms, and the unstructured data includes encyclopedias, news, consultations, and articles in different fields. For example, in the medical field, unstructured data can include popular science articles and news consultations on health topics, disease descriptions, symptom descriptions, and cause descriptions.
[0088] In step S202 of some embodiments, the target database may be a relational database constructed based on relationships between existing entities. These target databases are linked via pre-defined APIs, and corresponding structured data is directly extracted from the target databases. The structured data primarily includes entity features in different fields and the relationships between entity features. For example, in the medical and insurance fields, structured data includes data on common disease entities, the relationships between diseases and symptoms, the relationships between diseases and insurance products, and the relationships between insurance products and benefits.
[0089] See also Figure 3 In some embodiments, the target data includes structured data and unstructured data, the target triple data includes first triple data and second triple data, and step S102 may include but is not limited to steps S301 to S302:
[0090] Step S301, converting the structured data into a format according to a preset format type to obtain first triplet data;
[0091] Step S302 : extracting features from the unstructured data using a preset knowledge extraction model to obtain triple features, and constructing second triple data based on the triple features.
[0092] In some embodiments, in step S301, the preset format type is a triplet format, specifically expressed as (first entity -> relationship -> second entity). Structured data (e.g., the relationship between a disease and an insurance product) is directly converted into a triplet representation to obtain first triplet data. For example, the triplet format of hypertension and insurance product can be expressed as (hypertension - disease insurance - insurance product).
[0093] In step S302 of some embodiments, a knowledge extraction model may be constructed based on a pipeline approach, wherein the knowledge extraction model includes an entity extraction layer and a relationship recognition layer. Part-of-speech tags are used to tag unstructured data using the part-of-speech categories of the entity extraction layer. Classification processing is performed on the unstructured data based on the tagged part-of-speech tags to obtain triple features corresponding to each part-of-speech tag. The part-of-speech tags may include subject tags, predicate tags, object tags, etc. The relationship recognition layer then combines the triple features with different part-of-speech tags to obtain second triple data.
[0094] In some specific embodiments, each triple in the target triple data includes a first entity A, a second entity B, and a relationship between the first entity A and the second entity B. For example, characteristic information such as a symptom analysis of a disease and related insurance products can be represented as a triple. More specifically, as shown in Table 1, the two triples extracted from the corresponding entity "hypertension" are represented in the form of (first entity->relationship->second entity): (hypertension-disease analysis-hypertension symptoms), (hypertension-disease insurance-insurance products). In the first triple, the first entity A is "hypertension", the relationship is "disease analysis", and the second entity B is "hypertension symptoms"; in the second triple, the first entity A is "hypertension", the relationship is "disease insurance", and the second entity B is "insurance products".
[0095]
[0096] Table 1
[0097] See also Figure 4 In some embodiments, the entity inference feature includes a first entity feature and a second entity feature. Step S103 may include, but is not limited to, steps S401 to S402:
[0098] Step S401, character matching is performed on the target triple data using a preset entity dictionary to obtain a first entity feature;
[0099] Step S402: extracting features from the target triplet data using a preset sequence prediction model to obtain second entity features.
[0100] In step S401 of some embodiments, an entity dictionary is constructed based on existing entity features, that is, the existing entity features are included in the same set to obtain an entity dictionary, the target triples are segmented into character forms to obtain triple segments, each triple segment is input into the entity dictionary, the entity features in the entity dictionary are matched with the triple segments to obtain a first entity feature, wherein the first entity feature is an entity feature in the entity dictionary whose similarity with the triple segment is greater than a preset threshold.
[0101] In step S402 of some embodiments, the sequence prediction model is trained based on machine learning. For example, the sequence prediction model can be constructed based on a conditional random field algorithm (CRF) or a neural network model. Specifically, the sequence prediction model can be constructed based on the conditional random field algorithm and the BERT model. Specifically, the target triple data is encoded by the encoding layer of the sequence prediction model (the encoding layer is composed of the BERT model) to obtain a triple vector, and then the conditional random field algorithm is used to calculate the transition probability of the context relationship of the triple vector, so as to extract the entity feature according to the size of the transition probability to obtain the second entity feature.
[0102] In a specific application scenario, the first entity feature and the second entity feature may be a person's name, a place name, an organization name, a business term, etc., without limitation.
[0103] See also Figure 5 In some embodiments, step S104 may include but is not limited to steps S501 to S503:
[0104] Step S501: construct a relationship between every two entity inference features to obtain an initial entity pair;
[0105] Step S502, performing entity alignment on the initial entity pairs using the knowledge base of the prior reasoning model to obtain the target entity pairs;
[0106] Step S503 : performing a comparison analysis on the target entity pair and the reference entity pair to obtain first prediction data.
[0107] In step S501 of some embodiments, a relationship may be constructed between each two entity inference features using a preset relationship rule or bootstrap technology to obtain an initial entity pair. Specifically, an entity inference feature is extracted from one target triple data set, and another entity inference feature is extracted from another target triple data set. A relationship row list of these two entity inference features is constructed using bootstrap technology, and the row and column features of this relationship row list are combined to obtain an initial entity pair.
[0108] In step S502 of some embodiments, the above-mentioned knowledge base is formed by extracting the collected data, performing structured processing on the extracted data, and storing the structured data in a certain set in the form of triples. Feature matching is performed on the two entity reasoning features in the initial entity pair based on the knowledge base. Specifically, the correlation between the two entity reasoning features in the initial entity pair is analyzed based on the entity features in the knowledge base and the relationship between the entity features. If the same two entity reasoning features are associated in the knowledge base, it is considered that the correlation between the two entity reasoning features in the initial entity pair is high, and this initial entity pair is used as the target entity pair; if the same two entity reasoning features are not associated in the knowledge base, it is considered that the correlation between the two entity reasoning features in the initial entity pair is low, and this initial entity pair is not used as the target entity pair.
[0109] In step S503 of some embodiments, a similarity is calculated between the target entity pair and the reference entity pair using a preset similarity algorithm, wherein the similarity algorithm may be a cosine similarity algorithm, etc. The calculated similarity reflects whether the entities in the target entity pair and the reference entity pair are the same entity. If the similarity is greater than a preset similarity threshold, the target entity pair and the entities in the reference entity pair are considered to be the same entity, and the entities of the reference entity pair and the relationships between the entities are extracted to obtain a priori results, which are used as the first prediction data. For example, in the medical field or the insurance field, if the similarity between the target entity pair and the reference entity pair is greater than a preset similarity threshold, the corresponding reference entity pair, such as the verification relationship between the disease and the symptom, the disease and the insurance product, and the insurance product and the guarantee, is referenced as the priori result (i.e., the first prediction data).
[0110] Through the above steps S501 to S503, deterministic a priori reasoning can be performed on known entity pairs through the knowledge base of the a priori reasoning model, thereby extracting entity features and the causal relationship between entity features, thereby obtaining a priori results, and using the a priori results as the first prediction data. This method can be analyzed through existing entity relationships, saving the model's computing cost and computing time. Since the reference entity pairs can be obtained from the existing relationship library, the data source is more authoritative, which can effectively improve the accuracy of the prediction.
[0111] See also Figure 6 In some embodiments, step S105 includes but is not limited to steps S601 to S602:
[0112] Step S601, obtaining candidate matching features corresponding to entity reasoning features, wherein the candidate matching features include candidate relationship features or candidate entity features;
[0113] Step S602: Predict the entity reasoning features and the candidate matching features through the ternary knowledge graph of the posterior reasoning model to obtain second prediction data.
[0114] In step S601 of some embodiments, candidate entity features corresponding to entity reasoning features are obtained from an entity feature set or a relationship set, or candidate relationship features corresponding to entity reasoning features are obtained from a relationship set. Based on the causal relationship of the triples, an unknown third feature can be inferred from the two obtained features (entity reasoning features and candidate relationship features, or entity reasoning features and candidate entity features).
[0115] In step S602 of some embodiments, the ternary knowledge graph can be represented as G = {E, R, F}, where E represents the set of all entity features, R represents the set of all relationships, that is, the relationship features between entity features, and F is the set of all triples. The triples in this set of triples are represented in the form of (first entity -> relationship -> second entity). These triples can be obtained from an existing entity feature relationship library. Based on the ternary knowledge graph, only the entity inference feature and the corresponding candidate matching feature need to be obtained to infer another feature.
[0116] For example, given the first entity feature a and the relationship R, the second entity feature b can be predicted based on the above-mentioned ternary knowledge graph. For example, given the first entity feature a is hypertension and the relationship is disease insurance, the second entity feature b can be predicted to be an insurance product related to hypertension. Given the second entity feature b and the relationship R, the first entity feature a can also be predicted based on the above-mentioned ternary knowledge graph. For example, given the second entity feature b is a symptom of coronary heart disease and the relationship is disease, the first entity a can be predicted to be coronary heart disease. Given the first entity feature a and the second entity feature b, the unknown relationship R can also be predicted based on the above-mentioned ternary knowledge graph. For example, given the first entity feature a is a vehicle accident and the second entity feature b is a vehicle-related insurance product, the relationship R can be predicted to be vehicle insurance.
[0117] Through the above steps S601 and S602, non-deterministic posterior reasoning can be performed on the two known features through the ternary knowledge graph of the posterior reasoning model, so as to predict the entity features and the causal relationship between the entity features, thereby obtaining the posterior result, and using the posterior result as the second prediction data. This method can supplement the prior results and improve the comprehensiveness of the prediction.
[0118] See also Figure 7 In some embodiments, step S106 may include but is not limited to steps S701 to S703:
[0119] Step S701, comparing and analyzing the first prediction data and the second prediction data to obtain an analysis result;
[0120] Step S702: If the analysis result shows that the first predicted data and the second predicted data are the same, the first predicted data or the second predicted data is used as the target inference data;
[0121] Step S703: If the analysis result shows that the first prediction data and the second prediction data are different, the priorities of the first prediction data and the second prediction data are obtained, and the first prediction data or the second prediction data is used as the target inference data according to the priority.
[0122] In step S701 of some embodiments, a comparison analysis is performed on the first prediction data and the second prediction data to determine whether the entity features and the relationship between the entity features in the first prediction data and the second prediction data are the same, thereby obtaining an analysis result.
[0123] In step S702 of some embodiments, if the analysis result is that the first prediction data (prior result) and the second prediction data (posterior result) are the same, it indicates that the entity features and the relationship between the entity features in the first prediction data and the second prediction data are consistent, that is, the prior result and the posterior result are the same, and the first prediction data or the second prediction data can be used as the target inference data.
[0124] In step S703 of some embodiments, if the analysis result is that the first prediction data (prior result) and the second prediction data (posterior result) are different, it indicates that the entity features and the relationship between the entity features in the first prediction data and the second prediction data are inconsistent, or the first prediction data cannot characterize the entity features and the relationship between the entity features, the priority of the first prediction data and the second prediction data is obtained, and the first prediction data or the second prediction data is used as the target inference data according to the priority.
[0125] Furthermore, since the prior results are more authoritative and accurate, in order to improve the reasoning accuracy, when the first prediction data and the second prediction data are different, the entity features in the first prediction data and the relationship between the entity features are generally preferred as the target reasoning data.
[0126] In step S107 of some embodiments, entity features corresponding to the target inference data and relationship features between the entity features are extracted, preset candidate objects are screened according to the entity features and the relationship features between the entity features, candidate objects containing the entity features and the relationship features are selected as target objects, and the target objects are pushed to the target user.
[0127] Furthermore, when a large number of target objects are obtained after screening, some of the target objects can be selected and pushed to target users according to actual business needs.
[0128] The recommendation method of the embodiment of the present application obtains target data, converts the format of the target data, and obtains target triple data; and extracts features from the target triple data to obtain entity reasoning features. By converting the target user's access data into triple data, the concept of the knowledge graph is integrated into the reasoning process, so that sentence relationships can be reasoned based on entity features, thereby improving the reasoning accuracy. Furthermore, a first relationship prediction is performed on the entity reasoning features through a preset a priori reasoning model to obtain first prediction data; a second relationship prediction is performed on the entity reasoning features through a preset a posteriori reasoning model to obtain second prediction data; and target reasoning data is obtained based on the first prediction data and the second prediction data. This method combines a priori reasoning and a posteriori reasoning, so that the a priori reasoning and the a posteriori reasoning can complement each other and effectively improve the accuracy of the reasoning results. Finally, the preset candidate objects are screened and processed according to the target reasoning data to obtain the target object, and the target object is pushed to the target user. Targeted recommendations can be made based on the target user's access preferences, meeting the personalized needs of recommendations and improving the accuracy of recommendations.
[0129] See also Figure 8 , the embodiment of the present application further provides a recommendation device that can implement the above-mentioned recommendation method, the device comprising:
[0130] The data acquisition module 801 is used to acquire target data, which is the access data of the target user;
[0131] The format conversion module 802 is used to convert the target data into a format to obtain target triplet data;
[0132] Feature extraction module 803, used to extract features from target triple data to obtain entity reasoning features;
[0133] A first prediction module 804 is configured to perform a first relationship prediction on the entity reasoning feature using a preset priori reasoning model to obtain first prediction data;
[0134] A second prediction module 805 is configured to perform a second relationship prediction on the entity reasoning feature using a preset posterior reasoning model to obtain second prediction data;
[0135] A comparison module 806 is configured to obtain target inference data based on the first prediction data and the second prediction data;
[0136] The recommendation module 807 is used to screen the preset candidate objects according to the target inference data, obtain the target object, and push the target object to the target user.
[0137] In some embodiments, the target data includes structured data and unstructured data, and the data acquisition module 801 includes:
[0138] A data crawling unit is used to crawl data from a preset data source through a web crawler to obtain unstructured data;
[0139] The acquisition unit is used to obtain structured data from the target database through a preset API interface.
[0140] In some embodiments, the target data includes structured data and unstructured data, the target triple data includes first triple data and second triple data, and the format conversion module 802 includes:
[0141] a conversion unit, configured to perform format conversion on the structured data according to a preset format type to obtain first triplet data;
[0142] The feature extraction unit is used to extract features from unstructured data through a preset knowledge extraction model to obtain triple features and construct second triple data based on the triple features.
[0143] In some embodiments, the entity inference feature includes a first entity feature and a second entity feature, and the feature extraction module 803 includes:
[0144] A character matching unit, configured to perform character matching on the target triple data using a preset entity dictionary to obtain a first entity feature;
[0145] The feature extraction unit is used to extract features from the target triple data using a preset sequence prediction model to obtain a second entity feature.
[0146] In some embodiments, the first prediction module 804 includes:
[0147] The relationship construction unit is used to construct the relationship between each two entity reasoning features to obtain the initial entity pair;
[0148] The entity alignment unit is used to align the initial entity pairs using the knowledge base of the prior reasoning model to obtain the target entity pairs;
[0149] The comparison unit is used to compare and analyze the target entity pair with the reference entity pair to obtain first prediction data.
[0150] In some embodiments, the second prediction module 805 includes:
[0151] A feature acquisition unit, configured to acquire candidate matching features corresponding to entity reasoning features, wherein the candidate matching features include candidate relationship features or candidate entity features;
[0152] The prediction unit is used to predict the entity reasoning features and the candidate matching features through the ternary knowledge graph of the posterior reasoning model to obtain second prediction data.
[0153] In some embodiments, the comparison module 806 includes:
[0154] An analysis unit, configured to compare and analyze the first prediction data and the second prediction data to obtain an analysis result;
[0155] a first determining unit, configured to use the first predicted data or the second predicted data as target inference data if the analysis result shows that the first predicted data and the second predicted data are the same;
[0156] The second determining unit is used to obtain the priority of the first prediction data and the second prediction data if the analysis result shows that the first prediction data and the second prediction data are different, and use the first prediction data or the second prediction data as the target inference data according to the priority.
[0157] The specific implementation of the recommendation device is basically the same as the specific embodiment of the recommendation method described above, and will not be repeated here.
[0158] The present application also provides an electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, the aforementioned recommended method is implemented. The electronic device may be any intelligent terminal, such as a tablet computer or an in-vehicle computer.
[0159] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0160] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0161] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the recommended method of the embodiments of this application;
[0162] Input / output interface 903, used to implement information input and output;
[0163] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0164] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );
[0165] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0166] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned recommended method.
[0167] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The recommendation method, recommendation device, electronic device and storage medium provided in the embodiment of the present application obtain target data, convert the format of the target data to obtain target triple data; and extract features from the target triple data to obtain entity reasoning features. By converting the access data of the target user into triple data, the concept of the knowledge graph is integrated into the reasoning process, so that sentence relationships can be reasoned based on entity features, thereby improving the reasoning accuracy. Furthermore, a first relationship prediction is performed on the entity reasoning features through a preset a priori reasoning model to obtain first prediction data; a second relationship prediction is performed on the entity reasoning features through a preset a posteriori reasoning model to obtain second prediction data; and target reasoning data is obtained based on the first prediction data and the second prediction data. This method combines a priori reasoning and a posteriori reasoning, so that the a priori reasoning and the a posteriori reasoning can complement each other and effectively improve the accuracy of the reasoning results. Finally, the preset candidate objects are screened and processed according to the target reasoning data to obtain the target object, and the target object is pushed to the target user. It can make targeted recommendations based on the access preferences of the target user, meet the personalized needs of the recommendation, and improve the accuracy of the recommendation.
[0169] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0170] It will be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or a combination of certain steps, or different steps.
[0171] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0172] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0173] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0174] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0175] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0176] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0179] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A recommendation method, characterized in that: The method comprises: Acquire target data, where the target data is access data of a target user; Performing format conversion on the target data to obtain target triplet data; Performing feature extraction on the target triple data to obtain entity reasoning features; Performing a first relationship prediction on the entity reasoning feature through a preset priori reasoning model to obtain first prediction data; Performing a second relationship prediction on the entity reasoning feature through a preset posterior reasoning model to obtain second prediction data; Obtaining target inference data based on the first prediction data and the second prediction data; Screening preset candidate objects according to the target inference data to obtain a target object, and pushing the target object to the target user; The performing a first relationship prediction on the entity reasoning feature by using a preset priori reasoning model to obtain first prediction data includes: Constructing a relationship between each two entity reasoning features to obtain an initial entity pair; Perform entity alignment on the initial entity pairs using the knowledge base of the prior reasoning model to obtain target entity pairs; Comparing and analyzing the target entity pair with the reference entity pair to obtain the first prediction data; The performing a second relationship prediction on the entity reasoning feature by using a preset posterior reasoning model to obtain second prediction data includes: Obtaining candidate matching features corresponding to the entity reasoning features, wherein the candidate matching features include candidate relationship features or candidate entity features; The entity reasoning feature and the candidate matching feature are predicted and processed through the ternary knowledge graph of the posterior reasoning model to obtain the second prediction data.
2. The recommendation method according to claim 1, characterized in that The target data includes structured data and unstructured data, the target triple data includes first triple data and second triple data, and the step of performing format conversion on the target data to obtain the target triple data includes: Performing format conversion on the structured data according to a preset format type to obtain the first triplet data; Feature extraction is performed on the unstructured data using a preset knowledge extraction model to obtain triple features, and the second triple data is constructed based on the triple features.
3. The recommendation method according to claim 1, characterized in that: The entity reasoning feature includes a first entity feature and a second entity feature. The step of extracting features from the target triple data to obtain the entity reasoning feature includes: Performing character matching on the target triple data using a preset entity dictionary to obtain the first entity feature; The target triplet data is subjected to feature extraction through a preset sequence prediction model to obtain the second entity feature.
4. The recommendation method according to claim 1, characterized in that: The step of obtaining target inference data based on the first prediction data and the second prediction data includes: Comparing and analyzing the first prediction data and the second prediction data to obtain an analysis result; If the analysis result shows that the first prediction data and the second prediction data are the same, using the first prediction data or the second prediction data as target inference data; If the analysis result is that the first prediction data and the second prediction data are different, the priorities of the first prediction data and the second prediction data are obtained, and the first prediction data or the second prediction data is used as target inference data according to the priorities.
5. The recommendation method according to any one of claims 1 to 4, characterized in that: The target data includes structured data and unstructured data, and the step of obtaining the target data includes: Crawling a preset data source through a web crawler to obtain the unstructured data; The structured data is obtained from the target database through a preset API interface.
6. A recommendation device, characterized in that: The device comprises: A data acquisition module is used to acquire target data, wherein the target data is access data of a target user; a format conversion module, configured to perform format conversion on the target data to obtain target triplet data; A feature extraction module is used to extract features from the target triple data to obtain entity reasoning features; A first prediction module, configured to perform a first relationship prediction on the entity reasoning feature using a preset priori reasoning model to obtain first prediction data; A second prediction module is used to perform a second relationship prediction on the entity reasoning feature through a preset posterior reasoning model to obtain second prediction data; a comparison module, configured to obtain target inference data based on the first prediction data and the second prediction data; A recommendation module is used to screen preset candidate objects according to the target inference data to obtain a target object, and push the target object to the target user; The performing a first relationship prediction on the entity reasoning feature by using a preset priori reasoning model to obtain first prediction data includes: Constructing a relationship between each two entity reasoning features to obtain an initial entity pair; Perform entity alignment on the initial entity pairs using the knowledge base of the prior reasoning model to obtain target entity pairs; Comparing and analyzing the target entity pair with the reference entity pair to obtain the first prediction data; The performing a second relationship prediction on the entity reasoning feature by using a preset posterior reasoning model to obtain second prediction data includes: Obtaining candidate matching features corresponding to the entity reasoning features, wherein the candidate matching features include candidate relationship features or candidate entity features; The entity reasoning feature and the candidate matching feature are predicted and processed through the ternary knowledge graph of the posterior reasoning model to obtain the second prediction data.
7. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the recommended method according to any one of claims 1 to 5 are implemented.
8. A storage medium, which is a computer-readable storage medium and is used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of the recommendation methods according to claims 1 to 5.
Citation Information
Patent Citations
Item recommendation method and device and storage medium
CN110309405A
Data recommendation method and device, computer equipment and storage medium
CN110909176A