Entity Relationship Display Method, Apparatus, Electronic Device, and Computer Storage Medium
By employing semantic recognition and fusion techniques with pre-trained models, the method improves the accuracy of entity relationship presentation by enhancing contextual understanding and entity association depth, facilitating better business insights.
Patent Information
- Application Number
- CN202310547717.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-05-16
AI Technical Summary
The existing entity relationship display method is insufficient in context, resulting in low accuracy in entity relationship display, over-reliance on the encoding ability of pre-trained language models, and inability to deeply explore the degree of correlation between entities.
By obtaining the customer's text information, extracting entity attribute information, semantic recognition and span division, using preset entity type information for fusion, combining it with a two-way long and short-term memory network for entity relationship classification, and building an entity relationship map.
It improves the accuracy of entity relationship display, deeply explores the degree of correlation between customers, and can more accurately display the customer's entity relationship.
Smart Images

Figure CN116737842B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to an entity relationship display method, device, electronic device and computer-readable storage medium. Background Art
[0002] An entity refers to an object or thing that exists objectively and can be distinguished from each other in the real world, including names of people, places, organizations or other proper nouns. Entity relationships represent the intrinsic connections between each entity. By displaying the relationships between entities, the correlation between different entities can be obtained, thereby enabling entity expansion. For example, a company can find potential customers and expand its business scope through its customer entity relationships.
[0003] Existing research on entity relationship display methods mainly focuses on the interaction between the two subtasks, but there is a problem of insufficient attention to the context, and excessive reliance on the encoding capabilities of pre-trained language models such as ELMo (Embeddings from Language Models) and BERT (Bidirectional Encoder Representation from Transformers), resulting in insufficient text breadth semantics. For example, Eberts et al. directly use the information of [CLS] in BERT and adopt simple maximum pooling to integrate text information into entity and relationship representations. This fails to pay good attention to the potential information in the context, and thus fails to deeply explore the degree of correlation between entities, ultimately resulting in poor accuracy in entity relationship display. Summary of the invention
[0004] The present invention provides an entity relationship display method, device, electronic device and computer-readable storage medium, the main purpose of which is to solve the problem of low accuracy in entity relationship display.
[0005] To achieve the above object, the present invention provides an entity relationship display method, comprising:
[0006] Obtain text data of each customer in the customer set, and extract entity attribute information from the text data;
[0007] Performing semantic recognition on the entity attribute information to obtain semantic representation information in the text material, and performing span division on the semantic representation information according to the entity attribute information to obtain a span semantic sequence of the text material;
[0008] Determine the entity type sequence corresponding to the span semantic sequence by using preset entity type information, fuse the entity type sequence with the text data, and obtain the fusion relationship feature of the text data;
[0009] Classify the entity relationships of each customer in the customer set using the fusion relationship features to obtain a customer classification set;
[0010] Construct an entity relationship graph for each customer in the customer set according to the customer classification set.
[0011] Optionally, the semantic recognition of the entity attribute information to obtain the semantic representation information in the text material includes:
[0012] Perform word embedding on the entity attribute information to obtain an attribute vector of the entity attribute information;
[0013] Use a pre-trained language representation model to perform semantic encoding on the attribute vector to obtain the semantic representation information in the text material.
[0014] Optionally, the span division of the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text material includes:
[0015] Segment the entity attribute information to obtain a segmented sequence of the entity attribute information;
[0016] Perform an initial span division on the semantic representation information according to the proportion of each segment in the segmented sequence to obtain an initial span semantic sequence;
[0017] Use a preset span value threshold to adjust the initial span semantic sequence to obtain the span semantic sequence of the text material.
[0018] Optionally, the determination of the entity type sequence corresponding to the span semantic sequence using the preset entity type information includes:
[0019] Perform convolution pooling on each span semantic in the span semantic feature sequence in turn to obtain a pooled feature map;
[0020] Fully connect the pooled feature map to obtain the feature information corresponding to each span semantic;
[0021] Calculate the feature similarity between the feature information and the entity type information, and determine the entity type sequence corresponding to the span semantic sequence according to the feature similarity.
[0022] Optionally, the fusion of the entity type sequence and the text material to obtain the fusion relationship features of the text material includes:
[0023] Convert the text material into a text vector and construct a vector matrix of the text vector;
[0024] Multiply the vector matrix with the entity types in the entity type sequence respectively to obtain the fusion relationship features of the text materials.
[0025] Optionally, classifying the entity relationships of each customer in the customer set by using the fusion relationship features to obtain a customer classification set, including:
[0026] Calculating the forward propagation features and backward propagation features corresponding to the fusion relationship features by using a pre-constructed bidirectional long short-term memory network;
[0027] Performing feature splicing on the forward propagation features and the backward propagation features to obtain the spliced features of the fusion relationship features;
[0028] Performing an activation operation on the spliced features to obtain the entity categories corresponding to the fusion relationship features, and classifying the entity categories of each customer in the customer set according to the entity categories to obtain a customer classification set.
[0029] Optionally, constructing an entity relationship graph of each customer in the customer set according to the customer classification set, including:
[0030] Taking each customer in the customer set as a graph node in the entity relationship graph;
[0031] Determining the association relationships between the graph nodes according to the customer classification set, and constructing the edges of the graph nodes according to the association relationships;
[0032] Generating the entity relationship graph of each customer in the customer set according to the graph nodes and the edges of the graph nodes.
[0033] To solve the above problems, the present invention also provides an entity relationship display device, and the device includes:
[0034] An entity attribute information extraction module, configured to obtain the text materials of each customer in the customer set and extract the entity attribute information in the text materials;
[0035] A span semantic sequence generation module, configured to perform semantic recognition on the entity attribute information to obtain semantic representation information in the text materials, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text materials;
[0036] A fusion relationship feature generation module, configured to use preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text materials to obtain the fusion relationship features of the text materials;
[0037] An entity relationship classification module, used to perform entity relationship classification on each customer in the customer set by using the fused relationship feature to obtain a customer classification set;
[0038] The entity relationship graph construction module is used to construct an entity relationship graph for each customer in the customer set according to the customer classification set.
[0039] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0040] at least one processor; and,
[0041] a memory communicatively connected to the at least one processor; wherein,
[0042] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the entity relationship presentation method described above.
[0043] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned entity relationship display method.
[0044] The embodiment of the present invention obtains the text data of each customer and extracts the entity attribute information in the text data, and can use the attribute information to identify the attributes of each customer, thereby calculating the entity attribute association between each customer; identifying the semantic representation information in the text data and dividing the span of the semantic representation information in combination with the context can increase the breadth of the semantic representation, thereby increasing the breadth of the entity type corresponding to the semantic representation information, fusing the entity type with the text data to obtain the fusion relationship feature, which can increase the potential information of the text data, thereby deeply mining the degree of association between each customer, so as to classify the customers and obtain a customer classification set; displaying the entity relationship map of each customer in the customer set through the customer classification set can effectively improve the accuracy of the entity relationship display. Therefore, the entity relationship display method, device, electronic device and computer-readable storage medium proposed by the present invention can solve the problem of low accuracy when displaying entity relationships. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a flow chart of an entity relationship display method provided by an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of a process for span division of semantic representation information provided by an embodiment of the present invention;
[0047] Figure 3 Schematic flowchart of determining the entity category sequence provided by an embodiment of the present invention;
[0048] Figure 4 Functional module diagram of the entity relationship display device provided by an embodiment of the present invention;
[0049] Figure 5 Schematic structural diagram of an electronic device for implementing the entity relationship display method provided by an embodiment of the present invention.
[0050] The realization, functional features and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the accompanying drawings. Detailed implementation manners
[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] An embodiment of the present application provides an entity relationship display method. The execution subject of the entity relationship display method includes, but is not limited to, at least one of an electronic device such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the entity relationship display method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server, or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0053] Refer to Figure 1 As shown, it is a schematic flowchart of the entity relationship display method provided by an embodiment of the present invention. In this embodiment, the entity relationship display method includes:
[0054] S1. Obtain the text materials of each customer in the customer set, and extract the entity attribute information in the text materials;
[0055] In an embodiment of the present invention, the customer set is a set of historical customers of an enterprise, and each customer of the enterprise is included in the customer set. The basic situation of each customer can be determined through the text materials of each customer in the enterprise. Among them, the text materials may include event instances that each customer has in the enterprise, such as each consumption event, after-sales event, etc. in the enterprise.
[0056] In the embodiments of the present invention, the entity attribute information is the entity attributes of each customer. For example, it is the attribute information contained in the text materials obtained by an enterprise such as customer consumption time, customer gender, customer's job, etc.
[0057] In the embodiments of the present invention, extracting the entity attribute information from the text materials includes:
[0058] Extracting the event instances of each customer in the text materials and obtaining the event data in the event instances;
[0059] Using a preset entity attribute set to determine the entity attributes corresponding to the event data, and obtaining the entity attribute information in the text materials.
[0060] In the embodiments of the present invention, the event instances are the consumption situations of each customer recorded by the enterprise, such as data on time, consumption situation, customer information, and employee evaluations, etc. Thus, event data can be obtained from each event instance of the customer.
[0061] In the embodiments of the present invention, the entity attribute set is a set of all entity attributes included in the text materials of the customer. Through the entity attribute set, the entity attributes corresponding to each event data can be determined. For example, through the time in the event data, the customer consumption time attribute information can be obtained, and through the customer information, entity attribute information such as customer gender attribute information can be obtained, thereby obtaining the entity attribute information in the text materials.
[0062] S2. Conduct semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text materials;
[0063] In the embodiments of the present invention, the semantic representation information is the semantic features of each entity attribute. By performing span division on the semantic representation information, the semantic information of the entity attribute information can be expanded.
[0064] In the embodiments of the present invention, conducting semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials includes:
[0065] Performing word embedding on the entity attribute information to obtain the attribute vector of the entity attribute information;
[0066] Using a pre-trained language representation model to perform semantic encoding on the attribute vector to obtain the semantic representation information in the text materials.
[0067] In the embodiments of the present invention, the word embedding is to convert the words in the entity attribute information into digital vectors, which embeds a high-dimensional space with the dimension of the number of all words into a continuous vector space with a lower dimension. Each word or phrase is mapped to a vector in the real number field to obtain the attribute vector of the entity attribute information, so as to be able to use the entity attribute information in digital form as input. The embodiments of the present invention can perform word embedding on the entity attribute information by using one-hot encoding, Word2vec algorithm, etc.
[0068] In the embodiments of the present invention, the pre-trained language representation model is the bert (Bidirectional Encoder Representation from Transformers) model. The pre-trained bert model is used to perform semantic encoding on the attribute vectors to obtain the semantic representation information in the text material. Specifically, the semantic encoding includes word vectors and position encoding, multi-head self-attention mechanism, residual connection and feed-forward network. The present invention uses the attribute vectors and position encoding to provide the position information of each word in the short text, so that the dependency relationship and temporal relationship of each word in the entity attribute information can be recognized. The mutual relationship between each word in the entity attribute information and the remaining words in the sentence is calculated by using the multi-head self-attention mechanism, so that each attribute vector contains the information of all attribute vectors in the entity attribute information. Then, residual connection is performed to solve the problems of gradient disappearance and network degradation. Finally, activation calculation is performed on the attribute vectors after semantic encoding, and the semantic representation information in the text material is output.
[0069] In the embodiments of the present invention, refer to Figure 2 As shown, the step of performing span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text material includes:
[0070] S21. Segment the entity attribute information to obtain the segmentation sequence of the entity attribute information;
[0071] S22. Perform initial span division on the semantic representation information according to the proportion of each segmentation in the segmentation sequence to obtain the initial span semantic sequence;
[0072] S23. Adjust the initial span semantic sequence by using a preset span value threshold to obtain the span semantic sequence of the text material.
[0073] In the embodiments of the present invention, by segmenting the entity attribute information and initially dividing the semantic representation information according to the proportion of each segmentation, the integrity of the semantic information in the initial span semantic sequence is ensured. Then, the initial span semantic sequence is adjusted by a preset span value threshold, so that the span value in the span semantic sequence does not exceed the preset threshold, reducing the problem of long-distance semantic dependence limitation between entities, improving the depth of the semantic representation information, and expanding the semantic feature information.
[0074] S3. Use the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text material to obtain the fusion relationship feature of the text material.
[0075] In the embodiments of the present invention, the entity type information is the entity feature corresponding to the semantic representation information included in the span semantic sequence. Then, the entity type corresponding to the span semantic sequence is determined through the entity feature to increase the feature range of the text material.
[0076] In the embodiments of the present invention, refer to Figure 3 As shown, the use of the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence includes:
[0077] S31. Perform convolution pooling on each span semantic in the span semantic feature sequence in turn to obtain a pooled feature map.
[0078] S32. Perform a fully connected operation on the pooled feature map to obtain the feature information corresponding to each span semantic.
[0079] S33. Calculate the feature similarity between the feature information and the entity type information, and determine the entity type sequence corresponding to the span semantic sequence according to the feature similarity.
[0080] In the embodiments of the present invention, a preset convolutional neural network can be used to perform convolution pooling on each span semantic in turn, which can further extract the features corresponding to each span semantic. At the same time, performing a fully connected operation on the pooled feature map can unfold and flatten the feature map to obtain the feature information of each span semantic. Then, by calculating the feature similarity between the feature information and the entity type information, the entity type information with the largest similarity is selected as the corresponding entity type for each span semantic, and thus the entity type sequence of the span semantic sequence can be determined.
[0081] In the embodiments of the present invention, fusing the entity type sequence with the text material means adding the entity types that may be included in the text material to the text material, so that the text material contains the corresponding entity types, thereby increasing the potential information of the text material.
[0082] In an embodiment of the present invention, the fusion of the entity type sequence and the text material to obtain the fusion relationship feature of the text material includes:
[0083] Convert the text material into a text vector and construct a vector matrix of the text vector;
[0084] Perform a dot product of the vector matrix with each entity type in the entity type sequence to obtain the fusion relationship feature of the text material.
[0085] In an embodiment of the present invention, by constructing a vector matrix of text materials, each entity type in the entity type sequence can be added to the text materials, realizing the fusion of the text materials and the entity type sequence, expanding the feature depth of the text materials, so as to deeply mine the deep entity relationships of each customer, and then accurately display the entity relationships.
[0086] S4. Use the fusion relationship feature to classify the entity relationships of each customer in the customer set to obtain a customer classification set;
[0087] In an embodiment of the present invention, the entity relationship classification is to classify each customer according to the corresponding fusion relationship feature in each customer's text material, classify the customers with similar entity classification categories, and obtain a customer classification set with different entity categories, so as to determine the entity relationship of each customer.
[0088] In an embodiment of the present invention, the use of the fusion relationship feature to classify the entity relationships of each customer in the customer set to obtain a customer classification set includes:
[0089] Use a pre-constructed bidirectional long short-term memory network to calculate the forward propagation feature and the backward propagation feature corresponding to the fusion relationship feature;
[0090] Perform feature splicing on the forward propagation feature and the backward propagation feature to obtain the splicing feature of the fusion relationship feature;
[0091] Perform an activation operation on the splicing feature to obtain the entity category corresponding to the fusion relationship feature, and classify the entity categories of each customer in the customer set according to the entity category to obtain a customer classification set.
[0092] In the embodiment of the present invention, the pre-constructed long short-term memory network is a (Bi-directional Long Short-Term Memory, Bi-LSTM) bidirectional long short-term memory network, which consists of a forward memory network and a backward reverse memory network. The forward memory network processes the input fusion relationship features in the forward direction, and the backward memory network processes the fusion relationship features in the reverse direction, so as to obtain the forward and backward feature information of the fusion relationship features, thereby increasing the information of the spliced features and improving the accuracy of entity relationship classification.
[0093] In the embodiment of the present invention, the entity category is the classification category corresponding to the customer. For example, classified according to the cooperation level with the enterprise, the entity category can be divided into customers with high cooperation intention, customers with low cooperation intention, key customers, etc. By activating the spliced features, the probability of the spliced features in each entity category is obtained, and the entity category with the largest probability is selected as the entity category corresponding to the spliced features, and then entity relationship classification is performed on each customer to obtain an entity customer set.
[0094] In the embodiment of the present invention, the customers in the customer classification set are customers with the same entity category. Therefore, through the customer classification set, the customer entities with a relatively high degree of relevance to each customer can be determined, and then the entity relationship of each customer can be determined, which is beneficial to the enterprise customers to expand their business scope.
[0095] S5. Construct an entity relationship graph for each customer in the customer set according to the customer classification set.
[0096] In the embodiment of the present invention, the entity relationship graph is a graph-based data structure, where each customer is used as a node in the graph, and the relationship between each customer is used as an edge connecting the nodes, so as to display the entity relationship of each customer and intuitively determine the associated customers of each customer.
[0097] In the embodiment of the present invention, constructing the entity relationship graph for each customer in the customer set according to the customer classification set includes:
[0098] Taking each customer in the customer set as a graph node in the entity relationship graph;
[0099] Determining the association relationship between the graph nodes according to the customer classification set, and constructing the edges of the graph nodes according to the association relationship;
[0100] Generating an entity relationship graph for each customer in the customer set according to the graph nodes and the edges of the graph nodes.
[0101] In the embodiments of the present invention, each customer in the customer set serves as a graph node of the entity relationship graph. Other customers in the customer classification set where each customer is located are regarded as associated customers, and then the association relationship between each customer is determined. The associated customers are connected to construct the edges of each graph node.
[0102] In the embodiments of the present invention, the association degree between each customer is deeply mined through the customer classification set, and the association degree between each customer is intuitively displayed by constructing an entity relationship graph. Other customers with a high degree of association can be found through one customer, thereby effectively improving the accuracy of entity relationship display.
[0103] In the embodiments of the present invention, by obtaining the text materials of each customer and extracting the entity attribute information in the text materials, the entity attributes of each customer can be identified using the attribute information, so as to calculate the entity attribute association between each customer; identifying the semantic representation information in the text materials and dividing the span of the semantic representation information in combination with the context can increase the breadth of the semantic representation, and further increase the breadth of the entity types corresponding to the semantic representation information. Fusing the entity types with the text materials to obtain the fusion relationship features can increase the potential information of the text materials, thereby deeply mining the association degree between each customer to classify the customers and obtain the customer classification set; displaying the entity relationship graph of each customer in the customer set through the customer classification set can effectively improve the accuracy of entity relationship display. Therefore, the entity relationship display method proposed by the present invention can solve the problem of low accuracy in entity relationship display.
[0104] As Figure 4 shown, it is a functional module diagram of an entity relationship display device provided by an embodiment of the present invention.
[0105] The entity relationship display device 400 of the present invention can be installed in an electronic device. According to the functions achieved, the entity relationship display device 400 may include an entity attribute information extraction module 401, a span semantic sequence generation module 402, a fusion relationship feature generation module 403, an entity relationship classification module 404, and an entity relationship graph construction module 405. The modules of the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0106] In this embodiment, the functions of each module / unit are as follows:
[0107] The entity attribute information extraction module 401 is used to obtain the text materials of each customer in the customer set and extract the entity attribute information in the text materials;
[0108] The span semantic sequence generation module 402 is configured to perform semantic recognition on the entity attribute information to obtain semantic representation information in the text material, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text material;
[0109] The fusion relationship feature generation module 403 is configured to use preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text material to obtain the fusion relationship feature of the text material;
[0110] The entity relationship classification module 404 is configured to perform entity relationship classification on each customer in the customer set by using the fusion relationship feature to obtain a customer classification set;
[0111] The entity relationship graph construction module 405 is configured to construct an entity relationship graph for each customer in the customer set according to the customer classification set.
[0112] Specifically, each module in the entity relationship display device 400 in the embodiments of the present invention uses the same technical means as those in the above Figures 1 to 3 and can produce the same technical effects, which will not be elaborated here.
[0113] As Figure 5 shown, it is a schematic structural diagram of an electronic device for implementing the entity relationship display method provided by an embodiment of the present invention.
[0114] The electronic device 500 may include a processor 501, a memory 502, a communication bus 503, and a communication interface 504, and may further include a computer program stored in the memory 502 and executable on the processor 501, such as an entity relationship display program.
[0115] Among them, the processor 501 may be composed of integrated circuits in some embodiments. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 501 is the control core (Control Unit) of the electronic device, connecting various components of the entire electronic device through various interfaces and lines, and by running or executing programs or modules stored in the memory 502 (such as executing the entity relationship display program, etc.), and calling data stored in the memory 502, to perform various functions of the electronic device and process data.
[0116] The memory 502 includes at least one type of readable storage medium, which includes flash memory, mobile hard disks, multimedia cards, card-type memories (such as SD or DX memories, etc.), magnetic memories, magnetic disks, optical disks, etc. In some embodiments, the memory 502 may be an internal storage unit of the electronic device, such as the mobile hard disk of the electronic device. In other embodiments, the memory 502 may also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the electronic device. Further, the memory 502 may also include both an internal storage unit and an external storage device of the electronic device. The memory 502 can be used not only to store application software installed on the electronic device and various types of data, such as the code of the entity relationship display program, etc., but also to temporarily store data that has been output or will be output.
[0117] The communication bus 503 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable connection communication between the memory 502 and at least one processor 501, etc.
[0118] The communication interface 504 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is generally used to establish a communication connection between this electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), and optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, and is used to display information processed in the electronic device and to display a visual user interface.
[0119] Only an electronic device with components is shown in the figure. Those skilled in the art can understand that the structure shown in the figure does not constitute a limitation on the electronic device, and it may include fewer or more components than shown in the figure, or combine some components, or have different component arrangements.
[0120] For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to each component. Preferably, the power source can be logically connected to the at least one processor 501 through a power management device, so as to implement functions such as charge management, discharge management, and power consumption management through the power management device. The power source may also include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated here.
[0121] It should be understood that the embodiments are only for illustrative purposes and are not limited by this structure in the scope of the patent application.
[0122] The entity relationship display program stored in the memory 502 in the electronic device 500 is a combination of multiple instructions. When running in the processor 501, it can implement:
[0123] Obtain the text materials of each customer in the customer set, and extract the entity attribute information in the text materials;
[0124] Perform semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text materials;
[0125] Use the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text materials to obtain the fusion relationship feature of the text materials;
[0126] Use the fusion relationship feature to classify the entity relationships of each customer in the customer set to obtain a customer classification set;
[0127] Construct an entity relationship graph of each customer in the customer set according to the customer classification set.
[0128] Specifically, the specific implementation method of the above instructions by the processor 501 can refer to the description of the relevant steps in the corresponding embodiments of the accompanying drawings, which will not be elaborated here.
[0129] Furthermore, if the modules / units integrated in the electronic device 500 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only Memory).
[0130] The present invention also provides a computer-readable storage medium storing a computer program, which when executed by a processor of an electronic device, can implement:
[0131] Obtain the text materials of each customer in the customer set, and extract the entity attribute information in the text materials;
[0132] Perform semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text materials;
[0133] Use the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text materials to obtain the fusion relationship feature of the text materials;
[0134] Use the fusion relationship feature to perform entity relationship classification on each customer in the customer set to obtain a customer classification set;
[0135] Construct an entity relationship graph of each customer in the customer set according to the customer classification set.
[0136] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation.
[0137] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, in each embodiment of the present invention, the functional modules can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0139] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.
[0140] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be encompassed within the present invention. Any reference signs in the claims should not be construed as limiting the claimed invention.
[0141] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0142] In addition, obviously, the word "including" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The terms such as "first" and "second" are used to represent names and do not indicate any specific order.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for presenting entity relationships, characterized in that, The method includes: Obtain the text materials of each customer in the customer set, and extract the entity attribute information in the text materials; Perform semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials; Segment the entity attribute information to obtain the word segmentation sequence of the entity attribute information; Perform initial span division on the semantic representation information according to the proportion of each word segment in the word segmentation sequence in the word segmentation sequence to obtain the initial span semantic sequence; Adjust the initial span semantic sequence by using a preset span value threshold to obtain the span semantic sequence of the text materials; Use the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text materials to obtain the fusion relationship feature of the text materials; Perform entity relationship classification on each customer in the customer set by using the fusion relationship feature to obtain a customer classification set; Construct an entity relationship graph for each customer in the customer set according to the customer classification set.
2. The entity relationship display method according to claim 1, wherein The performing semantic recognition on the entity attribute information to obtain the semantic representation information in the text materials includes: Perform word embedding on the entity attribute information to obtain the attribute vector of the entity attribute information; Use the pre-trained language representation model to perform semantic encoding on the attribute vector to obtain the semantic representation information in the text materials.
3. The entity relationship display method according to claim 1, characterized in that The using the preset entity type information to determine the entity type sequence corresponding to the span semantic sequence includes: Perform convolutional pooling on each span semantic in the span semantic sequence in turn to obtain a pooled feature map; Fully connect the pooled feature map to obtain the feature information corresponding to each span semantic; Calculate the feature similarity between the feature information and the entity type information, and determine the entity type sequence corresponding to the span semantic sequence according to the feature similarity.
4. The entity relationship display method according to claim 1, wherein The fusing the entity type sequence with the text materials to obtain the fusion relationship feature of the text materials includes: Convert the text materials into a text vector, and construct a vector matrix of the text vector; Perform dot multiplication on the vector matrix with the entity types in the entity type sequence respectively to obtain the fusion relationship feature of the text materials.
5. The entity relationship display method according to claim 1, characterized in that The performing entity relationship classification on each customer in the customer set by using the fusion relationship feature to obtain a customer classification set includes: Use a pre-constructed bidirectional long short-term memory network to calculate the forward propagation feature and the backward propagation feature corresponding to the fusion relationship feature; Perform feature splicing on the forward propagation feature and the backward propagation feature to obtain the spliced feature of the fusion relationship feature; Perform an activation operation on the spliced feature to obtain the entity category corresponding to the fusion relationship feature, and perform entity category classification on each customer in the customer set according to the entity category to obtain a customer classification set.
6. The entity relationship display method according to claim 1, characterized in that, The constructing an entity relationship graph for each customer in the customer set according to the customer classification set includes: Take each customer in the customer set as a graph node in the entity relationship graph; Determine the association relationships between the graph nodes according to the customer classification set, and construct the edges of the graph nodes according to the association relationships; Generate an entity relationship graph for each customer in the customer set according to the graph nodes and the edges of the graph nodes.
7. An entity relationship display device for implementing the entity relationship display method according to any one of claims 1-6, characterized in that The device includes: An entity attribute information extraction module, configured to obtain the text materials of each customer in the customer set, and extract the entity attribute information in the text materials; A span semantic sequence generation module, configured to perform semantic recognition on the entity attribute information to obtain semantic representation information in the text materials, and perform span division on the semantic representation information according to the entity attribute information to obtain the span semantic sequence of the text materials; A fusion relationship feature generation module, configured to use preset entity type information to determine the entity type sequence corresponding to the span semantic sequence, and fuse the entity type sequence with the text materials to obtain the fusion relationship feature of the text materials; An entity relationship classification module, configured to perform entity relationship classification on each customer in the customer set by using the fusion relationship feature to obtain a customer classification set; An entity relationship graph construction module, configured to construct an entity relationship graph for each customer in the customer set according to the customer classification set.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the entity relationship display method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the entity relationship display method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Product information pushing method and device, terminal equipment and storage medium
CN114022246A
Chinese entity and relation extraction method and device based on span and attention mechanism
CN114881038A