Method and apparatus for constructing a map, electronic device, storage medium

By acquiring entity, entity type, and fine-grained sentiment data, and combining knowledge systems and entity links to construct a target graph, the problem of know-what knowledge graphs being unable to provide personalized recommendations or arrangements is solved, and the transformation of know-how knowledge graphs is realized.

CN114741533BActive Publication Date: 2026-03-24BEIJING XUEZHITU NETWORK TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing know-what knowledge graphs can only provide information about the relationships between entities, and cannot be used for personalized recommendations or personnel assignments.

Method used

By acquiring entities, entity types, and fine-grained sentiment data from the data, connecting entities using a pre-defined knowledge system, and constructing a target graph by combining entity links, the transformation from know-what to know-how is achieved.

Benefits of technology

It combines factual knowledge in the knowledge graph with user emotions, enabling personalized recommendations or arrangements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741533B_ABST
    Figure CN114741533B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of knowledge graphs, and discloses a method for constructing a graph, which comprises the following steps: acquiring data; determining each entity in the data, the entity types corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity types corresponding to each entity to obtain a candidate graph; and connecting the fine-grained sentiment data and each entity in the candidate graph through entity linking to obtain a target graph. In this way, each entity is connected with the fine-grained sentiment data through entity linking, factual knowledge exists in the knowledge graph, and user sentiment is added, so that the knowledge graph is converted from a know-what knowledge graph to a know-how knowledge graph. Users can be personalized recommended or arranged according to the fine-grained sentiment data corresponding to each entity. The application also discloses a device for constructing a graph, an electronic device and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, such as a method and apparatus for constructing a graph, electronic equipment, and storage medium. Background Technology

[0002] With the advent of knowledge graphs, they have been widely applied across various fields. Currently, knowledge graphs are typically constructed using factual knowledge to obtain know-what knowledge graphs. However, based on know-what knowledge graphs, users can only know that relationships exist between entities; they cannot use the know-what knowledge graph to determine how to allocate personnel or make user recommendations. For example, regarding know-what knowledge graphs for cosmetics, users can only know which cosmetics belong to the same category, but they cannot use the know-what knowledge graph to know how to make personalized recommendations or arrangements for users. Summary of the Invention

[0003] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for constructing atlases to facilitate personalized recommendations or arrangements for users.

[0005] In some embodiments, the method for constructing a graph includes: acquiring data; determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain a candidate graph; and connecting the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain a target graph.

[0006] In some embodiments, the apparatus for constructing a graph includes: an acquisition module configured to acquire data; a determination module configured to determine each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; a first graph construction module configured to connect each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain a candidate graph; and a second graph construction module configured to connect the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain a target graph.

[0007] In some embodiments, the electronic device includes a processor and a memory storing program instructions, the processor being configured to execute the above-described method for constructing a map when the program instructions are executed.

[0008] In some embodiments, the storage medium, when the program instructions are executed, performs the above-described method for constructing the map.

[0009] The method, apparatus, electronic device, and storage medium for constructing a knowledge graph provided in this disclosure can achieve the following technical effects: By acquiring data; determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain a candidate knowledge graph; and connecting the fine-grained sentiment data with each entity in the candidate knowledge graph through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. This allows users to receive personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0010] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0011] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0012] Figure 1 This is a schematic diagram of a method for constructing a map provided in an embodiment of this disclosure;

[0013] Figure 2 This is a schematic diagram of another method for constructing a map provided in this disclosure embodiment;

[0014] Figure 3 This is a schematic diagram of another method for constructing a map provided in this disclosure embodiment;

[0015] Figure 4 This is a schematic diagram of an apparatus for constructing a map, provided in an embodiment of this disclosure;

[0016] Figure 5 This is a schematic diagram of another apparatus for constructing a map provided in an embodiment of this disclosure;

[0017] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0018] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0019] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0020] Unless otherwise stated, the term "multiple" means two or more.

[0021] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0022] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0023] Existing know-what knowledge graphs are typically composed of factual knowledge. Users can only understand the relationships between entities through these factual knowledge graphs, but cannot determine how to allocate personnel or make user recommendations. Therefore, it is necessary to construct know-how knowledge graphs to enable personalized recommendations or arrangements for users.

[0024] In some embodiments, the know-what knowledge graph is a factual knowledge graph, which contains factual knowledge, such as factual knowledge triples (High-speed rail G10, stations along the way, Jinan West Station) and (High-speed rail G10, destination, Beijing South Station). The know-how knowledge graph is a skill-based knowledge graph, such as (Jinan to Beijing, taking, High-speed rail G10).

[0025] In some embodiments, a knowledge system is a high-level generalization and abstraction of the knowledge domain to be constructed. That is, a knowledge system is obtained by manually abstracting several concepts from several entities and connecting these concepts to form a multi-level, tree-like knowledge structure. A pre-defined knowledge system stores several concepts and the relationships between them. A concept is an abstract generalization of multiple entities and is also called an entity type in the knowledge system.

[0026] In some embodiments, there are entities such as apples, bananas, and lychees. The abstract generalization of these entities yields the concept of fruit.

[0027] Meanwhile, the electronic devices involved in the embodiments of the present invention may include, but are not limited to, mobile phones, tablet computers, personal computers, handheld computers, and servers.

[0028] Combination Figure 1 As shown, this disclosure provides a method for constructing a map, including:

[0029] Step S101: The electronic device acquires data.

[0030] In step S102, the electronic device determines each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data.

[0031] In step S103, the electronic device connects each entity according to the preset knowledge system and the entity type corresponding to each entity to obtain the candidate map.

[0032] In step S104, the electronic device connects the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain the target graph.

[0033] The method for constructing a knowledge graph provided in this disclosure involves: acquiring data; determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate knowledge graphs; and connecting the fine-grained sentiment data with each entity in the candidate knowledge graphs through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. This allows users to receive personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0034] Optionally, determining each entity in the data and the corresponding entity type includes: inputting the structured data in the data into a preset first knowledge extraction model to obtain each entity and the corresponding entity type.

[0035] Optionally, determining each entity in the data and its corresponding entity type includes: inputting the structured data into a preset first knowledge extraction model to obtain each candidate entity and its corresponding candidate entity type; merging the candidate entities through entity alignment to obtain an entity; and determining the candidate entity type corresponding to the candidate entity as the entity type corresponding to the entity. In this way, merging the candidate entities through entity alignment to obtain the entity makes the candidate graph composed of the merged entities more intuitive and concise.

[0036] Optionally, determining fine-grained sentiment data in the data includes: inputting unstructured data from the data into a pre-defined second knowledge extraction model to obtain fine-grained sentiment data.

[0037] In some embodiments, a knowledge extraction model is used to extract entities from the data to obtain entity relationships between entities, and the entity relationships correspond to positive or negative sentiment.

[0038] Optionally, the entities are connected according to the preset knowledge system and the entity type corresponding to each entity to obtain a candidate graph, including: randomly selecting one entity from each entity to determine as the target entity, and determining the entities other than the target entity as entities to be judged; if there is a connection relationship between the entity type corresponding to the target entity and the entity type corresponding to the entity to be judged in the knowledge system, the target entity and the entity to be judged are connected to obtain a candidate graph.

[0039] Combination Figure 2 As shown, this disclosure provides a method for constructing a map, including:

[0040] Step S201: The electronic device acquires data.

[0041] In step S202, the electronic device inputs the structured data in the data into a preset first knowledge extraction model to obtain each entity and the entity type corresponding to each entity.

[0042] In step S203, the electronic device inputs the unstructured data in the data into a preset second knowledge extraction model to obtain fine-grained sentiment data.

[0043] In step S204, the electronic device connects each entity according to the preset knowledge system and the entity type corresponding to each entity to obtain the candidate map.

[0044] In step S205, the electronic device connects the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain the target graph.

[0045] The method for constructing a knowledge graph provided in this disclosure involves: acquiring data; determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate knowledge graphs; and connecting the fine-grained sentiment data with each entity in the candidate knowledge graphs through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. This allows users to receive personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0046] In some embodiments, the preset knowledge system consists of vegetables, fruits, ingredients, colors, shapes, dish names, chefs, stores, demographics, consumer services, and reviews. Data such as menus, customer reviews, employee system data, restaurant operating data, customer lists, order lists, and chef assignments from the catering industry are acquired. The structured data is input into a preset first knowledge extraction model to obtain each entity and its corresponding entity type. For example, the entity "tomato and scrambled eggs" corresponds to the entity type "dish name"; the entity "Li Si" corresponds to the entity type "chef". The entity "Li Si" is selected as the target entity, and all other entities besides "Li Si" (including "tomato and scrambled eggs") are selected as entities to be judged. If there is a connection between the entity type "chef" and the entity type "dish name" in the preset knowledge system, then "Li Si" is connected to "tomato and scrambled eggs" to obtain a candidate graph. The unstructured data is input into a preset second knowledge extraction model to obtain fine-grained sentiment data, for example, Zhang San's sentiment towards Li Si's tomato and scrambled eggs is positive. With the entity type preset as "chef," the entity "Li Si," corresponding to "chef" in the candidate knowledge graph, is identified as the entity to be linked. Through entity linking, a connection is established between "Zhang San's positive feelings towards Li Si's tomato and scrambled eggs" and "Li Si." This connection is then linked to "Li Si" in the candidate knowledge graph to obtain the target knowledge graph. Similarly, with the entity type preset as "dish name," the entity "Tomato and Scrambled Eggs," corresponding to "dish name," in the candidate knowledge graph, is identified as the entity to be linked. The connection is established between "Zhang San's positive feelings towards Li Si's tomato and scrambled eggs" and "Tomato and Scrambled Eggs." This connection is then linked to "Tomato and Scrambled Eggs" in the candidate knowledge graph to obtain the target knowledge graph. This approach allows for a clear understanding of the relationships between entity types and between each entity type and fine-grained sentiment data, facilitating user-based business planning using the target knowledge graph.

[0047] In some embodiments, employee system data includes, for example, the dates employees are on duty. Restaurant operational data includes, for example, daily sales figures.

[0048] Optionally, after connecting the fine-grained sentiment data with the entities in the candidate graph through entity links to obtain the target graph, the method further includes: displaying the target graph to the user.

[0049] Optionally, the target map can be displayed to the user, including pushing the target map to a preset client.

[0050] Optionally, displaying the target graph to the user includes sending the target graph to a preset display screen and triggering the display screen to show the target graph. This makes it easier for users to view the target graph intuitively and make personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0051] Combination Figure 3 As shown, this disclosure provides a method for constructing a map, including:

[0052] Step S301: The electronic device acquires data;

[0053] Step S302: The electronic device determines each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data;

[0054] Step S303: The electronic device connects each entity according to the preset knowledge system and the entity type corresponding to each entity to obtain the candidate map;

[0055] In step S304, the electronic device connects the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain the target graph.

[0056] In step S305, the electronic device displays the target map to the user.

[0057] The method for constructing a knowledge graph provided in this disclosure involves: acquiring data; determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate knowledge graphs; and connecting the fine-grained sentiment data with each entity in the candidate knowledge graphs through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. Presenting the target knowledge graph to the user makes it easier for the user to make personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0058] Optionally, the fine-grained sentiment data is connected to each entity in the candidate graph through entity links to obtain the target graph, including: connecting the fine-grained sentiment data to each entity in the candidate graph through entity links to obtain the graph to be judged; and obtaining the target graph based on the graph to be judged.

[0059] Optionally, the fine-grained sentiment data is connected to each entity in the candidate graph through entity links, including: identifying several entities to be linked in the candidate graph, and connecting the fine-grained sentiment data to each entity to be linked through entity links.

[0060] Optionally, several entities to be linked in the candidate graph are determined, including: determining entities corresponding to preset entity types in the candidate graph as entities to be linked.

[0061] Optionally, obtaining the target graph based on the graph to be judged includes: obtaining candidate fine-grained sentiment data corresponding to each entity; determining fine-grained sentiment scores based on each candidate fine-grained sentiment data; labeling candidate entity relationships between entities based on each fine-grained sentiment score; and connecting entities according to the candidate entity relationships to obtain the target graph.

[0062] Optionally, the fine-grained sentiment score is determined based on the candidate fine-grained sentiment data, including: counting the number of positive sentiments in the candidate fine-grained sentiment data; counting the number of negative sentiments in the candidate fine-grained sentiment data; adding the number of positive sentiments to the number of negative sentiments to determine the total number of sentiments; and dividing the number of positive sentiments by the total number of sentiments to determine the fine-grained sentiment score.

[0063] Optionally, the candidate entity relationships between entities are labeled according to each fine-grained sentiment score, including: identifying the entity with the highest fine-grained sentiment score in the graph to be judged as the first entity to be labeled; identifying the entity directly connected to the first entity to be labeled as the second entity to be labeled; and establishing the first entity relationship between the first entity to be labeled and the second entity to be labeled.

[0064] Optionally, the process of labeling the candidate entity relationships between entities based on the fine-grained sentiment scores further includes: sorting each fine-grained sentiment score in descending order, identifying the entity with the second-highest fine-grained sentiment score in the graph to be judged as the third entity to be labeled; identifying the entity directly connected to the third entity to be labeled as the fourth entity to be labeled; and establishing a second entity relationship between the third entity to be labeled and the fourth entity to be labeled.

[0065] In some embodiments, the alternative entity relationships include several different entity relationships to be labeled.

[0066] Optionally, the alternative entity relationships between entities are labeled based on the fine-grained sentiment score, including: labeling the alternative entity relationships between entities in response to the user's alternative entity relationship labeling instruction.

[0067] In some embodiments, there are multiple graphs to be judged, and candidate entity relationships between entities are determined from each graph. The target graph is obtained by connecting the entities according to the candidate entity relationships.

[0068] In some embodiments, the entity "scrambled eggs with tomatoes" in the graph to be judged is connected to entities "chef a", "chef b", and "chef c" respectively. The fine-grained sentiment score for "chef a" is 0.2, for "chef b" it is 0.8, and for "chef c" it is 0.5. "chef b" is identified as the first entity to be labeled, and "scrambled eggs with tomatoes" directly connected to "chef b" is identified as the second entity to be labeled. A first entity relationship "skilled" is established between "chef b" and "scrambled eggs with tomatoes". The entity "chef c", whose fine-grained sentiment score is second in the graph to be judged, is identified as the third entity to be labeled; the entity "scrambled eggs with tomatoes" directly connected to "chef c" is identified as the fourth entity to be labeled; a second entity relationship "can do" is established between "chef c" and "scrambled eggs with tomatoes".

[0069] Optionally, after obtaining the target map, the process also includes: planning personnel work based on the target map.

[0070] Optionally, the work of personnel planning according to the target map includes: sending the target map to a preset recommendation platform, responding to the user's recommendation instructions, and obtaining user recommendation information.

[0071] Optionally, personnel work is planned based on the target map, including: sending the target map to a preset scheduling platform, responding to the user's scheduling instructions, and obtaining personnel scheduling information.

[0072] In some embodiments, the alternative entity relationship between "Chef C" and "Scrambled Eggs with Tomatoes" in the target graph is "Can make". The alternative entity relationship between "Chef B" and "Scrambled Eggs with Tomatoes" in the target graph is "Proficient". When a customer orders "Scrambled Eggs with Tomatoes", Chef B is assigned first, followed by Chef C.

[0073] In some embodiments, the fine-grained sentiment data includes ratings of each entity, such as "good," "neutral," and "bad." "Good" and "neutral" ratings represent positive sentiment, while "bad" ratings represent negative sentiment.

[0074] In some embodiments, the knowledge system consists of a three-layer schema. The first layer schema includes vegetables, fruits, ingredients, colors, and shapes; the second layer schema includes dish names, chefs, and stores; and the third layer schema includes people, consumer services, and reviews. Connecting these three layers of schema constitutes the knowledge system.

[0075] Combination Figure 4 As shown, this disclosure provides an apparatus for constructing a graph, including: an acquisition module 401, a determination module 402, a first graph construction module 403, and a second graph construction module 404. The acquisition module 401 is configured to acquire data; the determination module 402 is configured to determine each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; the first graph construction module 403 is configured to connect each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain a candidate graph; the second graph construction module 404 is configured to connect the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain a target graph.

[0076] The apparatus for constructing a knowledge graph provided in this disclosure involves: an acquisition module acquiring data; a determination module determining each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; a first knowledge graph construction module connecting each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate knowledge graphs; and a second knowledge graph construction module connecting the fine-grained sentiment data with each entity in the candidate knowledge graphs through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. This allows users to receive personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0077] Optionally, the determination module determines each entity in the data and the corresponding entity type in the following way: the structured data in the data is input into a preset first knowledge extraction model to obtain each entity and the corresponding entity type.

[0078] Optionally, the determining module determines fine-grained sentiment data in the data by inputting unstructured data from the data into a preset second knowledge extraction model to obtain fine-grained sentiment data.

[0079] Optionally, the first graph construction module connects the entities according to the preset knowledge system and the entity type corresponding to each entity to obtain the candidate graph in the following way: select one entity from each entity as the target entity, and determine the entities other than the target entity as entities to be judged; if there is a connection relationship between the entity type corresponding to the target entity and the entity type corresponding to the entity to be judged in the knowledge system, connect the target entity and the entity to be judged to obtain the candidate graph.

[0080] Combination Figure 5 As shown, this embodiment of the present disclosure provides an apparatus for constructing a map, and further includes a display module 405.

[0081] The acquisition module 401 acquires data and sends it to the determination module 402. The determination module 402 receives the data and determines each entity, its corresponding entity type, and fine-grained sentiment data. It then sends each entity and its corresponding entity type to the first graph construction module 403 and sends the fine-grained sentiment data to the second graph construction module 404. The first graph construction module 403 receives each entity and its corresponding entity type, connects each entity according to a preset knowledge system and its corresponding entity type, and obtains candidate graphs. The second graph construction module 404 receives the fine-grained sentiment data and connects it with each entity in the candidate graphs through entity links to obtain the target graph.

[0082] Combination Figure 6 As shown, this disclosure provides an electronic device including a processor 600 and a memory 601. Optionally, the device may further include a communication interface 602 and a bus 603. The processor 600, communication interface 602, and memory 601 can communicate with each other via the bus 603. The communication interface 602 can be used for information transmission. The processor 600 can call logical instructions in the memory 601 to execute the method for constructing a map described in the above embodiments.

[0083] Furthermore, the logic instructions in the aforementioned memory 601 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0084] The memory 601, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 600 executes functional applications and data processing by running the program instructions / modules stored in the memory 601, that is, it implements the method for constructing the map in the above embodiments.

[0085] The memory 601 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 601 may include high-speed random access memory and may also include non-volatile memory.

[0086] The electronic device employing embodiments of this disclosure acquires data; determines each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; connects each entity according to a preset knowledge system and the entity type corresponding to each entity to obtain a candidate knowledge graph; and connects the fine-grained sentiment data with each entity in the candidate knowledge graph through entity links to obtain a target knowledge graph. In this way, by connecting each entity with fine-grained sentiment data through entity links, the knowledge graph not only contains factual knowledge but also adds user sentiment, enabling the knowledge graph to complete the transformation from a know-what knowledge graph to a know-how knowledge graph. This allows users to receive personalized recommendations or arrangements based on the fine-grained sentiment data corresponding to each entity.

[0087] This disclosure provides a storage medium storing program instructions, which, when executed, perform the above-described method for constructing a map.

[0088] This disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the above-described method for constructing a map.

[0089] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0090] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0091] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0092] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0093] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. 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 the units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for constructing a map, characterized in that, include: Acquire data; Determine each entity in the data, the entity type corresponding to each entity, and the fine-grained sentiment data; Connect the entities according to the preset knowledge system and the entity type corresponding to each entity to obtain the candidate graph; The fine-grained sentiment data is connected to each entity in the candidate graph through entity links to obtain the graph to be judged; Based on the spectrum to be judged, obtain the target spectrum; The process of obtaining the target graph based on the graph to be judged includes: obtaining candidate fine-grained sentiment data corresponding to each entity; determining fine-grained sentiment scores based on each candidate fine-grained sentiment data; labeling candidate entity relationships between entities based on each fine-grained sentiment score; and connecting entities according to the candidate entity relationships to obtain the target graph. The process of determining the fine-grained sentiment score based on the candidate fine-grained sentiment data includes: counting the number of positive sentiments in the candidate fine-grained sentiment data; counting the number of negative sentiments in the candidate fine-grained sentiment data; adding the number of positive sentiments to the number of negative sentiments to determine the total number of sentiments; and dividing the number of positive sentiments by the total number of sentiments to determine the fine-grained sentiment score.

2. The method according to claim 1, characterized in that, Determining each entity in the data and the corresponding entity type includes: The structured data in the data is input into a preset first knowledge extraction model to obtain each entity and the corresponding entity type.

3. The method according to claim 1, characterized in that, Determining fine-grained sentiment data from the data includes: The unstructured data in the data is input into a preset second knowledge extraction model to obtain fine-grained sentiment data.

4. The method according to claim 1, characterized in that, Based on a pre-defined knowledge system and the entity types corresponding to each entity, connect the entities to obtain candidate graphs, including: Select one entity from all entities as the target entity, and define the other entities as entities to be judged. When there is a connection between the entity type corresponding to the target entity and the entity type corresponding to the entity to be judged in the knowledge system, the target entity and the entity to be judged are connected to obtain the alternative graph.

5. An apparatus for constructing a map, characterized in that, include: The acquisition module is configured to acquire data. The determination module is configured to determine each entity in the data, the entity type corresponding to each entity, and fine-grained sentiment data; The first graph construction module is configured to connect entities according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate graphs; The second graph construction module is configured to connect the fine-grained sentiment data with each entity in the candidate graph through entity links to obtain the graph to be judged. Based on the spectrum to be judged, obtain the target spectrum; The process of obtaining the target graph based on the graph to be judged includes: obtaining candidate fine-grained sentiment data corresponding to each entity; determining fine-grained sentiment scores based on each candidate fine-grained sentiment data; labeling candidate entity relationships between entities based on each fine-grained sentiment score; and connecting entities according to the candidate entity relationships to obtain the target graph. The process of determining the fine-grained sentiment score based on the candidate fine-grained sentiment data includes: counting the number of positive sentiments in the candidate fine-grained sentiment data; counting the number of negative sentiments in the candidate fine-grained sentiment data; adding the number of positive sentiments to the number of negative sentiments to determine the total number of sentiments; and dividing the number of positive sentiments by the total number of sentiments to determine the fine-grained sentiment score.

6. The apparatus according to claim 5, characterized in that, The determination module determines each entity in the data and the corresponding entity type of each entity in the following manner: The structured data in the data is input into a preset first knowledge extraction model to obtain each entity and the corresponding entity type.

7. The apparatus according to claim 5, characterized in that, The determination module determines the fine-grained sentiment data in the data in the following manner: The unstructured data in the data is input into a preset second knowledge extraction model to obtain fine-grained sentiment data.

8. The apparatus according to claim 5, characterized in that, The first graph construction module connects entities according to a preset knowledge system and the entity type corresponding to each entity to obtain candidate graphs: Select one entity from all entities as the target entity, and define the other entities as entities to be judged. In a knowledge system, if there is a connection between the entity type corresponding to the target entity and the entity type corresponding to the entity to be judged, the target entity and the entity to be judged are connected to obtain alternative graphs.

9. An electronic device comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to, when executing the program instructions, perform the method for constructing a map as described in any one of claims 1 to 4.

10. A storage medium storing program instructions, characterized in that, When the program instructions are executed, they perform the method for constructing a map as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Knowledge graph-based recommendation method, apparatus and device, and computer readable medium

    CN112100513A