Entity classification method, device, storage medium, processor and electronic device

By constructing entity instances containing text, questions and answers, and using reading comprehension model for classification, the problems of variable risk types and complex judgment basis in entity risk classification are solved, and the efficiency and accuracy of entity risk classification are improved.

CN114201603BActive Publication Date: 2025-08-12ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111301031.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2025-08-12
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

In the automatic production process of knowledge graphs, the risk types in the entity risk classification process are varied and the judgment basis is complex, resulting in low audit efficiency and low accuracy.

Method used

By constructing multiple instances, each instance includes a text part, a question part and an answer part, the reading comprehension model is used to classify entities and multiple relationship types, obtain multiple classification tags, and determine the attribute category of entities based on these tags.

Benefits of technology

The efficiency and accuracy of entity risk classification are improved, and the risk types of different knowledge entities are accurately identified in the automatic production process of knowledge graph knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114201603B_ABST
    Figure CN114201603B_ABST
Patent Text Reader

Abstract

The present invention discloses an entity classification method, device, storage medium, processor and electronic device. The method comprises: obtaining an entity to be predicted; constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each instance in the multiple instances comprises: a text portion, a question portion and an answer portion; classifying each instance in the multiple instances to obtain multiple classification labels; and determining the category of the entity to be predicted based on the multiple classification labels. The present invention solves the technical problems of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type, thereby accurately identifying the risk types of different knowledge entities in the knowledge graph knowledge automatic production process and effectively improving the efficiency and accuracy of entity risk classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to an entity classification method, device, storage medium, processor and electronic device. Background Art

[0002] Entity classification technology generally refers to the classification of textual entities into designated categories based on a series of characteristics. In the automated knowledge graph production process, entity risk classification is a key step in ensuring the close integration of the risk knowledge graph with risk identification application scenarios. The risk knowledge graph contains a large number of knowledge entities. Accurately identifying the different risk types of these entities and recommending them to different risk review scenarios to assist operators in risk review can address knowledge gaps among operators and improve review efficiency and accuracy.

[0003] The main differences between entity risk classification and traditional entity classification are: First, the risk categories of entities in risk identification scenarios in entity risk classification are not completely fixed and will undergo periodic dynamic changes as the target tasks change. Second, the risk type of an entity in entity risk classification cannot be directly determined based on the displayed entity name; it requires the combination of a large number of entities and background knowledge of entity types.

[0004] Therefore, how to establish a new entity risk classification method based on these two distinguishing points so that it can be applied in real-world scenarios and generate practical application value has become a key issue in entity classification technology in the field of natural language processing. Currently, no effective solution has been proposed to address these issues. Summary of the Invention

[0005] Embodiments of the present invention provide an entity classification method, device, storage medium, processor, and electronic device to at least solve the technical problems of low efficiency and low accuracy in entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type. In this way, in the automatic production process of knowledge graph knowledge, the risk types of different knowledge entities can be accurately identified and the efficiency and accuracy of entity risk classification can be effectively improved.

[0006] According to one aspect of an embodiment of the present invention, there is provided an entity classification method, characterized in that it includes: obtaining an entity to be predicted; constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part, and an answer part; classifying each of the multiple instances to obtain multiple classification labels; and determining the category to which the entity to be predicted belongs based on the multiple classification labels.

[0007] According to another aspect of an embodiment of the present invention, an entity classification method is also provided, which is characterized by including: receiving an entity to be predicted from a client; constructing multiple instances using the entity to be predicted and multiple relationship types, classifying each of the multiple instances to obtain multiple classification labels, and determining a category of the entity to be predicted based on the multiple classification labels, wherein each of the multiple instances includes: a text part, a question part, and an answer part; and feeding back the category of the entity to be predicted to the client.

[0008] According to another aspect of an embodiment of the present invention, an entity classification method is also provided, which is characterized by including: obtaining a knowledge entity to be predicted from a knowledge graph; constructing multiple instances using the knowledge entity and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part, and an answer part; classifying each of the multiple instances to obtain multiple classification labels; and determining the entity type of the knowledge entity based on the multiple classification labels.

[0009] According to another aspect of an embodiment of the present invention, an entity classification device is also provided, characterized in that it includes: an acquisition module for acquiring an entity to be predicted; a construction module for constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part and an answer part; a processing module for classifying each of the multiple instances to obtain multiple classification labels; and a classification module for determining the category to which the entity to be predicted belongs based on the multiple classification labels.

[0010] According to another aspect of an embodiment of the present invention, a storage medium is further provided, characterized in that the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the above-mentioned entity classification methods.

[0011] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein the program executes any one of the above-mentioned entity classification methods when running.

[0012] According to another aspect of an embodiment of the present invention, an electronic device is also provided, characterized in that it includes: a processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining an entity to be predicted; constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part and an answer part; classifying each of the multiple instances to obtain multiple classification labels; and determining the belonging category of the entity to be predicted based on the multiple classification labels.

[0013] In an embodiment of the present invention, an entity to be predicted is obtained; multiple instances are constructed using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion; each of the multiple instances is classified to obtain multiple classification labels; and the category of the entity to be predicted is determined based on the multiple classification labels.

[0014] It is easy to notice that multiple classification labels are obtained by pre-classifying multiple instances of the entity to be predicted and multiple relationship types, and the category of the entity to be predicted is determined based on the above multiple classification labels, which achieves the purpose of providing more appropriate risk categories and classifying the entity to be predicted more accurately, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification, and further solves the technical problems of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type. Therefore, in the knowledge automatic production process of knowledge graph, the risk types of different knowledge entities can be accurately identified and the efficiency and accuracy of entity risk classification can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0016] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an entity classification method according to the prior art;

[0017] Figure 2 is a flow chart of an entity classification method according to an embodiment of the present invention;

[0018] Figure 3 is a flow chart of an optional entity risk classification according to an embodiment of the present invention;

[0019] Figure 4 is a schematic diagram of an optional construction question-answering instance according to an embodiment of the present invention;

[0020] Figure 5 is a schematic structural diagram of an optional reading comprehension model for entity classification according to an embodiment of the present invention;

[0021] Figure 6 is a flow chart of an optional entity classification method according to an embodiment of the present invention;

[0022] Figure 7 is a schematic diagram of an optional entity classification on a cloud server according to an embodiment of the present invention;

[0023] Figure 8 is a flowchart of another optional entity classification method according to an embodiment of the present invention;

[0024] Figure 9 is a structural diagram of an entity classification device according to an embodiment of the present invention;

[0025] Figure 10 is a structural block diagram of another computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0029] Entity: An entity in natural language refers to an object or concept that exists in the objective world and can be distinguished from each other and appears in a sentence.

[0030] Bidirectional Encoder Representation from Transformer (BERT) Model: The BERT model, proposed by Devlin et al. in 2019, utilizes a Transformer encoder to encode bidirectional contextual information and employs a multi-task model to consider semantic information at different granularities. Specifically, it employs a masked language model (ML) and next sentence prediction (NSP) approach to capture word-level and sentence-level feature descriptions. The BERT model consists of two main phases: pre-training and fine-tuning. In the pre-training phase, the BERT pre-trained language model trains two subtasks based on a large amount of unlabeled data. In the fine-tuning phase, the BERT downstream task model initializes parameters using the results of the BERT pre-trained language model and then fine-tunes the model using labeled data. Currently, the BERT model has been widely used in various natural language processing tasks to learn semantic representations of training words.

[0031] Knowledge Graph: A knowledge graph is a structured semantic knowledge base used to rapidly describe concepts and their relationships in the physical world. By effectively processing, manipulating, and integrating complex document data, a knowledge graph generates simple, clear "entity, relationship, entity" triples. Finally, by aggregating vast amounts of knowledge, it enables rapid response and reasoning. Due to its powerful semantic processing capabilities and open connectivity, knowledge graphs are widely used in intelligent search, intelligent question-and-answering, personalized recommendations, intelligence analysis, and anti-fraud.

[0032] Example 1

[0033] According to an embodiment of the present invention, an embodiment of an instance classification model is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] The method embodiment provided in Example 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an entity classification method. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the entity classification method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned entity classification method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0037] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0039] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the aforementioned computer device (or mobile device).

[0040] Under the above operating environment, this application provides Figure 2 An entity classification method shown. Figure 2 is a flow chart of an entity classification method according to an embodiment of the present invention. Figure 2 As shown, the entity classification method includes:

[0041] Step S202, obtaining the entity to be predicted;

[0042] Step S204: construct multiple instances using the entity to be predicted and the multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion;

[0043] Step S206, classifying each of the multiple instances to obtain multiple classification labels;

[0044] Step S208 : determining the category of the entity to be predicted based on the multiple classification labels.

[0045] It is easy to notice that multiple classification labels are obtained by pre-classifying multiple instances of the entity to be predicted and multiple relationship types, and the category of the entity to be predicted is determined based on the above multiple classification labels, which achieves the purpose of providing more appropriate risk categories and classifying the entity to be predicted more accurately, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification, and further solves the technical problems of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type. Therefore, in the knowledge automatic production process of knowledge graph, the risk types of different knowledge entities can be accurately identified and the efficiency and accuracy of entity risk classification can be effectively improved.

[0046] Optionally, the entity classification method provided in the embodiments of this application can be applied, but is not limited to, to entity risk classification. When used in entity risk classification tasks, the classification labels are various risk type labels, and the final classification result is the actual risk category of the entity to be predicted. By adopting the entity classification method in the embodiments of this application, the corresponding classification labels can be determined based on the actual situation, resulting in more accurate entity classification results.

[0047] Optionally, the entity to be predicted can be a distinguishable object or concept that exists in the objective world. The description of the entity to be predicted can be in text format, and the attributes of the entity to be predicted can be text, images, videos, etc. The same entity may have different meanings and belong to different semantic types when appearing in different sentence contexts, so the classification of entities is of great significance in practical applications. By obtaining the description and attributes of the entity to be predicted, the entity is classified using the entity classification method described in the embodiments of this application.

[0048] Alternatively, the relationship type can be a type description and relationship attribute of an existing type. For example, the relationship attribute of a relationship type is "computer hardware," and the type description is "Computer hardware refers to the general term for various physical devices in a computer system, such as electronic, mechanical, and optoelectronic components. These physical devices form an organic whole according to the requirements of the system structure and provide the material basis for the operation of computer software." Learning and training relationship types can help machines determine whether an entity belongs to that relationship type.

[0049] Optionally, the above-mentioned examples can refer to examples that actually exist in the objective world. An example can contain multiple parts. In this embodiment, the example includes a text part, a question part, and an answer part. The method in this embodiment is to convert the entity classification task into a question-answering example and input it into the machine for reading comprehension and classification. This can realize the analysis and mining of massive entity data and information extraction, and use neural networks to quickly and accurately classify entities.

[0050] In an optional embodiment, in step S204, multiple instances are constructed using the entity to be predicted and multiple relationship types, including the following method steps:

[0051] Step S241, obtaining the entity profile and entity attributes of the entity to be predicted;

[0052] Step S242, obtaining a type introduction and relationship attributes of each relationship type in the plurality of relationship types;

[0053] Step S243: construct the multiple instances using the entity profile, the entity attributes, the type profile, and the relationship attributes.

[0054] Optionally, the entity to be predicted is an entity in text form containing a series of features. When obtaining the entity, the entity profile and entity attributes of the entity can be obtained using existing resources; the above-mentioned multiple relationship types are existing, and the type profile and relationship attributes of the relationship type can be obtained using existing resources; after obtaining the above-mentioned entity profile, entity attributes, type profile and relationship attributes, an instance can be constructed, where each instance includes: a text part, a question part and an answer part.

[0055] Figure 3 is a flow chart of an optional entity risk classification according to an embodiment of the present invention, such as Figure 3 As shown, in the actual application of entity risk classification, there is a textual entity "Entity A" to be predicted, and its actual entity risk type is "Risk Type 01". According to this optional embodiment, the entity risk classification process for "Entity A" is as follows:

[0056] Preprocess the entity to obtain entity information and entity type information.

[0057] Obtain the entity to be predicted "Entity A", and use the preset type resource library to obtain the entity introduction and entity attributes of "Entity A". The entity introduction is a text containing the basic information and brief introduction of "Entity A", recorded as "Entity Introduction A", and the entity attribute is "text".

[0058] Determine the existing 30 entity risk types, namely "Risk Type 01" to "Risk Type 30", and use resources such as Wikipedia to obtain the type introduction and relationship attributes of each of the 30 entity risk types. For example, the type introduction of "Risk Type 01" is a text containing the basic information and brief introduction of "Risk Type 01", recorded as "Type Introduction 01", and the relationship attribute of "Risk Type 01" is "Keyword 01"; the type introduction of "Risk Type 30" is a text containing the basic information and brief introduction of "Risk Type 30", recorded as "Type Introduction 30", and the relationship attribute of "Risk Type 30" is "Keyword 30".

[0059] Construct a question-answering instance, and construct multiple instances based on the obtained "Entity Profile A", the attribute "text" of entity A, the type profiles of 30 entity risk types recorded as "Risk Type 01" to "Risk Type 30" respectively, and the relationship attributes "Keyword 01" to "Keyword 30" of the 30 entity risk types.

[0060] In an optional embodiment, in step S243, the multiple instances are constructed using the entity profile, the entity attributes, the type profile, and the relationship attributes, including the following method steps:

[0061] Step S2431, constructing the text portion using the entity introduction and the type introduction;

[0062] Step S2432, constructing the question part using the entity attributes and the relationship attributes;

[0063] Step S2433, using multiple preset options to construct the above answer part.

[0064] Optionally, for each instance, the above text part is a concatenation of the entity introduction text to be predicted and the type introduction text; for each instance, the above question part is a question sentence constructed based on the entity attributes and relationship attributes to be predicted; for each instance, the above answer part is constructed from multiple preset options.

[0065] Still taking the entity risk classification of Entity A in actual use as an example, Figure 4 is a schematic diagram of an optional construction question-answering instance according to an embodiment of the present invention, such as Figure 4 As shown, multiple instances are constructed based on the acquired "Entity Profile A", the attribute "text" of Entity A, the type profiles of 30 entity risk types "Risk Type 01" to "Risk Type 30", and the relationship attributes "Keyword 01" to "Keyword 30" of the 30 entity risk types. For specific construction steps, refer to steps S2431 to S2433:

[0066] Build Example 01:

[0067] Article parts: "Entity Introduction A", "Type Introduction 01".

[0068] Question section: Does the text "Entity A" belong to "Keyword 01"?

[0069] Answer section: Yes / No.

[0070] Build Example 02:

[0071] Article parts: "Entity Introduction A", "Type Introduction 02".

[0072] Question section: Does the text "Entity A" belong to "Keyword 02"?

[0073] Answer section: Yes / No.

[0074]

[0075] Build Example 30:

[0076] Article parts: "Entity Introduction A", "Type Introduction 30".

[0077] Question section: Does the text "Entity A" belong to "Keyword 30"?

[0078] Answer section: Yes / No.

[0079] In an optional embodiment, in step S206, each of the multiple instances is classified to obtain the multiple classification labels, including the following method steps:

[0080] Step S261 , classifying each of the multiple instances using a reading comprehension model to obtain the multiple classification labels, wherein the reading comprehension model is obtained through deep learning training using a data set, and the data set is determined by the multiple instances.

[0081] Optionally, a dataset determined by the aforementioned multiple instances is used for deep learning training to obtain a reading comprehension model, which is then used to classify each of the aforementioned instances to obtain the aforementioned multiple classification labels. Because the reading comprehension model used to classify the aforementioned multiple instances in this solution is obtained through deep learning training based on the dataset determined by the aforementioned multiple instances, this inevitably ensures the applicability of the aforementioned multiple classification labels to the aforementioned multiple instances, avoiding the problem of inaccurate classification caused by dynamic changes in entity categories in traditional classification methods.

[0082] In an optional embodiment, the entity classification method further includes the following method steps:

[0083] Step S210: dividing the plurality of instances into a first portion of instances and a second portion of instances, wherein the first portion of instances are positive examples in the plurality of instances, and the second portion of instances are negative examples in the plurality of instances;

[0084] Step S212, performing negative example sampling processing at different ratios based on the similarity between the types of the first part of instances and the second part of instances, to obtain negative example sampling results, wherein the similarity between the types is proportional to the negative example sampling ratio;

[0085] Step S214, using the first part of the examples and part of the sampling results of the negative example sampling results to determine the data set;

[0086] Step S216: Use the above dataset as training data to train a reading comprehension model.

[0087] Optionally, the positive examples in the above multiple instances are divided into a first part of instances, and the negative examples are divided into a second part of instances, wherein the positive examples refer to instances whose answers are affirmative options, and the negative examples refer to instances whose answers are negative options; the negative examples are sampled, and the sampling basis is the similarity between a certain negative example and the current positive example. If the similarity between a certain negative example and the current positive example is large, a large proportion of the negative example is sampled; if the similarity between a certain negative example and the current positive example is small, a small proportion of the negative example is sampled; the data set is divided into a test set and a training set, wherein the test set is not processed, and the training set is constructed as follows: all positive examples are added to the training set, and some negative examples are extracted and added to the training set to complete the sampling; the above reading comprehension model is obtained based on the above training set training.

[0088] It should be noted that the sampling method in this scheme can form a data set with a uniform distribution of difficult samples and simple samples, thereby generating some more challenging negative examples, which is conducive to the model learning the differences between different categories.

[0089] Still taking the entity risk classification of Entity A in actual use as an example, Figure 3 As shown in the figure, the 30 examples constructed above are divided into positive and negative examples. Positive examples are those belonging to "Keyword 01," and negative examples are those not belonging to "Keyword 02." All positive examples are added to the training set. The degree of similarity between each negative example and the current positive example is determined, and the sampling ratio for each negative example is determined. The sampling ratio is determined based on the principle that negative examples with a high degree of similarity to the current positive example have a high sampling ratio, while negative examples with a low degree of similarity to the current positive example have a low sampling ratio. A portion of the negative examples are extracted and added to the training set, resulting in a training set for learning the training model.

[0090] Specifically, for example, determine the type attribute words "keyword 01a", "keyword 01b", and "keyword 01c" that are similar in meaning to "keyword 01". If a negative example among the above negative examples belongs to at least one of "keyword 01a", "keyword 01b", and "keyword 01c", then it is considered that the negative example has a high degree of similarity with the current positive example, and a higher sampling ratio coefficient is determined for the negative example. Otherwise, it is considered that the negative example has a low degree of similarity with the previous positive example, and a lower sampling ratio coefficient is determined for the negative example. Add all instances belonging to "keyword 01" to training set D, and extract 5 from the negative examples and add them to training set D.

[0091] For all instances, the above rules are used to generate corresponding question-and-answer instances, resulting in corresponding datasets D1 to D30. These datasets are then aggregated and shuffled to form the training set Ds. Based on the resulting training set Ds, a reading comprehension model corresponding to the question-and-answer instances is trained using the BERT model.

[0092] In an optional embodiment, the reading comprehension model includes: an input layer, an encoding layer, and an output layer, and the entity classification method further includes the following method steps:

[0093] Step S218: In the input layer, the text portion of the data set is transformed into a text sequence, the question portion of the data set is transformed into a question sequence, and the text sequence and the question sequence are concatenated into a target sequence, wherein the target sequence is the input sequence of the encoding layer.

[0094] Step S220: In the encoding layer, encoding the target sequence and outputting a target vector, wherein the target vector is used to represent the correlation between the text portion in the data set and the question portion in the data set;

[0095] Step S222: In the output layer, the target vector outputs the entity type probability distribution through a fully connected network.

[0096] Optionally, the reading comprehension model may include: an input layer, an encoding layer, and an output layer. The encoder used in the encoding layer may be a BERT pre-trained language model.

[0097] Among them, the input layer is used to generate a target sequence based on the above-mentioned data set and serve as the input sequence of the encoding layer. The above-mentioned target sequence is generated as follows: obtain the text part in the above-mentioned data set and transform the text part into a text sequence; obtain the question part in the above-mentioned data set and transform the question part into a question sequence; splice the above-mentioned text sequence and question sequence to obtain the above-mentioned target sequence.

[0098] Among them, the encoding layer is used to generate a target vector based on the above target sequence and serve as the input vector of the output layer. The above target vector is generated as follows: the above target sequence is obtained and encoded, and the target vector is obtained and output. The target vector is used to represent the correlation between the text part in the above data set and the problem part in the above data set.

[0099] The output layer is used to calculate and output the entity type probability distribution based on the target vector, wherein the calculation process can be implemented through a fully connected network.

[0100] Optionally, Figure 5 is a structural diagram of an optional reading comprehension model for entity classification according to an embodiment of the present invention; Figure 5 As shown in Figure 2, the reading comprehension model includes an input layer, an encoding layer, and an output layer:

[0101] 1) Input layer

[0102] like Figure 5 As shown, the input data of the input layer is the above-mentioned dataset consisting of all positive examples and some negative examples, which includes text part and question part. The input layer of the reading comprehension model performs the following operations: obtain the text part in the above-mentioned dataset and transform the text part into a text sequence (Document Sequence), which is expressed as D = {d1, ..., d i ,...,d n}, where d i is the word vector representation of the i-th word in the sentence, and the value of i ranges from 1 to n (n is the length of the sentence); obtain the question part in the above dataset and transform the question part into a question sequence (Question Sequence), which is expressed as Q = {q1, ..., q j ,...,q n}, where q j is the word vector representation of the jth word in the sentence, and the value range of j is 1 to m (m is the length of the question sequence); the transformed text sequence D and the question sequence Q are concatenated to obtain the target sequence X = {CLS, d1, ..., d i ,...,d n , SEP, q1, ..., q j ,...,q n , SEP}, where the beginning of the target sequence is marked with "CLS" and the end and separation are marked with "SEP", which is used as the input sequence of the Bert coding layer standard format.

[0103] 2) Coding layer

[0104] Still like Figure 5 As shown in the figure, the BERT fine-tuning model is used to learn semantic information. Specifically, in the learning process of each word, three target vectors are obtained: word vector (Token Embedding), sentence tag vector (Segment Embedding), and position vector (Position Embedding). The above target vectors are encoded to obtain the encoded target vector h and output it, where the target vector h represents the correlation between the text part in the above dataset and the question part in the above dataset.

[0105] h=Bert(X)

[0106] Where h∈R d , d is the Bert output unit size.

[0107] 3) Output layer

[0108] Still like Figure 5 As shown, the target vector h output by the encoding layer is sent to the fully connected network and the entity type probability distribution P is calculated:

[0109] P = sigmoid(W·h+b)

[0110] Among them, sigmoid is the activation function used for the fully connected network, and the coefficient W∈R in the function d×n , bias coefficient b∈R n The return value of the sigmoid function is between 0 and 1. A return value of 0 means that the entity has no relationship with the type, and a return value of 1 means that the entity has a relationship with the type. The closer the return value is to 0, the smaller the correlation between the entity and the type, and the closer the value is to 1, the greater the correlation between the entity and the type).

[0111] In an optional embodiment, in step S208, determining the category of the entity to be predicted based on the multiple classification labels includes the following method steps:

[0112] Step S281: When the values of the plurality of classification labels are not all the first numerical values, the classification labels with the second numerical values among the plurality of classification labels are used to determine the category of the entity to be predicted;

[0113] Step S282: When the values of the plurality of classification labels are all the first value, the classification label with the highest prediction probability among the plurality of classification labels is used to determine the category of the entity to be predicted.

[0114] Optionally, the values of the above-mentioned multiple classification labels are the first numerical value or the second numerical value, the first numerical value can be set to 0, and the second numerical value can be set to 1; when the values of the above-mentioned multiple classification labels are not all 0, the classification labels with a value of 1 among the above-mentioned multiple classification labels are used to determine the category of the above-mentioned entity to be predicted; when the values of the above-mentioned multiple classification labels are all 0, the classification label with the largest prediction probability among the above-mentioned multiple classification labels is used to determine the category of the above-mentioned entity to be predicted.

[0115] Still taking the entity risk classification of Entity A in actual use as an example, Figure 3 As shown in the figure, in the post-processing stage, the entity to be predicted "Entity A" is paired with all 30 entity types to construct the above question-answering instance, and the above trained model is used to predict the instance, and 30 classification labels with values of 0 or 1 are obtained: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1].

[0116] Obviously, the values of the 30 classification labels are not all 0. At this time, the classification labels with a value of 1 among the 30 classification labels are used to determine the category of the above-mentioned entity to be predicted, that is, "Entity A" belongs to "Risk Type 01" and "Risk Type 30".

[0117] If the entity to be predicted "Entity A" is paired with all 30 entity types to construct the above question-answering instance, and the above trained model is used to predict the instance, the 30 classification labels with values of 0 or 1 are: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].

[0118] At this time, when the values of all 30 classification labels are 0, the classification label with the largest prediction probability among the 30 classification labels should be used to determine the category of the entity to be predicted. If the corresponding 30 prediction probabilities are: [0.7620033634417748, 0.1388555675800121, 0.2596139521380908, 0.4325283008530042, 0.24238841649395962, 0.4082061891682502, 0.1781496170716906, 0. 10886773581501563, 0.06036736362770878, 0.3287696247872377, 0.3198184198034486, 0.2928648547591263, 0.4324529417656455, 0.29852280541357246, 0.25954697396370 38, 0.4323834268278667, 0.1476391270067722, 0.04205311802982234, 0.18918742155292834, 0.06506514503916522, 0.10705794383051248, 0.16008469976844203, 0.0081716 17462894354, 0.17319397234972866, 0.11130817377887536, 0.478273845637069, 0.34554487024967784, 0.2703587190987574, 0.27691884067223166, 0.61653045891421438].

[0119] Among them, the maximum predicted probability value is 0.7620033634417748, which corresponds to "risk type 01". At this time, it is determined that "Entity A" belongs to "risk type 01".

[0120] Through the embodiments of the present application, multiple classification labels can be obtained by pre-classifying multiple instances of the entity to be predicted and multiple relationship types, and the category of the entity to be predicted can be determined based on the above multiple classification labels, so as to provide a more appropriate risk category and classify the entity to be predicted more accurately, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification.

[0121] One embodiment of the present invention further provides an entity classification method, which is run on a cloud server. Figure 6 is a flow chart of an optional entity classification method according to an embodiment of the present invention, such as Figure 6 As shown, the entity classification method includes:

[0122] Step S602: receiving an entity to be predicted from a client;

[0123] Step S604: constructing multiple instances using the entity to be predicted and the multiple relationship types, classifying each of the multiple instances to obtain multiple classification labels, and determining a category of the entity to be predicted based on the multiple classification labels, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion;

[0124] Step S606: Feedback the category of the entity to be predicted to the client.

[0125] Optionally, Figure 7 is a schematic diagram of an optional entity classification on a cloud server according to an embodiment of the present invention, such as Figure 7 As shown, the client uploads the entity to be classified to the cloud server, and the cloud server uses the entity classification model to analyze the above-mentioned entity to be classified, constructs multiple instances using the above-mentioned entity to be predicted and multiple relationship types, classifies each of the above-mentioned multiple instances to obtain multiple classification labels, and determines the category of the above-mentioned entity to be predicted based on the above-mentioned multiple classification labels, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part.

[0126] Then, the cloud server will feedback the classification results to the client, and the final classification results will be displayed to the user through the client's graphical user interface. The optional method of displaying the classification results in the graphical user interface has been described in the above embodiment and will not be repeated here.

[0127] It should be noted that the above-mentioned entity classification method provided in the embodiment of the present application can be, but is not limited to, applicable to actual application scenarios of entity risk classification. Through the interaction between the SaaS server and the client, the entity classification model is used to analyze the above-mentioned entities to be classified, obtain the corresponding categories of the above-mentioned entities to be classified, and display the returned classification results on the client.

[0128] One embodiment of the present invention further provides an entity classification method, which can be used in the automatic production process of knowledge graph knowledge. Figure 8 is a flowchart of another optional entity classification method according to an embodiment of the present invention. Figure 8 As shown, the entity classification method includes:

[0129] Step S802: obtaining the knowledge entity to be predicted from the knowledge graph;

[0130] Step S804: construct multiple instances using the knowledge entity and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion;

[0131] Step S806, classifying each of the multiple instances to obtain multiple classification labels;

[0132] Step S808: determining the entity type of the knowledge entity based on multiple classification tags.

[0133] In an optional embodiment, in step S806, each of the multiple instances is classified to obtain multiple classification labels, including the following method steps:

[0134] Step S8061: Classify each of the multiple instances using a reading comprehension model to obtain multiple classification labels, wherein the reading comprehension model is obtained through deep learning training using a data set, and the data set is determined by multiple instances.

[0135] The knowledge entity to be predicted can be obtained from a knowledge graph. Multiple instances are constructed using this knowledge entity and the multiple relationship types, where each instance includes a text portion, a question portion, and an answer portion. Multiple classification labels are obtained by classifying each of the multiple instances. The entity type of the knowledge entity is determined based on the multiple classification labels. The optional method for classifying each of the multiple instances to obtain multiple classification labels has been described in the previous embodiment and will not be repeated here.

[0136] In the automatic production process of knowledge graph knowledge, by using the entity classification method of the embodiment of the present invention, the risk types of different knowledge entities can be accurately identified, thereby effectively improving the efficiency and accuracy of entity risk classification.

[0137] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0138] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the above methods of each embodiment of the present invention.

[0139] Example 2

[0140] According to an embodiment of the present invention, there is also provided an embodiment of a device for implementing the above entity classification method. Figure 9 is a structural diagram of an entity classification device according to an embodiment of the present invention. Figure 9 As shown, the entity classification device includes: an acquisition module 901, a construction module 902, a processing module 903, and a classification module 904, wherein:

[0141] An acquisition module 901 is used to acquire an entity to be predicted; a construction module 902 is used to construct multiple instances using the above-mentioned entity to be predicted and multiple relationship types, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; a processing module 903 is used to classify each of the above-mentioned multiple instances to obtain multiple classification labels; a classification module 904 is used to determine the category to which the above-mentioned entity to be predicted belongs based on the above-mentioned multiple classification labels.

[0142] Optionally, construction module 902 is further used to: obtain the entity profile and entity attributes of the above-mentioned entity to be predicted; obtain the type profile and relationship attributes of each relationship type in the above-mentioned multiple relationship types; and construct the above-mentioned multiple instances using the above-mentioned entity profile, the above-mentioned entity attributes, the above-mentioned type profile and the above-mentioned relationship attributes.

[0143] Optionally, the construction module 902 is further used to: construct the above text part using the above entity introduction and the above type introduction; construct the above question part using the above entity attributes and the above relationship attributes; and construct the above answer part using multiple preset options.

[0144] Optionally, the processing module 903 is further used to: use a reading comprehension model to classify each of the above-mentioned multiple instances to obtain the above-mentioned multiple classification labels, wherein the above-mentioned reading comprehension model is obtained through deep learning training using a data set, and the above-mentioned data set is determined by the above-mentioned multiple instances.

[0145] Optionally, the processing module 903 is further used to: divide the above-mentioned multiple instances into a first part of instances and a second part of instances, wherein the above-mentioned first part of instances are positive examples among the above-mentioned multiple instances, and the above-mentioned second part of instances are negative examples among the above-mentioned multiple instances; perform negative example sampling processing in different proportions based on the type similarity between the above-mentioned first part of instances and the above-mentioned second part of instances to obtain negative example sampling results, wherein the type similarity is proportional to the negative example sampling proportion; use part of the sampling results of the above-mentioned first part of instances and the above-mentioned negative example sampling results to determine the above-mentioned data set; use the above-mentioned data set as training data to train the above-mentioned reading comprehension model.

[0146] Optionally, the above-mentioned reading comprehension model includes: an input layer, an encoding layer and an output layer, and the processing module 903 is also used to: in the above-mentioned input layer, transform the text part in the above-mentioned data set into a text sequence, transform the question part in the above-mentioned data set into a question sequence, and splice the above-mentioned text sequence and the above-mentioned question sequence into a target sequence, wherein the above-mentioned target sequence is the input sequence of the above-mentioned encoding layer; in the above-mentioned encoding layer, encode the above-mentioned target sequence and output a target vector, wherein the above-mentioned target vector is used to represent the correlation between the text part in the above-mentioned data set and the question part in the above-mentioned data set; in the above-mentioned output layer, the above-mentioned target vector outputs the entity type probability distribution through a fully connected network.

[0147] Optionally, the classification module 904 is also used to: when the values of the above-mentioned multiple classification labels are not all the first numerical value, use the classification label with the second numerical value among the above-mentioned multiple classification labels to determine the category of the above-mentioned entity to be predicted; when the values of the above-mentioned multiple classification labels are all the above-mentioned first numerical value, use the classification label with the largest prediction probability among the above-mentioned multiple classification labels to determine the category of the above-mentioned entity to be predicted.

[0148] It should be noted that the acquisition module 901, construction module 902, processing module 903, and classification module 904 correspond to steps S202 to S208 in Example 1. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0149] In an embodiment of the present invention, an entity to be predicted is obtained; multiple instances are constructed using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion; each of the multiple instances is classified to obtain multiple classification labels; and the category of the entity to be predicted is determined based on the multiple classification labels. It is easy to notice that by pre-classifying the multiple instances constructed by the entity to be predicted and multiple relationship types to obtain multiple classification labels, and determining the category of the entity to be predicted based on the multiple classification labels, the purpose of providing a more appropriate risk category and classifying the entity to be predicted more accurately is achieved, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification, and further solving the technical problem of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for determining the entity risk type. Therefore, in the knowledge automatic production process of knowledge graph, the risk types of different knowledge entities can be accurately identified, and the efficiency and accuracy of entity risk classification can be effectively improved.

[0150] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Example 1 and will not be repeated here.

[0151] Example 3

[0152] According to an embodiment of the present invention, an embodiment of an electronic device is also provided. The electronic device can be any computing device in a computing device group. The electronic device includes: a processor and a memory, wherein:

[0153] A memory is connected to the above-mentioned processor and is used to provide the above-mentioned processor with instructions for processing the following processing steps: obtaining an entity to be predicted; constructing multiple instances using the above-mentioned entity to be predicted and multiple relationship types, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; classifying each of the above-mentioned multiple instances to obtain multiple classification labels; and determining the category to which the above-mentioned entity to be predicted belongs based on the above-mentioned multiple classification labels.

[0154] In an embodiment of the present invention, an entity to be predicted is obtained; multiple instances are constructed using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion; each of the multiple instances is classified to obtain multiple classification labels; and the category to which the entity to be predicted belongs is determined based on the multiple classification labels.

[0155] It is easy to notice that multiple classification labels are obtained by pre-classifying multiple instances of the entity to be predicted and multiple relationship types, and the category of the entity to be predicted is determined based on the above multiple classification labels, which achieves the purpose of providing more appropriate risk categories and classifying the entity to be predicted more accurately, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification, and further solves the technical problems of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type. Therefore, in the knowledge automatic production process of knowledge graph, the risk types of different knowledge entities can be accurately identified and the efficiency and accuracy of entity risk classification can be effectively improved.

[0156] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Example 1 and will not be repeated here.

[0157] Example 4

[0158] According to an embodiment of the present invention, a computer terminal embodiment is also provided, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0159] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.

[0160] In this embodiment, the computer terminal can execute the program code of the following steps in the entity classification method: obtaining the entity to be predicted; constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part, and an answer part; classifying each of the multiple instances to obtain multiple classification labels; and determining the category to which the entity to be predicted belongs based on the multiple classification labels.

[0161] Optionally, Figure 10 is a structural block diagram of another computer terminal according to an embodiment of the present invention, such as Figure 10 As shown, the computer terminal may include: one or more (only one is shown in the figure) processors 122 , a memory 124 , and a peripheral interface 126 .

[0162] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the entity classification method and device in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned entity classification method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof.

[0163] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the entity to be predicted; use the above-mentioned entity to be predicted and multiple relationship types to construct multiple instances, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; classify each of the above-mentioned multiple instances to obtain multiple classification labels; and determine the category to which the above-mentioned entity to be predicted belongs based on the above-mentioned multiple classification labels.

[0164] Optionally, the processor may also execute the program code of the following steps: obtaining the entity profile and entity attributes of the entity to be predicted; obtaining the type profile and relationship attributes of each relationship type in the multiple relationship types; and constructing the multiple instances using the entity profile, entity attributes, type profile, and relationship attributes.

[0165] Optionally, the processor may also execute program code for the following steps: constructing the above-mentioned multiple instances using the above-mentioned type introduction and the above-mentioned relationship attributes includes: constructing the above-mentioned text part using the above-mentioned entity introduction and the above-mentioned type introduction; constructing the above-mentioned question part using the above-mentioned entity attributes and the above-mentioned relationship attributes; and constructing the above-mentioned answer part using multiple preset options.

[0166] Optionally, the processor may also execute the program code of the following steps: classify each of the multiple instances using a reading comprehension model to obtain the multiple classification labels, wherein the reading comprehension model is obtained through deep learning training using a data set, and the data set is determined by the multiple instances.

[0167] Optionally, the processor may also execute the program code of the following steps: dividing the multiple instances into a first part of instances and a second part of instances, wherein the first part of instances are positive examples among the multiple instances, and the second part of instances are negative examples among the multiple instances; performing negative example sampling processing in different proportions based on the type similarity between the first part of instances and the second part of instances to obtain negative example sampling results, wherein the type similarity is proportional to the negative example sampling proportion; using part of the sampling results of the first part of instances and the negative example sampling results to determine the data set; using the data set as training data to train a reading comprehension model.

[0168] Optionally, the processor may also execute the following program code: in the input layer, transforming the text portion in the data set into a text sequence, transforming the question portion in the data set into a question sequence, and concatenating the text sequence and the question sequence into a target sequence, wherein the target sequence is the input sequence of the encoding layer; in the encoding layer, encoding the target sequence and outputting a target vector, wherein the target vector is used to represent the correlation between the text portion in the data set and the question portion in the data set; in the output layer, the target vector outputs the entity type probability distribution through a fully connected network.

[0169] Optionally, the processor may also execute the program code of the following steps: when the values of the multiple classification labels are not all the first numerical value, the classification label with the second numerical value among the multiple classification labels is used to determine the category of the entity to be predicted; when the values of the multiple classification labels are all the first numerical value, the classification label with the highest prediction probability among the multiple classification labels is used to determine the category of the entity to be predicted.

[0170] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receiving the entity to be predicted from the client; using the above-mentioned entity to be predicted and multiple relationship types to construct multiple instances, classifying each of the above-mentioned multiple instances to obtain multiple classification labels, and determining the belonging category of the above-mentioned entity to be predicted based on the above-mentioned multiple classification labels, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; and feeding back the belonging category of the above-mentioned entity to be predicted to the above-mentioned client.

[0171] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the knowledge entity to be predicted from the knowledge graph; use the knowledge entity and multiple relationship types to construct multiple instances, wherein each of the multiple instances includes: a text part, a question part and an answer part; classify each of the multiple instances to obtain multiple classification labels; and determine the entity type of the knowledge entity based on the multiple classification labels.

[0172] Optionally, the processor may also execute the following program code: classify each of the multiple instances using a reading comprehension model to obtain multiple classification labels, wherein the reading comprehension model is obtained through deep learning training using a data set, and the data set is determined by multiple instances.

[0173] An embodiment of the present invention provides an entity classification solution. The solution comprises obtaining an entity to be predicted; constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each instance includes a text portion, a question portion, and an answer portion; performing classification processing on each instance to obtain multiple classification labels; and determining the category of the entity to be predicted based on the multiple classification labels.

[0174] It is easy to notice that multiple classification labels are obtained by pre-classifying multiple instances of the entity to be predicted and multiple relationship types, and the category of the entity to be predicted is determined based on the above multiple classification labels, which achieves the purpose of providing more appropriate risk categories and classifying the entity to be predicted more accurately, thereby achieving the technical effect of improving the efficiency and accuracy of entity risk classification, and further solves the technical problems of low efficiency and low accuracy of entity risk review caused by the variable risk types in the entity risk classification process and the complex and difficult basis for judging the entity risk type. Therefore, in the knowledge automatic production process of knowledge graph, the risk types of different knowledge entities can be accurately identified and the efficiency and accuracy of entity risk classification can be effectively improved.

[0175] It can be understood by those skilled in the art that Figure 10 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 10 It does not limit the structure of the above electronic device. For example, the computer terminal may also include Figure 10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 10 Different configurations shown.

[0176] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0177] According to an embodiment of the present invention, an embodiment of a computer-readable storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to store program codes executed by the entity classification method provided in the first embodiment.

[0178] Optionally, in this embodiment, the above-mentioned storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0179] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining an entity to be predicted; constructing multiple instances using the above-mentioned entity to be predicted and multiple relationship types, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; classifying each of the above-mentioned multiple instances to obtain multiple classification labels; and determining the belonging category of the above-mentioned entity to be predicted based on the above-mentioned multiple classification labels.

[0180] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining the entity profile and entity attributes of the above-mentioned entity to be predicted; obtaining the type profile and relationship attributes of each relationship type in the above-mentioned multiple relationship types; and constructing the above-mentioned multiple instances using the above-mentioned entity profile, the above-mentioned entity attributes, the above-mentioned type profile and the above-mentioned relationship attributes.

[0181] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: the above-mentioned type introduction and the above-mentioned relationship attributes construct the above-mentioned multiple instances, including: using the above-mentioned entity introduction and the above-mentioned type introduction to construct the above-mentioned text part; using the above-mentioned entity attributes and the above-mentioned relationship attributes to construct the above-mentioned question part; using multiple preset options to construct the above-mentioned answer part.

[0182] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: using a reading comprehension model to classify each of the above-mentioned multiple instances to obtain the above-mentioned multiple classification labels, wherein the above-mentioned reading comprehension model is obtained through deep learning training using a data set, and the above-mentioned data set is determined by the above-mentioned multiple instances.

[0183] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: dividing the above-mentioned multiple instances into a first part of instances and a second part of instances, wherein the above-mentioned first part of instances are positive examples among the above-mentioned multiple instances, and the above-mentioned second part of instances are negative examples among the above-mentioned multiple instances; performing negative example sampling processing in different proportions based on the type similarity between the above-mentioned first part of instances and the above-mentioned second part of instances to obtain negative example sampling results, wherein the type similarity is proportional to the negative example sampling ratio; using part of the sampling results of the above-mentioned first part of instances and the above-mentioned negative example sampling results to determine the above-mentioned data set; using the above-mentioned data set as training data to train a reading comprehension model.

[0184] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: in the above-mentioned input layer, the text part in the above-mentioned data set is transformed into a text sequence, the question part in the above-mentioned data set is transformed into a question sequence, and the above-mentioned text sequence and the above-mentioned question sequence are spliced into a target sequence, wherein the above-mentioned target sequence is the input sequence of the above-mentioned encoding layer; in the above-mentioned encoding layer, the above-mentioned target sequence is encoded and a target vector is output, wherein the above-mentioned target vector is used to represent the correlation between the text part in the above-mentioned data set and the question part in the above-mentioned data set; in the above-mentioned output layer, the above-mentioned target vector outputs the entity type probability distribution through a fully connected network.

[0185] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when the values of the above-mentioned multiple classification labels are not all the first numerical value, the classification label with the second numerical value among the above-mentioned multiple classification labels is used to determine the category of the above-mentioned entity to be predicted; when the values of the above-mentioned multiple classification labels are all the above-mentioned first numerical value, the classification label with the highest prediction probability among the above-mentioned multiple classification labels is used to determine the category of the above-mentioned entity to be predicted.

[0186] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving an entity to be predicted from a client; constructing multiple instances using the above-mentioned entity to be predicted and multiple relationship types, classifying each of the above-mentioned multiple instances to obtain multiple classification labels, and determining the belonging category of the above-mentioned entity to be predicted based on the above-mentioned multiple classification labels, wherein each of the above-mentioned multiple instances includes: a text part, a question part and an answer part; and feeding back the belonging category of the above-mentioned entity to be predicted to the above-mentioned client.

[0187] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining the knowledge entity to be predicted from the knowledge graph; constructing multiple instances using the knowledge entity and multiple relationship types, wherein each of the multiple instances includes: a text part, a question part, and an answer part; classifying each of the multiple instances to obtain multiple classification labels; and determining the entity type of the knowledge entity based on the multiple classification labels.

[0188] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: classifying each of multiple instances using a reading comprehension model to obtain multiple classification labels, wherein the reading comprehension model is obtained through deep learning training using a data set, and the data set is determined by multiple instances.

[0189] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0190] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0191] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0193] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0194] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0195] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An entity classification method, characterized in that: include: Get the entity to be predicted; Constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion, the text portion including an entity profile of the entity to be predicted and a type profile of the relationship type, and the question portion including entity attributes of the entity to be predicted and relationship attributes of the relationship type; performing negative example sampling processing at different ratios based on the degree of type similarity between the positive examples in the multiple instances and the negative examples in the multiple instances, to obtain negative example sampling results, wherein the degree of type similarity is proportional to the negative example sampling ratio; Using the positive examples and the negative example sampling results in the multiple instances, a reading comprehension model is obtained through deep learning training; Using the reading comprehension model, classify each of the multiple instances to obtain multiple classification labels; The category of the entity to be predicted is determined based on the multiple classification labels.

2. The entity classification method according to claim 1, characterized in that: Constructing the multiple instances using the entity to be predicted and the multiple relationship types includes: Obtaining an entity profile and entity attributes of the entity to be predicted; Obtaining a type introduction and relationship attributes of each relationship type in the plurality of relationship types; The plurality of instances are constructed using the entity profile, the entity attributes, the type profile, and the relationship attributes.

3. The entity classification method according to claim 2, characterized in that: Constructing the plurality of instances using the entity profile, the entity attributes, the type profile, and the relationship attributes includes: constructing the text portion using the entity profile and the type profile; constructing the question part using the entity attributes and the relationship attributes; The answer section is constructed using a number of preset options.

4. The entity classification method according to claim 1, characterized in that: Classifying each of the multiple instances to obtain the multiple classification labels includes: A reading comprehension model is used to classify each of the multiple instances to obtain the multiple classification labels, wherein the reading comprehension model is obtained by deep learning training using a data set, and the data set is determined by the multiple instances.

5. The entity classification method according to claim 4, characterized in that: The entity classification method further includes: Dividing the multiple instances into a first portion of instances and a second portion of instances, wherein the first portion of instances are positive examples in the multiple instances, and the second portion of instances are negative examples in the multiple instances; Based on the degree of similarity between the types of the first part of instances and the second part of instances, negative example sampling is performed at different ratios to obtain negative example sampling results, wherein the degree of similarity between the types is proportional to the negative example sampling ratio; Determine the data set using the first portion of instances and a portion of the sampling results of the negative example sampling results; The data set is used as training data to train a reading comprehension model.

6. The entity classification method according to claim 5, characterized in that: The reading comprehension model includes: an input layer, an encoding layer, and an output layer. The entity classification method further includes: In the input layer, the text portion of the data set is transformed into a text sequence, the question portion of the data set is transformed into a question sequence, and the text sequence and the question sequence are concatenated into a target sequence, wherein the target sequence is the input sequence of the encoding layer; In the encoding layer, encoding is performed on the target sequence to output a target vector, wherein the target vector is used to represent the correlation between the text portion in the data set and the question portion in the data set; In the output layer, the target vector outputs the entity type probability distribution through a fully connected network.

7. The entity classification method according to claim 1, characterized in that: Determining the category of the entity to be predicted based on the multiple classification labels includes: When the values of the multiple classification labels are not all the first numerical values, determining the category of the entity to be predicted by using the classification labels with the second numerical values among the multiple classification labels; When the values of the multiple classification labels are all the first value, the classification label with the largest prediction probability among the multiple classification labels is used to determine the category of the entity to be predicted.

8. A method for entity classification, characterized in that: include: Receive the entity to be predicted from the client; Constructing multiple instances using the entity to be predicted and multiple relationship types, performing negative example sampling processing at different proportions based on the degree of type similarity between positive examples in the multiple instances and negative examples in the multiple instances, to obtain negative example sampling results, wherein the degree of type similarity is proportional to the negative example sampling proportion; Using the positive examples and the negative example sampling results in the multiple instances, a reading comprehension model is obtained through deep learning training; Using the reading comprehension model to classify each of the multiple instances to obtain multiple classification labels, and determining the category of the entity to be predicted based on the multiple classification labels, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion, the text portion includes an entity profile of the entity to be predicted and a type profile of the relationship type, and the question portion includes entity attributes of the entity to be predicted and relationship attributes of the relationship type; The category of the entity to be predicted is fed back to the client.

9. A method for entity classification, characterized in that: include: Obtain the knowledge entities to be predicted from the knowledge graph; Constructing multiple instances using the knowledge entity and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion, the text portion including an entity profile of the knowledge entity and a type profile of the relationship type, and the question portion including entity attributes of the knowledge entity and relationship attributes of the relationship type; performing negative example sampling processing at different ratios based on the degree of type similarity between the positive examples in the multiple instances and the negative examples in the multiple instances, to obtain negative example sampling results, wherein the degree of type similarity is proportional to the negative example sampling ratio; Using the positive examples and the negative example sampling results in the multiple instances, a reading comprehension model is obtained through deep learning training; Using the reading comprehension model, classify each of the multiple instances to obtain multiple classification labels; An entity type of the knowledge entity is determined based on the multiple classification labels.

10. The entity classification method according to claim 9, characterized in that: Classifying each of the multiple instances to obtain the multiple classification labels includes: A reading comprehension model is used to classify each of the multiple instances to obtain the multiple classification labels, wherein the reading comprehension model is obtained by deep learning training using a data set, and the data set is determined by the multiple instances.

11. An entity classification device, characterized in that: include: An acquisition module, used to obtain the entity to be predicted; a construction module, configured to construct multiple instances using the entity to be predicted and the multiple relationship types, wherein each of the multiple instances comprises: a text portion, a question portion, and an answer portion, wherein the text portion comprises an entity profile of the entity to be predicted and a type profile of the relationship type, and the question portion comprises entity attributes of the entity to be predicted and relationship attributes of the relationship type; a processing module configured to perform negative example sampling processing at different ratios based on the degree of type similarity between the positive examples in the multiple instances and the negative examples in the multiple instances, to obtain negative example sampling results, wherein the type similarity is proportional to the negative example sampling ratio; using the positive examples in the multiple instances and the negative example sampling results, to obtain a reading comprehension model through deep learning training; and using the reading comprehension model to classify each of the multiple instances to obtain multiple classification labels; A classification module is used to determine the category of the entity to be predicted based on the multiple classification labels.

12. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the entity classification method according to any one of claims 1 to 10.

13. A processor, characterized in that: The processor is configured to run a program, wherein the program executes the entity classification method according to any one of claims 1 to 10 when running.

14. An electronic device, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following steps: Step 1: Obtain the entity to be predicted; Step 2: constructing multiple instances using the entity to be predicted and multiple relationship types, wherein each of the multiple instances includes: a text portion, a question portion, and an answer portion, wherein the text portion includes an entity profile of the entity to be predicted and a type profile of the relationship type, and the question portion includes entity attributes of the entity to be predicted and relationship attributes of the relationship type; Step 3: Based on the degree of type similarity between the positive examples in the multiple instances and the negative examples in the multiple instances, negative example sampling processing is performed in different proportions to obtain negative example sampling results, wherein the type similarity is proportional to the negative example sampling proportion; using the positive examples in the multiple instances and the negative example sampling results, a reading comprehension model is obtained through deep learning training; and using the reading comprehension model to classify each of the multiple instances to obtain multiple classification labels; Step 4: Determine the category of the entity to be predicted based on the multiple classification labels.

Citation Information

Patent Citations

  • Negative example training sample collection method and device, and model training method and device

    CN109165309A

  • Entity classification method and device, computing equipment and storage medium

    CN113221573A