Method and device for acquiring association relationship, storage medium and electronic device
By obtaining the embedded representation and Euclidean distance of the target entity, and combining it with the preset association relationship and classification model, the problem of difficulty in obtaining the target company's product field and industry supply relationship in the existing technology is solved, and more accurate and extensive association relationship determination is achieved.
Patent Information
- Application Number
- CN202210442619.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-04-25
AI Technical Summary
Existing methods can only obtain the target company's supply relationships, but it is difficult to obtain the supply relationships of related companies or enterprises with similar product areas to the target company, let alone the supply relationships of the target company's industry.
By obtaining the embedded representation of the target entity, calculating the Euclidean distance between the target entity and the target entity, determining the set of related entities, and determining the association relationship of the target entity's corresponding entity category according to the preset association relationship, the entity category is classified using a pre-trained classification model.
It improves the accuracy of the association relationships of target entities, expands the scope of association relationships, and accurately obtains the association relationships of the target entity's category.
Smart Images

Figure CN114780728B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of information acquisition, and in particular, to a method, device, storage medium and electronic equipment for acquiring a correlation relationship. BACKGROUND
[0002] In actual production and operation activities, an upstream company and a downstream company form a supply chain relying on a supply-demand relationship. For example, A company sells chemical raw materials to B company, and B company sells organic intermediates to C company, thereby A company, B company and C company form a supply chain. For B company, A company is its upstream company, and C company is its downstream company.
[0003] In order to determine the supply relationship of a target company and its industry, in the existing method, the supply demand corresponding to the target company needs to be acquired, specifically, according to the supply behavior data of the target company and the upstream and downstream companies of the target company, a company having direct supply demand with the target company is determined, and then other companies having a supply relationship with the target company are determined.
[0004] However, in the existing method, only the supply relationship of the target company can be acquired, it is difficult to acquire the supply relationship of a related company or enterprise similar to the product field of the target company, and it is even more difficult to acquire the supply relationship of the industry in which the target company is located. SUMMARY
[0005] In order to solve the above problems, the present disclosure provides a method, device, storage medium and electronic equipment for acquiring a correlation relationship.
[0006] In a first aspect, the present disclosure provides a method for acquiring a correlation relationship, the method comprising: acquiring a target entity determined by a user from a plurality of entities, and an embedding representation of the plurality of entities, the embedding representation being used to represent the correlation degree between the plurality of entities; acquiring, according to the embedding representation, a related entity related to the target entity, to obtain a related entity set, the related entity set comprising the target entity and the related entity; determining, according to a preset correlation relationship corresponding to the plurality of entities, an associated object associated with each entity in the related entity set; and determining, according to the preset correlation relationship, the associated object and the related entity set, a correlation relationship of an entity category corresponding to the target entity.
[0007] Optionally, the acquiring, according to the embedding representation, of the related entity related to the target entity to obtain the related entity set comprises: calculating, according to the embedding representation, a first Euclidean distance between the target entity and a first other entity in the plurality of entities except the target entity; and determining the related entity set according to the first Euclidean distance.
[0008] Optionally, the determining the related entity set according to the first Euclidean distance comprises: taking a preset number of first other entities closest to the first Euclidean distance as entities in the related entity set, to obtain the related entity set.
[0009] Optionally, the determining the related entity set according to the first Euclidean distance comprises: taking a first other entity with a first Euclidean distance less than or equal to a preset distance threshold as a pending entity; and performing a set determination step in a loop until a preset loop termination condition is met, to obtain the related entity set; the set determination step comprises: calculating a second Euclidean distance between the pending entity and a second other entity, the second other entity comprising other entities in the plurality of entities except the pending entity and the target entity; adding an entity in the second other entity with a second Euclidean distance less than or equal to a preset distance threshold to the related entity set, and taking the entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold as a new pending entity.
[0010] Optionally, the preset loop termination condition comprises: determining that a number of the pending entities reaches a preset number; or, determining that no new pending entity is determined.
[0011] Optionally, the determining the association relationship of the target entity corresponding entity category according to the preset association relationship, the association object and the related entity set comprises: obtaining a first entity category corresponding to each entity in the related entity set, and an object category of the association object; mapping, according to the preset association relationship, an association relationship between each entity in the related entity set and the object as a category association relationship of the first entity category and the object category; and determining the association relationship of the target entity corresponding entity category according to the category association relationship.
[0012] Optionally, the association object comprises an association entity and an association product, the object category comprises a second entity category corresponding to the association entity and a product category corresponding to the association product, and the obtaining the first entity category corresponding to each entity in the related entity set and the object category of the association object comprises: obtaining the first entity category corresponding to each entity in the related entity set, and the second entity category corresponding to each entity in the association entity and the product category corresponding to each product in the association product.
[0013] Optionally, the determining, according to the category association relationship, of the association relationship of the entity category corresponding to the target entity comprises: for each category association relationship, if the category association relationship is included in a pre-established category relationship set, increasing a statistical parameter corresponding to the category association relationship in the category relationship set by a specified value, and if the category association relationship is not included in the category relationship set, adding the category association relationship to the category relationship set; and determining the association relationship corresponding to the entity type of the target entity according to the statistical parameter of each category association relationship in the category relationship set.
[0014] Optionally, the determining, according to the statistical parameter of each category association relationship in the category relationship set, of the association relationship corresponding to the entity type of the target entity comprises: taking a preset number of category association relationships with the largest statistical parameter in the category relationship set as the association relationship corresponding to the entity type of the target entity.
[0015] Optionally, the entity comprises a company, the association relationship comprises a supply relationship between the companies, and the association object comprises a company and / or a product.
[0016] In a second aspect, the present disclosure provides a device for obtaining an association relationship, the device comprising:
[0017] an obtaining module configured to obtain a target entity determined by a user from a plurality of entities and an embedding representation of the plurality of entities, the embedding representation being used to represent a correlation degree between the plurality of entities;
[0018] a set determining module configured to obtain, according to the embedding representation, a relevant entity related to the target entity, to obtain a relevant entity set, the relevant entity set comprising the target entity and the relevant entity;
[0019] an object determining module configured to determine, according to a preset association relationship corresponding to the plurality of entities, an association object associated with each entity in the relevant entity set;
[0020] a relationship determining module configured to determine, according to the preset association relationship, the association object and the relevant entity set, an association relationship of an entity category corresponding to the target entity.
[0021] Optionally, the set determining module is configured to calculate a first Euclidean distance between the target entity and a first other entity in the plurality of entities except the target entity according to the embedding representation, respectively; and determine the relevant entity set according to the first Euclidean distance.
[0022] Optionally, the set determining module is configured to determine the first other entities with the first Euclidean distances closest to the target entity as the entities in the related entity set, so as to obtain the related entity set.
[0023] Optionally, the set determining module is configured to determine the first other entities with the first Euclidean distances less than or equal to a preset distance threshold as pending entities; and perform the set determining step cyclically until a preset cycle termination condition is met, so as to obtain the related entity set; the set determining step includes: calculating second Euclidean distances between the pending entities and second other entities, the second other entities including other entities in the plurality of entities except the pending entities and the target entity; adding the second other entities with the second Euclidean distances less than or equal to the preset distance threshold to the related entity set, and taking the second other entities with the second Euclidean distances less than or equal to the preset distance threshold as new pending entities.
[0024] Optionally, the preset cycle termination condition includes: determining that a quantity of the pending entities reaches a preset quantity; or determining that no new pending entity is determined.
[0025] Optionally, the relationship determining module is configured to acquire a first entity category corresponding to each entity in the related entity set and an object category of the association object; map, according to the preset association relationship, an association relationship between each entity in the related entity set and the association object to a category association relationship between the first entity category and the object category; and determine the association relationship of the entity category corresponding to the target entity according to the category association relationship.
[0026] Optionally, the association object includes an association entity and an association product, and the object category includes a second entity category corresponding to the association entity and a product category corresponding to the association product; and the relationship determining module is configured to acquire the first entity category corresponding to each entity in the related entity set, the second entity category corresponding to each entity in the association entity, and the product category corresponding to each product in the association product.
[0027] Optionally, the relationship determining module is configured to, for each category association relationship, increase a statistical parameter corresponding to the category association relationship in a category relationship set by a specified value in a case where the category association relationship is included in the category relationship set, or add the category association relationship to the category relationship set in a case where the category association relationship is not included in the category relationship set; and determine the association relationship corresponding to the entity type of the target entity according to the statistical parameter of each category association relationship in the category relationship set.
[0028] Optionally, the relationship determining module is configured to associate, as the association relationship corresponding to the entity type of the target entity, a preset number of association relationships with the largest statistical parameters in the set of category relationships.
[0029] Optionally, the entity includes a company, the association relationship includes a supply relationship between the companies, and the association object includes a company and / or a product.
[0030] In a third aspect, a non-transitory computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above method are implemented.
[0031] In a fourth aspect, an electronic device is provided, which includes a memory storing a computer program, and a processor configured to execute the computer program in the memory to implement the steps of the above method.
[0032] By using the above technical solution, the embedding representation of a plurality of entities including the target entity is obtained, the related entities related to the target entity are obtained according to the embedding representation, the association objects associated with each entity in the set of related entities are determined according to the preset association relationship corresponding to the plurality of entities, and then the association relationship of the entity category corresponding to the target entity is determined according to the preset association relationship, the association objects and the set of related entities. In this way, the association objects having the association relationship with the target entity are obtained through the embedding representation between the target entity and a plurality of entities, and then the association relationship of the entity category corresponding to the target entity is determined, which is beneficial to improving the accuracy of the association relationship of the target entity, expanding the range of the association relationship of the target entity, and accurately obtaining the association relationship of the category to which the target entity belongs.
[0033] Other features and advantages of the present disclosure will be described in detail in the following detailed description section. BRIEF DESCRIPTION OF DRAWINGS
[0034] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of the specification, which together with the following detailed description, serve to explain the present disclosure. In the drawings:
[0035] Figure 1 is a flowchart of a method for obtaining an association relationship according to an example embodiment;
[0036] Figure 2 is a flowchart of another method for obtaining an association relationship according to an example embodiment;
[0037] Figure 3 is a block diagram of another device for obtaining an association relationship according to an example embodiment;
[0038] Figure 4 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0039] The specific embodiments of the present disclosure will be described below in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely intended to illustrate and explain the present disclosure, and are not intended to limit the present disclosure.
[0040] It should be noted that all actions of obtaining signals, information or data in the present disclosure are carried out in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
[0041] First, the application scenario of the present disclosure is described. The present disclosure is applied to the scenario of obtaining association relationship information. In the existing method of obtaining association relationship, the upstream and downstream companies of the target company are obtained by obtaining the raw material supply chain and product supply chain of the target company, the companies having a supply and demand relationship with the target company are determined, and the supply relationship of the target company is determined.
[0042] However, the inventors found that in the existing method, since only the upstream and downstream companies of the target company are concerned, the data range obtained is small, which leads to the inability to further obtain other supply relationships of the industry chain in which the target company is located, the inability to obtain the supply relationship of other companies related to the product field of the target company, and the inability to obtain the supply relationship of the industry and the industry category in which the target company is located.
[0043] In order to solve the above problems, the present application provides a method, device, storage medium and electronic equipment for obtaining association relationship, by obtaining the embedding representation of a plurality of entities including the target entity, obtaining the related entities related to the target entity according to the embedding representation, and determining the association object associated with each entity in the related entity set according to the preset association relationship corresponding to the plurality of entities, and then determining the association relationship of the entity category corresponding to the target entity according to the preset association relationship, the association object and the related entity set. In this way, by the embedding representation between the target entity and a plurality of entities, the association object having an association relationship with the target entity is obtained, and then the association relationship of the entity category corresponding to the target entity is determined, which is beneficial to improve the accuracy of the association relationship of the target entity, expand the range of the association relationship of the target entity, and accurately obtain the association relationship of the category in which the target entity is located.
[0044] The present disclosure will be described below in conjunction with specific embodiments.
[0045] Figure 1 is a method for obtaining association relationship according to an exemplary embodiment of the present application, as shown in Figure 1 the method comprises:
[0046] S101、obtain a target entity determined by a user from a plurality of entities and an embedding representation of the plurality of entities.
[0047] The embedding representation is used to represent the correlation between the plurality of entities, the entities include companies, the correlation includes supply relationship between the companies, and the correlation object includes companies and / or products. The embedding representation is obtained by analyzing supply relationship data and can be a multi-dimensional coordinate or vector representation used to represent the closeness of the supply relationship between the plurality of companies.
[0048] For example, the embedding representation can be determined by supply and demand behavior data between the plurality of companies to determine the supply and demand relationship between the plurality of companies, and then generate a plurality of supply and demand paths, and input the plurality of supply and demand paths into a pre-trained vector model to obtain the embedding representation of the plurality of entities.
[0049] Specifically, the embedding representation of each entity can be obtained by inputting the plurality of supply and demand paths into a pre-trained vector model according to the supply and demand behavior data between the plurality of companies, and vectorizing the supply and demand paths by the pre-trained vector model. The pre-trained vector model can be word2vec or GloVe (Global Vectors for Word Representation) or the like.
[0050] In this way, by vectorizing the supply data between the plurality of companies, it is beneficial to more intuitively represent the supply relationship and closeness between the plurality of companies.
[0051] S102, according to the embedding representation, obtaining a related entity related to the target entity to obtain a related entity set.
[0052] The related entity set includes the target entity and the related entity. Since the embedding representation is a vectorization of the supply data between the plurality of entities, the similarity between the embedding representation of the target entity and the embedding representation of other entities is the similarity between the supply chain of the target entity and the supply chain of other entities. The similarity between the embedding representation of the target entity and the embedding representation of other entities can be calculated by the distance between them, such as cosine distance, Euclidean distance, etc. The greater the distance, the smaller the similarity, and the smaller the supply relationship. On the contrary, the smaller the distance, the greater the similarity, and the greater the supply relationship.
[0053] Therefore, in this step, the related entity related to the target entity is obtained, and the first Euclidean distance between the target entity and a first other entity in the plurality of entities except the target entity can be calculated according to the embedding representation; and the related entity set is determined according to the first Euclidean distance.
[0054] In a possible implementation, the first preset number of the first other entities with the first Euclidean distance are taken as entities in the set of related entities, so as to obtain the set of related entities.
[0055] For example, the Euclidean distances between the plurality of entities and the target entity are calculated with the target entity as the center, and the preset number of entities are selected from the plurality of entities as related entities in the order of the Euclidean distances from small to large, so as to obtain the set of related entities.
[0056] For example, there are seven entities A, B, C, D, E, F, and G in total, entity A is the target entity, and the preset number is 3, that is, three entities are needed as related entities to form the set of related entities together with entity A. The Euclidean distances between entity A and entities B, C, D, E, F, and G are obtained, and the Euclidean distance between entity A and entity B is 8, the Euclidean distance between entity A and entity C is 11, the Euclidean distance between entity A and entity D is 2, the Euclidean distance between entity A and entity E is 4, the Euclidean distance between entity A and entity F is 16, and the Euclidean distance between entity A and entity G is 1. Therefore, entity G, entity D, and entity E can be obtained as related entities, that is, the entities in the set of related entities include entity A, entity G, entity D, and entity E.
[0057] In another possible implementation, the first other entity with the first Euclidean distance less than or equal to the preset distance threshold is taken as a pending entity, and the set determination step is executed in a loop until a preset loop termination condition is met, so as to obtain the set of related entities. The set determination step includes: calculating a second Euclidean distance between the pending entity and a second other entity, the second other entity including other entities in the plurality of entities except the pending entity and the target entity; adding an entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold to the set of related entities, and taking the entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold as a new pending entity.
[0058] The preset loop termination condition includes: determining that the number of the pending entities reaches a preset number; or, determining that no new pending entity is determined.
[0059] For example, there are 1000 entities, entity 1 to entity 1000, the target entity is entity 1, the preset number is 100, and the preset distance threshold can be 3. An empty set A is created, entities with a Euclidean distance less than or equal to 3 from the target entity 1 are obtained, and 4 entities, entity 10, entity 36, entity 200 and entity 411, are obtained. The 4 entities are put into set A as undetermined entities, and entities with a Euclidean distance less than or equal to 3 from the entity 10, the entity 36, the entity 200 and the entity 411 are obtained respectively. The entities with a Euclidean distance less than or equal to 3 from the entity 10 are 91, the entities with a Euclidean distance less than or equal to 3 from the entity 36 are 49 and 41, the entities with a Euclidean distance less than or equal to 3 from the entity 200 are 133, 249 and 251, and the entities with a Euclidean distance less than or equal to 3 from the entity 411 are 12. The 7 entities, entity 91, entity 49, entity 41, entity 133, entity 249, entity 251 and entity 12, are put into set A as undetermined entities, and entities with a distance less than or equal to 3 from the 7 undetermined entities are obtained again. In this way, the size of set A reaches 100 or the size of set A no longer changes, that is, the number of undetermined entities reaches the preset number, or no new undetermined entity is obtained, and the entity 1 is put into set A to obtain a related entity set.
[0060] It should be noted that the above-mentioned preset distance threshold can be adjusted according to actual conditions, or adjusted in real time according to the growth rate of the undetermined entity. For example, in the case that the growth rate of the undetermined entity is relatively high, the preset distance threshold can be appropriately reduced in the next cycle of obtaining the undetermined entity. In addition, the weight of the plurality of entity embedding representations can also be adjusted according to the needs, such as increasing the transaction amount in the supply data as the weight of the corresponding entity embedding representation, and then obtaining the Euclidean distance between the target entity and the plurality of entities. The present disclosure does not limit this.
[0061] In this way, the supply data is vectorized, the related entities are determined by obtaining the Euclidean distance between the target entity and the plurality of entities, the speed of obtaining the related entities is improved, the supply relationship between the related entities and the target entity is more intuitive, and the accuracy of the related entities is increased.
[0062] S103, determining an associated object associated with each entity in the related entity set according to a preset association relationship corresponding to the plurality of entities.
[0063] The preset association relationship can be supply data of the related entities in the related entity set, and the associated object can be a company and / or a product determined according to the supply data. According to the supply data, all associated objects of the related entities in the related entity set are determined.
[0064] For example, there is a related entity A in the related entity set, which is a medical device production company, and there is supply data: XX medical device production company (related entity A) → XX medical device (product) → XX hospital (company), and the XX medical device and the XX hospital are associated objects of the entity A; or the related entity A is a XX pharmacy, and there is supply data: XX pharmacy (related entity A) → XX medicine (product), and the medicine is an associated object of the related entity A.
[0065] In S104, according to the preset association relationship, the associated object, and the related entity set, the association relationship of the target entity corresponding entity category is determined.
[0066] For example, the association relationship can be determined by the following steps:
[0067] In S1041, the first entity category corresponding to each entity in the related entity set and the object category of the associated object are obtained.
[0068] For example, the associated object can include an associated entity and an associated product, and the object category can include a second entity category corresponding to the associated entity and a product category corresponding to the associated product.
[0069] For example, the related entity set and the associated object can be classified according to the enterprise classification directory and the product classification directory by using a pre-trained classification model, to obtain the first entity category corresponding to each entity in the related entity set, the second entity category corresponding to each entity in the associated entity, and the product category corresponding to each product in the associated product.
[0070] For example, the classification model is trained by the following method: obtaining a sample input set and a sample output set, the sample input set including a plurality of sample inputs, the sample input including entity names of the plurality of entities, the sample output set including sample outputs corresponding to each sample input, each sample output including an entity category corresponding to the entity name; taking the sample input set as the input of the classification model and taking the sample output set as the output of the classification model to train the classification model.
[0071] For example, the name of the related entity and the name of the associated object are input into the pre-trained classification model, the companies in the related entity and the associated object are classified according to keywords according to the enterprise classification directory, such as being classified as “hospital” if the name contains “hospital”, or being classified as “pharmacy” if the name contains “pharmacy” / “medicine production”; and the products are classified according to keywords according to the product classification directory, such as being classified as “mobile phone” if the name contains “mobile phone”.
[0072] S1042, according to the preset association relationship, mapping the association relationship between each entity in the related entity set and the object as the category association relationship of the first entity category and the object category.
[0073] For example, there is a preset association relationship: XX City First Machinery Company → XX Medical Machinery Product → XX City First Hospital. According to the classification categories of the entity and the associated object in S1, the corresponding association relationship of the entity category can be obtained: company category A → product category 1 → company category B.
[0074] S1043, according to the category association relationship, determining the association relationship of the corresponding entity category of the target entity.
[0075] Among them, multiple preset association relationships may correspond to an association relationship of an entity category. For example, there are two preset association relationships: XX City First Machinery Company → XX Medical Machinery Product → XX City First Hospital and XX City First Machinery Company → XX Medical Machinery Product → XX City Second Hospital. According to the two preset association relationships, the corresponding association relationship of the entity category is: company category A → product category 1 → company category B.
[0076] For example, for each category association relationship, if the category association relationship is included in the pre-established category relationship set, the corresponding statistical parameter of the category association relationship in the category relationship set is increased by a specified value, and if the category association relationship is not included in the category relationship set, the category association relationship is added to the category relationship set.
[0077] For example, in the case of obtaining the association relationship of the entity category according to the preset association relationship: XX City First Machinery Company → XX Medical Machinery Product → XX City First Hospital, if the category association relationship: company category A → product category 1 → company category B does not exist in the category relationship set, the category association relationship is added to the category relationship set, and if the category association relationship exists, the number of the category association relationship is increased by 1.
[0078] For example, the association relationship corresponding to the entity type of the target entity can be determined according to the statistical parameter of each category association relationship in the category relationship set.
[0079] Among them, different category association relationships may have different quantities, and the preset number of category association relationships with the largest statistical parameter in the category relationship set are taken as the association relationship corresponding to the entity type of the target entity.
[0080] According to the embedding representation of the target entity and the plurality of entities, the related entities related to the target entity are obtained, and according to the preset association relationship corresponding to the plurality of entities, an association object associated with each entity in the related entity set is determined, and then according to the preset association relationship, the association object and the related entity set, the association relationship of the entity category corresponding to the target entity is determined. In this way, by the embedding representation between the target entity and the plurality of entities, the association object having the association relationship with the target entity is obtained, and then the association relationship of the entity category corresponding to the target entity is determined, which is beneficial to improving the accuracy of the association relationship of the target entity, expanding the range of the association relationship of the target entity, and accurately obtaining the association relationship of the category to which the target entity belongs.
[0081] Figure 2 Another method for obtaining an association relationship according to an example embodiment of the present application is shown in the following. Figure 2 The embodiment is described by taking the entity as a company and the association relationship as a supply relationship between the companies as an example, and the method comprises the following steps.
[0082] S201, obtaining a target company determined by a user from a plurality of companies and embedding representations of the plurality of companies.
[0083] In this step, according to the supply and demand behavior data between the plurality of companies, a plurality of supply and demand paths are input into a pre-trained vector model, the supply and demand paths are vectorized by the pre-trained vector model, and embedding representations of the plurality of companies are obtained.
[0084] S202, calculating a first Euclidean distance between the target company and a first other company in the plurality of companies except the target company according to the embedding representation.
[0085] In this step, by calculating the first Euclidean distance between the target company and the first other company, the association degree between the target company and the first other company can be obtained, and the smaller the first Euclidean distance is, the closer the association degree is.
[0086] S203, determining a related company set according to the first Euclidean distance.
[0087] In this step, there are two methods for determining the related company set according to the first Euclidean distance.
[0088] The first method can be to arrange the first other companies in order of the first Euclidean distance from the target company from small to large, to obtain a pre-set number of first other companies arranged in front as related companies, and to determine the related company set according to the target company and the related companies.
[0089] The second method can be that the first other company with a first Euclidean distance less than or equal to a preset distance threshold value is obtained as a pending company, and the second other company with a second Euclidean distance less than or equal to a preset distance threshold value is obtained as a second pending company, the above steps are repeatedly executed until the number of the pending company reaches a preset number, or a new pending company is not determined, and the related company set is determined according to the target company and the pending company.
[0090] S204, determining an associated object associated with each company in the related company set according to a preset association relationship corresponding to the plurality of companies.
[0091] In this step, the preset association relationship can be supply data of the companies in the related company set, and the associated object can be a company and / or a product determined according to the supply data. According to the supply data of the related company, all associated objects of all companies in the related company set are determined.
[0092] S205, obtaining a first company category corresponding to each company in the related company set and an object category of the associated object.
[0093] In this step, the related company set and the associated object can be classified by a pre-trained classification model according to an enterprise classification directory and a product classification directory, to obtain the first company category corresponding to each company in the related company set, and the second company category corresponding to each company in the associated company and the product category corresponding to each product in the associated product.
[0094] S206, mapping the association relationship between each company in the related company set and the object into a category association relationship of the first company category and the object category according to the preset association relationship.
[0095] In this step, according to the first company category corresponding to each company in the related company set, and the second company category corresponding to each company in the associated company and the product category corresponding to each product in the associated product in the above S205 step, the supply data between each company in the related company set, each company in the associated company and each product in the associated product is mapped into a category association relationship between the first company category, the second company category and the product category, and a category relationship set is determined according to the category association relationship.
[0096] S207, determining an association relationship corresponding to the company type of the target company according to a statistical parameter of each category association relationship in the category relationship set.
[0097] In this step, for each category association relationship, if the category association relationship is included in a pre-established category relationship set, the corresponding statistical parameter of the category association relationship in the category relationship set is increased by a specified value, if the category association relationship is not included in the category relationship set, the category association relationship is added to the category relationship set, and after the statistics are completed, the preset number of category association relationships with the largest statistical parameter in the category relationship set are taken as the association relationships corresponding to the company type of the target company.
[0098] By using the above method, the embedding representation of the target entity and a plurality of entities is obtained, the related entity related to the target entity is obtained according to the embedding representation, the associated object associated with each entity in the related entity set is determined according to the preset association relationship corresponding to the plurality of entities, and then the association relationship of the entity category corresponding to the target entity is determined according to the preset association relationship, the associated object and the related entity set. In this way, by using the embedding representation between the target entity and a plurality of entities, the associated object having an association relationship with the target entity is obtained, and then the association relationship of the entity category corresponding to the target entity is determined, which is beneficial to improving the accuracy of the association relationship of the target entity, expanding the range of the association relationship of the target entity, and accurately obtaining the association relationship of the category to which the target entity belongs.
[0099] Figure 3 is a device for obtaining an association relationship according to an example embodiment of the present disclosure, as shown in Figure 3 the device comprises:
[0100] The obtaining module 301 is configured to obtain a target entity determined by a user from a plurality of entities and embedding representations of the plurality of entities, the embedding representations being used to represent the relevance between the plurality of entities.
[0101] The set determining module 302 is configured to obtain a related entity related to the target entity according to the embedding representations, to obtain a related entity set, and the related entity set includes the target entity and the related entity.
[0102] The object determining module 303 is configured to determine an associated object associated with each entity in the related entity set according to a preset association relationship corresponding to the plurality of entities.
[0103] The relationship determining module 304 is configured to determine an association relationship of an entity category corresponding to the target entity according to the preset association relationship, the associated object and the related entity set.
[0104] Optionally, the set determining module 302 is configured to calculate a first Euclidean distance between the target entity and a first other entity in the plurality of entities except the target entity according to the embedding representations; and determine the related entity set according to the first Euclidean distance.
[0105] Optionally, the set determining module 302 is configured to determine the first preset number of the first other entities with the first Euclidean distance as the entities in the related entity set, so as to obtain the related entity set.
[0106] Optionally, the set determining module 302 is configured to determine the first other entity with the first Euclidean distance less than or equal to a preset distance threshold as a pending entity, and repeatedly perform the set determining step until a preset loop termination condition is met, so as to obtain the related entity set. The set determining step includes: calculating a second Euclidean distance between the pending entity and a second other entity, the second other entity including other entities in the plurality of entities except the pending entity and the target entity; adding an entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold to the related entity set, and taking the entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold as a new pending entity.
[0107] Optionally, the preset loop termination condition includes: determining that the number of the pending entities reaches a preset number; or, determining that no new pending entity is determined.
[0108] Optionally, the relationship determining module 304 is configured to obtain a first entity category corresponding to each entity in the related entity set and an object category of the associated object; according to the preset association relationship, map the association relationship between each entity in the related entity set and the object to a category association relationship between the first entity category and the object category; and determine the association relationship of the entity category corresponding to the target entity according to the category association relationship.
[0109] Optionally, the associated object includes an associated entity and an associated product, and the object category includes a second entity category corresponding to the associated entity and a product category corresponding to the associated product. The relationship determining module 304 is configured to obtain the first entity category corresponding to each entity in the related entity set, the second entity category corresponding to each entity in the associated entity, and the product category corresponding to each product in the associated product.
[0110] Optionally, the relationship determining module 304 is configured to, for each category association relationship, increase a statistical parameter corresponding to the category association relationship in a category relationship set by a specified value in a case where the category association relationship is included in the category relationship set, or add the category association relationship to the category relationship set in a case where the category association relationship is not included in the category relationship set; and determine the association relationship corresponding to the entity type of the target entity according to the statistical parameter of each category association relationship in the category relationship set.
[0111] Optionally, the relationship determining module 304 is configured to associate, as the association relationship corresponding to the entity type of the target entity, a preset number of association relationships of the category relationship set with the maximum statistical parameter.
[0112] Optionally, the entity includes a company, the association relationship includes a supply relationship between the companies, and the association object includes a company and / or a product.
[0113] With the above device, by obtaining the embedding representation of a plurality of entities including the target entity, obtaining the related entities related to the target entity according to the embedding representation, and determining the association object associated with each entity in the related entity set according to the preset association relationship corresponding to the plurality of entities, and then determining the association relationship of the entity category corresponding to the target entity according to the preset association relationship, the association object and the related entity set, the association object associated with the target entity through the embedding representation between the target entity and the plurality of entities is obtained, and then the association relationship of the entity category corresponding to the target entity is determined, which is beneficial to improve the accuracy of the association relationship of the target entity, expand the range of the association relationship of the target entity, and accurately obtain the association relationship of the category to which the target entity belongs.
[0114] As to the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments of the method, and will not be described here in detail.
[0115] Figure 4 is a block diagram of an electronic device 400 according to an example embodiment. As shown in Figure 4 the electronic device 400 can include a processor 401 and a memory 402. The electronic device 400 can also include one or more of a multimedia component 403, an input / output (I / O) interface 404, and a communication component 405.
[0116] The processor 401 is configured to control overall operations of the electronic device 400 to complete all or part of the steps of the above-described method for obtaining a correlation relationship. The memory 402 is configured to store various types of data to support operations of the electronic device 400, which can include, for example, instructions for operating any application or method on the electronic device 400, and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The memory 402 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk, or an optical disk. The multimedia component 403 can include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is configured to output and / or input audio signals. For example, the audio component can include a microphone configured to receive external audio signals. The received audio signals can be further stored in the memory 402 or transmitted through the communication component 405. The audio component further includes at least one speaker configured to output audio signals. The I / O interface 404 provides an interface between the processor 401 and other interface modules, which can be a keyboard, a mouse, a button, and the like. The buttons can be virtual buttons or physical buttons. The communication component 405 is configured to perform wired or wireless communication between the electronic device 400 and other devices. The wireless communication, such as Wi-Fi, Bluetooth, near field communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, and the like, or a combination of one or more of them, is not limited herein. Therefore, the corresponding communication component 405 can include a Wi-Fi module, a Bluetooth module, an NFC module, and the like.
[0117] In an exemplary embodiment, the electronic device 400 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements for performing the above-described method of acquiring a correlation relationship.
[0118] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described method of acquiring a correlation relationship. For example, the computer-readable storage medium can be the above-described memory 402 including program instructions, and the above-described program instructions can be executed by the processor 401 of the electronic device 400 to complete the above-described method of acquiring a correlation relationship.
[0119] In another exemplary embodiment, a computer program product is also provided, which contains a computer program capable of being executed by a programmable device, and the computer program has code portions for executing the above-described method of acquiring a correlation relationship when executed by the programmable device.
[0120] The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the above-described embodiments. Within the technical concept range of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all belong to the protection range of the present disclosure.
[0121] In addition, it should be noted that each specific technical feature described in the above specific embodiments can be combined in any appropriate manner without contradiction, and in order to avoid unnecessary repetition, the present disclosure will not further describe various possible combination manners.
[0122] In addition, various different embodiments of the present disclosure can also be combined in any appropriate manner, as long as it does not deviate from the idea of the present disclosure, and it should be considered as disclosed by the present disclosure.
Claims
1. A method of acquiring a relationship, characterized by, The method comprises: obtaining a target entity determined by a user from a plurality of entities, and an embedding representation of the plurality of entities, the embedding representation being used to represent the relevance between the plurality of entities; obtaining, according to the embedding representation, a relevant entity related to the target entity, to obtain a relevant entity set, the relevant entity set comprising the target entity and the relevant entity; determining, according to a preset association relationship corresponding to the plurality of entities, an association object associated with each entity in the relevant entity set; determining, according to the preset association relationship, the association object, and the relevant entity set, an association relationship of an entity category corresponding to the target entity; the determining, according to the preset association relationship, the association object, and the relevant entity set, an association relationship of an entity category corresponding to the target entity comprises: classifying, according to an enterprise classification directory and a product classification directory, the relevant entity set and the association object by a pre-trained classification model, to obtain a first entity category corresponding to each entity in the relevant entity set and an object category of the association object; mapping, according to the preset association relationship, an association relationship between each entity in the relevant entity set and the object into a category association relationship of the first entity category and the object category; determining, according to the category association relationship, an association relationship of an entity category corresponding to the target entity.
2. The method of claim 1, wherein, the obtaining, according to the embedding representation, a relevant entity related to the target entity to obtain a relevant entity set comprises: calculating, according to the embedding representation, a first Euclidean distance between the target entity and a first other entity in the plurality of entities except the target entity; determining, according to the first Euclidean distance, the relevant entity set.
3. The method of claim 2, wherein, the determining, according to the first Euclidean distance, the relevant entity set comprises: taking a preset number of the first other entities with the closest first Euclidean distance as entities in the relevant entity set, to obtain the relevant entity set.
4. The method of claim 2, wherein, the determining, according to the first Euclidean distance, the relevant entity set comprises: taking the first other entity with a first Euclidean distance less than or equal to a preset distance threshold as a pending entity; recursively performing the set determination step until a preset loop termination condition is met, to obtain the relevant entity set; the set determination step comprises: calculating a second Euclidean distance between the pending entity and a second other entity, the second other entity comprising other entities in the plurality of entities except the pending entity and the target entity; adding, to the relevant entity set, an entity in the second other entity with a second Euclidean distance less than or equal to a preset distance threshold, and taking the entity in the second other entity with the second Euclidean distance less than or equal to the preset distance threshold as a new pending entity.
5. The method of claim 4, wherein, the preset loop termination condition comprises: the number of the determined pending entities reaches a preset number; or no new pending entity is determined.
6. The method of claim 1, wherein, The association object includes an association entity and an association product, the object category includes a second entity category corresponding to the association entity, and a product category corresponding to the association product, the obtaining of the first entity category corresponding to each entity in the related entity set and the object category of the association object includes: The first entity category corresponding to each entity in the related entity set, and the second entity category corresponding to each entity in the association entity and the product category corresponding to each product in the association product are obtained.
7. The method of claim 1, wherein, The association relationship of the target entity corresponding entity category is determined according to the category association relationship, which includes: For each category association relationship, if the category association relationship is included in a pre-established category relationship set, the statistical parameter corresponding to the category association relationship in the category relationship set is increased by a specified value, and if the category association relationship is not included in the category relationship set, the category association relationship is added to the category relationship set; According to the statistical parameter of each category association relationship in the category relationship set, the association relationship corresponding to the entity type of the target entity is determined.
8. The method of claim 7, wherein, The association relationship of the target entity corresponding entity category is determined according to the category association relationship, which includes: The maximum preset number of category association relationships in the category relationship set is taken as the association relationship corresponding to the entity type of the target entity.
9. The method according to any one of claims 1 to 8, characterized in that, The entity includes a company, the association relationship includes a supply relationship between the companies, and the association object includes a company and / or a product.
10. An apparatus for acquiring a relationship, the apparatus comprising: The device includes: An acquisition module is configured to acquire a target entity determined by a user from a plurality of entities and an embedding representation of the plurality of entities, the embedding representation being used to represent a correlation degree between the plurality of entities; A set determination module is configured to acquire a related entity related to the target entity according to the embedding representation, to obtain a related entity set, the related entity set including the target entity and the related entity; An object determination module is configured to determine an association object associated with each entity in the related entity set according to a preset association relationship corresponding to the plurality of entities; A relationship determination module is configured to determine an association relationship of a target entity corresponding entity category according to the preset association relationship, the association object, and the related entity set. The association relationship of the target entity corresponding entity category is determined according to the category association relationship, which includes: The related entity set and the association object are classified by a pre-trained classification model according to an enterprise classification directory and a product classification directory, to obtain a first entity category corresponding to each entity in the related entity set and an object category of the association object; According to the preset association relationship, the association relationship between each entity in the related entity set and the object is mapped to a category association relationship of the first entity category and the object category; The association relationship of the target entity corresponding entity category is determined according to the category association relationship.
11. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The program, when executed by the processor, implements the steps of the method of any one of claims 1-9.
12. An electronic device, comprising: comprising: a memory having stored thereon a computer program; a processor configured to execute the computer program in the memory to implement the steps of the method of any one of claims 1-9.
Citation Information
Patent Citations
Graph-based incidence relation obtaining method and device and computer equipment
CN111026921A
Enterprise subject association relationship determination method and device, medium and electronic equipment
CN114139544A
Method and device for determining target object
CN114155049A