Text processing method and apparatus
By decomposing the target text into subtexts and determining and updating the reasoning path from the knowledge graph, the problems of inaccurate content generation and opaque decision-making in large language models are solved, resulting in more accurate and transparent text processing results.
Patent Information
- Application Number
- PCT/CN2025/107213
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-05
- Filing Date
- 2025-07-04
- Publication Date
- 2026-02-12
AI Technical Summary
The inaccuracy of content generated by large language models and the lack of transparency in the decision-making process, especially in rapidly evolving fields, can lead to inaccurate advice and misleading content, reducing user trust.
By decomposing the target text into subtexts, using a text processing model to determine the initial reasoning path from the knowledge graph, and by updating and integrating the paths, the accuracy and transparency of the text processing results are improved.
It improves the accuracy of text processing results and user trust, reduces the probability of hallucinatory content, and enhances the adjustability of text processing models and the transparency of decision-making processes.
Smart Images

Figure CN2025107213_12022026_PF_FP_ABST
Abstract
Description
Text processing method and device TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of computer, in particular to two text processing methods. One or more embodiments of the present disclosure also relate to two text processing devices. BACKGROUND
[0002] At present, due to the high reasoning ability and flexible applicability of large language model (LLM), the LLM has a wide range of applications in digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design and the like.
[0003] However, the LLM has the problem of generating inaccurate content, such as generating outdated knowledge and generating hallucination content. Moreover, due to the opacity of the decision-making process of the LLM, the decision-making process of the LLM-generated content cannot be understood, verified, corrected, etc., further increasing the inaccuracy of the LLM-generated content.
[0004] Therefore, there is an urgent need for a technical solution to improve the accuracy of the LLM-generated content to solve the above technical problems. SUMMARY
[0005] Therefore, the embodiments of the present disclosure provide two text processing methods. One or more embodiments of the present disclosure also relate to two text processing devices, an auxiliary decision-making method, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects in the prior art that the accuracy of the text processing result is low due to the defects of the LLM itself.
[0006] According to a first aspect of the embodiments of the present disclosure, a text processing method is provided, comprising:
[0007] determining a target entity contained in a target text and at least two subtexts corresponding to the target text, and determining an initial reasoning path according to the target entity;
[0008] determining an exploration reasoning path associated with the target entity from a knowledge graph according to the target text, the at least two subtexts and using a text processing model, and updating the initial reasoning path according to the exploration reasoning path, wherein the exploration reasoning path comprises the target entity, an associated entity of the target entity and an associated relationship between the target entity and the associated entity;
[0009] obtaining an initial text processing result according to the target text, the at least two subtexts and the initial reasoning path using a text processing model;
[0010] In a case where it is determined that the initial text processing result does not satisfy the preset iteration end condition, the target entity is updated according to the target text, the initial text processing result, the associated entity, and the initial reasoning path, and the step of determining the exploration reasoning path associated with the target entity from the knowledge graph according to the target text, the at least two subtexts, and utilizing the text processing model is continuously performed until, in a case where it is determined that the initial text processing result satisfies the preset iteration end condition, the text processing result of the target text is determined according to the initial text processing result.
[0011] According to a second aspect of the embodiments of the present disclosure, another text processing method is provided, including:
[0012] According to the target text, an initial reasoning path associated with a target entity is determined by utilizing a text processing model, wherein the target entity is an entity contained in the target text.
[0013] According to the target text and the initial reasoning path, an initial text processing result is obtained by utilizing the text processing model.
[0014] According to the initial text processing result, the initial reasoning path is updated by utilizing the text processing model to obtain a target reasoning path.
[0015] According to the target text and the target reasoning path, a target text processing result is obtained by utilizing the text processing model.
[0016] According to a third aspect of the embodiments of the present disclosure, a decision-making assistance method applied to a city digital twin system is provided, including:
[0017] According to a problem to be decided and at least two sub-decision problems corresponding to the problem to be decided, an initial reasoning path associated with a target entity is determined by utilizing a text processing model, wherein the target entity is an entity contained in the problem to be decided.
[0018] According to the problem to be decided, the at least two sub-decision problems, and the initial reasoning path, an initial decision reference result is obtained by utilizing the text processing model.
[0019] According to the initial decision reference result, the initial reasoning path is updated by utilizing the text processing model to obtain a target reasoning path.
[0020] According to the problem to be decided, the at least two sub-decision problems, and the target reasoning path, a target decision reference result is obtained by utilizing the text processing model, so that the target decision is displayed through the city digital twin system.
[0021] According to a fourth aspect of embodiments of the present disclosure, a text processing apparatus is provided, comprising:
[0022] An initial reasoning path determination module configured to determine, by using a text processing model, an initial reasoning path associated with a target entity according to a target text and at least two subtexts corresponding to the target text, wherein the target entity is an entity contained in the target text;
[0023] An initial text processing result obtaining module configured to obtain an initial text processing result by using the text processing model according to the target text, the at least two subtexts and the initial reasoning path;
[0024] A target reasoning path obtaining module configured to update the initial reasoning path by using the text processing model according to the initial text processing result, and obtain a target reasoning path;
[0025] A target text processing result obtaining module configured to obtain a target text processing result by using the text processing model according to the target text, the at least two subtexts and the target reasoning path.
[0026] According to a fifth aspect of embodiments of the present disclosure, another text processing apparatus is provided, comprising:
[0027] An initial reasoning path determination module configured to determine, by using a text processing model, an initial reasoning path associated with a target entity according to a target text, wherein the target entity is an entity contained in the target text;
[0028] An initial text processing result obtaining module configured to obtain an initial text processing result by using the text processing model according to the target text and the initial reasoning path;
[0029] A target reasoning path obtaining module configured to update the initial reasoning path by using the text processing model according to the initial text processing result, and obtain a target reasoning path;
[0030] A target text processing result obtaining module configured to obtain a target text processing result by using the text processing model according to the target text and the target reasoning path.
[0031] According to a sixth aspect of embodiments of the present disclosure, a computing device is provided, comprising:
[0032] A memory and a processor;
[0033] The memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the text processing method or the decision-making assisting method are implemented.
[0034] According to a seventh aspect of an embodiment of the present disclosure, a computer readable storage medium is provided, which stores computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the text processing method or the decision-making assisting method are implemented.
[0035] According to an eighth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the text processing method or the decision-making assisting method are implemented.
[0036] According to an embodiment of the present disclosure, a text processing method is provided. The target text is divided into at least two subtexts, so that the text processing model can focus on processing more useful text segments of the target text. Then, according to the target text and the at least two subtexts, an initial reasoning path is determined from a knowledge graph by using the text processing model with the target entity contained in the target text as the starting point. The determination of the exploration reasoning path can not only adapt to the target text, but also adapt to the at least two subtexts, thereby improving the accuracy of the exploration reasoning path and the accuracy of the initial reasoning path. The more accurate initial reasoning path makes the decision-making process of the text processing model more explicit, and the adjustability of the decision-making of the text processing model is realized. Further, after updating the initial reasoning path, knowledge integration is performed by using the text processing model according to the target text, the at least two subtexts, and the initial reasoning path, to obtain an initial text processing result. The initial text processing result can be used to update the initial reasoning path to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of the target text processing result of the target text finally obtained. BRIEF DESCRIPTION OF DRAWINGS
[0037] FIG. 1 is a specific application scenario diagram of a text processing method according to an embodiment of the present disclosure;
[0038] FIG. 2 is a flowchart of a text processing method according to an embodiment of the present disclosure;
[0039] FIG. 3 is a process flowchart of a text processing method according to an embodiment of the present disclosure;
[0040] FIG. 4 is a structural block diagram of a text processing device according to an embodiment of the present disclosure;
[0041] FIG. 5 is a structural block diagram of a computing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, the present disclosure can be practiced without the specific details, and it is understood that the present disclosure is not limited to the embodiments described herein. In other instances, well-known methods, procedures, components, and networks have not been described in detail as not to unnecessarily obscure aspects of the present disclosure.
[0043] The terminology used in this disclosure, including the in the description of one or more embodiments of the present disclosure, is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0044] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, a first item could be termed a second item, and, similarly, a second item could be termed a first item without departing from the scope of one or more embodiments of the present disclosure. As used herein, the term "if' can be construed to mean "when" or "in response to determining" or "in response to a determination" depending on the context.
[0045] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0046] In one or more embodiments of the present disclosure, a large model refers to a deep learning model with a large number of model parameters, usually containing hundreds of millions, billions, tens of billions, hundreds of billions, or even tens of billions of model parameters. The large model can also be called a foundation model. Through large-scale unlabeled corpus pre-training, a pre-trained model with hundreds of millions of parameters is produced. This model can adapt to a wide range of downstream tasks and has good generalization ability. For example, large language models (LLM) and multi-modal pre-training models.
[0047] In practical applications, a large model only needs a small amount of sample data to fine-tune the pre-trained model and can be applied to different tasks. Large models can be widely used in natural language processing (NLP) and computer vision fields. Specifically, they can be applied to computer vision tasks such as visual question answering (VQA), image captioning (IC), and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization generation, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.
[0048] First, the technical terms related to one or more embodiments of the present disclosure are explained.
[0049] Large language model (LLM): also known as large-scale language model or large language model, is a type of natural language processing (NLP) model based on deep learning technology. The large language model is characterized by training on extremely large text datasets to learn and master the complex structure and patterns of natural language. The main functions of the large language model include understanding, generating, and converting text, and it can perform various natural language processing tasks / text processing tasks such as answering questions, writing articles, translation, summary generation, and dialogue systems. However, the large language model has problems such as the obsolescence of knowledge, the generation of hallucination content, and the inconsistency between answers and facts.
[0050] Obsolescence of knowledge: refers to the fact that over time, existing knowledge may become outdated or inaccurate due to new discoveries, technological advancements, social changes, or theoretical developments; obsolescence of knowledge is often more apparent in fields such as science, technology, medicine, business, etc., where knowledge systems are frequently updated to reflect newer research findings and industry standards.
[0051] Hallucinated content: hallucinated content generated by large language models refers to inaccurate, unrealistic, etc. text generated by large language models, which may mislead users or pose potential risks and challenges, hallucinated content may include, for example, generated content that does not match user-provided input, generated content that contradicts previously generated information, generated content that does not match known axiomatic knowledge, etc.
[0052] Knowledge graph (KG): a data structure used to represent and store knowledge, which displays entities (such as people, places, events, concepts, etc.) and relationships between entities in a graphical manner, this graphical data model can express complex relationships and semantic information.
[0053] Knowledge graph stores entities and relationships between entities in the form of structured reasoning paths, reasoning paths usually describe real-world facts, consisting of head entities (entities at the starting point of reasoning paths), tail entities (entities at the end point of reasoning paths), and relationships between head entities and tail entities (relationships from head entities to tail entities), in some scenarios, relationships are also referred to as attributes, and tail entities are also referred to as attribute values.
[0054] From the perspective of graph structure, a knowledge graph consists of nodes and directed edges, entities are nodes in a knowledge graph, and relationships are directed edges connecting two nodes.
[0055] Multiple reasoning paths in a knowledge graph can form a reasoning path, for example, a reasoning path can be "entity-relation-entity", "entity-relation-entity-relation-entity", etc.
[0056] In the field of text processing applications, large language models have received widespread attention due to their good reasoning ability and flexible and varied applicability.
[0057] However, large language models have many challenges, such as obsolescence of knowledge, generation of hallucinated content, and opacity of decision-making process, for example, in some rapidly evolving fields (such as business analysis, medical diagnosis, urban twins, etc.), outdated information may lead to inaccurate or even dangerous recommendations, hallucinated content may reduce the effectiveness of large language models and reduce users' trust in large language models, and the opacity of decision-making leads to difficulty in understanding and verifying the decision-making process of large language models, increasing the risk of misinterpretation and incorrect citation of large language models.
[0058] Based on this, one embodiment of the present disclosure provides a technical solution of equipping a large language model with a knowledge graph, to provide a structured knowledge base for the large language model, to provide an explicit and editable knowledge source for the large language model, specifically, one embodiment of the present disclosure utilizes a large language model, accurately finds a path strictly related to an answer in a knowledge graph, and thereby obtains accurate generated content output by the large language model by referring to the latest knowledge graph in a visualized manner.
[0059] However, the technical solution of equipping a large language model with a knowledge graph has some limitations, such as limiting the breadth of the reasoning path, lacking adaptive exploration of the reasoning path, and due to the need for accurate matching, ignoring the semantic diversity of the text, in the case of complex target text to be processed, the technical solution is complex to explore and is prone to produce error paths, thereby limiting the text processing efficiency and effect.
[0060] To solve the above technical problems, in the present disclosure, two text processing methods are provided, one or more embodiments of the present disclosure simultaneously relate to two text processing devices, an auxiliary decision-making method, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0061] Referring to FIG. 1, FIG. 1 shows a specific application scenario diagram of a text processing method provided by one embodiment of the present disclosure.
[0062] In the application scenario as shown in FIG. 1, a large model is deployed in a server 104, which includes but is not limited to a physical server, a cloud server, etc.; the server 104 can be connected to one or more clients 102 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks, the client 102 here can include but is not limited to: a smartphone, a tablet computer, a notebook computer, a palm computer, a personal computer, a smart home device, a vehicle-mounted device, etc.; the client 102 can interact with the user through a user interaction interface, obtain the user's demand, and realize the text processing method provided by the present embodiment through the calling of the large model by the server 104.
[0063] Specifically, the text processing method includes:
[0064] determining an initial reasoning path associated with a target entity according to a target text and at least two subtexts corresponding to the target text, wherein the target entity is an entity contained in the target text;
[0065] obtaining an initial text processing result according to the target text, the at least two subtexts, and the initial reasoning path by using the text processing model.
[0066] According to the initial text processing result, the initial reasoning path is updated by using the text processing model, to obtain a target reasoning path;
[0067] According to the target text, the at least two subtexts, and the target reasoning path, a target text processing result is obtained by using the text processing model.
[0068] In the embodiments of the present disclosure, the system composed of the client 102 and the server 104 can perform the following steps: the client 102 generates a target text in response to the triggering operation of the user on the user interaction interface of the client, and sends the target text to the server 104; the server 104 implements the above-mentioned text processing method to obtain a target text processing result, and sends the target text processing result to the client 102; and the client 102 displays the target text processing result to the user through the user interaction interface.
[0069] It should be noted that, in the case that the running resources of the client can meet the deployment and running conditions of the large model, the embodiments of the present application can be performed in the client, and in addition, the large model can also be deployed in a third-party server, which includes but is not limited to a third-party physical server, a third-party cloud server, etc.
[0070] One embodiment of the present disclosure provides a text processing method. The client obtains a target text through a user interaction interface, and sends the target text to a server. The server decomposes the target text into at least two subtexts, so that the text processing model can focus on processing more useful text segments of the target text. Then, according to the target text and the at least two subtexts, the text processing model determines an initial reasoning path from a target entity contained in the target text in the knowledge graph, so that the determination of the exploration reasoning path can not only adapt to the target text, but also adapt to the at least two subtexts, thereby improving the accuracy of the exploration reasoning path, and improving the accuracy of the initial reasoning path. Then, the more accurate initial reasoning path is used to make the text processing model decision-making process more clear, and the adjustability of the text processing model decision-making is realized. Further, after updating the initial reasoning path, the text processing model is used to integrate knowledge according to the target text, the at least two subtexts, and the initial reasoning path, to obtain an initial text processing result. Then, the initial reasoning path can be updated by using the initial text processing result to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of the target text processing result of the target text finally obtained, and the target text processing result is sent to the client, so that the client can show the user a more accurate target text processing result, and the degree of trust of the user in the text processing process is improved.
[0071] Referring to FIG. 2, FIG. 2 shows a flowchart of a text processing method according to one embodiment of the present disclosure, which specifically includes the following steps.
[0072] Step 202: determining an initial reasoning path associated with a target entity according to a target text, at least two subtexts corresponding to the target text, and a text processing model.
[0073] The target entity is an entity contained in the target text.
[0074] Specifically, the target text can be understood as a text to be processed, and the target text can be understood as a target text stored in a server or received from a client. The target text includes but is not limited to questions, dialogues, codes, etc.
[0075] The target entity can be understood as an entity name with actual meaning in the target text, including but not limited to a person's name, a place name, a project name, a numerical value, a percentage, an event, a work name, a time, etc.
[0076] The subtext can be understood as a text obtained by decomposing the target text according to the semantics of the target text. The text of the subtext is simpler than that of the target text, for example, the text structure of the subtext is simpler, the syntax complexity is lower, the information density is lower, and the knowledge depth is shallower. The target text is understood as "Xiao A met Xiao B in X area", and the subtext can be understood as "Xiao A met Xiao B", "Xiao A has been to X area", "Xiao B has been to X area", etc.
[0077] The initial reasoning path can be understood as a reasoning path for the text processing model to make reference for reasoning. The reasoning path is composed of one or more entities and the relationship between the entities. For example, the reasoning path can be composed of one or more reasoning paths. One reasoning path can be understood as a reasoning path of "entity-relation-entity", that is, the reasoning path is composed of entities as nodes and the relationship between entities as directed edges.
[0078] In practical applications, one or more target entities can be determined from the target text, and the target text can be decomposed to obtain at least two subtexts corresponding to the target text. The initial reasoning path composed of the target entity as a node is determined according to the target entity. The specific implementation manner is as follows:
[0079] The initial reasoning path associated with the target entity is determined according to the target text, at least two subtexts corresponding to the target text, and the text processing model, including:
[0080] The target entity contained in the target text and at least two subtexts corresponding to the target text are determined, and the initial reasoning path is determined according to the target entity.
[0081] determining, from the target text, the at least two subtexts, and according to the target text and the at least two subtexts, an exploration reasoning path associated with the target entity from a knowledge graph by using a text processing model;
[0082] updating the initial reasoning path according to the exploration reasoning path, wherein the exploration reasoning path comprises the target entity, an associated entity of the target entity, and an association relationship between the target entity and the associated entity.
[0083] The exploration reasoning path can be understood as one or more triples composed of the target entity, the associated entity of the target entity, and the association relationship between the target entity and the associated entity, i.e., a reasoning path of "target entity-association relationship between target entity and associated entity-associated entity of target entity".
[0084] In actual application, in order to facilitate subsequent text processing, an initial subgraph can also be constructed according to the target entity, the initial subgraph being a subgraph of the knowledge graph, and an initial text processing result corresponding to the subtext can also be constructed.
[0085] Further, in order to ensure the accuracy of the target entity and the subtext, the target entity can be recognized by using a preset entity recognition method, and the target text can be decomposed by using the text processing model, and the specific implementation manner is as follows:
[0086] The target text contains the target entity, and the target text corresponds to at least two subtexts, comprising:
[0087] determining the target text, and recognizing the target entity contained in the target text by using a preset entity recognition method;
[0088] According to the target text and the text decomposition prompt text, the text processing model is used to obtain at least two subtexts corresponding to the target text.
[0089] The preset entity recognition method can be understood as a preset method for recognizing the target entity in the text, for example, the preset entity recognition method includes but is not limited to named entity recognition (Named Entity Recognition, NER), large language model recognition method, etc.
[0090] In the case where the preset entity recognition method is understood as named entity recognition, a pre-labeled training data set can be used to train a pre-trained neural network model (including but not limited to hidden Markov model, conditional random field, recurrent neural network, long short-term memory network, etc.), to obtain an entity recognition model capable of recognizing entities, and the target text is input into the entity recognition model to recognize the entity contained in the target text, and the recognized entity is taken as the target entity.
[0091] In the case where the preset entity recognition method is understood as a large language model recognition method, an entity recognition prompt text can be constructed, such as "please recognize the entity of the following text", "please perform entity recognition on the following text", and the like, and the entity recognition prompt text and the target text are input into the large language model to obtain the target entity output by the large language model.
[0092] Further, the text processing model can be understood as a neural network model for processing text, such as a large language model (LLM), a multi-modal pre-training model (Multi-modal Pre-Training Model), and the like; and the text decomposition prompt text can be understood as a prompt for guiding the text processing model to decompose the target text.
[0093] Specifically, the text processing model can be deployed locally on the server or on a third-party server, and the present disclosure does not limit this.
[0094] Based on this, according to the target text and the text decomposition prompt text, at least two subtexts corresponding to the target text are obtained by using the text processing model, which can be understood as inputting the target text and the text decomposition prompt text into the text processing model, and in the text processing model, the target text is decomposed according to the text decomposition prompt text to obtain at least two subtexts corresponding to the target text after decomposition; for example, the target text A is decomposed to obtain subtexts a1, a2, and a3.
[0095] One or more embodiments of the present disclosure provide a text processing method, which improves the accuracy of the target entity by identifying the target entity in the target text using a preset entity recognition method, and improves the subsequent text processing accuracy by decomposing the target text using a text processing model, so that the progressive relationship of the subtexts obtained by decomposition is stronger and the logicality is higher.
[0096] In practical applications, the target text can be a text uploaded, input, or selected by a user through a client, and after the server completes processing of the target text, the processed target text processing result can be displayed to the user through the client to improve the user's experience, and the specific implementation mode is as follows:
[0097] Before determining the target entity contained in the target text and the at least two subtexts corresponding to the target text, the method further includes:
[0098] receiving the target text sent by the client, wherein the target text is generated by a user's trigger operation on a user interaction interface of the client;
[0099] After obtaining the target text processing result, the method further includes:
[0100] send the target text processing result to the client, so that the client displays the target text processing result to the user through the user interaction interface.
[0101] The user interaction interface can be understood as an interface for the user to interact with the client, and the user interaction interface includes interactive buttons, text input boxes, etc.
[0102] Specifically, the user can input, upload, select, etc. the target text through the client, the client sends the target text to the server, the server determines the target text processing result corresponding to the target text, and returns the client, and the client can display the target text processing result to the user through the user interaction interface.
[0103] The text processing method provided by one or more embodiments of the present disclosure processes the target text specified by the user, and displays the processed target text processing result to the user through the client after the server completes the processing of the target text. Through more accurate target text processing results, the user's trust in text processing is improved, and the user's use experience is improved.
[0104] The knowledge graph can be understood as a knowledge graph (Knowledge Graph, KG) containing knowledge of the field to which the target text belongs, and the exploration reasoning path can be understood as one or more triples composed of a target entity, an associated entity of the target entity, and an association relationship between the target entity and the associated entity, i.e. the reasoning path of "target entity-association relationship between target entity and associated entity-associated entity of target entity", for example, the target entity is entity 1, and the exploration reasoning path can be, for example, "entity 1-relation 1", "entity 1-relation 2-entity 2", "entity 2-relation 2-entity 1", "entity 1-relation 2-entity 2-relation 3", "entity 1-relation 2-entity 2-relation 3-entity 3", etc.
[0105] The associated entity can be understood as an entity having an association relationship with the target entity. In the knowledge graph, the node represented by the target entity and the node represented by the associated entity are connected by a directed edge from the target entity to the associated entity, and the directed edge is the association relationship between the target entity and the associated entity.
[0106] In specific implementation, the target text and at least two subtexts can be input into the text processing model. In the text processing model, the exploration reasoning path is obtained by exploration and screening from the knowledge graph according to the matching relationship between the target text, the at least two subtexts and the target entity.
[0107] Based on this, the exploration reasoning path can be updated to the initial reasoning path. For example, the initial reasoning path determined according to the target entity includes “target entity”, the exploration reasoning path can be understood as “target entity-association relationship-target associated entity”, and the initial reasoning path updated according to the exploration reasoning path can be understood as “target entity-association relationship-target associated entity”.
[0108] In practical applications, according to the target text and the at least two subtexts, an exploration reasoning path associated with the target entity is determined from a knowledge graph by using a text processing model. The exploration reasoning path can be implemented by relationship exploration and entity exploration, and the specific implementation manner is as follows:
[0109] According to the target text and the at least two subtexts, an initial reasoning path associated with the target entity is determined from a knowledge graph by using a text processing model, including:
[0110] A candidate entity relationship connected with the target entity is determined from the knowledge graph.
[0111] According to the target text, the at least two subtexts, the candidate entity relationship, and a relationship screening prompt text, a screened entity relationship is obtained by using the text processing model.
[0112] According to the screened entity relationship, an associated entity connected with the target entity is determined from the knowledge graph, and a first screening reasoning path is constructed according to the target entity, the screened entity relationship, and the associated entity.
[0113] According to the target text, the first screening reasoning path, and an entity screening prompt text, a target associated entity is obtained from the associated entity in the first screening reasoning path by using the text processing model.
[0114] A second screening reasoning path related to the target associated entity is determined from the first screening reasoning path, and the first screening reasoning path and the second screening reasoning path are determined as the initial reasoning path.
[0115] The relationship screening prompt text can be understood as a prompt text (prompt) used to guide the text processing model to screen a more relevant candidate entity relationship from the candidate entity relationship according to the target text and the at least two subtexts.
[0116] The entity screening prompt text can be understood as a prompt text (prompt) used to guide the text processing model to screen a more relevant associated entity from the associated entity according to the target text.
[0117] In a specific implementation, the relationship exploration includes determining, from the knowledge graph, a relationship connected with the target entity as a candidate entity relationship; and then inputting the target text, the at least two subtexts, the candidate entity relationship, and a relationship screening prompt text into the text processing model, where, according to the relationship screening prompt text, a candidate entity relationship related to the target text and the at least two subtexts is determined from the candidate entity relationship as a screened entity relationship in the text processing model.
[0118] After obtaining the screened entity relationship, an entity existing the screened entity relationship with the target entity is determined from the knowledge graph as an associated entity of the target entity according to the screened entity relationship, and a first screened reasoning path is constructed with the target entity as a starting node, the screened entity relationship as a directed edge, and the associated entity as a terminal node, that is, the first screened reasoning path can be understood as "target entity-screened entity relationship-associated entity".
[0119] Based on this, the target text, the first screened reasoning path, and an entity screening prompt text are input into the text processing model, where, according to the entity screening prompt text, an associated entity related to the target text is determined from the associated entity in the first screened reasoning path as a target associated entity in the text processing model, and then the first screened reasoning path containing the target associated entity is determined as a second screened reasoning path, and the first screened reasoning path and the second screened reasoning path are determined as an exploration reasoning path.
[0120] One or more embodiments of the present disclosure provide a text processing method, which can more accurately process a target text and reduce the probability of hallucination of a text processing model by using the text processing model to sequentially explore a relationship and an entity from a knowledge graph to obtain a second screened reasoning path.
[0121] In actual application, the text processing model can screen a screened entity relationship by matching the target text and the at least two subtexts with the candidate entity relationship, and the specific implementation manner is as follows:
[0122] The obtaining, by the text processing model, of the screened entity relationship according to the target text, the at least two subtexts, the candidate entity relationship, and a relationship screening prompt text includes:
[0123] inputting the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text into the text processing model;
[0124] screening, by the text processing model, the screened entity relationship from the candidate entity relationship according to a matching result of the target text and the at least two subtexts with the candidate entity relationship according to the relationship screening prompt text.
[0125] The matching result of the target text and the candidate entity relationship includes, but is not limited to, a semantic matching result, a character matching result, a text similarity matching result, and the like; and the matching result of the at least two subtexts and the candidate entity relationship includes, but is not limited to, a semantic matching result, a character matching result, a text similarity matching result, and the like of each subtext and the candidate entity relationship, a total evaluation of the matching result of each subtext and the candidate entity relationship, and the like.
[0126] The matching result of the target text and the candidate entity relationship includes, but is not limited to, a semantic matching result, a character matching result, a text similarity matching result, and the like; and the matching result of the at least two subtexts and the candidate entity relationship includes, but is not limited to, a semantic matching result, a character matching result, a text similarity matching result, and the like of each subtext and the candidate entity relationship, a total evaluation of the matching result of each subtext and the candidate entity relationship, and the like.
[0127] In a specific implementation, after the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text are input into the text processing model, according to the relationship screening prompt text, the target text and the candidate entity relationship can be matched in the text processing model, and the at least two subtexts and the candidate entity relationship can be matched to obtain the matching result of the target text and the candidate entity relationship and the matching result of the at least two subtexts and the candidate entity relationship.
[0128] Based on this, the candidate entity relationship can be screened, and the screened candidate entity relationship is obtained as the screened entity relationship.
[0129] The text processing method provided by one or more embodiments of the present disclosure utilizes a text processing model to realize screening of a candidate entity relationship through matching of the candidate entity relationship with a subtext and a target text, so that the obtained screened entity relationship is closer to the target text and the subtext, thereby improving the accuracy of subsequent text processing with reference to the screened entity relationship.
[0130] In actual application, relationship exploration can be realized through twice semantic matching screening of the target text and the at least two subtexts and the candidate entity relationship to improve screening accuracy, and specific implementation manners are as follows:
[0131] According to the relationship screening prompt text, in the text processing model, the matching result of the target text and the at least two subtexts and the candidate entity relationship is used to screen the screened entity relationship from the candidate entity relationship, and the screened entity relationship includes:
[0132] According to the relationship screening prompt text, in the text processing model, the semantic matching result of the at least two subtexts and the candidate entity relationship is used to screen a first entity relationship from the candidate entity relationship;
[0133] According to the semantic matching result of the target text and the first entity relationship, the first entity relationship is filtered from the first entity relationship to obtain the filtered entity relationship; or
[0134] According to the semantic matching result of the target text and the first entity relationship, the first entity relationship is filtered from the first entity relationship to obtain the filtered entity relationship; or
[0135] According to the semantic matching result of the target text and the first entity relationship, the first entity relationship is filtered from the first entity relationship to obtain the filtered entity relationship; or
[0136] According to the semantic matching result of the target text and the first entity relationship, the first entity relationship is filtered from the first entity relationship to obtain the filtered entity relationship; or
[0137] Specifically, one implementation of relationship exploration is to input the target text, the at least two subtexts, the candidate entity relationship, and the relationship filtering prompt text into a text processing model. In the text processing model, semantic matching can be first performed on the at least two subtexts and the candidate entity relationship, and according to the semantic matching result of the at least two subtexts and the candidate entity relationship, the candidate entity relationship that is semantically matched with the at least two subtexts is filtered from the candidate entity relationship as the first entity relationship.
[0138] Then, semantic matching is performed on the target text and the first entity relationship, and according to the semantic matching result of the target text and the first entity relationship, the first entity relationship that is semantically matched with the target text is filtered from the first entity relationship as the filtered entity relationship.
[0139] Another implementation of relationship exploration is to input the target text, the at least two subtexts, the candidate entity relationship, and the relationship filtering prompt text into a text processing model. In the text processing model, semantic matching can be first performed on the target text and the candidate entity relationship, and according to the semantic matching result of the target text and the candidate entity relationship, the candidate entity relationship that is semantically matched with the target text is filtered from the candidate entity relationship as the second entity relationship.
[0140] Then, semantic matching is performed on the target text and the first entity relationship, and according to the semantic matching result of the target text and the first entity relationship, the first entity relationship that is semantically matched with the target text is filtered from the first entity relationship as the filtered entity relationship.
[0141] The text processing method provided by one or more embodiments of the present disclosure can make the screening of the entity relationship more accurate by sequentially performing semantic matching of the entity relationship with the subtext and the target text by the text processing model, thereby further improving the accuracy of subsequent text processing with reference to the screened entity relationship.
[0142] In actual application, the entity exploration can also be achieved by screening the semantic matching of the target text and the candidate entity relationship, thereby improving the accuracy of entity screening through semantic matching, and the specific implementation manner is as follows:
[0143] The target associated entity is obtained from the associated entity in the first screening reasoning path according to the target text, the first screening reasoning path, and the entity screening prompt text by using the text processing model, and the specific implementation manner is as follows:
[0144] The target text, the first screening reasoning path, and the entity screening prompt text are input into the text processing model.
[0145] The target associated entity is obtained from the associated entity by using the semantic matching result of the target text and the first screening reasoning path in the text processing model according to the entity screening prompt text.
[0146] The semantic matching result of the target text and the first screening reasoning path can be obtained by performing semantic matching of the target text and the associated entity in the first screening reasoning path.
[0147] Specifically, the text processing model can refer to the target entity, the associated entity, and the association relationship between the target entity and the associated entity in the first screening reasoning path, perform semantic matching of the associated entity and the target text, and thereby screen the associated entity according to the semantic matching result of the target text and the associated entity in the first screening reasoning path to obtain the screened associated entity as the target associated entity. The specific implementation manner can be referred to the above description, and will not be described here.
[0148] The text processing method provided by one or more embodiments of the present disclosure can make the text processing process more accurate by performing semantic matching of the associated entity and the target text by the text processing model, so that the target associated entity is more close to the target text.
[0149] In actual application, in order to ensure the memory integrity of the text processing model, the exploration reasoning path determined in each iteration can be updated to the initial reasoning path, and the initial reasoning path is provided to the text processing model in subsequent text processing to improve the text processing accuracy, and the specific implementation manner is as follows:
[0150] updating the initial reasoning path according to the exploration reasoning path comprises:
[0151] determining tail entities of each of the initial reasoning paths, and updating the initial reasoning path according to a matching relationship between the target entity and the tail entity, the screening entity relationship and the target entity included in the second screening reasoning path in the exploration reasoning path.
[0152] The tail entity can be understood as the last entity in the reasoning path. For example, for a reasoning path “entity 1-relation 1-entity 2”, the tail entity can be understood as entity 2 of the reasoning path.
[0153] Specifically, the head entity of the second screening reasoning path is the tail entity of the initial reasoning path, so the second screening reasoning path can be updated to the initial reasoning path, and correspondingly, the second screening reasoning path is updated to the tail entity corresponding to the target entity in the initial reasoning path.
[0154] For example, the second screening reasoning path is “entity 3-relation 4-entity 5” and “entity 4-relation 3-entity 6”, and the initial reasoning path is “entity 1-relation 1-entity 3” and “entity 1-relation 1-entity 4”. According to the matching relationship between the target entity “entity 3” in the second screening reasoning path “entity 3-relation 4-entity 5” and the tail entity “entity 3” in the initial reasoning path “entity 1-relation 1-entity 3”, the second screening reasoning path “entity 3-relation 4-entity 5” can be updated to the initial reasoning path “entity 1-relation 1-entity 3”, and the updated initial reasoning path “entity 1-relation 1-entity 3-relation 4-entity 5” is obtained. Similarly, the second screening reasoning path “entity 4-relation 3-entity 6” is updated to the initial reasoning path “entity 1-relation 1-entity 4”, and the updated initial reasoning path “entity 1-relation 1-entity 4-relation 3-entity 6” is obtained.
[0155] After obtaining the updated initial reasoning path, the initial reasoning path can be used as known information for subsequent processing of the target text.
[0156] The text processing method provided by one or more embodiments of the present disclosure integrates the entities and relationships obtained from the knowledge graph into the initial reasoning path, so that subsequent reasoning can be performed according to the initial reasoning path, improves the completeness of the reference information of the knowledge graph, and further improves the accuracy of the target text processing result obtained subsequently.
[0157] One embodiment of the present disclosure provides a text processing method. The text processing method includes: decomposing a target text into at least two subtexts, so that a text processing model can focus on processing more useful text segments of the target text; and determining an exploration reasoning path from a knowledge graph based on the target text and the at least two subtexts and using the text processing model, with a target entity contained in the target text as a starting point, so that the determination of the exploration reasoning path can adapt to the target text and the at least two subtexts, and the accuracy of the exploration reasoning path is improved, thereby improving the accuracy of an initial reasoning path, and the more accurate initial reasoning path makes the decision process of the text processing model more clear and the adjustability of the decision of the text processing model is achieved.
[0158] Specifically, the text processing model can be deployed locally on a server or on a third-party server. In the case of deploying the text processing model locally on the server, an initial text processing result is obtained by using the text processing model based on the target text, the at least two subtexts, and the initial reasoning path. It can be understood that the target text, the at least two subtexts, and the initial reasoning path are input into the text processing model, and in the text processing model, the at least two subtexts are reasoned based on the target text and the initial reasoning path to obtain initial text processing results corresponding to the at least two subtexts.
[0159] In the case of deploying the text processing model on the third-party server, the text processing model can be called through an interface calling mode, and the specific implementation mode is as follows:
[0160] The method further includes: determining an initial reasoning path associated with the target entity based on the target text and the at least two subtexts corresponding to the target text and using the text processing model.
[0161] The method further includes: calling the text processing model based on a text processing model interface, and inputting the target text and the at least two subtexts corresponding to the target text into the text processing model, so that in the text processing model, the initial reasoning path associated with the target entity is determined based on the target text and the at least two subtexts corresponding to the target text and using the text processing model.
[0162] The text processing model interface includes, but is not limited to, an application program interface and a hardware interface.
[0163] Specifically, the server can call the text processing model through the text processing model interface to implement the above steps of obtaining the initial reasoning path using the text processing model. The specific implementation mode can be referred to the above description.
[0164] The text processing method provided by one or more embodiments of the present disclosure reduces resource occupation of a server locally by deploying a text processing model in a third-party server, thereby improving the computing efficiency of the server, and the text processing model deployed in the third-party server can be trained by more parameters, thereby improving the accuracy of processing of the text processing model.
[0165] Step 204: obtaining an initial text processing result by using the text processing model according to the target text, the at least two subtexts and the initial reasoning path.
[0166] The initial text processing result can be understood as information analyzed by the text processing model on the subtexts. For example, a subtext includes "find the song of Xiao A", and the initial reasoning path contains "Xiao A-song-song 1", and the text processing model can obtain the initial text processing result "song 1 is the song of Xiao A" and "Xiao A has song 1" according to the initial reasoning path.
[0167] Step 206: updating the initial reasoning path by using the text processing model according to the initial text processing result, to obtain a target reasoning path.
[0168] Specifically, the text processing model may continue to explore in the case that not enough knowledge is explored from the knowledge graph.
[0169] In actual application, the exploration can be continued from the explored entities or from the unexplored entities, and the specific implementation manner is as follows:
[0170] The updating the initial reasoning path by using the text processing model according to the initial text processing result, to obtain a target reasoning path, includes:
[0171] determining whether the initial text processing result meets a preset iteration end condition;
[0172] If not, updating the target entity according to the target text, the initial text processing result and the initial reasoning path, and continuing to execute the step of determining the initial reasoning path of the target entity associated with the text processing model according to the target text and the at least two subtexts corresponding to the target text;
[0173] If yes, the initial reasoning path is determined as the initial reasoning path.
[0174] The preset iteration end condition includes but is not limited to that the information in the initial text processing result is sufficient to implement the processing of the target text (i.e., the initial text processing result does not meet the processing condition of processing the target text), or the iteration number reaches a preset iteration number threshold (for example, 9 times, 10 times, etc.).
[0175] After obtaining the initial text processing result, it can be firstly judged whether the initial text processing result meets the preset iteration end condition, that is, whether the above exploration has obtained sufficient information to complete the processing of the target text, or whether the preset iteration number is exceeded, and the like, so as to avoid abnormal iteration of the text processing process.
[0176] If the initial text processing result does not meet the preset iteration end condition, the target entity can be updated according to the current exploration content, that is, the target text, the initial text processing result and the initial reasoning path, so as to continue the exploration.
[0177] If the initial text processing result meets the preset iteration end condition, the initial reasoning path can be determined as the target reasoning path, so as to facilitate subsequent text processing.
[0178] The text processing method provided by one or more embodiments of the present disclosure can give the text processing model the ability to reflect when reasoning on the knowledge graph, that is, to determine the target entity of the next iteration, and record the historical search and reasoning content, that is, the initial reasoning path, the subgraph and the sub-target state, with the memory mechanism, so that the text processing model can identify and correct the wrong reasoning path, thereby more flexibly adapting to the complexity and dynamic changes of the problem, greatly improving the reasoning effect of the knowledge graph enhanced text processing model, and improving the accuracy of the target text processing result.
[0179] In one or more embodiments of the present disclosure, the target entity updating rule can be preset, and the target entity can be updated, and the specific implementation manner is as follows:
[0180] After obtaining the initial text processing result by using the text processing model according to the target text, the at least two subtexts and the initial reasoning path, the method further includes:
[0181] In a case where it is determined that the initial text processing result does not meet the preset iteration end condition, an updated entity is determined according to the associated entity and the initial reasoning path, the target entity is updated according to the updated entity, and the step of determining the exploration reasoning path associated with the target entity from the knowledge graph by using the text processing model according to the target text and the at least two subtexts is continuously executed until, in a case where it is determined that the initial text processing result meets the preset iteration end condition, a target text processing result of the target text is determined according to the initial text processing result; or
[0182] In a case where it is determined that the initial text processing result does not satisfy the preset iteration end condition, the target entity is updated according to a tail entity of the initial reasoning path, and the step of determining the exploration reasoning path associated with the target entity from the knowledge graph according to the target text and the at least two subtexts by using the text processing model is continuously performed until, in a case where it is determined that the initial text processing result satisfies the preset iteration end condition, the target text processing result of the target text is determined according to the initial text processing result.
[0183] Specifically, in a case where it is determined that the initial text processing result does not satisfy the preset iteration end condition, the next iteration process can be entered. A specific implementation manner of determining the target entity of the next iteration process is backtracking exploration.
[0184] Specifically, first, the entity pruned in the current iteration process is determined, that is, the target associated entity of the current iteration is determined according to the initial reasoning path, and then the updated entity can be determined according to the associated entity and the target associated entity. The updated entity is an associated entity that belongs to the associated entity but does not belong to the target associated entity. After that, the updated entity is determined as the target entity, so as to perform the next iteration process.
[0185] For example, the associated entities are “entity 3”, “entity 4” and “entity 5”, and the target associated entities are “entity 3” and “entity 4”. It can be determined that the updated entity is “entity 5”.
[0186] Another specific implementation manner of determining the target entity of the next iteration process is continuous exploration, that is, the target associated entity is determined as the target entity, so as to perform the next iteration process.
[0187] Specifically, after the target entity of the next iteration process is determined, the step of determining the exploration reasoning path associated with the target entity from the knowledge graph according to the target text and the at least two subtexts by using the text processing model is continuously performed until it is determined that the initial text processing result satisfies the preset iteration end condition.
[0188] In a case where it is determined that the initial text processing result satisfies the preset iteration end condition, it can be considered that the text processing model has sufficient knowledge to process the target text, and therefore the target text processing result of the target text can be determined according to the initial text processing result.
[0189] The text processing method provided by one or more embodiments of the present disclosure integrates information by using a text processing model, that is, according to the obtained initial reasoning path, target text, subtext and other memory information, the subtext is integrated and analyzed to obtain an initial text processing result, so as to facilitate subsequent analysis of whether the knowledge is sufficient, that is, to give the text processing model the ability to organize information and subsequent reflection in the reasoning process, thereby improving the accuracy of the text processing model.
[0190] In actual application, the target entity can be updated by using the text processing model according to the target text, the initial text processing result, the associated entity and the initial reasoning path, and the specific implementation manner is as follows:
[0191] The updating of the target entity according to the target text, the initial text processing result and the initial reasoning path comprises:
[0192] According to the target text, the text processing information, the initial reasoning path, the associated entity and the reflection prompt text, a target entity update decision result is obtained by using the text processing model.
[0193] In a case where it is determined that the target entity update decision result is to adjust the path, a candidate update entity is determined from the associated entity, wherein the candidate update entity is an entity contained in the associated entity but not contained in the initial reasoning path.
[0194] According to the target text, the text processing information, the candidate update entity, the initial reasoning path and the adjustment prompt text, an update entity is obtained by using the text processing model, and the target entity is updated according to the update entity.
[0195] Specifically, the specific implementation manner of the embodiments of the present disclosure can be referred to the above description embodiments, and the difference is that the updating of the target entity is realized by using the text processing model in the embodiments of the present disclosure, and the specific implementation manner realized by using the text processing model can also be referred to the above description embodiments, which will not be described here.
[0196] In actual application, in a case where the text processing model decides that no backtracking iteration is needed, exploration can be continued, and the specific implementation manner is as follows:
[0197] After the reflection result is obtained, the method further comprises:
[0198] In a case where it is determined that the target entity update decision result is not to adjust the path, the target entity is updated according to the tail entity of the initial reasoning path.
[0199] Specifically, the specific implementation manner of the embodiments of the present disclosure can be referred to the above description embodiments, which will not be described here.
[0200] The text processing method provided by one or more embodiments of the present disclosure continues the subsequent exploration without increasing the candidate entities in the decision of the text processing model, ensures stable exploration of the text processing, and thus improves the probability of obtaining a more accurate target text processing result by the text processing.
[0201] The text processing method provided by one embodiment of the present disclosure updates the initial reasoning path, integrates knowledge by using the text processing model according to the target text, the at least two subtexts, and the initial reasoning path, obtains an initial text processing result, and then determines whether the initial text processing result meets a preset iteration end condition, for example, whether the initial text processing result is sufficient for the text processing model to reason to obtain a target text processing result, that is, whether the currently known knowledge can achieve processing of the target text, and in a case where it is determined that the initial text processing result does not meet the preset iteration end condition, updates the target entity according to the target text, the initial text processing result, the associated entity, and the initial reasoning path, so as to continue to execute the step of determining the exploration reasoning path associated with the target entity from the target entity as a starting point, so as to obtain a more accurate initial reasoning path, improve the accuracy of the initial text processing result, and thus improve the accuracy of the target text processing result of the target text finally obtained.
[0202] Step 208: obtaining a target text processing result by using the text processing model according to the target text, the at least two subtexts, and the target reasoning path.
[0203] Specifically, the target text, the at least two subtexts, and the target reasoning path can be processed by using the text processing model, for example, the text processing model processing step in the above embodiments, to achieve processing of the target text, and the specific implementation of the text processing model is not repeated here.
[0204] One embodiment of the present disclosure provides a text processing method. The text processing method can decompose a target text into at least two subtexts, so that a text processing model can focus on processing more useful text segments of the target text. Then, the text processing model is used to determine an initial reasoning path from a knowledge graph based on the target text and the at least two subtexts, with a target entity contained in the target text as a starting point. The determination of the initial reasoning path can adapt to the target text and the at least two subtexts, improving the accuracy of the initial reasoning path. The more accurate initial reasoning path can make the decision process of the text processing model more explicit, and the adjustability of the decision of the text processing model is achieved. Further, after updating the initial reasoning path, the text processing model is used to integrate knowledge based on the target text, the at least two subtexts, and the initial reasoning path, to obtain an initial text processing result. The initial text processing result can be used to update the initial reasoning path to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of a target text processing result of the target text finally obtained.
[0205] The above is a schematic scheme of the text processing method of the present embodiment. It should be noted that the technical scheme of the text processing method belongs to the same concept as the technical scheme of the text processing method described above. The details of the technical scheme of the text processing method that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0206] The text processing method provided by the present disclosure is further described below in the application of the text processing method in a question and answer application scenario with reference to FIG. 3.
[0207] It should be noted that the text processing method described in the present embodiment can be implemented in an iterative form. For the sake of understanding, the text processing method provided by the present embodiment is exemplarily described by taking three iterations to complete text processing as an example. Other embodiments can be referred to the present embodiment, and details are not described herein.
[0208] In addition, the text processing model in the present embodiment is an LLM, and is deployed locally on a server. As shown in FIG. 3, FIG. 3 shows a process flowchart of a text processing method according to one embodiment of the present disclosure, which specifically includes the following steps.
[0209] Step 302: Decompose the task.
[0210] The task decomposition can be understood as decomposing a target problem to obtain a sub-target.
[0211] Specifically, the target question can be understood as the above target text. The server can determine the target question input by the user through the user interaction interface of the client, or obtain and determine the target question from the local server. For example, the target question can be understood as "which song of Xia A won the M award", "Xia A has a song that won the M award, which one is it", and the like.
[0212] To guide the LLM to perform more accurate problem decomposition on the target question, the server can obtain a pre-constructed problem decomposition prompt text (i.e., the above text decomposition prompt text) to guide the LLM to decompose the target question, reduce the complexity of the LLM processing object, and avoid the LLM directly processing the target question. The problem decomposition prompt text contains example texts related to the problem decomposition task.
[0213] Then, the server inputs the problem decomposition prompt text and the target question into the LLM. In the LLM, the target question is decomposed according to the problem decomposition prompt text, and the sub-target corresponding to the target question is obtained.
[0214] It should be noted that the sub-target obtained by decomposing the target question can be one or multiple. The present embodiment takes the case of obtaining multiple sub-targets by decomposing the target question as an example for illustrative purposes. For the specific implementation of obtaining one sub-target by decomposing the target question, please refer to the present embodiment.
[0215] Following the above example, the problem decomposition prompt text can be understood as:
[0216] Please decompose the process of answering the question into as few sub-targets as possible based on semantic analysis.
[0217] Here is an example:
[0218] Which cell in J district won the Good Home Honor?
[0219] Output: ["Search for cells in J district", "Search for honors won by each cell", "Find the cell that won the Good Home Honor"].
[0220] Now, you need to directly output the sub-targets of the following question in list format without any additional information or annotations.
[0221] Question:
[0222] In the case where the target question is "which song of Xia A won the M award", the server decomposes the target question in the LLM according to the problem decomposition prompt text, and the obtained sub-targets can be understood as "find Xia A's songs", "find the awards won by these songs", and "determine the song that won the M award".
[0223] In one or more embodiments of the present disclosure, the server inputs the question decomposition prompt text and the target question into the LLM, and decomposes the target question according to the question decomposition prompt text to obtain a sub-target corresponding to the target question. If the sub-target corresponding to the target question is the same as the target question, the LLM can be used to directly answer the target question to obtain a target answer corresponding to the target question (i.e., the above text processing result).
[0224] Step 304: First explore the path.
[0225] The exploration path can be understood as exploring the reasoning path related to the target question from the knowledge graph.
[0226] Specifically, after the server obtains the sub-target, the LLM can be used to explore an initial reasoning path related to the target question and the sub-target from the knowledge graph as reference information for subsequent reasoning of the LLM on the target question.
[0227] To ensure the accuracy of the exploration, at the beginning of the exploration, an initial entity (i.e., the above target entity) can be first determined from the target question, and the initial entity is matched and verified with the entities in the knowledge graph to ensure that the initial entity has a corresponding relationship with the knowledge graph, i.e., to ensure that the knowledge graph contains the initial entity.
[0228] In specific implementation, the initial entity can be determined by a named entity recognition method, or can be obtained by a prompt engineering of the LLM, and the present disclosure does not limit this.
[0229] Then, according to the initial entity, an initial memory can be determined, including an initial subgraph, an initial reasoning path, and an initial sub-target state. The initial subgraph contains an initial entity node, the initial reasoning path contains a reasoning path with the initial entity as a head entity, and the initial sub-target state can be understood as a state in which knowledge corresponding to each sub-target has not been obtained.
[0230] Further, after the initial entity is determined, relationship exploration and entity exploration can be performed in the knowledge graph based on the initial entity.
[0231] The relationship exploration can be understood as exploring the relationship related to the target question.
[0232] Specifically, the server first determines a tail entity of the initial reasoning path, and determines a relationship connected with the tail entity from the knowledge graph as a candidate relationship. In the first exploration path process, the tail entity can be understood as the above initial entity.
[0233] Afterwards, the server inputs the target question, the sub-target, the preset relationship screening prompt text, and the candidate relationship into the LLM, and in the LLM, the target relationship is obtained by screening from the candidate relationship according to the target question, the sub-target, and the preset relationship screening prompt text.
[0234] In the case of the initial entity being "Xiao A", as shown in FIG. 3, the relationships "place of birth", "song", "album", "year of birth", etc. connected with "Xiao A" can be determined from the knowledge graph, so that the relationships connected with "Xiao A" are determined as the candidate relationships.
[0235] Based on this, the initial sub-graph is updated according to the candidate relationships, and an updated sub-graph is obtained.
[0236] Afterwards, the pre-constructed relationship exploration prompt text, the target question, the candidate relationship, and the multiple sub-targets are input into the LLM, and the target relationship is obtained by screening from the candidate relationship.
[0237] In one or more embodiments of the present disclosure, an implementation of inputting the pre-constructed relationship exploration prompt text, the target question, the candidate relationship, and the multiple sub-targets into the LLM to screen the target relationship from the candidate relationship can be inputting the pre-constructed relationship exploration prompt text, the target question, the candidate relationship, and the multiple sub-targets into the LLM.
[0238] In the LLM, the candidate relationship is matched with each sub-target according to the relationship exploration prompt text, one or more sub-targets that are more relevant to part or all of the candidate relationships in each candidate relationship are determined, one or more sub-targets that are more relevant to each candidate relationship are taken as first reference sub-targets, each candidate relationship is matched with the first reference sub-target, multiple candidate first relationships that are matched with the first reference sub-target are obtained, and then the multiple candidate first relationships are semantically matched with the target question, and multiple first relationships are obtained by screening from the multiple candidate first relationships.
[0239] Another implementation of inputting the pre-constructed relationship exploration prompt text, the target question, the candidate relationship, and the multiple sub-targets into the LLM to screen the target relationship from the candidate relationship is also provided in one or more embodiments of the present disclosure, specifically, the pre-constructed relationship exploration prompt text, the target question, the candidate relationship, and the multiple sub-targets are input into the LLM.
[0240] In the LLM, according to the relationship exploration prompt text, the candidate relationship is matched with the target question to determine a plurality of candidate first relationships more relevant to the target question, and the plurality of candidate first relationships are matched with each sub-target respectively to determine one or more sub-targets more relevant to the candidate first relationship. One or more sub-targets more relevant to the candidate first relationship are taken as a first reference sub-target, and each candidate first relationship is matched with the reference sub-target to obtain a plurality of first relationships matched with the reference sub-target.
[0241] Following the above example, for example, the relationship exploration prompt text can be understood as "Please provide as few relationships as possible from the following relationships (separated by semicolons) that are highly relevant to the question and its sub-targets.
[0242] The following is an example:
[0243] Question: What is the set of reasoning paths for the small area in J area?
[0244] Sub-targets: "Search for small areas in J area", "Search for honors obtained by each small area", "Find small areas that have obtained the Good Home Honor".
[0245] Subject entity: J area.
[0246] Relationships: small area; population; plant; area; school; animal; honor.
[0247] Output: [Small area].
[0248] Now you need to directly output as few relationships as possible from the following relationships (separated by semicolons) that are highly relevant to the question and its sub-targets and the question in list format without other information or annotations.
[0249] Question:
[0250] Sub-targets:
[0251] Relationships:
[0252] Following the above example, the target question [Which song of Xia A won the M Award], the sub-targets ["Find Xia A's songs", "Find the awards won by these songs", "Determine the songs that won the M Award"], the relationships ["place of birth", "song", "album", "year of birth"], and the above relationship exploration prompt text are input into the text processing model to obtain the relationship output by the text processing model, for example, "song".
[0253] Further, after determining the first relationship, the initial reasoning path can be updated according to the first relationship, i.e. the first relationship is added to the initial reference path to obtain an updated initial reasoning path.
[0254] After obtaining the first relationship, the entity connected by the first relationship is determined as a candidate entity from the knowledge graph, and the subgraph is updated according to the candidate entity.
[0255] After that, the pre-constructed entity exploration prompt text, target question, and candidate entity are input into the LLM to obtain the first entity output by the LLM.
[0256] Specifically, in the LLM, first, according to the entity exploration prompt text, the candidate entity is semantically matched with the target question, and the candidate entity that satisfies the semantic matching with the target question is determined as the first entity from the candidate entity, and the initial reasoning path is updated according to the first entity.
[0257] Following the above example, the entity exploration prompt text can be understood as "which entities in the following list (in the [] of the reasoning path) can be used to answer this question? Please provide as few entities as possible and strictly follow the restrictions mentioned in the question.
[0258] The following is an example:
[0259] Question: Which small area in J district reasoning path set?
[0260] Reasoning path: J district-small area-[cell 1, cell 2, cell 3]
[0261] Output: [cell 1, cell 2].
[0262] Now you need to directly output the entities in the following list (in the [] of the reasoning path) that can be used to answer this question in list format, without any additional information or annotations.
[0263] Question:
[0264] Reasoning path:
[0265] Following the above example, as shown in FIG. 3, according to the first relationship "song", the candidate entities "song 1", "song 2", "song 3", "song 4", "song 5", etc. can be determined, and then according to the entity exploration prompt text, the target question is semantically matched with the candidate entity in the LLM to obtain the first entity "song 1", "song 2", "song 3", and thus it can be determined that the initial reasoning path includes "small A-song-song 1", "small A-song-song 2", "small A-song-song 3".
[0266] Step 306: First update memory.
[0267] The memory includes but is not limited to subgraph, initial reasoning path set, and sub-target state.
[0268] Specifically, after the above relationship exploration and entity exploration, the updated subgraph and the updated initial reasoning path can be obtained, and the initial reasoning path set is updated according to the initial reasoning path. In the subsequent iteration, the initial reasoning path set can be updated according to the subsequent updated initial reasoning path.
[0269] Then, the pre-constructed sub-target state update prompt text, target question, sub-target, sub-target state, and initial reasoning path set are input into the LLM to obtain the LLM output sub-target state.
[0270] Following the above example, the initial reasoning path set contains "Xiao A-song-song 1", "Xiao A-song-song 2", and "Xiao A-song-song 3". The sub-target state update prompt text can be understood as:
[0271] "According to the provided information (which may have missing parts and need further retrieval) and your knowledge, output the currently known information to achieve the sub-target.
[0272] Here is an example:
[0273] Question: Which cell reasoning path set does the cell in J area have?
[0274] Sub-target: "Search for small cells in J area", "Search for honors obtained by each cell", and "Find the cell that won the Good Home Honor".
[0275] Sub-target state: ["1": "No relevant information.",
[0276] "2": "No relevant information.",
[0277] "3": "No relevant information."]
[0278] Reasoning path: J area-cell-cell 1; J area-cell-cell 2.
[0279] Output:
[0280] ["1": "J area has cell 1 and cell 2.",
[0281] "2": "No relevant information.",
[0282] "3": "No relevant information."]
[0283] Now, you need to directly output the results of the sub-target of the following question in JSON format without any additional information or annotations.
[0284] Question:
[0285] Sub-target:
[0286] Reasoning path: ""
[0287] The sub-target state update prompt text, the above target question, the above plurality of sub-targets, the above plurality of sub-target states, and the initial reasoning path set are input to the LLM, and the LLM output sub-target state is obtained as:
[0288] “1. Song 1, Song 2, and Song 3 are songs of Xia A.
[0289] 2. There is no relevant information.
[0290] 3. There is no relevant information.”
[0291] Step 308: First evaluation.
[0292] After completing the memory update, the server can use the LLM to determine whether the current obtained information is sufficient to obtain the answer.
[0293] Specifically, the evaluation prompt text, the target question, the initial reasoning path set, and the sub-target state are input to the LLM.
[0294] In the case where the evaluation result of the LLM is that the knowledge is sufficient, or the iteration number is greater than the preset iteration number threshold (for example, 9 times, 10 times, etc.), the target answer corresponding to the target question output by the LLM is obtained.
[0295] In the case where the evaluation result of the LLM is that the knowledge is insufficient, and the iteration number is less than or equal to the preset iteration number threshold, the pre-constructed reflection prompt text, the target question, the first entity, the initial reasoning path set, and the sub-target state are input to the LLM, and the reflection result output by the LLM is obtained. In the case where the reflection judgment contained in the reflection result is “no need to correct”, the first entity is taken as the initial entity, and the step of exploring the path is continued.
[0296] In the case where the reflection result contains a reflection judgment that needs to be corrected, it can be considered that the current exploration result represents that the LLM continues to explore the path along the current first entity, and the knowledge retrieved is insufficient to answer the above target question.
[0297] Based on this, the candidate update entity (the candidate update entity is an entity contained in the sub-graph but not contained in the first entity) can be determined according to the above sub-graph, and the correction reason (i.e., the reason for correction) contained in the reflection result can be determined.
[0298] Then, the pre-constructed correction prompt text, the target question, the correction reason, the candidate update entity
here it is correct, it is the candidate update entity, do not change it to the first entity
[0299] Following the above example, the evaluation prompt text can be understood as:
[0300] "Please answer the question based on the subgoal state, the relevant initial reasoning path set, and your knowledge.
[0301] Example:
[0302] "Question: Which cell in J district won the beautiful home honor?
[0303] Subgoal state: ["1": "J district has cell 1 and cell 2",
[0304] "2": "No relevant information.",
[0305] "3": "No relevant information."]
[0306] Initial reasoning path set: J district-cell-cell 1; J district-cell-cell 2.
[0307] Output: Evaluation result: [knowledge deficiency]; reason: [no honor obtained by cell 1, 2].
[0308] Now you need to directly answer the question based on the subgoal state, the relevant initial reasoning path set, and your knowledge, without other information or annotations."
[0309] Here are the question, initial reasoning path set, and subgoal state:
[0310] As shown in FIG. 3, the evaluation prompt text, the target question, the initial reasoning path set, and the subgoal state are input into the LLM, and the evaluation result of the LLM is knowledge deficiency. According to the first entity "song 1", "song 2", "song 3" and the candidate entity "song 1", "song 2", "song 3", "song 4", "song 5", the candidate update entity is determined, which is the entity contained in the candidate entity but not contained in the first entity, i.e. "song 4", "song 5".
[0311] Further, the reflection prompt text can be understood as:
[0312] "Based on the question, the currently determined first entity, and the memory (initial reasoning path set, subgoal state), determine whether it is necessary to add additional entities from the candidate update entity to answer the question?
[0313] Example:
[0314] "Question: Which cell in J district won the beautiful home honor?
[0315] First entity: cell 1, cell 2
[0316] Subgoal state: [“1”: “J district has cell 1 and cell 2”
[0317] “2”: “No relevant information.”
[0318] “3”: “No relevant information.”]
[0319] Initial reasoning path set: J district-cell-cell 1; J district-cell-cell 2.
[0320] Output: Reflection result: No correction needed; reason: No area of cell 1, 2.”
[0321] The following are the problem, candidate update entity, initial reasoning path set, subgoal state:
[0322] After that, the pre-constructed reflection prompt text, target question, first entity, initial reasoning path set, and subgoal state are input into the LLM to obtain the reflection result of the LLM output, and in the case of no correction needed, the current first entity “song 1”, “song 2”, “song 3” is taken as the initial entity, and the step of exploring the path is continued.
[0323] As shown in FIG. 3, the pre-constructed reflection prompt text, target question, first entity, initial reasoning path set, and subgoal state are input into the LLM, and in the LLM, the reflection result “There is no award information for song 1, song 2, and song 3, so I need to continue” is determined, i.e., no correction is needed, and the exploration continues. Based on this, the first entity is determined as the initial entity, and the step of exploring the path is continued, i.e., step 310.
[0324] Step 310: Second exploration path.
[0325] Specifically, the specific implementation of the second exploration path can be referred to the above step 304, which will not be described again.
[0326] Following the above example, as shown in FIG. 3, the first entity “song 1”, “song 2”, “song 3” is taken as the initial entity.
[0327] Based on the initial entity “song 1”, “song 2”, “song 3”, the relationships connected with the initial entity can be determined from the knowledge graph, as shown in FIG. 3, the relationships “composer”, “release date”, “award”, and “album” connected with the initial entity “song 1” are taken as candidate relationships, and the above subgraph is updated according to the candidate relationships.
[0328] Further, after inputting the pre-constructed relationship exploration prompt text, target question, candidate relationship, and multiple subgoals into the LLM, the first relationship “award” and “album” filtered by the LLM is obtained, and the reasoning path set is updated according to the first relationship.
[0329] After obtaining the first relationship, the entity having the first relationship with the initial entity is determined from the knowledge graph as a candidate entity according to the first relationship and the initial entity, that is, "N Award", "P Award", "Album 2", the entity exploration prompt text, the target question, and the candidate entity are input into the LLM to obtain the first entity "N Award" and "P Award" output by the LLM, so as to update the initial reasoning path set according to the first entity "N Award" and "P Award", and update the subgraph according to the candidate entity "N Award", "P Award", and "Album 2".
[0330] Then, the memory is continuously updated and evaluated, that is, steps 312-314 are executed.
[0331] Step 312: second update of the memory.
[0332] Specifically, the specific implementation of the second update of the memory can be referred to the above step 306, and details are not repeated here.
[0333] In the above example, the updated subgraph and the updated initial reasoning path set are obtained, for example, as shown in FIG. 3, the updated initial reasoning path set is "Small A-Song-Song 1", "Small A-Song-Song 2", "Small A-Song-Song 3", "Small A-Song-Song 2-Award-N Award", and "Small A-Song-Song 2-Award-P Award", and the sub-target state is updated, and the updated sub-target state is:
[0334] "1. Song 1, Song 2, and Song 3 are songs of Small A.
[0335] 2. Song 2 won N Award and P Award.
[0336] 3. No related information"
[0337] Based on this, the updated memory includes the updated subgraph, the updated initial reasoning path set, and the updated sub-target state.
[0338] Step 314: second evaluation.
[0339] Specifically, the specific implementation of the second evaluation can be referred to the above step 308, and details are not repeated here.
[0340] For example, the correction prompt text is, for example,
[0341] Please select the least necessary entity required to answer the question from the candidate updated entity based on the memory (including the initial reasoning path set and the sub-target state), the correction reason, and your knowledge.
[0342] Example:
[0343] Question: Which cell in J district won the Good Home Honor?
[0344] Correction reason: Cell 1 and Cell 2 did not win the Good Home Honor, and it is not certain whether other cells won.
[0345] Subgoal state: ["1": "J district has Cell 1, Cell 2, Cell 3, Cell 4"]
[0346] "2": "No relevant information."
[0347] "3": "No relevant information."]
[0348] Candidate update entities: J district, Cell 1, Cell 2, Cell 3, Cell 4.
[0349] Output: Cell 3
[0350] The following are the question, candidate update entities, correction reason, and subgoal state:
[0351] Following the above example, as shown in FIG. 3, after obtaining the reflection result that needs to be corrected, the pre-constructed correction prompt text, target question, candidate update entities, correction reason, and subgoal state are input into the LLM. From "Song 4", "Song 5", and "Song 6", "Song 4" and "Song 5" are determined as the initial entities. Based on this, the update entities "Song 4" and "Song 5" are taken as initial entities, and the step of exploring the path is continued, i.e., step 316.
[0352] Step 316: Third exploration path.
[0353] Step 318: Third update memory.
[0354] Step 320: Third evaluation.
[0355] Similarly, the specific implementation of steps 316-320 can refer to the specific implementation of steps 304-314 described above.
[0356] Following the above example, and as shown in FIG. 3, this round of exploration determines Song 4 and Song 5 as initial entities. The following is an example of taking Song 4 and Song 5 as initial entities.
[0357] Based on the initial entities "Song 4" and "Song 5", the relationship "award" connected to the initial entities can be determined from the knowledge graph as a candidate relationship. After inputting the pre-constructed relationship exploration prompt text, target question, candidate relationship, and multiple subgoals into the LLM, the first relationship is obtained as "award". The initial reasoning path set is updated according to the first relationship, and the subgraph is updated according to the candidate relationship.
[0358] After obtaining the first relationship above, the entities connected with the first relationship are determined as candidate entities, i.e., "M Award", "Q Award", "R Award", and the entity exploration prompt text, the target question, and the candidate entities are input into the LLM to obtain the first entity "M Award", "Q Award", "R Award" output by the LLM, and the candidate entities "M Award", "Q Award", "R Award" are used to continue updating the initial reasoning path set and the subgraph above.
[0359] Based on this, the updated initial reasoning path set and the updated subgraph can be obtained, and the updated memory includes the updated subgraph, the updated initial reasoning path set, and the updated sub-target state.
[0360] For example, as shown in FIG. 3, the updated initial reasoning path set is "Xiao A-song-song 1", "Xiao A-song-song 3", "Xiao A-song-song 2-award-N award", "Xiao A-song-song 2-award-P award", "Xiao A-song-song 4-award-M award", "Xiao A-song-song 5-award-Q award", and "Xiao A-song-song 5-award-R award", and the sub-target state is updated, and the updated sub-target state is:
[0361] "1. Song 1, song 2, song 3, song 4, and song 5 are songs of Xiao A.
[0362] 2. Song 2 won N Award and P Award, song 4 won M Award; song 5 won Q Award and R Award.
[0363] 3. Song 4 won M Award."
[0364] The current round of exploration is evaluated, for example, the evaluation result is that the knowledge is sufficient, and in the LLM, the target answer corresponding to the target question is obtained as "Song 4 is a song of Xiao A, song 4 won M Award, so the answer is song 4."
[0365] Based on the above steps, a more accurate target answer (i.e., the above target text processing result) is finally obtained.
[0366] The text processing method provided by one embodiment of the present disclosure decomposes a target problem into at least two sub-targets, so that the LLM can focus on processing more useful text segments of the target problem, and the response capability of the LLM to complex problems is improved; then, according to the target problem and the at least two sub-targets, the LLM is used to adaptively determine an exploration reasoning path from a knowledge graph with an initial entity contained in the target problem as a starting point, so that the determination of the exploration reasoning path can not only adapt to the target problem, but also adapt to the at least two sub-targets, the accuracy of the exploration reasoning path is improved, and because the adaptive breadth retrieval method is used, the decision of the LLM is more flexible, the accuracy of the exploration reasoning path is further improved, and the more accurate exploration reasoning path is used to make the decision process of the LLM more explicit and accurate, and the accuracy of the decision of the LLM is realized.
[0367] Further, in the case of obtaining the exploration reasoning path, knowledge integration is performed by using the LLM according to the target problem, the at least two sub-targets and the exploration reasoning path, a sub-target state is obtained, evaluation and reflection are performed according to the sub-target state, it can be determined whether the sub-target state contains a target answer, that is, whether the currently known knowledge can realize the processing of the target problem, and in the case of determining that the sub-target state does not contain the target answer, that is, the knowledge obtained by the LLM is not enough to obtain the target answer of the target problem, the reflection result is used to decide to continue exploration or to update the reasoning path to obtain a more accurate exploration reasoning path, so as to obtain sufficient knowledge to realize text processing, the accuracy of the finally obtained target answer is improved, and because the memory mechanism is used in the embodiment of the present disclosure, that is, the sub-graph, the reasoning path and the sub-target state are recorded in each exploration, the knowledge of each exploration is preserved in the subsequent exploration, and the reasoning accuracy of the LLM is improved.
[0368] The above is a schematic scheme of the text processing method of the present embodiment. It should be noted that the technical scheme of the text processing method belongs to the same concept as the technical scheme of the text processing method described above, and the details of the technical scheme of the text processing method that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0369] In one or more embodiments of the present disclosure, another text processing method is also provided, which specifically includes the following steps:
[0370] According to the target text, an initial reasoning path associated with a target entity is determined by using a text processing model, wherein the target entity is an entity contained in the target text;
[0371] According to the target text and the initial reasoning path, an initial text processing result is obtained by using the text processing model;
[0372] According to the initial text processing result, the initial reasoning path is updated by using the text processing model to obtain a target reasoning path.
[0373] According to the target text and the target reasoning path, a target text processing result is obtained by using the text processing model.
[0374] Specifically, the specific implementation of the embodiments of the present disclosure can refer to the above description of the embodiments, and the only difference is that the target text corresponding to at least two subtexts is not determined in the embodiments of the present disclosure, and accordingly, the path exploration of the reference subtext is not required, or one subtext is obtained after analyzing the target text, and accordingly, the screening process of the subtext is not required, which will not be described here.
[0375] For example, the target text can be taken as the above-mentioned at least two subtexts, and then, according to the above-mentioned description of the embodiments, the target entity corresponding to the target text is determined, that is, the target entity, and the target entity is determined as the initial reasoning path.
[0376] Then, the text processing model is used to determine an exploration reasoning path associated with the target entity from the knowledge graph, and specifically, the target text is input into the text processing model, and in the text processing model, according to the matching relationship between the target text and the target entity, the exploration reasoning path related to the target text is determined by experiencing relationship exploration, relationship screening, entity exploration, and entity screening from the knowledge graph, and the initial reasoning path is updated according to the second screening reasoning path in the exploration reasoning path.
[0377] Further, the target text and the initial reasoning path are input into the text processing model, and the initial text processing result is output after the text processing model is processed, so as to evaluate whether the reference reasoning path is sufficient to process the target text.
[0378] Based on this, the initial text processing result is analyzed, and in the case that the initial text processing result does not satisfy the preset iteration end condition, the target entity is updated according to the target text, the initial text processing result, the associated entity, and the initial reasoning path, and the above-mentioned exploration step is continued to be executed until the text processing result corresponding to the target text is obtained.
[0379] It should be noted that the technical scheme of the text processing method provided by the embodiments of the present disclosure belongs to the same concept as the above-mentioned technical scheme of the text processing method, and the details of the technical scheme of the text processing method provided by the embodiments of the present disclosure, which are not described in detail, can be referred to the description of the above-mentioned technical scheme of the text processing method.
[0380] One embodiment of the present disclosure provides a text processing method. The method uses a text processing model to determine an initial reasoning path from a target entity contained in a target text in a knowledge graph, so that the determination of the exploration reasoning path can adapt to the target text, improving the accuracy of the exploration reasoning path, thereby improving the accuracy of the initial reasoning path. Then, the more accurate initial reasoning path is used to make the text processing model decision-making process more explicit, realizing the adjustability of the text processing model decision-making. Further, after updating the initial reasoning path, the initial text processing result is obtained by using the text processing model to integrate knowledge according to the target text and the initial reasoning path. The initial text processing result can be used to update the initial reasoning path to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of the target text processing result of the target text finally obtained.
[0381] In one or more embodiments of the present disclosure, an auxiliary decision-making method is also provided, which is applied to a city digital twin system and specifically includes the following steps:
[0382] According to the to-be-decided problem and at least two sub-decision problems corresponding to the to-be-decided problem, an initial reasoning path associated with a target entity is determined by using a text processing model, wherein the target entity is an entity contained in the to-be-decided problem.
[0383] According to the to-be-decided problem, the at least two sub-decision problems, and the initial reasoning path, an initial decision reference result is obtained by using the text processing model.
[0384] According to the initial decision reference result, the initial reasoning path is updated by using the text processing model to obtain a target reasoning path.
[0385] According to the to-be-decided problem, the at least two sub-decision problems, and the target reasoning path, a target decision reference result is obtained by using the text processing model, so that the target decision is displayed through the city digital twin system.
[0386] The city digital twin system can be understood as a virtual digital twin system that simulates and predicts the city, including a city digital twin system client, a city digital twin system server, and the like.
[0387] The auxiliary decision-making method provided by the embodiments of the present disclosure and the text processing method provided by the embodiments of the description belong to the same general inventive concept. Specifically, the problem to be decided in the embodiments of the present disclosure can be understood as the above-mentioned target text; the sub-decision-making problem can be understood as the above-mentioned sub-text; the city digital knowledge graph can be understood as the above-mentioned knowledge graph, which contains city digital twin related knowledge; the decision-making reference information can be understood as the above-mentioned initial text processing result; and the target decision can be understood as the above-mentioned text processing result.
[0388] In one or more embodiments of the present disclosure, the specific implementation of determining the initial reasoning path associated with the target entity according to the problem to be decided and the at least two sub-decision-making problems corresponding to the problem to be decided by using a text processing model is as follows:
[0389] The target entity contained in the problem to be decided and the at least two sub-decision-making problems corresponding to the problem to be decided are determined, and an initial reasoning path is determined according to the target entity;
[0390] According to the problem to be decided and the at least two sub-decision-making problems, an exploration reasoning path associated with the target entity is determined from the city digital knowledge graph by using a text processing model;
[0391] The initial reasoning path is updated according to the exploration reasoning path, wherein the exploration reasoning path includes the target entity, an associated entity of the target entity, and an association relationship between the target entity and the associated entity.
[0392] Specifically, the specific implementation mode of the embodiments of the present disclosure can refer to the above-mentioned embodiments of the description, and after obtaining the target decision of the city digital twin system, the target decision is displayed to the user through the graphical interaction interface in the city digital twin system client, to assist the user in making decisions for the real city corresponding to the city digital twin system.
[0393] For example, the problem to be decided is “whether the current congestion location of X site needs to be evacuated”, and according to the above-mentioned embodiments of the description, the target decision corresponding to the problem to be decided “whether the current congestion location of X site needs to be evacuated” is “the congestion location is A door and B door, and B door needs to be closed and personnel to be evacuated”, and the target decision “the congestion location is A door and B door, and B door needs to be closed and personnel to be evacuated” is displayed to the user through the graphical interaction interface in the city digital twin system client, to provide assistance for the user to make decisions, and then the user can dispatch relevant personnel to B door for site closure and personnel evacuation guidance based on the target decision.
[0394] It should be noted that, since the technical solution of the auxiliary decision method provided by the embodiment of the disclosure and the technical solution of the text processing method described above belong to the same concept, the details of the technical solution of the auxiliary decision method provided by the embodiment of the disclosure which are not described in detail can be seen from the description of the technical solution of the text processing method described above.
[0395] The text processing method provided by one embodiment of the disclosure can make the text processing model focus on processing more useful text segments of the target text by decomposing the target text into at least two subtexts; then, according to the target text and the at least two subtexts, the initial reasoning path associated with the target entity is determined from the knowledge graph by using the text processing model, so that the determination of the exploration reasoning path can not only adapt to the target text, but also adapt to the at least two subtexts, thereby improving the accuracy of the exploration reasoning path, and thus improving the accuracy of the initial reasoning path; then, using the more accurate initial reasoning path, the decision process of the text processing model is more clear, and the adjustability of the decision of the text processing model is realized; further, after updating the initial reasoning path, the knowledge integration is performed by using the text processing model according to the target text, the at least two subtexts and the initial reasoning path, to obtain an initial text processing result, and then the initial reasoning path can be updated by using the initial text processing result to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of the target text processing result of the target text finally obtained, based on which a more accurate decision reference can be obtained, thereby improving the service quality of the urban digital twin system.
[0396] Corresponding to the method embodiments described above, the disclosure also provides text processing device embodiments. FIG. 4 shows a structural schematic diagram of a text processing device according to one embodiment of the disclosure. As shown in FIG. 4, the device includes:
[0397] The initial reasoning path determination module 402 is configured to determine an initial reasoning path associated with a target entity by using a text processing model according to a target text and at least two subtexts corresponding to the target text, wherein the target entity is an entity contained in the target text;
[0398] The initial text processing result obtaining module 404 is configured to obtain an initial text processing result by using the text processing model according to the target text, the at least two subtexts and the initial reasoning path;
[0399] The target reasoning path obtaining module 406 is configured to update the initial reasoning path by using the text processing model according to the initial text processing result, to obtain a target reasoning path;
[0400] The target text processing result obtaining module 408 is configured to obtain a target text processing result according to the target text, the at least two subtexts, and the target reasoning path, by using the text processing model.
[0401] Optionally, the initial reasoning path determining module 402 is further configured to:
[0402] determine a target entity included in the target text and at least two subtexts corresponding to the target text, and determine an initial reasoning path according to the target entity;
[0403] determine an exploration reasoning path associated with the target entity from a knowledge graph according to the target text and the at least two subtexts, by using a text processing model;
[0404] update the initial reasoning path according to the exploration reasoning path, wherein the exploration reasoning path includes the target entity, an associated entity of the target entity, and an associated relationship between the target entity and the associated entity.
[0405] Optionally, the target reasoning path obtaining module 406 is further configured to:
[0406] determine whether the initial text processing result meets a preset iteration end condition;
[0407] if not, update the target entity according to the target text, the initial text processing result, and the initial reasoning path, and continue to perform the step of determining an initial reasoning path associated with the target entity according to the target text and the at least two subtexts corresponding to the target text, by using a text processing model;
[0408] if yes, determine the initial reasoning path as the initial reasoning path.
[0409] Optionally, the initial reasoning path determining module 402 is further configured to:
[0410] determine a target text, and identify a target entity included in the target text by using a preset entity recognition method;
[0411] obtain at least two subtexts corresponding to the target text according to the target text and a text decomposition prompt text, by using the text processing model.
[0412] Optionally, the initial reasoning path determining module 402 is further configured to:
[0413] determine a candidate entity relationship connected to the target entity from the knowledge graph;
[0414] According to the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text, the text processing model is used to obtain a screened entity relationship;
[0415] According to the screened entity relationship, an associated entity connected with the target entity is determined from the knowledge graph, and a first screening reasoning path is constructed according to the target entity, the screened entity relationship, and the associated entity;
[0416] According to the target text, the first screening reasoning path, and an entity screening prompt text, the text processing model is used to obtain a target associated entity from the associated entity in the first screening reasoning path;
[0417] A second screening reasoning path related to the target associated entity is determined from the first screening reasoning path, and the first screening reasoning path and the second screening reasoning path are determined as the initial reasoning path.
[0418] Optionally, the initial reasoning path determination module 402 is further configured to:
[0419] The target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text are input into the text processing model;
[0420] According to the relationship screening prompt text, the matching result of the target text and the at least two subtexts with the candidate entity relationship is used in the text processing model to screen the screened entity relationship from the candidate entity relationship.
[0421] Optionally, the initial reasoning path determination module 402 is further configured to:
[0422] According to the relationship screening prompt text, the semantic matching result of the at least two subtexts and the candidate entity relationship is used in the text processing model to screen a first entity relationship from the candidate entity relationship;
[0423] According to the semantic matching result of the target text and the first entity relationship, the screened entity relationship is screened from the first entity relationship; or
[0424] According to the semantic matching result of the target text and the candidate entity relationship, a second entity relationship is screened from the candidate entity relationship;
[0425] According to the semantic matching result of the at least two subtexts and the second entity relationship, the screened entity relationship is screened from the candidate entity relationship.
[0426] Optionally, the initial reasoning path determination module 402 is further configured to:
[0427] input the target text, the first screening reasoning path, and entity screening prompt text into the text processing model;
[0428] According to the entity screening prompt text, the target text and the first screening reasoning path are matched in the text processing model, and the target associated entity is obtained from the associated entity according to the matching result.
[0429] Optionally, the initial reasoning path determination module 402 is further configured to:
[0430] Determine the tail entity of each initial reasoning path in the initial reasoning path, and update the initial reasoning path according to the matching relationship between the target entity and the tail entity contained in the second screening reasoning path in the exploration reasoning path, the screening entity relationship, and the target entity.
[0431] Optionally, the target reasoning path obtaining module 406 is further configured to:
[0432] According to the target text, the text processing information, the initial reasoning path, the associated entity, and the reflection prompt text, the text processing model is used to obtain a target entity update decision result;
[0433] In a case where it is determined that the target entity update decision result needs to adjust the path, a candidate update entity is determined from the associated entity, wherein the candidate update entity is an entity contained in the associated entity but not contained in the initial reasoning path;
[0434] According to the target text, the text processing information, the candidate update entity, the initial reasoning path, and the adjustment prompt text, the text processing model is used to obtain an update entity, and the target entity is updated according to the update entity.
[0435] The device further comprises an entity update module configured to:
[0436] In a case where it is determined that the target entity update decision result does not need to adjust the path, the target entity is updated according to the tail entity of the initial reasoning path.
[0437] Optionally, the device further comprises an iteration module configured to:
[0438] In a case where it is determined that the initial text processing result does not satisfy the preset iteration end condition, an updated entity is determined according to the associated entity and the initial reasoning path, the target entity is updated according to the updated entity, and the step of determining the initial reasoning path associated with the target entity according to the target text and the at least two subtexts corresponding to the target text by using the text processing model is continued to be executed; or
[0439] In a case where it is determined that the text processing information does not satisfy the preset iteration end condition, the target entity is updated according to the tail entity of the initial reasoning path, and the step of determining the initial reasoning path associated with the target entity according to the target text and the at least two subtexts corresponding to the target text by using the text processing model is continued to be executed.
[0440] Optionally, the apparatus further comprises an interaction module configured to:
[0441] receive the target text sent by the client, wherein the target text is generated by a user in a trigger operation of a user interaction interface of the client;
[0442] After the target text processing result is obtained, the method further comprises:
[0443] sending the target text processing result to the client, so that the client displays the target text processing result to the user through the user interaction interface.
[0444] Optionally, the initial reasoning path determination module 402 is further configured to:
[0445] determine the initial reasoning path associated with the target entity according to the target text and the at least two subtexts corresponding to the target text by using the text processing model according to a text processing model interface.
[0446] One embodiment of the present disclosure provides a text processing device. The device decomposes a target text into at least two subtexts, so that a text processing model can focus on processing more useful text segments of the target text. Then, the device determines an initial reasoning path from a knowledge graph based on the target text and the at least two subtexts, and using the text processing model and taking a target entity contained in the target text as a starting point, so that the determination of the exploration reasoning path can not only adapt to the target text, but also adapt to the at least two subtexts, thereby improving the accuracy of the exploration reasoning path and the accuracy of the initial reasoning path. Then, the more accurate initial reasoning path makes the decision process of the text processing model more explicit, and the adjustability of the decision of the text processing model is realized. Further, after updating the initial reasoning path, the device integrates knowledge based on the target text, the at least two subtexts, and the initial reasoning path, and using the text processing model to obtain an initial text processing result. Then, the initial text processing result can be used to update the initial reasoning path to obtain a target reasoning path, so as to obtain a more accurate target reasoning path, improve the accuracy of the initial text processing result, and further improve the accuracy of the target text processing result of the target text finally obtained.
[0447] The above is a schematic scheme of the text processing device of the present embodiment. It should be noted that the technical scheme of the text processing device belongs to the same concept as the technical scheme of the text processing method described above, and the details of the technical scheme of the text processing device that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0448] Corresponding to the method embodiments described above, the present disclosure also provides text processing device embodiments. Specifically, the device includes:
[0449] An initial reasoning path determination module is configured to determine an initial reasoning path associated with a target entity based on a target text and using a text processing model, wherein the target entity is an entity contained in the target text.
[0450] An initial text processing result obtaining module is configured to obtain an initial text processing result based on the target text and the initial reasoning path and using the text processing model.
[0451] A target reasoning path obtaining module is configured to update the initial reasoning path based on the initial text processing result and using the text processing model to obtain a target reasoning path.
[0452] A target text processing result obtaining module is configured to obtain a target text processing result based on the target text and the target reasoning path and using the text processing model.
[0453] One embodiment of the present disclosure provides a text processing device. The device determines an initial reasoning path from a knowledge graph by taking a target entity contained in a target text as a starting point by using a text processing model, so that the determination of the exploration reasoning path can adapt to the target text, and the accuracy of the exploration reasoning path is improved, thereby improving the accuracy of the initial reasoning path. Then, the more accurate initial reasoning path is used, so that the decision-making process of the text processing model is more clear, and the adjustability of the decision-making of the text processing model is realized. Further, after updating the initial reasoning path, the knowledge integration is performed by using the text processing model according to the target text and the initial reasoning path, and an initial text processing result is obtained. Then, the initial reasoning path can be updated by using the initial text processing result, and a target reasoning path is obtained, so that a more accurate target reasoning path is obtained, the accuracy of the initial text processing result is improved, and the accuracy of the target text processing result of the target text finally obtained is further improved.
[0454] The above is a schematic scheme of the text processing device of the present embodiment. It should be noted that the technical scheme of the text processing device belongs to the same concept as the technical scheme of the text processing method described above, and the details of the technical scheme of the text processing device that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0455] Referring to FIG. 5, FIG. 5 shows a structural block diagram of a computing device 500 according to one embodiment of the present disclosure. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 through a bus 530, and a database 550 is used to save data.
[0456] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of such networks, such as the Internet. The access device 540 can include one or more of any type of network interface (for example, a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, Near Field Communication (NFC).
[0457] In one embodiment of the present disclosure, the above-mentioned components of the computing device 500 and other components not shown in FIG. 5 can also be connected to each other, for example, through a bus. It should be understood that the computing device structure block diagram shown in FIG. 5 is only for the purpose of example, and is not a limitation on the scope of the present disclosure. Those skilled in the art can add or replace other components as needed.
[0458] The computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 can also be a mobile or stationary server.
[0459] Among them, the memory 510 is used to store computer programs / instructions, and the processor 520 is used to execute the computer programs / instructions stored in the memory 510, which when executed by the processor, implement the steps of the above-mentioned text processing method.
[0460] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the text processing method described above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0461] An embodiment of the present disclosure further provides a computer readable storage medium storing computer programs / instructions, which, when executed by a processor, implement the steps of the text processing method.
[0462] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the text processing method described above belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0463] An embodiment of the present disclosure further provides a computer program product comprising computer programs / instructions, which, when executed by a processor, implement the steps of the text processing method.
[0464] The above is a schematic scheme of the computer program product of the embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the text processing method described above belong to the same concept, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the text processing method.
[0465] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order described in the embodiments and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order in order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous.
[0466] The computer program / instructions can include a computer program code, which can be in a form of source code, object code, executable file, or some intermediate form etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate contents according to the requirements of patent practice, for example, according to the patent practice in some regions, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0467] It should be noted that, for the foregoing method embodiments, in order to facilitate description, each is described as a combination of a series of acts, but those skilled in the art should know that the disclosed embodiments are not limited to the order of the acts described, because according to the disclosed embodiments, certain steps can be performed in other orders or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the acts and modules involved are not necessarily essential to the disclosed embodiments.
[0468] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0469] The preferred embodiments of the disclosure disclosed above are only used to help explain the disclosure. The alternative embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the disclosed embodiments, many modifications and changes can be made. The disclosure selects and describes these embodiments in order to better explain the principles and practical applications of the disclosed embodiments, so that those skilled in the art can well understand and utilize the disclosure. The disclosure is limited only by the claims and their full scope and equivalents.
Claims
1. A text processing method, comprising: determining an initial reasoning path associated with a target entity according to a target text, at least two subtexts corresponding to the target text, and a text processing model, wherein the target entity is an entity contained in the target text; obtaining an initial text processing result according to the target text, the at least two subtexts, and the initial reasoning path and the text processing model; updating the initial reasoning path according to the initial text processing result and the text processing model to obtain a target reasoning path; obtaining a target text processing result according to the target text, the at least two subtexts, and the target reasoning path and the text processing model.
2. The text processing method of claim 1, wherein the determining an initial reasoning path associated with a target entity according to a target text, at least two subtexts corresponding to the target text, and a text processing model comprises: determining a target entity contained in a target text and at least two subtexts corresponding to the target text, and determining an initial reasoning path according to the target entity; determining an exploration reasoning path associated with the target entity from a knowledge graph according to the target text and the at least two subtexts and the text processing model; updating the initial reasoning path according to the exploration reasoning path, wherein the exploration reasoning path comprises the target entity, an associated entity of the target entity, and an association relationship between the target entity and the associated entity.
3. The text processing method of claim 1, wherein the updating the initial reasoning path according to the initial text processing result and the text processing model to obtain a target reasoning path comprises: determining whether the initial text processing result satisfies a preset iteration end condition; if not, updating the target entity according to the target text, the initial text processing result, and the initial reasoning path, and continuing to perform the determining an initial reasoning path associated with a target entity according to a target text, at least two subtexts corresponding to the target text, and a text processing model step; if yes, determining the initial reasoning path as the target reasoning path.
4. The text processing method of claim 2, wherein the determining a target entity contained in a target text and at least two subtexts corresponding to the target text comprises: determining a target text, and identifying a target entity contained in the target text by using a preset entity recognition method; obtaining at least two subtexts corresponding to the target text according to the target text and a text decomposition prompt text and the text processing model.
5. The text processing method of claim 2, wherein the determining an initial reasoning path associated with the target entity from a knowledge graph according to the target text and the at least two subtexts and the text processing model comprises: determining a candidate entity relationship connected to the target entity from the knowledge graph. According to the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text, a screened entity relationship is obtained by using the text processing model. According to the screened entity relationship, an associated entity connected with the target entity is determined from the knowledge graph, and a first screening reasoning path is constructed according to the target entity, the screened entity relationship, and the associated entity. According to the target text, the first screening reasoning path, and entity screening prompt text, a target associated entity is obtained from the associated entity in the first screening reasoning path by using the text processing model. A second screening reasoning path related to the target associated entity is determined from the first screening reasoning path, and the first screening reasoning path and the second screening reasoning path are determined as the initial reasoning path.
6. The text processing method of claim 5, wherein the obtaining, according to the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text, a screened entity relationship by using the text processing model comprises: inputting the target text, the at least two subtexts, the candidate entity relationship, and the relationship screening prompt text into the text processing model; according to the relationship screening prompt text, screening the screened entity relationship from the candidate entity relationship by using the target text and the at least two subtexts and the matching result of the candidate entity relationship in the text processing model.
7. The text processing method of claim 6, wherein the screening, according to the relationship screening prompt text, the screened entity relationship from the candidate entity relationship by using the target text and the at least two subtexts and the matching result of the candidate entity relationship in the text processing model comprises: according to the relationship screening prompt text, screening a first entity relationship from the candidate entity relationship by using the semantic matching result of the at least two subtexts and the candidate entity relationship in the text processing model; screening the screened entity relationship from the first entity relationship according to the semantic matching result of the target text and the first entity relationship; or screening a second entity relationship from the candidate entity relationship by using the semantic matching result of the target text and the candidate entity relationship; screening the screened entity relationship from the candidate entity relationship according to the semantic matching result of the at least two subtexts and the second entity relationship.
8. The text processing method of claim 5, wherein the obtaining, according to the target text, the first screening reasoning path, and entity screening prompt text, a target associated entity from the associated entity in the first screening reasoning path by using the text processing model comprises: inputting the target text, the first screening reasoning path, and entity screening prompt text into the text processing model; According to the entity screening prompt text, in the text processing model, the target associated entity is screened from the associated entity according to the semantic matching result of the target text and the first screening reasoning path.
9. The text processing method of claim 5, wherein the updating the initial reasoning path according to the exploration reasoning path comprises: determining tail entities of each initial reasoning path in the initial reasoning path, and updating the initial reasoning path according to a matching relationship between the tail entities and the target entity contained in the second screening reasoning path in the exploration reasoning path, the screening entity relationship, and the target entity.
10. The text processing method of claim 3, wherein the updating the target entity according to the target text, the initial text processing result, and the initial reasoning path comprises: obtaining a target entity update decision result by using the text processing model according to the target text, the text processing information, the initial reasoning path, the associated entity, and reflection prompt text; in a case where it is determined that the target entity update decision result is that the path needs to be adjusted, determining a candidate update entity from the associated entity, wherein the candidate update entity is an entity contained in the associated entity but not contained in the initial reasoning path; obtaining an update entity by using the text processing model according to the target text, the text processing information, the candidate update entity, the initial reasoning path, and adjustment prompt text, and updating the target entity according to the update entity.
11. The text processing method of claim 10, wherein after the obtaining the reflection result, the method further comprises: in a case where it is determined that the target entity update decision result is that the path does not need to be adjusted, updating the target entity according to a tail entity of the initial reasoning path.
12. The text processing method of claim 3, wherein after the determining whether the initial text processing result meets the preset iteration end condition, the method further comprises: in a case where it is determined that the initial text processing result does not meet the preset iteration end condition, determining an update entity according to the associated entity and the initial reasoning path, updating the target entity according to the update entity, and continuing to perform the step of determining the initial reasoning path associated with the target entity according to the target text and at least two subtexts corresponding to the target text by using the text processing model; or in a case where it is determined that the text processing information does not meet the preset iteration end condition, updating the target entity according to a tail entity of the initial reasoning path, and continuing to perform the step of determining the initial reasoning path associated with the target entity according to the target text and at least two subtexts corresponding to the target text by using the text processing model.
13. The text processing method of claim 2, wherein before the determining the target entity contained in the target text and the at least two subtexts corresponding to the target text, the method further comprises: receiving the target text sent by a client, wherein the target text is generated by a user in a user interaction interface of the client in response to a trigger operation. The obtaining the target text processing result further includes: sending the target text processing result to the client to enable the client to display the target text processing result to the user through the user interaction interface.
14. The text processing method of claim 1, wherein the determining, according to the target text and at least two subtexts corresponding to the target text, an initial reasoning path associated with a target entity by using a text processing model comprises: According to the text processing model interface, calling the text processing model, inputting the target text and at least two subtexts corresponding to the target text into the text processing model, and determining, in the text processing model, an initial reasoning path associated with a target entity by using a text processing model according to the target text and at least two subtexts corresponding to the target text.
15. A text processing method, comprising: determining, according to a target text, an initial reasoning path associated with a target entity by using a text processing model, wherein the target entity is an entity contained in the target text; obtaining an initial text processing result by using the text processing model according to the target text and the initial reasoning path; updating the initial reasoning path by using the text processing model according to the initial text processing result to obtain a target reasoning path; obtaining a target text processing result by using the text processing model according to the target text and the target reasoning path.
16. An auxiliary decision-making method applied to a city digital twin system, comprising: determining, according to a problem to be decided and at least two sub-decision problems corresponding to the problem to be decided, an initial reasoning path associated with a target entity by using a text processing model, wherein the target entity is an entity contained in the problem to be decided; obtaining an initial decision reference result by using the text processing model according to the problem to be decided, the at least two sub-decision problems, and the initial reasoning path; updating the initial reasoning path by using the text processing model according to the initial decision reference result to obtain a target reasoning path; obtaining a target decision reference result by using the text processing model according to the problem to be decided, the at least two sub-decision problems, and the target reasoning path, so as to display the target decision through the city digital twin system.
17. A text processing device, comprising: an initial reasoning path determination module configured to determine, according to a target text and at least two subtexts corresponding to the target text, an initial reasoning path associated with a target entity by using a text processing model, wherein the target entity is an entity contained in the target text; an initial text processing result obtaining module configured to obtain an initial text processing result by using the text processing model according to the target text, the at least two subtexts, and the initial reasoning path; a target reasoning path obtaining module configured to update the initial reasoning path by using the text processing model according to the initial text processing result to obtain a target reasoning path; The target text processing result obtaining module is configured to obtain a target text processing result according to the target text, the at least two subtexts and the target reasoning path by using the text processing model.
18. A text processing apparatus, comprising: An initial reasoning path determining module configured to determine an initial reasoning path associated with a target entity in a target text by using a text processing model, wherein the target entity is an entity contained in the target text; An initial text processing result obtaining module configured to obtain an initial text processing result according to the target text and the initial reasoning path by using the text processing model; A target reasoning path obtaining module configured to update the initial reasoning path to obtain a target reasoning path according to the initial text processing result by using the text processing model; A target text processing result obtaining module configured to obtain a target text processing result according to the target text and the target reasoning path by using the text processing model.
19. A computing device, comprising: a memory and a processor; The memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, and the computer programs / instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 16.
20. A computer readable storage medium storing computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 16.
21. A computer program product comprising computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 16.
Citation Information
Patent Citations
Text processing method and device
CN112784590A
Vertical domain question and answer method and device and electronic equipment
CN117634611A
Military question and answer method and system for large language model-driven knowledge graph multi-hop reasoning
CN118036742A
Medical LLM model reasoning method based on knowledge graph and related equipment
CN118095450A
Artificial intelligence device for entity linking and knowledge base question and answering and control method thereof
US20240211482A1
Cited By
Biological invasion identification method and system based on multi-source data fusion analysis
CN122333289A