CN114579757A - Knowledge graph assistance-based text processing method and device - Google Patents

Knowledge graph assistance-based text processing method and device Download PDF

Info

Publication number
CN114579757A
CN114579757A CN202210167615.8A CN202210167615A CN114579757A CN 114579757 A CN114579757 A CN 114579757A CN 202210167615 A CN202210167615 A CN 202210167615A CN 114579757 A CN114579757 A CN 114579757A
Authority
CN
China
Prior art keywords
sentence
vector
text
graph
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210167615.8A
Other languages
Chinese (zh)
Inventor
李旭瑞
康杨杨
孙常龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210167615.8A priority Critical patent/CN114579757A/en
Publication of CN114579757A publication Critical patent/CN114579757A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Databases & Information Systems (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Animal Behavior & Ethology (AREA)
  • Game Theory and Decision Science (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The specification provides a text processing method and device based on knowledge graph assistance. The method comprises the following steps: acquiring a knowledge graph of a target object, and acquiring a text related to the target object; wherein the knowledge-graph describes a relationship between the target object and a number of other objects. And generating a map vector corresponding to the knowledge graph, and generating sentence vectors respectively corresponding to the sentences included in the text. And respectively calculating first similarity between the sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the text. Wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.

Description

Knowledge graph assistance-based text processing method and device
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a text processing method and device based on knowledge graph assistance.
Background
This section is intended to provide a background or context to the embodiments of the specification that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Processing of text, typically including understanding and analysis of text, is one of the research goals in the field of natural language processing. And the processing of the text is usually completed by relying on an artificial intelligence model. In practical application, a text can be processed into a feature vector, and the feature vector is input into an artificial intelligence model as a feature sample to be calculated so as to complete the processing of the text.
For example, taking classification prediction for a text as an example, a plurality of text features may be extracted from the text to construct a feature vector, the feature vector is input as a classification feature sample into an artificial intelligence model for performing classification prediction on the text to perform prediction calculation, and a corresponding classification label is labeled for the text according to a prediction result output by the artificial intelligence model.
Disclosure of Invention
To overcome the problems in the related art, the present specification provides the following methods and apparatuses.
In a first aspect of embodiments of the present specification, there is provided a method of text processing based on knowledge-graph assistance, the method comprising:
acquiring a knowledge graph of a target enterprise, and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
generating a graph vector corresponding to the knowledge graph, and generating sentence vectors corresponding to each sentence included in the news text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the news text; and the target vector is used for performing risk classification prediction on the target object enterprise as a classification feature sample.
In a second aspect of embodiments of the present specification, there is provided a text processing method, the method comprising:
acquiring a relation graph of a target object, and acquiring a text related to the target object; wherein the relationship graph describes relationships between the target object and a number of other objects;
generating a graph vector corresponding to the relationship graph, and generating sentence vectors respectively corresponding to each sentence included in the text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the text; wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.
In a third aspect of embodiments herein, there is provided a knowledge-graph-based assisted text processing apparatus, the apparatus comprising:
the system comprises a first object acquisition unit, a second object acquisition unit and a third object acquisition unit, wherein the first object acquisition unit is used for acquiring a knowledge graph of a target enterprise and acquiring a text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
a first vector generation unit configured to generate a map vector corresponding to the knowledge graph, and generate sentence vectors corresponding to respective sentences included in the news text;
a first weighting calculation unit, configured to calculate first similarities between the sentence vectors corresponding to the respective sentences and the graph vectors, respectively, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences, using the first similarities corresponding to the respective sentences as weights corresponding to the respective sentences, to obtain target vectors corresponding to the news text; wherein the target vector is used for risk classification prediction of the target enterprise as a classification feature sample.
In a fourth aspect of embodiments herein, there is provided a text processing apparatus comprising:
the second object acquisition unit is used for acquiring a relation graph of a target object and acquiring a text related to the target object; wherein the relationship graph describes relationships between the target object and a number of other objects;
a second vector generation unit configured to generate a graph vector corresponding to the relationship graph, and generate sentence vectors corresponding to respective sentences included in the text;
a second weighting calculation unit, configured to calculate first similarities between the sentence vectors corresponding to the sentences and the graph vectors, respectively, and perform weighted average calculation on the sentence vectors corresponding to the sentences, using the first similarities corresponding to the sentences as weights corresponding to the sentences, to obtain target vectors corresponding to the text; wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.
In a fifth aspect of embodiments of the present specification, there is provided a storage medium; the storage medium has stored thereon a computer program which, when executed, implements the steps of the method as described below:
acquiring a knowledge graph of a target enterprise, and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
generating a graph vector corresponding to the knowledge graph, and generating sentence vectors corresponding to each sentence included in the news text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the news text; and the target vector is used for performing risk classification prediction on the target object enterprise as a classification feature sample.
In a sixth aspect of embodiments herein, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the following method when executing the program:
acquiring a knowledge graph of a target enterprise, and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
generating a graph vector corresponding to the knowledge graph, and generating sentence vectors corresponding to each sentence included in the news text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the news text; and the target vector is used for performing risk classification prediction on the target object enterprise as a classification feature sample.
The above embodiments of the present specification have at least the following advantageous effects:
in the above technical solution, when risk classification prediction is performed on a target enterprise, feature fusion can be performed on a graph vector and a sentence vector which are used as sample features by generating a graph vector corresponding to a knowledge graph of the target enterprise and a sentence vector corresponding to each sentence included in a news text related to a target object and setting a weight for each sentence vector based on a similarity between each sentence vector and an image quantity, so that additional sample features can be introduced on the basis of the sentence vectors, feature samples for classification prediction can be expanded, and accuracy of risk classification prediction on the target enterprise can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram illustrating an architecture of a knowledge-graph-based aided text processing system according to an embodiment of the present specification;
FIG. 2 schematically illustrates a flow diagram of a method of text processing according to an embodiment of the present description;
FIG. 3 schematically illustrates a flow diagram of a method of knowledge-graph-based assisted text processing according to an embodiment of the present specification;
FIG. 4 is a diagram schematically illustrating a method of processing text based on knowledge-graph assistance according to an embodiment of the present specification;
FIG. 5 schematically illustrates a block diagram of a text processing apparatus based on knowledge-graph assistance according to an embodiment of the present specification;
FIG. 6 schematically shows a block diagram of a text processing apparatus according to an embodiment of the present specification;
fig. 7 schematically shows a hardware configuration diagram of a computer device in which a knowledge-graph-based assisted text processing apparatus according to an embodiment of the present specification is located.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present description will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely to enable those skilled in the art to better understand and to implement the present description, and are not intended to limit the scope of the present description in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the description to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present description may be embodied as a system, apparatus, device, method, or computer program product. Thus, the present description may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
When performing classification prediction on an object, texts related to the object may be collected, and features are extracted from the texts to perform classification prediction.
For example, taking risk prediction for a business as an example, relevant features may be extracted from news text related to the target business to predict the risk that it may present.
In practical application, classification prediction is performed only according to features extracted from texts, the sample features are relatively single, and features related to target objects except for text features are omitted.
In view of the above, the present application proposes a technical solution that performs feature fusion on features extracted from a relationship diagram for describing a relationship between a target object and several other objects and features extracted from a text related to the target object, and uses the fused features as classification features for performing classification prediction on the target object.
For example, taking the target object as an enterprise as an example, features extracted from a knowledge graph for describing the relationship between the target enterprise and several other enterprises and features extracted from news texts related to the target enterprise may be feature-fused, and the fused features may be used as classification features for risk classification prediction of the target enterprise.
During implementation, a graph vector corresponding to the relationship graph and a sentence vector corresponding to each sentence included in the text can be generated respectively; and then respectively calculating the similarity between the sentence vector corresponding to each sentence and the graph vector, taking the similarity corresponding to each sentence as the weight corresponding to each sentence, and carrying out weighted average calculation on the sentence vectors corresponding to each sentence so as to obtain the target vector corresponding to the text, and taking the target vector as a classification characteristic sample to carry out classification prediction on the target object.
Based on the above technical solution, in the above technical solution, when performing classification prediction on a target object, by calculating a graph vector corresponding to a relationship graph of the target object, a sentence vector corresponding to each sentence included in a text related to the target object, and setting a weight for each sentence vector based on a similarity between each sentence vector and an image quantity, feature fusion can be performed on the graph vector and the sentence vector as sample features, so that additional sample features can be introduced on the basis of the sentence vectors, feature samples for classification prediction can be expanded, and further, accuracy of the text classification prediction can be improved.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
FIG. 1 is an architectural diagram of a text processing system, according to an exemplary embodiment. As shown in fig. 1, the system may include a network 10, a server 11, a number of electronic devices, such as a cell phone 12, a cell phone 13, a cell phone 14, and so on.
The server 11 may be a physical server comprising an independent host, or the server 11 may be a virtual server, a cloud server, etc. carried by a cluster of hosts. Handsets 12-14 are just one type of electronic device that a user may use. In fact, it is obvious that the user can also use electronic devices of the type such as: tablet devices, notebook computers, Personal Digital Assistants (PDAs), wearable devices (e.g., smart glasses, smart watches, etc.), etc., which are not limited by one or more embodiments of the present disclosure. The network 10 may include various types of wired or wireless networks.
In one embodiment, the server 11 may cooperate with handsets 12-14; wherein, the mobile phones 12-14 can receive user operation, and upload the received command and file to the server 11 through the network 10, and then the server 11 processes the file based on the scheme of the present specification. In another embodiment, the handsets 12-14 may independently implement the text processing scheme of the present specification; wherein, the mobile phones 12-14 receive user operation, and process the received commands and files based on the scheme of the specification to realize text processing.
The embodiments of the present description will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flowchart of a text processing method applied to a processing device, such as the server 11 or the mobile phones 12 to 14 shown in fig. 1, according to an exemplary embodiment. The method performs the steps of:
step 202, acquiring a relation graph of a target object, and acquiring a text related to the target object;
the target object may include any type of object that can be a target for classification prediction. For example, in one example, the classification prediction may specifically be a risk classification prediction; the target object may be a business for risk classification prediction.
In practical application, when performing classification prediction on a target object, a text related to the target object may be generally acquired, and then text features are extracted from the acquired text and used as classification features to perform classification prediction.
For example, taking risk classification prediction for a target enterprise as an example, the text may include news text related to the target enterprise, and 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 to perform classification prediction.
In this specification, in performing classification prediction on a target object, in addition to a feature extracted from a text related to the target object as a classification feature, another form of feature related to the target object other than the text feature may be employed as the classification feature.
In practical application, when the target object is classified and predicted, only the text features extracted from the text related to the target object are used as the classification features, and features capable of describing the characteristics of the target enterprise may be omitted. Based on this, in the present specification, other forms of features described above in relation to the target object may specifically employ features extracted from information capable of describing the characteristics of the target object itself.
For example, taking the case of performing risk classification prediction for a target enterprise as an example, in this case, the information capable of describing the characteristics of the target object itself may be specifically information capable of describing the risk of the target enterprise itself.
In an embodiment shown, the information capable of describing the characteristics of the target object may specifically include a relationship diagram capable of describing a relationship between the target object and several other objects.
It should be noted that a graph (gragh) is a data structure indicating that there is a certain relationship between objects. The above-described relationship diagram is a specific form of the graph.
For example, taking the target object as a target enterprise as an example, in this case, the relationship Graph may be a Knowledge Graph (Knowledge Graph) that can describe the relationship between the target enterprise and other enterprises.
In the above relationship diagram, a plurality of nodes may be specifically included, and any two nodes may be connected by an edge. The nodes may represent objects, and may specifically include nodes representing the target objects and nodes representing other objects having an association relationship with the target objects in the above-mentioned knowledge graph. The edges between the 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.
For example, when the object is an enterprise, the association relationship may include an investment relationship, a branch company relationship, a common high-management relationship, a common legal relationship, and the like. The nodes in the relationship graph may also include several features corresponding to the objects represented by the nodes. These features are typically associated with classes that need to be predicted. Therefore, these features can also be extracted and fused with features extracted from the text to increase the accuracy of the classification prediction.
For example, when the object is an enterprise and the information to be classified and predicted includes enterprise risk information, the features corresponding to the object may include business event label features of the enterprise, such as administration penalty times, credit loss times, executed times, and the like.
In this specification, after the processing device determines a target object that needs to be classified and predicted, a text related to the target object may be acquired; and acquiring a relation graph of the target object. For example, taking the target object as a target enterprise as an example, a knowledge graph of the target enterprise may be obtained.
The method for obtaining the text related to the target object may be, for example, collected through a network, purchased through a business, or other reasonable methods, which is not specifically limited in this specification.
In an exemplary embodiment of the present application, a web crawler may be used to crawl text related to the target object using the name of the target object as a keyword.
Similarly, for the manner of obtaining the relationship diagram of the target object, the existing relationship diagram of the target object may be directly obtained, or the relationship diagram of the target object may be constructed according to the information related to the target object, which is not specifically limited in this specification.
In an exemplary embodiment of the present application, when obtaining the relationship graph of the target object, the target object may be first used as a meta node of the relationship graph, and then other objects having an association relationship with the target object are obtained as nodes of the relationship graph, and are connected with the meta node through the association relationship. The association relationship between the nodes may be a one-level association relationship or a multi-level association relationship. And then adding the characteristics of a plurality of dimensions corresponding to the object represented by the node as the content of the node into the relational graph.
Step 204, generating a graph vector corresponding to the relationship graph, and generating sentence vectors respectively corresponding to each sentence included in the text;
for classification prediction, the obtained relationship graph and text are generally required to be converted into a vector form.
In this case, on the one hand, a specific embodiment of generating an image vector corresponding to the relationship diagram of the acquired target object may be further generated, which is not particularly limited in this specification;
for example, in practical applications, a vector generation model based on deep learning may be employed to generate a vector corresponding to the above-described relationship diagram. For example, the vector generation model may be a graph neural network model such as a Graphsage model, a GAT model, or a GCN model.
In practical application, because there are more nodes in the relationship graph, the association relationship between the nodes is complex; for example, N-level relationships are included; in order to reduce the amount of computation, the relationship graph can be simplified, and the computation complexity in generating the graph vector is reduced, for example, only nodes in the relationship graph, of which the association relationship with the meta node is within three levels, are reserved.
On the other hand, a sentence vector corresponding to a sentence included in the acquired text related to the target object may be further generated, where a specific manner of the sentence vector corresponding to the sentence included in the acquired text related to the target object is not particularly limited in this specification;
it is to be understood that the sentences in this specification may be divided in different manners as required, for example, the sentences may be divided by conventional sentence marks such as periods, question marks, exclamation marks, and the like, may be divided by other punctuations such as commas, semicolons, and the like, and may be divided by specific characters such as spaces, and this specification is not limited thereto.
For example, in practical applications, a vector generation model based on deep learning may be employed to generate a sentence vector corresponding to the sentence. For example, the vector generation model may be a neural network model such as a one-hot coding model, a word2vec model, or a transform model.
Step 206, calculating a first similarity between the sentence vector and the graph vector for each sentence, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation for the sentence vector corresponding to each sentence to obtain a target vector corresponding to the text;
in the present specification, after a graph vector corresponding to the relational graph and a sentence vector corresponding to each sentence included in the text are generated, the sentence vectors may be further feature-fused with the graph vector as a vector representing a feature of the text. The specific fusion mode is not particularly limited in the present specification.
In an exemplary embodiment shown in this specification, the above sentence vector and map vector may be fused by performing weighted calculation on the sentence vectors by using, as weighted values, the similarity between the map vector of the relationship map corresponding to the target object and the sentence vector of each sentence corresponding to the text.
In this case, the similarity between the sentence vector corresponding to each sentence and the vector distribution of the above-mentioned map vector may be calculated as the first similarity corresponding to each sentence. Different similarity algorithms, such as dot product similarity, cosine similarity, or euclidean similarity, may be used as needed, and this specification does not specifically limit this.
Further, a weighted average calculation may be performed for the sentence vectors corresponding to the respective sentences as a weight of each sentence based on the calculated first similarity.
Each sentence vector can form a sentence vector matrix, and then a weight matrix (attention matrix) is formed based on the first similarity between each sentence vector and the image vector; and performing matrix operation on the sentence vector matrix and the weight matrix to finish the weighted average calculation based on the first similarity for the sentence vector.
The sentence vector is a feature vector formed by features learned from the sentence by the deep learning model, and the graph vector is a feature vector formed by features learned from the relational graph by the deep learning model.
For a sentence vector, if it contains a feature that is more closely related to the feature contained in the graph vector, the sentence vector will generally have a higher similarity to the graph vector. Therefore, if the similarity is taken as the weight, a higher weight is set for the sentence vector containing the associated features, and the classification model is reminded to pay more attention to the features through the weight. Conversely, for sentence vectors that do not contain associated features, the classification model will fade such features.
For example, when the target object is an enterprise and the information to be classified and predicted includes enterprise risk information, the text related to the target object may be news text of the enterprise, and the relationship graph may be a knowledge graph describing relationships between the enterprises; if the knowledge graph contains information which has a high management relation with the target enterprise, is relatively high in association degree with the cloud computing industry and has more 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, sentence S4 describes the overall risk related to bankruptcy, sentences corresponding to sentences S1, S2, S3 and S4 are respectively V1, V2, V3 and V4;
since the sentence S2 is more closely related to the sentence S1, the sentence S3 is more closely related to the sentence S4, and the feature information contained in the knowledge graph, i.e., the cloud computing industry information and the litigation information, the sentence vector V2 is more closely related to the sentence vector V1, and the sentence vector V3 is more closely related to the sentence vector V4, so that a higher weight can be set, and the classification model will pay more attention to the features contained in the sentence vector V2 and the sentence vector V3.
In another exemplary implementation in the present specification, vector fusion may be performed by directly performing vector concatenation on the above-mentioned graph vector and sentence vector.
In the present specification, a target vector is obtained by feature fusion, and can be further used as an input of a classification model to perform classification prediction.
For example, a vector obtained by the weighted average calculation may be used as the target vector corresponding to the text.
It can be understood that the target vector may be used as an input of a classification model, and may be used for training a text classification model after labeling a corresponding classification result; or after the training of the text classification model is finished, the prediction of the text classification can be used as input.
For example, still take enterprise risk classification prediction as an example, and take the above two cases as examples respectively. For example, in the first case, a large amount of news can be prepared, and the news can be marked with corresponding risk information labels through manual marking; and obtaining a target vector aiming at each news in the above-described mode, constructing the target vector corresponding to each news into a sample set, dividing a part of samples in the sample set into a training set and a test set, and training a text classification model.
For another example, in the second case, after the training of the text classification model is completed, a target vector may be obtained from the news text of the target enterprise that needs to be classified and predicted in the manner described above, and the risk that may exist in the target enterprise may be obtained by predicting through the text classification model.
In this specification, as for the target object to be classified, the categories to which the target object may belong may include two or more, and this specification does not specifically limit this.
In one exemplary embodiment shown, the text classification predictions described in this specification may include multi-label classification predictions if the target object may belong to multiple classes.
Referring to fig. 3, fig. 3 is a flowchart of a method for processing text based on knowledge-graph assistance according to an exemplary embodiment, which may still be applied to a processing device, such as the server 11 or the mobile phones 12 to 14 shown in fig. 1. The method performs the steps of:
step 301, acquiring a knowledge graph of a target enterprise, and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
the specific steps are as described above, and are not described herein again.
Step 302: inputting the knowledge graph to a first vector generation model based on deep learning to obtain a graph vector corresponding to the knowledge graph;
the corresponding map vector is obtained through the knowledge map and can be realized through a deep learning model. And inputting the knowledge graph into a first vector generation model, and processing to obtain a corresponding graph vector. The first vector model may adopt different vector models as needed, for example, graph neural network models such as a Graphsage model, a GAT model, or a GCN model, and the application is not particularly limited.
In one exemplary embodiment shown, the first vector generation model based on deep learning comprises a Graphsage model;
because the graph model only uses a small number of partial nodes in all nodes in the whole graph during each training and prediction, and the trained model has good prediction effect on newly added nodes and good performance, the graph model can be adopted to generate the graph vector.
Step 303: generating a full-text vector corresponding to the news text;
since the full text of the news text related to the target enterprise also contains a large amount of information which has a great importance in predicting the risk classification of the enterprise, a full text vector corresponding to the news text can be generated;
a specific manner of generating a full-text vector corresponding to the news text is not particularly limited in this specification;
for example, in practical applications, a vector generation model based on deep learning may be employed to generate a full-text vector corresponding to the text. For example, the vector generation model may be a neural network model such as a one-hot coding model, a word2vec model, or a transform model.
Step 304: respectively inputting each sentence included in the news text into a second vector generation model based on deep learning to obtain sentence vectors respectively corresponding to each sentence;
the corresponding sentence vector obtained by each sentence can be obtained by a deep learning method. And inputting each sentence into the second vector generation model, and processing to obtain a sentence vector corresponding to each sentence. The first vector model may adopt different vector models as needed, for example, a one-hot coding model, a word2vec model, or a transform model, and the like, and the present application is not limited specifically.
In one exemplary embodiment shown, the second vector generation model based on deep learning comprises a Transformer model.
The Transformer model has good parallelism, can better process the dependency relationship and has good comprehensive performance, so the Transformer model can be selected to generate text vectors, including full-text vectors and sentence vectors.
Step 305: acquiring a central sentence in the news text, and acquiring a sentence vector of the central sentence as a central sentence vector;
sentences in the news text containing keywords related to the target business may be used as key sentences. It is apparent that sentences containing keywords related to the target business may generally have a more important role in predictively classifying the target business.
The above-mentioned keywords related to the target enterprise may be keywords highly related to the target enterprise, such as a name, an alias, a code number, and the like of the target enterprise, which is not specifically limited in this specification.
Step 306: respectively calculating first similarity between sentence vectors corresponding to the sentences and the image vectors;
the specific steps are as described above, and are not described herein again.
Step 307: for each sentence, calculating a second similarity between the sentence vector and the central sentence vector;
as described above, the central sentence of the news text may generally have a more important role in risk classification prediction of the target enterprise. In each sentence in the news text, the sentence with the higher degree of association between the corresponding sentence vector and the central sentence vector of the news text can also have a more important role in risk classification prediction of the target enterprise.
Therefore, the central sentence vector and the sentence vector may be further fused, and a specific manner of the fusion may be further performed, which is not specifically limited in this specification.
For example, the above-mentioned fusion of the central sentence vector and the sentence vector may be implemented by using the vector distribution similarity between the sentence vector corresponding to each sentence in the news text and the central sentence vector of the news text as the second similarity to serve as the weight of the sentence vector corresponding to each sentence and perform weighted calculation on the sentence vectors.
For another example, the central sentence vector and the sentence vector may be directly spliced to realize the fusion of the central sentence vector and the sentence vector.
When calculating the vector distribution similarity between the sentence vector corresponding to each sentence and the central sentence of the text, different similarity calculation methods, such as dot product similarity, cosine similarity, or euclidean similarity, may be adopted as required, and this specification does not specifically limit this.
As described above, the higher the degree of association between a sentence and a central sentence, the higher the degree of importance of the sentence is generally. And the degree of association of the sentence with the central sentence may include the degree of association of the content of the sentence with the central sentence, and the degree of association of the position of the sentence with the central sentence. In general, sentences near the center sentence will also have a higher importance.
Therefore, the vector containing the sentence content characteristics and the vector containing the sentence position characteristics can be fused to obtain the sentence vector. The present invention relates to a method for fusing a vector containing sentence content features and a vector containing sentence position features, and the present specification does not limit this method.
In one exemplary embodiment shown, 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 concatenated to obtain a vector as a sentence vector corresponding to the sentence.
The text vector and the position vector corresponding to the sentence can be generated by adopting different neural network models according to needs, and the text vector and the position vector are not specifically limited in the specification. For example, a neural network model such as a one-hot coding model, a word2vec model, or a Transformer model.
In an exemplary embodiment shown in the present specification, the position vector may be assigned by referring to a triangular periodic function in a transform model.
Step 308: taking the product of the first similarity and the second similarity as the weight of each sentence, performing weighted average calculation on sentence vectors corresponding to the sentences, and calculating the weighted sum of the sentences;
because of the first similarity between each sentence in the news text and the graph vector and the second similarity between each sentence in the news text and the central sentence vector, the importance degree of the sentence in the risk classification prediction of the target enterprise can be represented. Therefore, the first similarity and the second similarity corresponding to the sentence can be fused to serve as the weight of the sentence. The specific manner in which the first similarity and the second similarity are fused is not specifically limited in the present specification.
For example, the product of the first similarity and the second similarity corresponding to the sentence may be used as the weight of the sentence, so as to realize 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 may be used as the weight of the sentence, so as to realize the fusion of the first similarity and the second similarity.
In an exemplary embodiment shown in this specification, a product of the first similarity and the second similarity is used as a weight of each sentence, and a weighted average calculation is performed for a sentence vector corresponding to each sentence.
Each sentence vector can form a sentence vector matrix, and then a weight matrix (attribute matrix) is formed based on the product of the first similarity and the second similarity corresponding to each sentence vector; and performing matrix operation on the sentence vector matrix and the weight matrix to complete weighted average calculation of the product of the first similarity and the second similarity of the sentence vector.
Step 309: splicing the vector obtained by weighted average calculation with the image 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 for risk classification prediction of the target enterprise as a classification feature sample.
The vector obtained by the weighted average calculation, the graph vector, the full-text vector and the central sentence vector respectively contain information which is valuable for risk classification prediction of target enterprises;
therefore, the vectors obtained by the weighted average calculation may be feature-fused with one or more of the graph vectors, the full-text vectors, and the central sentence vectors, respectively, to obtain target vectors corresponding to the news texts. In particular, the present specification is not particularly limited to the embodiment of the feature fusion.
In an exemplary embodiment shown in this specification, a vector obtained by the weighted average calculation may be spliced with the graph vector to obtain a target vector corresponding to the news text.
In another exemplary embodiment shown in this specification, the vector obtained by the weighted average calculation may be spliced with the full-text vector to obtain a target vector corresponding to the text of the news.
In another exemplary embodiment shown in this specification, the vector obtained by the weighted average calculation may be spliced with the central sentence vector to obtain a target vector corresponding to the news text.
In another exemplary embodiment shown in this specification, the vector obtained by the weighted average calculation may be spliced with the graph vector, the full-text vector, and the central sentence vector to obtain a target vector corresponding to the news text.
The above embodiments are described in detail below by taking the above target objects as examples of enterprises.
Referring to fig. 4, fig. 4 is a schematic diagram of a method for processing a text based on knowledge-graph assistance according to an embodiment of the present disclosure.
Because the risk classification prediction is carried out on the target enterprise only according to the related news, the risks of the enterprise and the correlation between the risks of the enterprise and the news are easily ignored, and the result of the risk classification prediction may not be accurate enough. Therefore, the target enterprise can be subjected to risk classification prediction by introducing information related to the risk of the enterprise itself, such as knowledge graph information of the enterprise, to assist news texts.
The target enterprise knowledge graph comprises nodes representing the target enterprise and a plurality of enterprises which have one-stage or multi-stage incidence relation with the target enterprise, connecting lines between the nodes represent incidence relation among the enterprises, and the incidence relation can comprise investment relation, branch company relation, common high management relation, common legal relation and the like. Each node on the target enterprise knowledge graph also comprises a plurality of risk characteristics of the enterprise represented by the node, such as the characteristics of administrative penalty times, credit loss times, executed times and other industrial and commercial events.
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 risk of the target enterprise, so that the full text vector of the full text of the news text related to the target enterprise and the sentence vector corresponding to each sentence are utilized by the neural network model. Similarly, a graph vector corresponding to the knowledge graph of the target enterprise is generated by using the graph neural network model.
In an actual scenario, in general business related news, the information contained in the central sentence is often the most important, where the central sentence refers to a sentence directly containing important information of a target business, such as a sentence directly containing information of a target business name, an abbreviation, a legal name, and the like. The sentence vector of the central sentence contains more information than the sentence vectors of the other sentences.
In summary, the full text vector, each sentence vector, and the central sentence vector, or a combination of these vectors, can be used as the text vector for representing the information in the news text.
The graph vector carries risk information of the enterprise and the related enterprises, and the text vector and the graph vector are fused to obtain a target vector fusing characteristics in the text vector and the graph vector so as to classify and predict risks of the target enterprise.
The specific fusion mode can be performed as follows:
since the importance of each sentence in the news text is often related to the association degree between the enterprise maps, the importance degree is generally the highest as the association degree with the enterprise maps is higher. Therefore, the first similarity between the sentence vector and the image vector of each sentence can be calculated and used as the corresponding weight of each sentence vector, and the weighting operation is carried out on each sentence vector to obtain the weighting result; the similarity between the vectors may use dot product similarity or cosine similarity.
Similarly, the importance of each sentence in the news text is often related to the degree of association between the central sentences, and the closer the position of the central sentence is, the more similar the content is, the highest the importance is. Therefore, the second similarity between the sentence vector of each sentence and the central sentence vector can be calculated, and is used as the weight corresponding to each sentence vector to carry out weighting operation on each sentence vector to obtain a weighting result;
considering both of the above, the first similarity and the second similarity may be combined, for example, a product of the first similarity and the second similarity is used as a weight corresponding to each sentence vector, and each sentence vector is subjected to a weighting operation to obtain a weighting result.
The weighted results may be used as target vectors for risk classification forecasting of the enterprise. Because the full-text vector, the central sentence vector and the graph vector respectively carry the risk information related to the target enterprise, the full-text vector, the central sentence vector and the graph vector can be spliced on the basis of the weighting result to be used as the target vector for risk classification and prediction of the enterprise.
In an exemplary embodiment of the present specification, a knowledge-graph-based-aided text processing apparatus is also provided. Referring to fig. 5, fig. 5 is a block diagram of a text processing apparatus based on knowledge-graph assistance according to an embodiment of the present disclosure.
The device is applied to the client and comprises:
a first object obtaining unit 510, configured to obtain a knowledge graph of a target enterprise, and obtain text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
a first vector generation unit 520 for generating a map vector corresponding to the knowledge graph and generating sentence vectors respectively corresponding to respective sentences included in the news text;
a first weighting calculation unit 530, configured to calculate first similarities between the sentence vectors corresponding to the sentences and the graph vectors, respectively, and perform weighted average calculation on the sentence vectors corresponding to the sentences by using the first similarities corresponding to the sentences as weights corresponding to the sentences, so as to obtain target vectors corresponding to the news texts; wherein the target vector is used for risk classification prediction of the target enterprise as a classification feature sample.
Optionally, the first vector generating unit 520 is specifically configured to: inputting the knowledge graph to a first vector generation model based on deep learning to obtain a graph vector corresponding to the knowledge graph; respectively inputting each sentence included in the news text into a second vector generation model based on deep learning to obtain sentence vectors respectively corresponding to each sentence;
optionally, the first vector generating unit 520 is specifically configured to: inputting the knowledge graph into a Graphsage model to obtain a graph vector corresponding to the knowledge graph; inputting each sentence included in the news text into a Transformer model respectively to obtain sentence vectors corresponding to each sentence respectively;
optionally, the first vector generating unit 520 is specifically configured to: generating a text vector corresponding to the text of each sentence and a vector obtained by splicing the position vector corresponding to the position of each sentence in the text;
optionally, the first weight calculating unit 530 is specifically configured to: carrying out weighted average calculation on sentence vectors corresponding to the sentences, and splicing vectors obtained by weighted average calculation with the image vectors to obtain target vectors corresponding to the news texts;
optionally, the first vector generating unit 520 is further configured to: generating a full-text vector corresponding to the news text;
correspondingly, the first weight calculating unit 530 is specifically configured to: carrying out weighted average calculation on sentence vectors corresponding to the sentences, and splicing the vectors obtained by weighted average calculation with the full text vectors to obtain target vectors corresponding to the news texts;
optionally, the first weight calculating unit 530 is specifically configured to: carrying out weighted average calculation on sentence vectors corresponding to the sentences, and splicing vectors obtained by weighted average calculation with the central sentence vectors to obtain target vectors corresponding to the news texts;
optionally, the first weight calculating unit 530 is further configured to: for each sentence, calculating a second similarity between the sentence vector and the central sentence vector; taking a product of the first similarity corresponding to the respective sentence and the second similarity corresponding to the respective sentence as a weight corresponding to the respective sentence;
optionally, the knowledge-graph includes a plurality of nodes; wherein the nodes include nodes representing the target enterprise and nodes representing other enterprises having an association with the target object; the node also includes a number of characteristics corresponding to the enterprise represented by the node;
optionally, the first similarity between the sentence vector corresponding to each sentence and the graph vector includes a dot product similarity between the sentence vector corresponding to each sentence and the graph vector, or a cosine similarity between the sentence vector corresponding to each sentence and the graph vector.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
In an exemplary embodiment of the present specification, a text processing apparatus is also provided. Referring to fig. 6, fig. 6 is a block diagram of a text processing apparatus according to an embodiment of the present disclosure. The device is applied to the client and comprises:
a second object obtaining unit 610, configured to obtain a relationship diagram of a target object, and obtain a text related to the target object; wherein the relationship graph describes relationships between the target object and a number of other objects;
a second vector generation unit 620 for generating a graph vector corresponding to the relationship graph and generating sentence vectors respectively corresponding to respective sentences included in the text;
a second weighting calculation unit 630, configured to calculate first similarities between the sentence vectors corresponding to the sentences and the graph vectors, respectively, and perform weighted average calculation on the sentence vectors corresponding to the sentences by using the first similarities corresponding to the sentences as weights corresponding to the sentences, so as to obtain target vectors corresponding to the text; wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.
The specific details of the implementation process of the functions and actions of each unit in the above device are the implementation processes of the corresponding steps in the above method, and are not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the elements can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
In exemplary embodiments of the present description, embodiments of an apparatus and a terminal applied thereto are also provided.
The embodiment of the text processing device can be applied to computer equipment, such as a server or terminal equipment. The apparatus embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor as a device in a logical sense. From a hardware aspect, as shown in fig. 7, which is a hardware structure diagram of a computer device 70 in which a text processing apparatus is located in the embodiment of the present disclosure, except for the processor 712, the memory 730, the network interface 720, and the nonvolatile memory 740 shown in fig. 6, a server or an electronic device in which the apparatus is located in the embodiment may also include other hardware according to an actual function of the computer device, and details thereof are not described again.
In an exemplary embodiment of the present specification, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the present description may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present description described in the "exemplary methods" section above of the present description, when the program product is run on the terminal device.
A program product for implementing the above method according to an embodiment of the present specification may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present specification is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for this specification may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind 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).
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In another aspect, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system elements and components in the embodiments described above 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.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (13)

1. A method for processing text based on knowledge graph assistance is characterized in that the method comprises the following steps:
acquiring a knowledge graph of a target enterprise, and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
generating a graph vector corresponding to the knowledge graph, and generating sentence vectors corresponding to each sentence included in the news text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the news text; and the target vector is used for performing risk classification prediction on the target object enterprise as a classification feature sample.
2. The method of claim 1,
the generating of the map vector corresponding to the knowledge graph comprises:
inputting the knowledge graph to a first vector generation model based on deep learning to obtain a graph vector corresponding to the knowledge graph;
the generating sentence vectors respectively corresponding to the sentences included in the news text includes:
and respectively 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.
3. The method of claim 2,
the first vector generation model based on deep learning comprises a Graphsage model;
the second vector generation model based on deep learning comprises a Transformer model.
4. The method of claim 2,
the sentence vectors respectively corresponding to the sentences include:
and splicing the text vector corresponding to the text of each sentence with the position vector corresponding to the position of each sentence in the news text to obtain a vector.
5. The method of claim 1,
the performing weighted average calculation on the sentence vectors corresponding to the sentences to obtain the target vectors corresponding to the news texts includes:
and carrying out weighted average calculation on sentence vectors corresponding to the sentences, and splicing the vectors obtained by weighted average calculation with the image vectors to obtain target vectors corresponding to the news texts.
6. The method of claim 1,
the method further comprises the following steps:
generating a full-text vector corresponding to the news text;
the performing weighted average calculation on the sentence vectors corresponding to the sentences to obtain the target vectors corresponding to the news texts includes:
and carrying out weighted average calculation on sentence vectors corresponding to the sentences, and splicing the vectors obtained by weighted average calculation with the full-text vectors to obtain target vectors corresponding to the news texts.
7. The method of claim 1,
the text comprises a central sentence; wherein the central sentence includes a sentence including a keyword related to the target object; the sentence vector of the central sentence is the central sentence vector;
the performing weighted average calculation on the sentence vectors corresponding to the sentences to obtain the target vectors corresponding to the text includes:
and performing weighted average calculation on sentence vectors corresponding to the sentences, and splicing the vectors obtained by the weighted average calculation with the central sentence vector to obtain a target vector corresponding to the news text.
8. The method of claim 7,
the method further comprises the following steps:
for each sentence, calculating a second similarity between the sentence vector corresponding to the sentence and the central sentence vector;
the taking the first similarity corresponding to the respective sentences as weights corresponding to the respective sentences includes:
and taking the product of the first similarity corresponding to each sentence and the second similarity corresponding to each sentence as the weight corresponding to each sentence.
9. A method of text processing, the method comprising:
acquiring a relation graph of a target object, and acquiring a text related to the target object; wherein the relationship graph describes relationships between the target object and a number of other objects;
generating a graph vector corresponding to the relationship graph, and generating sentence vectors respectively corresponding to each sentence included in the text;
respectively calculating first similarity between a sentence vector corresponding to each sentence and the graph vector, taking the first similarity corresponding to each sentence as a weight corresponding to each sentence, and performing weighted average calculation on the sentence vector corresponding to each sentence to obtain a target vector corresponding to the text; wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.
10. A knowledge-graph-based-aided text processing apparatus, the apparatus comprising:
the system comprises a first object acquisition unit, a second object acquisition unit and a third object acquisition unit, wherein the first object acquisition unit is used for acquiring a knowledge graph of a target enterprise and acquiring a news text related to the target enterprise; wherein the knowledge-graph describes relationships between the target enterprise and a number of other enterprises;
a first vector generation unit configured to generate a map vector corresponding to the knowledge graph, and generate sentence vectors corresponding to respective sentences included in the text;
a first weighting calculation unit, configured to calculate first similarities between the sentence vectors corresponding to the respective sentences and the graph vectors, respectively, and perform weighted average calculation on the sentence vectors corresponding to the respective sentences, using the first similarities corresponding to the respective sentences as weights corresponding to the respective sentences, to obtain target vectors corresponding to the news text; wherein the target vector is used for risk classification prediction of the target enterprise as a classification feature sample.
11. A text processing apparatus, characterized in that the apparatus comprises:
the second object acquisition unit is used for acquiring a relation graph of a target object and acquiring a text related to the target object; wherein the relationship graph describes relationships between the target object and a number of other objects;
a second vector generation unit configured to generate a graph vector corresponding to the relationship graph, and generate sentence vectors corresponding to respective sentences included in the text;
a second weighting calculation unit, configured to calculate first similarities between the sentence vectors corresponding to the sentences and the graph vector, respectively, and perform weighted average calculation on the sentence vectors corresponding to the sentences to obtain target vectors corresponding to the text, where the first similarities correspond to the sentences and serve as weights corresponding to the sentences; wherein the target vector is used for performing classification prediction on the target object as a classification feature sample.
12. A storage medium, characterized in that a computer program is stored thereon, which computer program, when executed, carries out the steps of the method according to any one of claims 1-9.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the method according to any of claims 1-9.
CN202210167615.8A 2022-02-23 2022-02-23 Knowledge graph assistance-based text processing method and device Pending CN114579757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210167615.8A CN114579757A (en) 2022-02-23 2022-02-23 Knowledge graph assistance-based text processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210167615.8A CN114579757A (en) 2022-02-23 2022-02-23 Knowledge graph assistance-based text processing method and device

Publications (1)

Publication Number Publication Date
CN114579757A true CN114579757A (en) 2022-06-03

Family

ID=81770798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210167615.8A Pending CN114579757A (en) 2022-02-23 2022-02-23 Knowledge graph assistance-based text processing method and device

Country Status (1)

Country Link
CN (1) CN114579757A (en)

Similar Documents

Publication Publication Date Title
CN112633419B (en) Small sample learning method and device, electronic equipment and storage medium
CN111177393B (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN112508691B (en) Risk prediction method and device based on relational network labeling and graph neural network
CN112015859A (en) Text knowledge hierarchy extraction method and device, computer equipment and readable medium
WO2021094920A1 (en) Fusing multimodal data using recurrent neural networks
CN113064964A (en) Text classification method, model training method, device, equipment and storage medium
US11276099B2 (en) Multi-perceptual similarity detection and resolution
CN112395487B (en) Information recommendation method and device, computer readable storage medium and electronic equipment
CN111859967B (en) Entity identification method and device and electronic equipment
CN113254716B (en) Video clip retrieval method and device, electronic equipment and readable storage medium
CN113505601A (en) Positive and negative sample pair construction method and device, computer equipment and storage medium
CN113298634A (en) User risk prediction method and device based on time sequence characteristics and graph neural network
CN112784157A (en) Training method of behavior prediction model, behavior prediction method, device and equipment
CN111444335B (en) Method and device for extracting central word
US20210117853A1 (en) Methods and systems for automated feature generation utilizing formula semantification
CN111241273A (en) Text data classification method and device, electronic equipment and computer readable medium
CN117670366A (en) Risk prediction method, apparatus, device, medium, and program product
CN117389544A (en) Artificial intelligence data modeling method, device, medium and equipment
US11532174B2 (en) Product baseline information extraction
CN116756281A (en) Knowledge question-answering method, device, equipment and medium
CN116340635A (en) Article recommendation method, model training method, device and equipment
CN112328899B (en) Information processing method, information processing apparatus, storage medium, and electronic device
CN114579757A (en) Knowledge graph assistance-based text processing method and device
CN114444441A (en) Name similarity calculation method and device, storage medium and calculation equipment
CN118485502B (en) Method, device, equipment and storage medium for generating personalized custom commodity label

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination