A knowledge graph construction method and system

By identifying advertising users and removing related triplets, and identifying advertising sensitive users using advertising slogan probability analysis and sentiment analysis, the pollution problem of advertising content in the knowledge graph is solved, and the data purity of the knowledge graph and the accuracy of the question-and-answer system are improved.

CN112287125BActive Publication Date: 2025-04-04SHENZHEN JILIAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011320762.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2025-04-04
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

The existing knowledge graph construction methods are difficult to effectively identify and remove advertising content during the construction process, resulting in a large number of advertising triplets in the knowledge graph, affecting the correctness of the question-and-answer system.

Method used

By analyzing the process of users answering questions, identifying advertisement users and removing related triples; using advertising slogan probability analysis to obtain node advertising probability tables, and removing nodes with higher advertising probability values; when users interact with chatbots, identifying advertisement sensitive people through sentiment analysis and similarity matching, and adjusting the answer content to reduce advertising information.

Benefits of technology

Effectively identify and remove ad triplets in the knowledge graph, improve the data purity of the knowledge graph and the accuracy of the question-and-answer system, and avoid contamination of advertising content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112287125B_ABST
    Figure CN112287125B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for constructing a knowledge graph. According to the knowledge graph constructed by user data and the user's answer, the advertising user is identified; according to the identified advertising user and the node with a higher probability value of node advertising, the triples related to the advertising user are removed from the knowledge graph; according to the user's question, the subject and predicate in the corresponding triple of the knowledge graph are obtained through entity recognition and relationship prediction technology, and the answer to the user's question is returned; in the process of the user chatting with the chat robot, the chat robot's answer content is evaluated to identify whether there is an advertising answer in the answer, and when encountering advertising content or user negative reviews, the user is determined to be advertising sensitive; according to the judgment of advertising sensitive users, when the robot answers the questions of advertising sensitive users, it selects answers that are biased towards non-advertising. The construction of the knowledge graph of the present invention effectively identifies the injection of advertisements and cleans up the triples of advertising content contained in the knowledge graph in a targeted manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a method for effectively identifying attackers and illegal triples in a knowledge graph when constructing a knowledge graph based on user answers to questions. Background Art

[0002] The ConceptNet knowledge graph is mainly constructed through three methods: Internet crowdsourcing, expert creation, and games. Among them, the expert construction of the knowledge graph is based on what internal personnel can control, but the number of experts is small after all. Most of the knowledge graph data still comes from crowdsourcing and conceptnet, which originally comes from games. It extracts user answers based on questions asked in the game and constructs a knowledge graph. However, people with ulterior motives will deliberately input wrong advertising content by multiple people at the same time during the knowledge graph construction process, thereby polluting the correctness of the system.

[0003] Invention patent CN201910290476.6 is a method for constructing a knowledge graph based on disaster scenarios. It obtains data information of disaster scenarios from one or more disaster data sources, performs knowledge fusion on the acquired data, eliminates contradictions and ambiguities between the data, and performs knowledge reasoning on the data information after knowledge fusion. However, when constructing the knowledge graph, the invention does not identify advertisements for the information, and cannot well judge whether all the information is advertising information.

[0004] The present invention can effectively detect triples containing advertising content and associated users, and delete the triples and users in a targeted manner, thereby avoiding the situation where a large amount of advertising content appears when using knowledge graphs for question and answering. Summary of the invention

[0005] The present invention provides a method for constructing a knowledge graph based on user answers to questions and removing advertising triples in the knowledge graph, so that the triples in the knowledge graph have more meaning.

[0006] The present invention provides a method for constructing a knowledge graph, which mainly includes the following steps:

[0007] According to the knowledge graph constructed in the user question-answering process and the answers of advertising users and related users, advertising users are identified; based on the identified advertising users, the related triples are removed from the knowledge graph; based on the entities in the existing triples in the knowledge graph, the node advertising probability table is obtained through advertising word probability analysis, and the nodes with high advertising probability values ​​are removed; according to the user's question, the subject and predicate in the corresponding triple in the knowledge graph are obtained through entity recognition and relationship prediction technology, and the answer to the user's question is returned; during the chat between the user and the chatbot, the chatbot's answer content is evaluated to identify whether there is an advertising answer in the answer. When encountering advertising content or a user's negative review, the user is defined as an advertising-sensitive person; according to the judgment of advertising-sensitive people, when the robot answers their questions, the answer should be more biased towards non-advertising;

[0008] Further optionally, in the above method, identifying the advertising user based on the knowledge graph constructed according to the user game data and the advertising user and the answers of the related users mainly includes:

[0009] After the user answers the question, concepnet will extract the corresponding triples according to the question and answer, i.e. (subject, predicate, object). The subject, i.e., the user name, in the triple just extracted is taken out and accurately matched with the user name in the user table. If the match is not successful, the user is judged as a new user. If the match is successful, it means that the user has answered other questions in the game before. According to the user table, the total number of questions answered by the user is obtained. When the total number of questions is less than the preset threshold, such as 3, the user is judged as a new user; when the total number of questions exceeds the preset threshold, such as 3, the user is judged as a non-new user.

[0010] For non-new users, according to the triple id corresponding to this non-new user in the user table, the object in the triple just generated is matched with the object in the corresponding triple in the knowledge graph for similarity, and the predicate in the triple and the predicate in the corresponding triple in the knowledge graph are input into the sentiment analysis module to determine the sentiment direction of the user's answer to the question. The sentiment directions contained in the sentiment analysis module include two categories: like and criticize.

[0011] For new users and users who have passed the previous detection, the IP address of the computer they use and the time they answer the question are used as the middle time. The preset number of minutes, for example, 30 minutes, is added forward and backward respectively. Within the preset time range and in the network segment where the IP address is located, for example, the IP address of the user who answers the question at this time is 192.168.1.24, and the network segment to which this IP belongs is 192.168.1.0-192.168.1.255. Users who answer the same question are selected, and the answers of the selected users are matched with the answers of the current user for similarity to determine whether these users are advertisers;

[0012] Further optionally, in the method described above, the similarity matching of the object in the triplet just generated with the object in the corresponding triplet in the knowledge graph is performed according to the triplet ID corresponding to the non-new user in the user table to determine whether the user is an advertisement publisher, mainly including:

[0013] When the current user successfully matches with the users stored in the user table and is determined to be not a new user, if the similarity between the object in the triplet just generated by this user and the object in the triplet stored in the knowledge graph reaches a preset threshold, such as 80%, then the user is judged to be an advertiser; when the similarity is between the preset thresholds, such as 60%--80%, a warning message is sent to the user through the system message in the game: Hello, Zhang San! The answers to the questions you answered in the game are highly similar. If it is not intentional, please pay attention to the answers to the questions in the future to avoid inconvenience;

[0014] Further optionally, in the method as described above, the sentiment analysis module inputs the predicate in the triple and the predicate in the corresponding triple in the knowledge graph into the sentiment analysis module, checks the sentiment direction of the user's answer to the question, and determines whether the user is an advertisement publisher, mainly including:

[0015] The sentiment analysis module divides the input predicate into two sentiment directions: like and criticize. The like direction's percentage is obtained by dividing the like direction's answers by the total number of questions. Similarly, the critic direction's percentage is obtained by dividing the critic direction's answers by the total number of questions. If one of these two percentages is greater than or equal to a preset threshold, such as 90%, the user is determined to be an advertiser.

[0016] Further optionally, in the above method, the determining module based on team advertisement publishing determines whether the user and other users are in a team and are all advertisement publishers, mainly including:

[0017] When both proportions obtained by the sentiment analysis module are less than a preset threshold (e.g., 90%) or the user is determined to be a new user, group advertising is determined. When some users are within the preset time range (e.g., 1 hour) of the current user's reply question and in the network segment where the IP address is located, the answers of these users and the current user are matched for similarity. If the similarity is greater than or equal to a preset threshold, e.g., 10%, these users are determined to be advertisers. If the similarity is lower than the preset threshold, e.g., 10%, these users are determined to be unrelated.

[0018] Further optionally, in the above method, according to the identified advertising user, removing the triples related to the advertising user from the knowledge graph mainly includes:

[0019] According to the determined advertiser, it is accurately matched with the user table in the database through similarity matching. After a successful match, the corresponding information of the advertiser is returned, that is, the id corresponding to the triplet obtained after each user answers the question. Since each triple has a unique id, the corresponding triple is removed from the knowledge graph according to the id of the triple.

[0020] Further optionally, in the above method, according to the entities in the existing triples in the knowledge graph, the node advertising probability table is obtained through advertising word probability analysis, and nodes with higher advertising probability values ​​are removed, mainly including:

[0021] Get each node in the knowledge graph to form a node set, crawl advertising words from the website to form an advertising dictionary. Each node will have a count for determining advertising words, and the initial value of count is 0. Traverse the nodes in the node set and perform similarity matching with each word in the advertising dictionary. If the similarity is greater than or equal to the preset threshold, such as 80%, then the count of the node is increased by 1. After the node completes the similarity matching with each word in the advertising dictionary, the advertising word probability of the node is obtained by count / the number in the advertising dictionary. Through the above steps, the advertising word probability value of each node is obtained to form a node advertising probability table. When the node advertising probability exceeds the preset threshold, such as 80%, the triples related to the node are deleted from the knowledge graph to further clear the triples containing advertising words in the knowledge graph;

[0022] Further optionally, in the method described above, according to the user's question, the subject and predicate in the corresponding triple in the knowledge graph are obtained by entity recognition and relationship prediction technology, and the answer to the user's question is returned, which mainly includes:

[0023] Entity recognition uses BERT+BiLSTM+CRF technology, and divides the problem set into a training set and a test set in a ratio of 8:2. In the training set, the entities in the problem set are manually labeled, and the labeled problems are input into the entity recognition model. Through the continuous iteration of the model, the model learns the entity recognition technology. During the training process, when the accuracy reaches the preset threshold, such as 90%, the training is stopped, and the data in the test set is input into the entity recognition model to test the quality of the model. If the accuracy is lower than the preset threshold, such as 90%, the hyperparameters of the model, such as the learning rate, are adjusted, and the training is performed again to optimize the model. Relationship prediction uses the BERT classification model to predict, extract all the relationships in the knowledge graph to form a relationship set, and the training set is composed of 1 positive sample and 5 negative samples for each question, in the form of "question+relationship+label". The 5 negative samples are randomly extracted from the shutdown set. The BERT classification model is trained with the data in the training set, and the optimal parameter model is obtained through continuous iteration of the model.

[0024] Use entity recognition technology to obtain an entity set from the question, and retrieve all triples related to the entity from the knowledge graph; if the relationship, i.e., the predicate, in the obtained triple is a string in the question string, then the triple is considered to be the corresponding triple that answers the question, and the object in the triple is extracted and returned as the answer to the question; if the relationship, i.e., the predicate, in the obtained triple is not a string in the question string, the question is input into the relationship prediction model to obtain the optimal relationship, obtain the triple with the optimal relationship, and extract the object in the triple as the answer to the question and return it;

[0025] Further optionally, in the method as described above, during the chat between the user and the chat robot, the chat robot's answer content is evaluated, and whether the answer is an advertisement answer is identified. When encountering advertisement content or a user's negative review, the user is defined as an advertisement sensitive person, mainly including:

[0026] After the user finishes chatting with the chatbot, the chatbot will be evaluated based on the content of the chat. If the evaluation is critical, it means that the user did not get the answer he or she wanted when the robot answered the user's question. At this time, the triples used by the user to ask the question in the knowledge graph are taken out, and the node advertising probability table is searched to obtain the probability value corresponding to the entity in the triple. If the probability value is greater than the preset threshold, such as 60%, the user is determined to be advertising-sensitive;

[0027] Further optionally, in the above method, according to the judgment of the advertisement-sensitive users, when the robot answers their questions, the answers should be more inclined to non-advertisements, mainly including:

[0028] When an advertising-sensitive person chats with a robot, the answer to the question returned by the question-and-answer system first obtains the probability value of the entity in the triple based on the advertising probability table. If the probability value is greater than a preset threshold, such as 60%, the answer cannot be returned directly. Instead, the knowledge graph question and answer system is used again to obtain the answer to the question. The answer to the question can only be returned if the advertising probability value of the entity is lower than a preset threshold, such as 60%.

[0029] The present invention provides a method for constructing a knowledge graph, the system comprising:

[0030] A new user determination module, used to determine whether a user is a new user or a non-new user;

[0031] Advertiser publisher determination module, which determines whether the user is an advertiser, so as to add or remove triples from the knowledge graph later;

[0032] Knowledge graph question-answering module, used to answer users’ questions;

[0033] The module for determining whether a user is sensitive to advertisements is used to determine whether the user is sensitive to advertisements, so as to determine whether to perform a knowledge graph question-and-answer operation again in the future.

[0034] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0035] The construction of the knowledge graph of the present invention effectively identifies the injection of advertisements and specifically cleans up the triples of advertisement contents contained in the knowledge graph.

[0036] The ConceptNet knowledge graph is mainly constructed through three methods: Internet crowdsourcing, expert creation, and games. Among them, the expert construction of the knowledge graph is based on what can be controlled by internal personnel, but the number of experts is small after all. Most of the knowledge graph data still comes from conceptnet through crowdsourcing and originally from games. It extracts the user's answers based on questions asked in the game and constructs a knowledge graph. However, people with ulterior motives will deliberately input wrong advertising content by multiple people at the same time during the knowledge graph construction process, thereby polluting the correctness of the system. The present invention can effectively monitor triples containing advertising content and related users, and delete triples and users in a targeted manner, avoiding the situation where a large amount of advertising content appears when using the knowledge graph for question and answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The present invention is a flowchart of an embodiment of a method for identifying attacks based on a knowledge graph.

[0038] Figure 2 This is a structural diagram of an embodiment of the knowledge graph-based attack identification method of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] Figure 1 FIG. 1 is a flow chart of the attack identification method based on the knowledge graph of the present invention. Figure 1 As shown, a method for constructing a knowledge graph in this embodiment may specifically include the following steps:

[0041] Step 101, identifying the advertising user based on the knowledge graph constructed based on the user game data and the advertising user and the answers of the related users.

[0042] In the knowledge graph built based on user game data, each triple in the knowledge graph is uniquely associated with a user, because each triple is generated by a specific user answering a question, and a user can correspond to multiple triples. User names are stored in the user table of the database. Each triple will have a unique ID number. There are two columns in the user table. The first column is the user name, and the second column is the triple ID associated with the user. For example: Zhang San, [2, 5, 7, 8] means that the triple with ID 2, 5, 7, 8 in the knowledge graph is the answer to the question answered by user Zhang San.

[0043] After the user answers the question, the knowledge graph construction system extracts the corresponding triples, i.e. (subject, predicate, object), based on the question and answer. The subject, i.e., the user name, in the triple just extracted is taken out and accurately matched with the user name in the user table. If the match is not successful, the user is judged as a new user. If the match is successful, it means that the user has answered other questions in the game before. According to the user table, the total number of questions answered by the user is obtained. When the total number of questions is less than or equal to 3, the user is judged as a new user; when the total number of questions is greater than 3, the user is judged as a non-new user.

[0044] For non-new users, according to the triple id corresponding to the non-new user in the user table, the object in the triple just generated is matched with the object in the corresponding triple in the knowledge graph for similarity, and the predicate in the triple and the predicate in the corresponding triple in the knowledge graph are input into the sentiment analysis module. The sentiment analysis module uses Baidu's open source sentiment analysis system Senta to determine the sentiment direction of the user's answer to the question. The sentiment direction analyzed by the sentiment analysis module using Senta includes two categories: like and criticize.

[0045] For new users and users who have passed previous tests, the IP addresses of the computers they use and the time they answer questions are used as the median time, with the time they answer questions as the median time, and 30 minutes are added forwards and backwards respectively. Within this 1-hour range and in the network segment where the IP address is located, for example, the IP address of the user answering the question at this time is 192.168.1.24, and the network segment to which this IP belongs is 192.168.1.0~192.168.1.255. Users who answer the same question are selected, and the answers of the selected users are matched with those of the current user for similarity to determine whether these users are advertisers.

[0046] For example, when the current user successfully matches with a user stored in the user table and is determined to be not a new user, if the object in the triplet just generated by this user and the object of the triplet of this user stored in the knowledge graph have a similarity of a preset threshold, such as 80%, the user is judged to be an advertiser; when the similarity is between the preset thresholds, such as 60%-80%, a warning message is sent to the user through the system message in the game: "Hello, Zhang San! The answers to the questions you answered in the game are highly similar. If it is not an intentional behavior, please pay attention to the answers to the questions in the future to avoid inconvenience to you!" And for users whose similarity is lower than the preset threshold (for example, 60%), the sentiment analysis module is used to detect the direction of the user's answer to the question. The sentiment analysis module divides the input predicate according to the two sentiment directions of like and criticism. The proportion of the like direction is obtained by dividing the answer in the like direction by the total number of questions. Similarly, the proportion of the criticism direction is obtained by dividing the answer in the criticism direction by the total number of questions. If one of the two proportions is greater than or equal to the preset threshold, such as 90%, the user is judged to be an advertiser. For users whose two percentages are both less than a preset threshold (for example, 90%) or who are determined to be new users, team advertising publishing determination is made. When certain users are within 1 hour of the current user's reply to the question and in the network segment where the IP address is located, the answers of these users are matched with the current user's answers for similarity. If the similarity is greater than or equal to the preset threshold, for example, 10%, these users are determined to be advertisers. If the similarity is lower than the preset threshold, for example, 10%, these users are determined to be unrelated and are non-advertisers.

[0047] Step 102: In order to ensure the purity of the data in the knowledge graph, the triples related to the advertiser determined in step 101 are removed from the knowledge graph.

[0048] The advertiser obtained in step 101 is accurately matched with the user table in the database by similarity matching. After a successful match, the corresponding information of the advertiser is returned, that is, the ID corresponding to the triple obtained after each user answers the question. Since each triple has a unique ID, the corresponding triple is removed from the knowledge graph according to the ID of the triple.

[0049] For example, Zhang San is judged to be an advertiser. Zhang San is first accurately matched with the username in the first column of the user table in the database. After a successful match, Zhang San’s information in the user table is obtained, that is, the triple id [2,5,7,8] generated by Zhang San’s previous answer to the question, and the triples with ids 2, 5, 7, and 8 are deleted from the knowledge graph.

[0050] Step 103, perform probability analysis of advertising words on the nodes in the knowledge graph to obtain node probabilities, sort the constructed nodes by advertising probabilities, and remove triplets related to nodes with higher advertising probability values.

[0051] Although the most efficient removal method is to find the publisher and remove the ads he posted, it is not possible to completely remove the ads in the knowledge graph by determining that the user is the publisher and removing the triples related to the publisher from the knowledge graph, because it is impossible to find every publisher. Therefore, further ads removal is required for the entire knowledge graph.

[0052] It mainly includes: obtaining each node in the knowledge graph to form a node set. Crawl advertising words from the website to form an advertising dictionary. Each node will have a count for determining advertising words, and the initial value of count is 0. Traverse the nodes in the node set and perform similarity matching with each word in the advertising dictionary. If the similarity is greater than or equal to the preset threshold, such as 80%, the count of the node is increased by 1. After the node completes the similarity matching with each word in the advertising dictionary, the advertising word probability of the node is obtained by count / the number in the advertising dictionary. Through the above steps, the advertising word probability value of each node is obtained to form a node advertising probability table. When the node advertising probability exceeds the preset threshold, such as 80%, the triples related to the node are deleted from the knowledge graph to further clear the triples containing advertising words in the knowledge graph.

[0053] Step 104, match the subject and predicate of the knowledge graph to obtain the object as the answer. That is, by matching the first two in the triple, the third one can be obtained, and the third one is the answer.

[0054] Entity recognition uses BERT+BiLSTM+CRF technology, and divides the problem set into a training set and a test set in a ratio of 8:2. In the training set, the entities in the problem set are manually labeled, and the labeled questions are input into the entity recognition model. Through continuous iteration of the model, the model learns the entity recognition technology. During the training process, when the accuracy reaches the preset threshold, such as 90%, the training is stopped, and the data in the test set is input into the entity recognition model to test the quality of the model. If the accuracy is lower than the preset threshold, such as 90%, the model's hyperparameters, such as the learning rate, are adjusted, and training is performed again to optimize the model.

[0055] Relationship prediction uses the BERT classification model to extract all the relationships in the knowledge graph to form a relationship set. The training set is composed of 1 positive sample and 5 negative samples for each question in the form of "question + relationship + label". The 5 negative samples are randomly selected from the shutdown set. The BERT classification model is trained using the data in the training set, and the optimal parameter model is obtained through continuous iteration of the model.

[0056] For example, the question asked by the user is: What is Zhang San's position? For this question, the corresponding training set is: (What is Zhang San's position, position, 1), (What is Zhang San's position, home address, 0), (What is Zhang San's position, location, 0), (What is Zhang San's position, gender, 0), (What is Zhang San's position, age, 0), (What is Zhang San's position, tickets, 0). Among them, (What is Zhang San's position, position, 1) is a positive sample, and what is Zhang San's position, home address, 0), (What is Zhang San's position, location, 0), (What is Zhang San's position, gender, 0), (What is Zhang San's position, age, 0), (What is Zhang San's position, tickets, 0) are negative samples. The relations in the negative samples (home address, location, gender, age, tickets) are randomly extracted from the existing relations in the knowledge graph.

[0057] The specific steps of the problem are as follows: use entity recognition technology to obtain the entity set from the question, and retrieve all triples related to the entity from the knowledge graph; if the relationship, that is, the predicate, in the obtained triple is a string in the question string, then the triple is considered to be the corresponding triple to answer the question, and the object in the triple is extracted and returned as the answer to the question; if the relationship, that is, the predicate, in the obtained triple is not a string in the question string, the question is input into the relationship prediction model to obtain the optimal relationship, obtain the triple with the optimal relationship, extract the object in the triple as the answer to the question and return it.

[0058] For example, the question asked by the user is: What is Zhang San's position? First, the entity Zhang San is extracted from the question through entity recognition technology; secondly, all triples related to Zhang San are retrieved from the knowledge graph through the entity Zhang San: (Zhang San, occupation, software engineer), (Zhang San, wife, Li Hong), (Zhang San, home address, Beijing). The relationship involved in the question is "position", but there is no "position" relationship in the relationship of the retrieved triples, that is, the relationship in the obtained triples is not the string in the question string. At this time, the question (What is Zhang San's position?) and the relationship of the triples just retrieved (occupation, wife, home address) are input into the relationship prediction model. The relationship prediction model will output the relationship most similar to the question, that is, occupation. At this time, the object in the triple where the occupation is located is the answer to the question.

[0059] Step 105, during the chat between the user and the chat robot, the chat robot's answers are evaluated to identify whether there are advertising answers in the answers. When suspected advertising content is identified and the user gives a bad review, the user is defined as an advertising-sensitive person.

[0060] During the chat between the user and the chat robot, the user can evaluate each reply of the chat robot. For each reply of the robot, the advertising probability judgment in step 103 is performed. If the reply content is identified as suspected advertising content and the evaluation content is "criticism", it means that when the robot answered the user's question, the user did not have a good impression of the suspected advertising answer. At this time, the user can be determined to be sensitive to advertising.

[0061] Step 106, when answering questions of those who are sensitive to advertisements as determined in step 105, the robot makes the answers tend to be non-advertising.

[0062] When an advertisement-sensitive person chats with the robot, the answer to the question returned in step 104 first obtains the probability value of the entity in the triple according to the advertisement probability table. If the probability value is greater than a preset threshold, such as 60%, the answer cannot be returned directly, but step 104 is performed again to obtain the answer to the question again. The answer to the question can only be returned when the advertisement probability value of the entity is lower than a preset threshold, such as 60%.

[0063] The program for implementing the information control of the present invention can be written in one or more programming languages ​​or a combination thereof to form a computer program code for performing the operations of the present invention, wherein the programming language includes an object-oriented programming language such as Java, python, C++, and a conventional procedural programming language such as C or a similar programming language.

[0064] The program code may be executed entirely on the client computer, partially on the client computer, as a stand-alone software package, partially on the client computer and partially locally, in a cloud computing environment or on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0065] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation.

[0066] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0067] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units. The above-mentioned integrated unit implemented in the form of software functional units may be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention.

[0068] The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0069] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for constructing a knowledge graph, characterized in that: The method comprises: Step S1: Identify the publisher of the advertisement based on the knowledge graph constructed by the user data and the user's answer; Wherein, the step S1 comprises: Step S11: After the user answers the question, the corresponding triples are extracted according to the question and the answer; The subject, i.e., the user name, in the extracted triple is extracted, and the extracted user name is accurately matched with the user name in the user table; if the match is not successful, the user is determined to be a new user; if the match is successful, the total number of questions answered by the user is obtained according to the user table, and when the total number of questions is less than or equal to a preset threshold, the user is determined to be a new user, and when the total number of questions exceeds the preset threshold, the user is determined to be a non-new user; Step S12: For non-new users, according to the triple ID corresponding to the non-new user in the user table, the objects in the generated triples are matched with the objects in the corresponding triples in the knowledge graph for similarity, and the predicates in the triples and the predicates in the corresponding triples in the knowledge graph are input into the sentiment analysis module to determine the sentiment tendency of the user's answer to the question. The sentiment direction contained in the sentiment analysis module includes two categories: like and criticize, and it is determined whether the user is an advertiser; Step S13: for new users or users who are not determined as advertisers in step S12, conduct team advertising publishing determination; by using the IP address of the computer used by the new user or the user who is not determined as an advertiser in step S12 and the time of answering the question, taking the time of answering the question as the intermediate time, respectively add preset minutes forward and backward, select users who answer the same question within the preset time range and in the network segment where the IP address is located, perform similarity matching between the answers of the selected users and the answer of the current user, and determine whether the above-mentioned user is an advertiser; Step S2: removing triples related to the data submitted by the advertisement publisher from the knowledge graph; Step S3: Perform probability analysis of advertising words on nodes in the knowledge graph to obtain node probabilities, sort the constructed nodes by advertising probabilities, and remove triplets related to nodes with higher advertising probability values; Step S4: applying the knowledge graph processed by step S3 to the chatbot. After obtaining the user's question, the chatbot obtains the subject and predicate in the corresponding triple in the knowledge graph through entity recognition and relationship prediction technology, and returns the answer to the user's question. Step S5: During the chat between the user and the chat robot, the chat robot's answers are evaluated to identify whether there are advertising answers in the answers. If advertising content is detected or the user gives a negative review, the user is determined to be advertising-sensitive. Step S6: Based on the judgment of the advertisement-sensitive person, the robot selects answers that are biased towards non-advertisements when answering questions from the advertisement-sensitive person.

2. The method according to claim 1, characterized in that The step S12 includes: when the current user successfully matches with the user stored in the user table and is determined to be not a new user, if the similarity between the object in the triple generated by this user and the object of the triple stored in the knowledge graph of this user is higher than a preset threshold, the user is judged to be an advertiser; when the similarity is between the preset thresholds, a warning message is sent to the user through a system message in the game; when the similarity is lower than the preset threshold, the predicate in the triple and the predicate in the corresponding triple in the knowledge graph are input into the sentiment analysis module, and the sentiment analysis module divides the input predicate according to two sentiment directions of like and criticism, and the proportion of the like direction is obtained by dividing the number of answers in the like direction by the total number of questions. Similarly, the proportion of the criticism direction is obtained by dividing the number of answers in the criticism direction by the total number of questions. When any value in the above proportions is greater than or equal to the preset threshold, the user is determined to be an advertiser.

3. The method according to claim 2, characterized in that The step S13 includes: when the two proportions obtained by the sentiment analysis module are both less than the preset threshold value or the user is determined to be a new user, a team advertising publishing judgment is performed; when the user who answers the same question is within the preset time range of the current user's answer to the question and is in the network segment where the IP address is located, the answer of the user who answers the same question is matched with the answer of the current user for similarity; if the similarity is greater than or equal to the preset threshold value, the user is determined to be an advertiser; if the similarity is lower than the preset threshold value, the user is determined to be a non-advertiser.

4. The method according to claim 1, characterized in that The step S2 comprises: According to the determined advertiser, it is accurately matched with the user table in the database through similarity matching. After a successful match, the corresponding information of the advertiser is returned, that is, the id corresponding to the triplet obtained after each user answers the question. Since each triple has a unique id, the corresponding triple is removed from the knowledge graph according to the id of the triple.

5. The method according to claim 1, characterized in that The step S3 comprises: Each node in the knowledge graph is obtained to form a node set, and advertising words are crawled from the website to form an advertising dictionary; each node will have a count for determining advertising words, and the initial value of count is 0. The nodes in the node set are traversed and similarity matching is performed with each word in the advertising dictionary. If the similarity is greater than or equal to the preset threshold, the count of the node is increased by 1. After the node completes the similarity matching with each word in the advertising dictionary, the advertising word probability of the node is obtained by the number of count in the advertising dictionary, so as to obtain the advertising word probability value of each node and form a node advertising probability table; when the node advertising probability exceeds the preset threshold, the triples related to the node are deleted from the knowledge graph, so as to further clear the triples containing advertising words in the knowledge graph.

6. The method according to claim 1, characterized in that The step S4 comprises: Entity recognition uses BERT+BiLSTM+CRF technology to divide the question set into a training set and a test set in proportion. In the training set, the entities in the question set are manually labeled, and the labeled questions are input into the entity recognition model. Through continuous iteration of the model, the model learns the entity recognition technology. During the training process, when the accuracy reaches the preset threshold, the training is stopped and the data in the test set is input into the entity recognition model to test the quality of the model. If the accuracy is lower than the preset threshold, the hyperparameters of the model are adjusted and the model is trained again to optimize the model. The hyperparameters include the learning rate. Relationship prediction uses the BERT classification model to extract all the relationships in the knowledge graph to form a relationship set. The training set is composed of 1 positive sample and 5 negative samples for each question. The sample is in the form of question + relation + Label. 5 negative samples are randomly extracted from the shutdown set. The BERT classification model is trained using the data in the training set. The optimal parameter model is obtained through continuous iteration of the model. The entity recognition technology is used to obtain the entity set from the question, and all triples related to the entity are retrieved from the knowledge graph. If the relation, that is, the predicate, in the obtained triple is a string in the question string, the triple is considered to be the corresponding triple to answer the question, and the object in the triple is extracted and returned as the answer to the question. If the relation, that is, the predicate, in the obtained triple is not a string in the question string, the question is input into the relationship prediction model to obtain the optimal relationship, obtain the triple with the optimal relationship, and extract the object in the triple as the answer to the question and return it.

7. The method according to claim 1, characterized in that The step S5 comprises: After the user finishes chatting with the chatbot, the robot will be evaluated based on the content of the chat. If the evaluation is critical, it means that the user did not get the answer he or she wanted when the robot answered the user's question. At this time, the triples used by the user to ask the question in the knowledge graph are taken out, and the node advertising probability table is searched to obtain the probability value corresponding to the entity in the triple. If the probability value is greater than the preset threshold, the user is judged to be sensitive to advertising.

8. The method according to claim 1, characterized in that The step S6 comprises: When an advertising-sensitive person chats with the robot, the answer obtained through the question-and-answer module first obtains the probability value of the entity in the triple according to the advertising probability table. If the probability value is greater than the preset threshold, the answer cannot be returned directly. Instead, the knowledge graph is used again to obtain the answer to the question. The answer to the question can only be returned when the advertising probability value of the entity is lower than the preset threshold.

9. A knowledge graph construction system, characterized in that: The method for constructing a knowledge graph as claimed in any one of claims 1 to 8, wherein the system comprises: A new user determination module, used to determine whether a user is a new user or a non-new user; Advertiser publisher determination module, used to determine whether the user is an advertiser, so as to subsequently add or remove triples from the knowledge graph; Q&A module, used to answer users’ questions; The advertisement-sensitive person determination module is used to determine whether the user is advertisement-sensitive, so as to determine whether to perform a knowledge graph question-and-answer operation again in the future.

Citation Information

Patent Citations

  • Knowledge graph construction method based on disaster scene

    CN109992672A

  • Food recipe recommendation system

    CN110298770A

  • Knowledge representation learning method fusing multi-source information

    CN111538848A