A text processing method and device based on knowledge graph assistance

By combining the characteristics of knowledge graphs and news text in text processing, graph vectors and sentence vectors are generated and weighted average calculations are performed, the problem of insufficient accuracy caused by single features in text processing in the prior art is solved, and a higher level of accuracy is achieved. Risk classification prediction accuracy.

CN114579757BActive Publication Date: 2025-02-07ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210167615.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2025-02-07
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

The prior art relies on a single text feature in text processing, ignoring other forms of features related to the target object, resulting in insufficient accuracy of classification prediction.

Method used

By generating the graph vector corresponding to the knowledge graph of the target enterprise and the sentence vector corresponding to each sentence in the news text related to the target enterprise, and setting the weight for the sentence vector based on the similarity calculation, performing weighted average calculation, and obtaining the target vector as a classification feature sample Conduct risk classification prediction.

Benefits of technology

Through feature fusion, additional sample features are introduced, which improves the accuracy of risk classification prediction for target companies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579757B_ABST
    Figure CN114579757B_ABST
Patent Text Reader

Abstract

The present specification provides a text processing method and device assisted by a knowledge graph. The method includes: obtaining a knowledge graph of a target object, and obtaining text related to the target object; wherein the knowledge graph describes the relationship between the target object and a number of other objects. Generate a graph vector corresponding to the knowledge graph, and generate sentence vectors corresponding to each sentence included in the text. Calculate the first similarity between the sentence vector corresponding to each sentence and the graph vector respectively, and use the first similarity corresponding to each sentence as the weight corresponding to each sentence, perform weighted average calculation on the sentence vectors corresponding to each sentence, and obtain a target vector corresponding to the text. Wherein, the target vector is used as a classification feature sample for classification prediction of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology. More specifically, the embodiments of this specification relate to a text processing method and device based on the assistance of knowledge graph. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the present specification as recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] The processing of text, which usually includes the understanding and analysis of text, is one of the research goals in the field of natural language processing. The processing of text is usually completed by relying on artificial intelligence models. In practical applications, text can be processed into feature vectors, and then the feature vectors are input into the artificial intelligence model as feature samples for calculation to complete the processing of the text.

[0004] For example, taking text classification prediction as an example, several text features can usually be extracted from the text to construct a feature vector, and then the feature vector is input as a classification feature sample into an artificial intelligence model used for text classification prediction to perform prediction calculations, and then the text is marked with a corresponding classification label based on the prediction result output by the artificial intelligence model. Summary of the invention

[0005] To overcome the problems existing in the related art, this specification provides the following methods and devices.

[0006] In a first aspect of the embodiments of this specification, a text processing method based on knowledge graph assistance is provided, the method comprising:

[0007] Obtaining a knowledge graph of a target enterprise, and obtaining news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0008] Generate a graph vector corresponding to the knowledge graph, and generate sentence vectors corresponding to each sentence included in the news text;

[0009] The first similarities between the sentence vectors corresponding to the respective sentences and the graph vector are calculated respectively, and the first similarities corresponding to the respective sentences are used as weights corresponding to the respective sentences. The sentence vectors corresponding to the respective sentences are weighted averaged to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0010] In a second aspect of the embodiments of this specification, a text processing method is provided, the method comprising:

[0011] Acquire a relationship diagram of a target object, and acquire text related to the target object; wherein the relationship diagram describes the relationship between the target object and a number of other objects;

[0012] Generate a graph vector corresponding to the relationship graph, and generate sentence vectors corresponding to each sentence included in the text;

[0013] The first similarities between the sentence vectors corresponding to the sentences and the graph vector are calculated respectively, and the first similarities corresponding to the sentences are used as weights corresponding to the sentences. The sentence vectors corresponding to the sentences are weighted averaged to obtain a target vector corresponding to the text; wherein the target vector is used as a classification feature sample to perform classification prediction on the target object.

[0014] In a third aspect of the embodiments of the present specification, a text processing device based on knowledge graph assistance is provided, the device comprising:

[0015] A first object acquisition unit is used to acquire a knowledge graph of a target enterprise and to acquire text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0016] A first vector generating unit, configured to generate a graph vector corresponding to the knowledge graph, and to generate a sentence vector corresponding to each sentence included in the news text;

[0017] The first weighted calculation unit is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as the weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0018] In a fourth aspect of the embodiments of the present specification, a text processing device is provided, the device comprising:

[0019] A second object acquisition unit is used to acquire a relationship diagram of a target object and to acquire text related to the target object; wherein the relationship diagram describes the relationship between the target object and a number of other objects;

[0020] A second vector generating unit, configured to generate a graph vector corresponding to the relationship graph, and to generate sentence vectors corresponding to respective sentences included in the text;

[0021] A second weighted calculation unit is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the text; wherein the target vector is used as a classification feature sample to perform classification prediction on the target object.

[0022] In a fifth aspect of the embodiments of the present specification, a storage medium is provided; a computer program is stored on the storage medium, and when the computer program is executed, the steps of the following method are implemented:

[0023] Obtaining a knowledge graph of a target enterprise, and obtaining news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0024] Generate a graph vector corresponding to the knowledge graph, and generate sentence vectors corresponding to each sentence included in the news text;

[0025] The first similarities between the sentence vectors corresponding to the respective sentences and the graph vector are calculated respectively, and the first similarities corresponding to the respective sentences are used as weights corresponding to the respective sentences. The sentence vectors corresponding to the respective sentences are weighted averaged to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0026] In a sixth aspect of the embodiments of the present specification, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following method is implemented:

[0027] Obtaining a knowledge graph of a target enterprise, and obtaining news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0028] Generate a graph vector corresponding to the knowledge graph, and generate sentence vectors corresponding to each sentence included in the news text;

[0029] The first similarities between the sentence vectors corresponding to the respective sentences and the graph vector are calculated respectively, and the first similarities corresponding to the respective sentences are used as weights corresponding to the respective sentences. The sentence vectors corresponding to the respective sentences are weighted averaged to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0030] The above embodiments of this specification have at least the following beneficial effects:

[0031] In the above technical scheme, when making risk classification predictions for the target enterprise, by generating a graph vector corresponding to the knowledge graph of the target enterprise and a sentence vector corresponding to each sentence included in the news text related to the target object, and setting a weight for each sentence vector based on the similarity between each sentence vector and the image quantity, the graph vector and the sentence vector as sample features can be feature fused, so that additional sample features can be introduced on the basis of the sentence vector, and the feature samples used for classification prediction can be expanded, thereby improving the accuracy of risk classification predictions for the target enterprise. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification, and for ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0033] Figure 1 The following schematically shows an architecture diagram of a text processing system based on knowledge graph assistance according to an embodiment of the present specification;

[0034] Figure 2 A flowchart of a text processing method according to an embodiment of the present specification is schematically shown;

[0035] Figure 3 A flowchart of a text processing method based on knowledge graph assistance according to an embodiment of the present specification is schematically shown;

[0036] Figure 4 A schematic diagram of a text processing method based on knowledge graph assistance according to an embodiment of the present specification is schematically shown;

[0037] Figure 5 A block diagram schematically shows a text processing device based on knowledge graph assistance according to an embodiment of the present specification;

[0038] Figure 6A block diagram schematically shows a text processing device according to an embodiment of the present specification;

[0039] Figure 7 A hardware structure diagram of a computer device in which a text processing device assisted by a knowledge graph is located according to an embodiment of the present specification is schematically shown.

[0040] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0041] The principles and spirit of this specification will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement this specification, and are not intended to limit the scope of this specification in any way. On the contrary, these embodiments are provided to make this specification more thorough and complete, and to fully convey the scope of this specification to those skilled in the art.

[0042] Those skilled in the art know that the embodiments of this specification can be implemented as a system, device, equipment, method or computer program product. Therefore, this specification can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0043] When making classification predictions for an object, you can usually collect texts related to the object and then extract features from these texts to make classification predictions.

[0044] For example, taking risk prediction for an enterprise as an example, relevant features can be extracted from news texts related to the target enterprise to predict its possible risks.

[0045] In practical applications, classification prediction is performed only based on features extracted from text. The sample features used are relatively simple, and other forms of features related to the target object except text features are ignored.

[0046] In view of this, the present application proposes a technical solution that fuses features extracted from a relationship graph used to describe the relationship between a target object and several other objects, and features extracted from text related to the target object, and uses the fused features as classification features for classification prediction of the target object.

[0047] For example, taking the above-mentioned target object as an enterprise, the features extracted from the knowledge graph used to describe the relationship between the target enterprise and several other enterprises and the features extracted from the news text related to the target enterprise can be fused, and the fused features can be used as classification features for risk classification prediction for the target enterprise.

[0048] During implementation, the graph vector corresponding to the above-mentioned relationship graph and the sentence vectors corresponding to each sentence included in the above-mentioned text can be generated respectively; then the similarity between the sentence vector corresponding to each sentence and the graph vector is calculated respectively, and the similarity corresponding to each sentence is used as the weight corresponding to each sentence, and the sentence vectors corresponding to each sentence are weighted averaged to obtain the target vector corresponding to the above-mentioned text, so as to perform classification prediction on the target object as a classification feature sample.

[0049] Based on the above technical scheme, in the above technical scheme, when classifying and predicting the target object, by calculating the graph vector corresponding to the relationship graph of the target object and the sentence vectors corresponding to each sentence included in the text related to the target object, and setting weights for each sentence vector based on the similarity between each sentence vector and the image quantity, the graph vector and the sentence vector as sample features can be feature fused, so that additional sample features can be introduced on the basis of the sentence vector, and the feature samples used for classification prediction can be expanded, thereby improving the accuracy of text classification prediction.

[0050] The exemplary embodiments will be described in detail below, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are only examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the attached claims.

[0051] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0052] Figure 1 FIG. 1 is a schematic diagram of the architecture of a text processing system provided by an exemplary embodiment. Figure 1As shown, the system may include a network 10, a server 11, and several electronic devices, such as a mobile phone 12, a mobile phone 13, and a mobile phone 14.

[0053] The server 11 may be a physical server including an independent host, or the server 11 may be a virtual server, a cloud server, etc. hosted by a host cluster. The mobile phones 12-14 are just one type of electronic device that the user can use. In fact, the user may also use electronic devices such as tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. The network 10 may include various types of wired or wireless networks.

[0054] In one embodiment, the server 11 can cooperate with the mobile phones 12-14; wherein the mobile phones 12-14 can accept user operations and upload the received commands and files to the server 11 through the network 10, and then the server 11 processes the files based on the solution of this specification. In another embodiment, the mobile phones 12-14 can independently implement the text processing solution of this specification; wherein the mobile phones 12-14 accept user operations and process the received commands and files based on the solution of this specification to implement text processing.

[0055] The scheme of this specification is described in detail below with reference to the accompanying drawings.

[0056] See also Figure 2 , Figure 2 is a flowchart of a text processing method provided by an exemplary embodiment, wherein the method is applied to a processing device, which can be, for example, Figure 1 The server 11 or mobile phones 12-14 shown in the figure. The method performs the following steps:

[0057] Step 202, obtaining a relationship diagram of a target object, and obtaining text related to the target object;

[0058] The target object may include any type of object that can be used as a classification prediction target. For example, in one example, the classification prediction may specifically be a risk classification prediction; the target object may be an enterprise for risk classification prediction.

[0059] In practical applications, when performing classification prediction on a target object, text related to the target object can usually be obtained, and then text features can be extracted from the obtained text as classification features for classification prediction.

[0060] For example, taking risk classification prediction for a target enterprise as an example, the text may include news text related to the target enterprise. When risk classification prediction is performed for the target enterprise, text features may be extracted from the news text related to the target enterprise as classification features for classification prediction.

[0061] In this specification, when performing classification prediction on a target object, in addition to using features extracted from text related to the target object as classification features, other forms of features related to the target object other than text features may also be used as classification features.

[0062] Among them, in actual applications, when classifying and predicting the target object, only the text features extracted from the text related to the target object are used as classification features, and those features that can describe the characteristics of the target enterprise itself may be ignored. Based on this, in this specification, the other forms of features related to the target object described above can specifically be features extracted from information that can describe the characteristics of the target object itself.

[0063] For example, taking the risk classification prediction for a target enterprise as an example, in this case, the above information that can describe the characteristics of the target object itself can specifically be information that can describe the risks of the target enterprise itself.

[0064] In an illustrated embodiment, the above-mentioned information capable of describing the characteristics of the target object itself may specifically include a relationship diagram capable of describing the relationship between the target object and a number of other objects.

[0065] It should be noted that a graph is a data structure that represents a certain relationship between objects. The above relationship graph is a specific form of a graph.

[0066] For example, taking the target object as a target enterprise, in this case, the relationship graph may specifically be a knowledge graph that can describe the relationship between the target enterprise and other enterprises.

[0067] In the above relationship graph, it may specifically include several nodes, and any two nodes may be connected by edges. The nodes may represent objects, and in the above knowledge graph, it may specifically include nodes representing the target object and nodes representing other objects that have an association relationship with the target object. The edges between nodes may specifically represent the association relationship between the objects represented by the nodes. The node content corresponding to the node may include features of several dimensions corresponding to the object represented by the node.

[0068] For example, when the object is an enterprise, the association relationship may include investment relationship, branch company relationship, common executive relationship, common legal person relationship, etc. The nodes in the relationship graph may also include several features corresponding to the objects represented by the nodes. These features are usually associated with the classification to be predicted. Therefore, these features can also be extracted and fused with the features extracted from the text to increase the accuracy of the classification prediction.

[0069] For example, when the object is an enterprise and the information that needs to be classified and predicted includes enterprise risk information, the several features corresponding to the above object may include the enterprise's industrial and commercial event label features, such as the number of administrative penalties, the number of breaches of trust, the number of executions, etc.

[0070] In this specification, after the processing device determines the target object that needs to be classified and predicted, it can obtain text related to the target object; and obtain a relationship graph of the target object. For example, taking the above target object as a target enterprise as an example, the knowledge graph of the target enterprise can be obtained.

[0071] The method of obtaining text related to the target object may be, for example, through Internet collection, commercial purchase, or other reasonable methods, which is not specifically limited in this specification.

[0072] In an exemplary embodiment of the present application, a web crawler may be used to crawl text related to the target object by taking the name of the target object as a keyword.

[0073] Similarly, as for the method of obtaining the relationship graph of the target object, the relationship graph of an existing target object may be directly obtained, or the relationship graph of the target object may be constructed according to information related to the target object, and this specification does not specifically limit this.

[0074] In an exemplary embodiment of the present application, when obtaining a relationship graph of a target object, the target object can be first used as a meta-node of the relationship graph, and then other objects that have an association relationship with the target object can be obtained as nodes of the relationship graph, and connected to the meta-node through the association relationship. Among them, the association relationship between nodes can be a first-level association relationship or a multi-level association relationship. Then, the features of several dimensions corresponding to the object represented by the node are added to the relationship graph as the content of the node.

[0075] Step 204, generating a graph vector corresponding to the relationship graph, and generating sentence vectors corresponding to each sentence included in the text;

[0076] To make classification predictions, it is usually necessary to convert the acquired relationship graphs and texts into vector form.

[0077] In this case, on the one hand, an image quantity corresponding to the acquired relationship graph of the target object may be further generated, wherein the specific manner of generating the image vector corresponding to the above relationship graph is not particularly limited in this specification;

[0078] For example, in practical applications, a vector generation model based on deep learning can be used to generate a vector corresponding to the above relationship graph. For example, the above vector generation model can be a graph neural network model such as a Graphsage model, a GAT model, or a GCN model.

[0079] In practical applications, since there may be many nodes in the relationship graph, the relationship between the nodes may be more complicated; for example, including N-level relationships; in order to reduce the amount of calculation, the relationship graph can be simplified to reduce the computational complexity when generating the graph vector, for example, only the nodes in the relationship graph that have a relationship with the meta-node within three levels are retained.

[0080] On the other hand, a sentence vector corresponding to the sentence contained in the acquired text related to the target object may be further generated, wherein the specific manner of generating the sentence vector corresponding to the sentence contained in the acquired text related to the target object is not particularly limited in this specification;

[0081] It is understandable that the sentences in this specification can be divided in different ways as needed, for example, by traditional sentence separators such as periods, question marks, exclamation marks, or by other punctuation marks such as commas and semicolons, or by specific characters such as spaces, etc. This specification does not specifically limit this.

[0082] For example, in practical applications, a vector generation model based on deep learning can be used to generate a sentence vector corresponding to the above sentence. For example, the above vector generation model can be a one-hot encoding model, a word2vec model, or a neural network model such as a Transformer model.

[0083] Step 206, for each sentence, calculate the first similarity between the sentence vector and the graph vector, and use the first similarity corresponding to each sentence as the weight corresponding to each sentence, perform weighted average calculation on the sentence vectors corresponding to each sentence, and obtain a target vector corresponding to the text;

[0084] In this specification, after the graph vector corresponding to the above relationship graph and the sentence vectors corresponding to the sentences in the above text are generated, the sentence vectors can be further used as vectors representing text features and feature fused with the graph vector. This specification does not specifically limit the specific fusion method.

[0085] In an exemplary embodiment shown in the present specification, the fusion of the above-mentioned sentence vector and graph vector can be achieved by using the similarity between the graph vector of the relationship graph corresponding to the target object and the sentence vectors of each sentence corresponding to the text as weighted values ​​and performing weighted calculation on the sentence vectors.

[0086] In this case, the vector distribution similarity between the sentence vector corresponding to each sentence and the above graph vector can be calculated as the first similarity corresponding to each sentence. Different similarity algorithms can be used as needed, such as dot product similarity, cosine similarity, or Euclidean similarity, etc., which are not specifically limited in this specification.

[0087] Furthermore, the calculated first similarity may be used as the weight of each sentence, and a weighted average calculation may be performed on the sentence vectors corresponding to the sentences.

[0088] Each sentence vector can be formed into a sentence vector matrix, and then a weight matrix (attention matrix) can be formed based on the first similarity between each sentence vector and the graph vector; matrix operations are performed on the above sentence vector matrix and weight matrix to complete the weighted average calculation based on the first similarity for the sentence vector.

[0089] Since the sentence vector is a feature vector composed of features learned by the deep learning model from the sentence, and the graph vector is a feature vector composed of features learned by the deep learning model from the relationship graph.

[0090] For a sentence vector, if it contains a feature that is highly correlated with a feature contained in a graph vector, then the similarity between the sentence vector and the graph vector will usually be higher. Therefore, if similarity is used as a weight, a higher weight will be set for such sentence vectors containing related features, and the weight will remind the classification model to pay more attention to such features. Conversely, for sentence vectors that do not contain related features, the classification model will downplay such features.

[0091] For example, when the target object is an enterprise, and the information that needs to be classified and predicted includes enterprise risk information, the text related to the target object can be the news text of the enterprise, and the above relationship graph can be a knowledge graph describing the relationship between enterprises; if the knowledge graph contains information that a certain enterprise that has a common executive relationship with the target enterprise is highly related to the cloud computing industry and has many litigation records; the news text contains the following sentences: sentence S1 describes the overall risk related to the e-commerce industry, sentence S2 describes the overall risk related to the cloud computing industry, sentence S3 describes the overall risk related to litigation, and sentence S4 describes the overall risk related to bankruptcy. The sentence vectors corresponding to sentences S1, S2, S3, and S4 are V1, V2, V3, and V4 respectively;

[0092] Since sentence S2 is more closely related to S1 than to sentence S3 and sentence S4 than to the feature information contained in the knowledge graph, namely, cloud computing industry information and litigation information, then sentence vector V2 should have a higher correlation with the above graph vectors than sentence vector V1, and sentence vector V3 should have a higher correlation with the above graph vectors than sentence vector V4, and higher weights can be set. Then the classification model will pay more attention to the features contained in sentence vectors V2 and V3.

[0093] In another exemplary implementation of the present specification, vector fusion may be performed by directly concatenating the above-mentioned graph vector and sentence vector.

[0094] In this specification, the target vector obtained by feature fusion can be further used as the input of the classification model for classification prediction.

[0095] For example, the vector obtained by the weighted average calculation can be used as the target vector corresponding to the text.

[0096] It is understandable that the above target vector can be used as the input of the classification model, and can be used for training the text classification model after being labeled with the corresponding classification results; it can also be used as the input for text classification prediction after the text classification model is trained.

[0097] For example, still taking enterprise risk classification prediction as an example, we will give examples for the above two situations. For example, in the first situation, we can prepare a large number of news, and label them with corresponding risk information labels through manual labeling; then, for each news, we can obtain a target vector through the above-described method, and then construct the target vectors corresponding to each news into a sample set, and divide part of the samples in this sample set into a training set and a test set to train the text classification model.

[0098] For example, in the second case, after the text classification model is trained, the news text of the target enterprise that needs to be classified and predicted can be used to obtain a target vector through the method described above, and the text classification model can be used for prediction to obtain the possible risks of the target enterprise.

[0099] In this specification, for a target object to be classified, the categories to which the target object may belong may include two or more categories, and this specification does not make any specific limitation on this.

[0100] In an exemplary embodiment shown, if the target object may belong to multiple categories, in this case, the text classification prediction described in this specification may include multi-label classification prediction.

[0101] See also Figure 3 , Figure 3is a flowchart of a text processing method based on knowledge graph assistance provided by an exemplary embodiment, and the method can still be applied to a processing device, which can still be, for example, Figure 1 The server 11 or mobile phones 12-14 shown in the figure. The method performs the following steps:

[0102] Step 301, obtaining a knowledge graph of a target enterprise, and obtaining news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0103] The specific steps are as described above and will not be repeated here.

[0104] Step 302: Input the knowledge graph into a first vector generation model based on deep learning to obtain a graph vector corresponding to the knowledge graph;

[0105] Obtaining the corresponding graph vector through the above knowledge graph can be achieved through a deep learning model. The above knowledge graph is input into the first vector generation model, and the corresponding graph vector can be obtained through processing. Among them, the above first vector model can adopt different vector models as needed, such as Graphsage model, GAT model or GCN model and other graph neural network models, which are not specifically limited in this application.

[0106] In an exemplary embodiment shown, the first deep learning-based vector generation model includes a Graphsage model;

[0107] Since the Graphsage model only uses a small number of all the nodes in the entire graph during each training and prediction, and the trained model has a good prediction effect on the newly added nodes and has good performance, the Graphsage model can be used to generate graph vectors.

[0108] Step 303: Generate a full-text vector corresponding to the news text;

[0109] Since the full text of the news text related to the target enterprise also contains a large amount of information that plays an important role in predicting the risk classification of the enterprise, a full text vector corresponding to the above news text can be generated;

[0110] The specific method of generating the full-text vector corresponding to the above news text is not particularly limited in this specification;

[0111] For example, in practical applications, a vector generation model based on deep learning can be used to generate a full-text vector corresponding to the above text. For example, the above vector generation model can be a one-hot encoding model, a word2vec model, or a neural network model such as a Transformer model.

[0112] Step 304: Inputting each sentence included in the news text into a second vector generation model based on deep learning to obtain a sentence vector corresponding to each sentence;

[0113] The corresponding sentence vectors obtained by the above-mentioned sentences can be obtained by deep learning methods. The above-mentioned sentences are input into the second vector generation model, and the sentence vectors corresponding to each sentence can be obtained through processing. Among them, the above-mentioned first vector model can adopt different vector models as needed, such as one-hot encoding model, word2vec model, or neural network model such as Transformer model, which is not specifically limited in this application.

[0114] In an exemplary embodiment shown, the second vector generation model based on deep learning includes a Transformer model.

[0115] The Transformer model has good parallelism, can handle dependencies well, and has good overall performance. Therefore, the Transformer model can be selected to generate text vectors, including the generation of full-text vectors and sentence vectors.

[0116] Step 305: obtaining a central sentence in the news text, and obtaining a sentence vector of the central sentence as a central sentence vector;

[0117] Sentences containing keywords related to the target enterprise in the news text may be used as key sentences. Obviously, sentences containing keywords related to the target enterprise usually play a more important role in predicting and classifying the target enterprise.

[0118] The above-mentioned keywords related to the target enterprise may be keywords that are highly associated with the target enterprise, such as the name, alias, code name, etc. of the target enterprise, and this specification does not make specific limitations on this.

[0119] Step 306: respectively calculating the first similarity between the sentence vector corresponding to each sentence and the graph vector;

[0120] The specific steps are as described above and will not be repeated here.

[0121] Step 307: For each sentence, calculate the second similarity between the sentence vector and the central sentence vector;

[0122] As mentioned above, the central sentence of the news text usually plays a more important role in predicting the risk classification of the target enterprise. Therefore, the sentences in the news text with a higher degree of correlation between the corresponding sentence vector and the central sentence vector of the news text usually play a more important role in predicting the risk classification of the target enterprise.

[0123] Therefore, the above-mentioned central sentence vector and sentence vector can be further fused. The specific method of fusion is not specifically limited in this specification.

[0124] For example, the vector distribution similarity between the sentence vectors corresponding to each sentence in the news text and the central sentence vector of the news text can be used as the second similarity to serve as the weight of the sentence vector corresponding to each sentence, and the sentence vectors can be weighted calculated to achieve the fusion of the central sentence vector and the sentence vector.

[0125] For another example, the central sentence vector and the sentence vector may be directly concatenated to achieve the fusion of the central sentence vector and the sentence vector.

[0126] When calculating the similarity of the sentence vectors corresponding to each sentence and the vector distribution of the central sentence of the text, different similarity algorithms can be used as needed, such as dot product similarity, cosine similarity, or Euclidean similarity, etc., which is not specifically limited in this specification.

[0127] As mentioned above, the higher the correlation between a sentence and the central sentence, the more important the sentence is. The correlation between a sentence and the central sentence can include the correlation between the content of the sentence and the central sentence, as well as the correlation between the position of the sentence and the central sentence. Generally, sentences near the central sentence will also have higher importance.

[0128] Therefore, a vector that can simultaneously contain sentence content features and a vector that contains sentence position features can be fused to obtain a sentence vector. The specific fusion method of the vector containing sentence content features and the vector containing sentence position features is not limited in this specification.

[0129] In an exemplary embodiment shown, a vector obtained by concatenating a text vector corresponding to the text of a sentence and a position vector corresponding to the position of the sentence in the news text may be used as a sentence vector corresponding to the sentence.

[0130] The text vector and position vector corresponding to the above sentence can be generated by different neural network models as needed, and this specification does not specifically limit this, for example, one-hot encoding model, word2vec model, or neural network model such as Transformer model.

[0131] In an exemplary embodiment shown in this specification, the above position vector can be assigned with reference to a triangular periodic function in a Transformer model.

[0132] Step 308: taking the product of the first similarity and the second similarity as the weight of each sentence, performing weighted average calculation on the sentence vectors corresponding to each sentence, and calculating the weighted sum of each sentence;

[0133] Since the first similarity between each sentence in the news text and the above graph vector, and the second similarity between each sentence and the above central sentence vector, can both characterize the importance of the sentence in the risk classification prediction of the target enterprise. Therefore, the above first similarity and the second similarity corresponding to the sentence can be fused as the weight of the sentence. However, this specification does not specifically limit the specific method of fusion of the above first similarity and the second similarity.

[0134] For example, the product of the first similarity and the second similarity corresponding to the sentence can be used as the weight of the sentence to achieve the fusion of the first similarity and the second similarity; for another example, the sum of the first similarity and the second similarity corresponding to the sentence can be used as the weight of the sentence to achieve the fusion of the first similarity and the second similarity.

[0135] In an exemplary embodiment shown in this specification, the product of the first similarity and the second similarity is used as the weight of each sentence, and a weighted average calculation is performed on the sentence vectors corresponding to each sentence.

[0136] The sentence vectors can be formed into a sentence vector matrix, and then a weight matrix (attention matrix) can be formed based on the product of the first similarity and the second similarity corresponding to each sentence vector; matrix operations are performed on the sentence vector matrix and the weight matrix to complete the weighted average calculation of the product of the first similarity and the second similarity of the sentence vector.

[0137] Step 309: The vector obtained by the weighted average calculation is concatenated with the graph vector, the full-text vector, and the central sentence vector to obtain a target vector corresponding to the news text; the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0138] Since the vector obtained by the weighted average calculation, the graph vector, the full text vector, and the central sentence vector each contain valuable information for risk classification prediction of the target enterprise;

[0139] Therefore, the vector obtained by the weighted average calculation can be fused with one or more of the graph vector, the full text vector, and the central sentence vector to obtain a target vector corresponding to the news text. The specific method of the feature fusion is not specifically limited in this specification.

[0140] In an exemplary embodiment shown in this specification, the vector obtained by the weighted average calculation and the graph vector can be concatenated to obtain a target vector corresponding to the news text.

[0141] In another exemplary embodiment shown in the present specification, the vector obtained by the weighted average calculation and the full-text vector may be concatenated to obtain a target vector corresponding to the text of the news.

[0142] In another exemplary embodiment shown in this specification, the vector obtained by the weighted average calculation and the central sentence vector can be concatenated to obtain a target vector corresponding to the news text.

[0143] In another exemplary embodiment shown in the present specification, the vector obtained by the weighted average calculation and the graph vector, the full-text vector, and the central sentence vector may be concatenated to obtain a target vector corresponding to the news text.

[0144] The following takes the target object as an enterprise as an example to describe the above embodiment in detail.

[0145] See also Figure 4 , Figure 4 It is a schematic diagram of a text processing method based on the assistance of a knowledge graph in an implementation mode of this specification.

[0146] Since the risk classification prediction of the target enterprise is only based on relevant news, it is easy to ignore the risks of the enterprise itself and the correlation between the risks of the enterprise itself and these news, so the results of risk classification prediction may not be accurate. Therefore, by introducing information related to the risks of the enterprise itself, such as the knowledge graph information of the enterprise, to assist the news text, the risk classification prediction of the target enterprise can be carried out.

[0147] The target enterprise's knowledge graph includes nodes representing the target enterprise and several enterprises with one or more levels of association with it. The lines between the nodes represent the associations between the enterprises, which may include investment relationships, branch company relationships, common executive relationships, common legal person relationships, etc. Each node on the target enterprise's knowledge graph also includes several risk characteristics of the enterprise represented by the node, such as the number of administrative penalties, the number of breaches of trust, the number of executions, and other industrial and commercial event characteristics.

[0148] In addition to the full text of the news text related to the target enterprise, each sentence in the news text may contain different information related to the target enterprise's risks. Therefore, the neural network model is used to generate the full text vector of the full text of the news text related to the target enterprise, as well as the sentence vector corresponding to each sentence. Similarly, the graph neural network model is used to generate the graph vector corresponding to the knowledge graph of the target enterprise.

[0149] In actual scenarios, in enterprise-related news, the information contained in the central sentence is often the most important. The central sentence refers to the sentence that directly contains important information about the target enterprise, such as the name, abbreviation, legal person name, etc. of the target enterprise. The sentence vector of the central sentence contains more information than the sentence vectors of other sentences.

[0150] In summary, the above full-text vector, each sentence vector, and the central sentence vector, or a combination of these vectors, can all be used as text vectors to represent information in news texts.

[0151] The graph vector carries the risk information of the enterprise and its related enterprises. By fusing the above text vector with the graph vector, we can obtain a target vector that combines the features of the text vector and the graph vector, which can be used to classify and predict the risks of the target enterprise.

[0152] The specific fusion method can be carried out as follows:

[0153] Since the importance of each sentence in the news text is often related to the degree of association between the above-mentioned enterprise graphs, the greater the degree of association with the enterprise graph, the higher the importance. Therefore, the first similarity between the sentence vector and the graph vector of each sentence can be calculated, and used as the weight corresponding to each sentence vector, and each sentence vector is weighted to obtain a weighted result; the similarity between the above vectors can use dot product similarity or cosine similarity.

[0154] Similarly, the importance of each sentence in a news text is often related to the degree of relevance between the central sentence and the central sentence. The closer the position to the central sentence and the more similar the content, the higher the importance. Therefore, the second similarity between the sentence vector of each sentence and the central sentence vector can be calculated, and it can be used as the weight corresponding to each sentence vector. The weighted operation is performed on each sentence vector to obtain the weighted result;

[0155] Taking both of the above into consideration at the same time, the first similarity and the second similarity can be combined. For example, the product of the first similarity and the second similarity is used as the weight corresponding to each sentence vector, and a weighted operation is performed on each sentence vector to obtain a weighted result.

[0156] The weighted result can be used as the target vector for enterprise risk classification prediction. Since the full text vector, central sentence vector, and graph vector also carry risk information related to the target enterprise, the full text vector, central sentence vector, and graph vector can be concatenated based on the weighted result to serve as the target vector for enterprise risk classification prediction.

[0157] In an exemplary embodiment of this specification, a text processing device based on knowledge graph assistance is also provided. Figure 5 , Figure 5 It is a block diagram of a text processing device based on the assistance of knowledge graph in an implementation mode of this specification.

[0158] The device is applied to the client and includes:

[0159] A first object acquisition unit 510 is used to acquire a knowledge graph of a target enterprise and to acquire text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises;

[0160] A first vector generating unit 520, configured to generate a graph vector corresponding to the knowledge graph, and to generate a sentence vector corresponding to each sentence included in the news text;

[0161] The first weighted calculation unit 530 is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as the weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

[0162] Optionally, the first vector generating unit 520 is specifically used to: input the knowledge graph into a first vector generating model based on deep learning to obtain a graph vector corresponding to the knowledge graph; input each sentence included in the news text into a second vector generating model based on deep learning to obtain a sentence vector corresponding to each sentence;

[0163] Optionally, the first vector generating unit 520 is specifically used to: input the knowledge graph into a Graphsage model to obtain a graph vector corresponding to the knowledge graph; input each sentence included in the news text into a Transformer model to obtain a sentence vector corresponding to each sentence;

[0164] Optionally, the first vector generating unit 520 is specifically used to: generate a vector obtained by concatenating a text vector corresponding to the text of each sentence and a position vector corresponding to the position of each sentence in the text;

[0165] Optionally, the first weighted calculation unit 530 is specifically used to: perform weighted average calculation on the sentence vectors corresponding to the respective sentences, and concatenate the vector obtained by the weighted average calculation with the graph vector to obtain a target vector corresponding to the news text;

[0166] Optionally, the first vector generating unit 520 is further used to: generate a full-text vector corresponding to the news text;

[0167] Correspondingly, the first weighted calculation unit 530 is specifically used to: perform weighted average calculation on the sentence vectors corresponding to the respective sentences, and concatenate the vector obtained by the weighted average calculation with the full-text vector to obtain a target vector corresponding to the news text;

[0168] Optionally, the first weighted calculation unit 530 is specifically used to: perform weighted average calculation on the sentence vectors corresponding to the respective sentences, and concatenate the vector obtained by the weighted average calculation with the central sentence vector to obtain a target vector corresponding to the news text;

[0169] Optionally, the first weighted calculation unit 530 is further used to: calculate, for each sentence, a second similarity between the sentence vector and the central sentence vector; and use the product of the first similarity corresponding to each sentence and the second similarity corresponding to each sentence as a weight corresponding to each sentence;

[0170] Optionally, the knowledge graph includes a plurality of nodes; wherein the nodes include nodes representing the target enterprise and nodes representing other enterprises associated with the target object; the nodes also include a plurality of features corresponding to the enterprises represented by the nodes;

[0171] Optionally, the first similarity between the sentence vectors corresponding to the sentences and the graph vector includes the dot product similarity between the sentence vectors corresponding to the sentences and the graph vector, or the cosine similarity between the sentence vectors corresponding to the sentences and the graph vector.

[0172] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0173] In an exemplary embodiment of the present specification, a text processing device is also provided. Figure 6 , Figure 6This is a block diagram of a text processing device in an embodiment of this specification. The device is applied to a client and includes:

[0174] The second object acquisition unit 610 is used to acquire a relationship diagram of a target object and to acquire text related to the target object; wherein the relationship diagram describes the relationship between the target object and a number of other objects;

[0175] A second vector generating unit 620 is used to generate a graph vector corresponding to the relationship graph, and to generate sentence vectors corresponding to each sentence included in the text;

[0176] The second weighted calculation unit 630 is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as the weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the text; wherein the target vector is used as a classification feature sample to perform classification prediction on the target object.

[0177] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0178] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0179] In an exemplary embodiment of the present specification, an embodiment of a device and a terminal to which the device is applied is also provided.

[0180] The embodiments of the text processing device of this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by its processor reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 7 FIG. 1 is a hardware structure diagram of a computer device 70 in which the text processing device of the embodiment of the present specification is located. Figure 6In addition to the processor 712, memory 730, network interface 720, and non-volatile memory 740 shown, the server or electronic device where the device is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0181] In the exemplary embodiments of this specification, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored. In some possible embodiments, various aspects of this specification can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of this specification described in the above "Exemplary Method" section of this specification.

[0182] According to the embodiment of the present specification, the program product for implementing the above method can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present specification is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0183] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0184] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0185] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0186] Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0187] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0188] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring these operations to be performed in the particular order shown or to be performed sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system units and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0189] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

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

Claims

1. A text processing method based on knowledge graph assistance, characterized in that: The method comprises: Obtaining a knowledge graph of a target enterprise, and obtaining news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises; Generate a graph vector corresponding to the knowledge graph, and generate sentence vectors corresponding to each sentence included in the news text; The first similarities between the sentence vectors corresponding to the respective sentences and the graph vector are calculated respectively, and the first similarities corresponding to the respective sentences are used as weights corresponding to the respective sentences. The sentence vectors corresponding to the respective sentences are weighted averaged to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

2. The method according to claim 1, characterized in that The generating a graph vector corresponding to the knowledge graph includes: Inputting the knowledge graph into a first vector generation model based on deep learning to obtain a graph vector corresponding to the knowledge graph; The generating of sentence vectors respectively corresponding to the sentences included in the news text includes: Each sentence included in the news text is input into a second vector generation model based on deep learning to obtain a sentence vector corresponding to each sentence.

3. The method according to claim 2, characterized in that The first vector generation model based on deep learning includes a Graphsage model; The second vector generation model based on deep learning includes a Transformer model.

4. The method according to claim 2, characterized in that: The sentence vectors corresponding to the sentences include: A vector obtained by concatenating a text vector corresponding to the text of each sentence and a position vector corresponding to the position of each sentence in the news text.

5. The method according to claim 1, characterized in that The weighted average calculation is performed on the sentence vectors corresponding to the respective sentences to obtain the target vector corresponding to the news text, including: A weighted average calculation is performed on the sentence vectors corresponding to the respective sentences, and the vector obtained by the weighted average calculation is concatenated with the graph vector to obtain a target vector corresponding to the news text.

6. The method according to claim 1, characterized in that The method further comprises: Generate a full-text vector corresponding to the news text; The weighted average calculation is performed on the sentence vectors corresponding to the respective sentences to obtain the target vector corresponding to the news text, including: A weighted average calculation is performed on the sentence vectors corresponding to the respective sentences, and the vector obtained by the weighted average calculation is concatenated with the full-text vector to obtain a target vector corresponding to the news text.

7. The method according to claim 1, characterized in that The text includes a central sentence; wherein the central sentence includes a sentence containing keywords related to the target object; the sentence vector of the central sentence is a central sentence vector; The weighted average calculation is performed on the sentence vectors corresponding to the respective sentences to obtain the target vector corresponding to the text, comprising: A weighted average calculation is performed on the sentence vectors corresponding to the respective sentences, and the vector obtained by the weighted average calculation is concatenated with the central sentence vector to obtain a target vector corresponding to the news text.

8. The method according to claim 7, characterized in that The method further comprises: For each sentence, calculating the second similarity between the sentence vector corresponding to the sentence and the central sentence vector; The using the first similarities corresponding to the respective sentences as weights corresponding to the respective sentences includes: The product of the first similarity corresponding to each of the sentences and the second similarity corresponding to each of the sentences is used as the weight corresponding to each of the sentences.

9. A text processing method, characterized in that: The method comprises: Acquire a relationship diagram of a target object, and acquire text related to the target object; wherein the relationship diagram describes the relationship between the target object and a number of other objects; Generate a graph vector corresponding to the relationship graph, and generate sentence vectors corresponding to each sentence included in the text; The first similarities between the sentence vectors corresponding to the sentences and the graph vector are calculated respectively, and the first similarities corresponding to the sentences are used as weights corresponding to the sentences. The sentence vectors corresponding to the sentences are weighted averaged to obtain a target vector corresponding to the text; wherein the target vector is used as a classification feature sample to perform classification prediction on the target object.

10. A text processing device based on knowledge graph assistance, characterized in that: The device comprises: A first object acquisition unit is used to acquire a knowledge graph of a target enterprise and to acquire news text related to the target enterprise; wherein the knowledge graph describes the relationship between the target enterprise and a number of other enterprises; A first vector generating unit, configured to generate a graph vector corresponding to the knowledge graph, and to generate sentence vectors corresponding to each sentence included in the text; The first weighted calculation unit is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as the weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the news text; wherein the target vector is used as a classification feature sample to perform risk classification prediction for the target enterprise.

11. A text processing device, characterized in that: The device comprises: A second object acquisition unit is used to acquire a relationship diagram of a target object and to acquire text related to the target object; wherein the relationship diagram describes the relationship between the target object and a number of other objects; A second vector generating unit, configured to generate a graph vector corresponding to the relationship graph, and to generate sentence vectors corresponding to respective sentences included in the text; A second weighted calculation unit is used to respectively calculate the first similarities between the sentence vectors corresponding to the respective sentences and the graph vector, and use the first similarities corresponding to the respective sentences as weights corresponding to the respective sentences, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences to obtain a target vector corresponding to the text; wherein the target vector is used as a classification feature sample to perform classification prediction on the target object.

12. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method according to any one of claims 1 to 9 are implemented.