Text acquisition method and device
By obtaining the similarity and metadata information of the input text and text blocks, combining multiple extractors and embedding models, a fine-grained output text collection is generated, and a pre-trained discriminant model reorders the decision sequence, the large language model is solved in decision making. The problem of accuracy and confidence in sequence generation improves the accuracy and diversity of search results.
Patent Information
- Application Number
- CN202411332434.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-07
AI Technical Summary
The large language model has poor accuracy in positioning user input information in decision sequence generation, resulting in inaccurate search results, and the generation of a single decision sequence may have the problem of overconfidence in the model.
By obtaining the similarity between the input text and the text blocks and metadata information in the text set, multiple extractors (title extractor, abstract extractor, problem extractor, keyword extractor, relationship extractor) are used to perform information. Extraction, combining the embedded model to calculate the similarity, generate a fine-grained output text set, and reorder the decision sequences using pre-trained discriminant models to improve accuracy.
Improve the accuracy and relevance of output text sets, reduce the error in generating a single decision sequence, enhance the interpretability and sustainability of the model, and adapt to customization in different fields and needs.
Smart Images

Figure CN119271798A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a text acquisition method and device. Background Art
[0002] With the development of science and technology, large language models have demonstrated extraordinary knowledge storage, understanding and reasoning capabilities based on their large parameter scale and large training data. In the downstream task stage, the paradigm that originally required fine-tuning for each subtask is gradually being replaced by prompt learning, and the use of prompt learning can also stimulate the reasoning thinking ability of large models, further strengthening the ability of the model, so that large language models can be used for decision sequence generation. This is of great significance to the field of communications. For example, the large model can be used mainly as a reasoning model with common sense knowledge for decision sequence generation, but due to the limitations of the large model, the accuracy of locating user input information is poor, making the retrieval results inaccurate. Summary of the invention
[0003] The present disclosure provides a text acquisition method and device, which can improve the accuracy of acquiring an output text set. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a text acquisition method is provided, including:
[0005] Get input text;
[0006] Acquire a text block set corresponding to each text in the text set, and acquire an extraction information set corresponding to text information of each text block in the text block set and metadata information of each text block;
[0007] Obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each piece of extracted information in the extracted information set corresponding to each set of text blocks;
[0008] According to the first similarity and at least one second similarity, an output text set corresponding to the input text in the text block set is obtained.
[0009] According to some embodiments, the method further comprises:
[0010] Get the text collection;
[0011] Splitting each text in the text set to obtain a text block set corresponding to the text set;
[0012] The extractor set is used to extract metadata information corresponding to each text block in the text block set, and an extracted information set corresponding to the metadata information of each text block is obtained.
[0013] According to some embodiments, extracting metadata information corresponding to each text block in the text block set using an extractor set to obtain an extracted information set corresponding to the metadata information of each text block includes at least one of the following:
[0014] Using a title extractor to extract metadata information corresponding to each text block in the text block set to obtain a title information set of each text block, wherein the title extractor includes a deep learning model based on a Transformer architecture;
[0015] Using a summary extractor to extract metadata information corresponding to each text block in the text block set to obtain a summary information set of each text block, wherein the summary extractor includes a sequence-to-sequence learning model;
[0016] Using a question extractor to extract metadata information corresponding to each text block in the text block set to obtain a question information set of each text block, wherein the question extractor includes natural language understanding technology and an inverse question generation algorithm;
[0017] Using a keyword extractor to extract metadata information corresponding to each text block in the text block set, to obtain a keyword information set of each text block;
[0018] A relation extractor is used to extract metadata information corresponding to each text block in the text block set to obtain a relation information set of each text block, wherein the relation extractor includes a graph neural network model.
[0019] According to some embodiments, the extracted information set includes title information, summary information, question information, keyword information and relationship matching information corresponding to each text block, and obtaining an output text set corresponding to the input text in the text block set according to the first similarity and at least one second similarity includes:
[0020] Obtaining the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining first scores corresponding to the input text and each text block;
[0021] The text blocks whose first scores are greater than a first score threshold in each text block set are added to an output text set corresponding to the input text.
[0022] According to some embodiments, the obtaining of the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining the first scores corresponding to the input text and each text block include:
[0023] Obtaining a first weight corresponding to the first similarity, and obtaining a second weight corresponding to each second similarity in at least one second similarity;
[0024] The first weight and the second weight are used to perform weighted processing on the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information to obtain a first score corresponding to the input text and each text block.
[0025] According to some embodiments, the step of obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set, comprises:
[0026] Using an embedding model to obtain a first embedding vector of the input text, a second embedding vector of the text information of each text block, and a third embedding vector corresponding to each extracted information in the extracted information set;
[0027] Acquire a first similarity between the input text and the text information of each text block according to the first embedding vector of the input text and the second embedding vector of the text information of each text block;
[0028] According to the first embedding vector of the input text and the third embedding vector corresponding to each extracted information in the extracted information set, a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained.
[0029] According to some embodiments, the method further comprises:
[0030] Using a large language model, obtaining a decision sequence set corresponding to the output text set, and obtaining a second score corresponding to each decision sequence in the decision sequence set;
[0031] Reordering the decision sequence set using a pre-trained discriminant model according to the first score to obtain a reordered decision sequence set;
[0032] Obtaining a third score corresponding to each reordered decision sequence in the reordered decision sequence set;
[0033] Outputting the decision sequence with the third highest score in the reordered decision sequence set;
[0034] A text block corresponding to the third highest-scoring decision sequence is output.
[0035] According to a second aspect of an embodiment of the present disclosure, a text acquisition device is provided, including:
[0036] A text acquisition unit, used for acquiring input text;
[0037] A set acquisition unit, used to acquire a text block set corresponding to each text in a text set, and acquire text information of each text block in the text block set and an extraction information set corresponding to metadata information of each text block;
[0038] A similarity acquisition unit, configured to acquire a first similarity between the input text and the text information of each text block, and acquire a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set;
[0039] The set acquisition unit is further configured to acquire, according to the first similarity and at least one second similarity, an output text set corresponding to the input text in the text block set.
[0040] According to a third aspect of an embodiment of the present disclosure, a network device is provided, including:
[0041] processor;
[0042] a memory for storing instructions executable by the processor;
[0043] The processor is configured to execute the instructions to implement the text acquisition method described in any one of the aforementioned aspects.
[0044] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of a network device, the network device is enabled to execute the text acquisition method described in any one of the preceding aspects.
[0045] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements any one of the methods described in the preceding aspects when executed by a processor.
[0046] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0047] In some or related embodiments, by obtaining input text; obtaining a text block set corresponding to each text in a text set, and obtaining a set of extracted information corresponding to the text information of each text block in the text block set and the metadata information of each text block; obtaining a first similarity between the input text and the text information of each text block, obtaining a second similarity between the input text and each extracted information in the set of extracted information corresponding to each text block set; and obtaining an output text set corresponding to the input text in the text block set based on the first similarity and at least one second similarity. Therefore, a fine-grained retrieval strategy can be provided, which performs retrieval through a set of metadata information and text information, and determines an output text set through similarity, which can integrate the matching similarity of multiple extracted information and input text, improve the correlation between the output text and the input text, improve the recall rate of related texts, and improve the accuracy of obtaining the output text set.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0050] Figure 1 is a background schematic diagram of a text acquisition method according to an exemplary embodiment;
[0051] Figure 2 is a flowchart of a text acquisition method according to an exemplary embodiment;
[0052] Figure 3 is a flowchart of a text acquisition method according to an exemplary embodiment;
[0053] Figure 4 is a schematic diagram showing an example of a method for extracting information according to an exemplary embodiment;
[0054] Figure 5 is an exemplary schematic diagram of a text acquisition method according to an exemplary embodiment;
[0055] Figure 6 is an exemplary schematic diagram of a text acquisition method according to an exemplary embodiment;
[0056] Figure 7 is a block diagram of a text acquisition device according to an exemplary embodiment;
[0057] Figure 8 The invention is a block diagram of a network device according to an exemplary embodiment. DETAILED DESCRIPTION
[0058] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0059] The embodiments of the present disclosure provide a text acquisition method and device. In some embodiments, the terms text acquisition method, information processing method, communication method, etc. can be interchangeable, the terms text acquisition device, information processing device, communication device, etc. can be interchangeable, and the terms information processing system, communication system, etc. can be interchangeable.
[0060] The embodiments of the present disclosure are not exhaustive, but are only illustrative of some embodiments, and are not intended to be a specific limitation on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a certain embodiment can also be implemented as an independent embodiment, and the order of the steps in a certain embodiment can be arbitrarily exchanged. In addition, the optional implementation methods in a certain embodiment can be arbitrarily combined; in addition, the embodiments can be arbitrarily combined, for example, some or all of the steps of different embodiments can be arbitrarily combined, and a certain embodiment can be arbitrarily combined with the optional implementation methods of other embodiments.
[0061] In each embodiment of the present disclosure, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between the embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form a new embodiment based on their internal logical relationships.
[0062] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0063] In the embodiments of the present disclosure, unless otherwise specified, elements expressed in the singular form, such as "a", "an", "the", "above", "said", "aforementioned", "this", etc., may mean "one and only one", or "one or more", "at least one", etc. For example, when using articles such as "a", "an", "the" in English in translation, the noun after the article may be understood as a singular expression or a plural expression.
[0064] In the embodiments of the present disclosure, “plurality” refers to two or more.
[0065] In some embodiments, the terms “at least one,” “one or more,” “a plurality of,” “multiple,” etc. may be used interchangeably.
[0066] The prefixes such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different description objects, and do not constitute restrictions on the position, order, priority, quantity or content of the description objects. The statement of the description object refers to the description in the context of the claims or embodiments, and should not constitute unnecessary restrictions due to the use of prefixes. For example, if the description object is a "field", the ordinal number before the "field" in the "first field" and the "second field" does not limit the position or order between the "fields", and the "first" and "second" do not limit whether the "fields" they modify are in the same message, nor do they limit the order of the "first field" and the "second field". For another example, if the description object is a "level", the ordinal number before the "level" in the "first level" and the "second level" does not limit the priority between the "levels". For another example, the number of description objects is not limited by the ordinal number, and can be one or more. Taking the "first device" as an example, the number of "devices" can be one or more. In addition, the objects modified by different prefixes may be the same or different. For example, if the description object is "device", then the "first device" and the "second device" may be the same device or different devices, and their types may be the same or different. For another example, if the description object is "information", then the "first information" and the "second information" may be the same information or different information, and their contents may be the same or different.
[0067] In some embodiments, "terminal" or "terminal device" can be referred to as "user equipment (UE)", "user terminal" "mobile station (MS)", "mobile terminal (MT)", subscriber station, mobile unit, subscriber unit, wireless unit, remote unit, mobile device, wireless device, wireless communication device, remote device, mobile subscriber station, access terminal, mobile terminal, wireless terminal, remote terminal, handset, user agent, mobile client, client, etc.
[0068] In some embodiments, data, information, etc. may be obtained with the user's consent.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0070] In the current era of rapid information growth, a large amount of new data is generated every day, and the knowledge of large models is limited by the training data. If the data is not updated in time, an incorrect decision sequence will be generated. When the large model can be generated based on new data, a feasible solution is to conduct continuous learning and continue to train the large model. However, this requires a large amount of computing resources and may cause catastrophic forgetting of knowledge.
[0071] For example, the large model can be used as a reasoning model with common sense knowledge for decision sequence generation. For new knowledge, a retrieval augmentation scheme, namely retrieval augmented generation, is adopted. Figure 1 is a background schematic diagram of a text acquisition method according to an exemplary embodiment. Figure 1 As shown in the figure, for example, it can include five steps: the first step is that the user asks a question to the agent; the second step is to retrieve related questions in the database based on the question; the third step is to pass the retrieved Top-k documents to the agent, and the agent synthesizes the final prompt; the fourth step is that the agent passes the prompt to the large language model, and the large language model returns the result to the agent; the fifth step is that the agent integrates the final result and returns it to the user. The main advantages of this solution are: (1) Based on this model, there is no need to update the model parameters, it can be plug-and-play, and can be customized according to downstream scenarios; (2) It is highly interpretable and can quickly locate supporting documents; (3) New knowledge can alleviate the hallucination phenomenon of the large language model and alleviate the generation of incorrect decision sequences. However, it is not combined with example retrieval, which makes the retrieval results inaccurate, and the generation of a single decision sequence may have the problem of overconfidence in the model, making the generated results far from the optimal solution.
[0072] Figure 2 is a flowchart of a text acquisition method according to an exemplary embodiment. Figure 2 As shown, the text acquisition method can be used to retrieve based on user input information and output the retrieved information scenario, including the following steps:
[0073] In step S11, the input text is obtained;
[0074] Among them, the execution subject of the embodiment of the present disclosure may be, for example, a network device. The name of the network device is not limited. For example, the network device may also be called a server, or a server cluster. The embodiment of the present disclosure is not limited to this. The embodiment of the present disclosure may be applied to the fields of artificial intelligence, infrastructure, and IT support technology, for example.
[0075] According to some embodiments, the input text may be, for example, an input text received by a network device. The input form of the input text is not limited. The input text may be, for example, a text in a textual form. The input text may also be, for example, a text in a voice form. When the text content corresponding to the input text changes, the input text may also change accordingly. For example, when the input time point of the input text changes, the input text may also change accordingly.
[0076] In some embodiments, the network device may, for example, obtain input text.
[0077] In step S12, a text block set corresponding to each text in the text set is obtained, and an extraction information set corresponding to text information of each text block in the text block set and metadata information of each text block is obtained;
[0078] According to some embodiments, a text set may be, for example, a collection of at least one text. The text included in the text set may be, for example, text that has been acquired in advance. The text set does not specifically refer to a fixed set. For example, when the number of texts corresponding to the text set changes, the text set may also change accordingly. For example, when a text in the text set changes, the text set may also change accordingly. For example, the text set includes, but is not limited to, instructions, published articles, historical cases, etc.
[0079] In some embodiments, the text block set may be, for example, a collection of at least one text block corresponding to a certain text. The text block set does not specifically refer to a certain fixed text block. For example, when the text corresponding to the text block set changes, the text block set may also change accordingly. For example, when the text splitting method changes, the text block set may also change accordingly.
[0080] In some embodiments, the text information may be used to refer to the original text corresponding to the text block. The text information may change with the change of the text block. For example, when the text block changes, the text information may also change accordingly.
[0081] According to some embodiments, the extracted information set may be, for example, a set obtained by extracting information from a certain text block. The extracted information set may be, for example, a collection of at least one extracted information. The extracted information set does not specifically refer to a certain fixed set. For example, when the number of extracted information corresponding to the extracted information set changes, the extracted information set may also change accordingly. For example, when a certain extracted information in the extracted information set changes, the extracted information set may also change accordingly.
[0082] According to some embodiments, a text block set corresponding to each text in a text set may be obtained, and an extraction information set corresponding to text information of each text block in the text block set and metadata information of each text block may be obtained.
[0083] In step S13, a first similarity between the input text and the text information of each text block is obtained, and a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained;
[0084] In some embodiments, the similarity may be used to indicate the degree of similarity between the input text and each piece of information. The similarity may vary according to the variation of each piece of information.
[0085] According to some embodiments, the first similarity may be used to indicate the similarity between the input text and the text information of each text block. The number of the first similarities may be the same as the number of text blocks, or may be less than the number of text blocks. The first similarity does not specifically refer to a fixed similarity. For example, when the text block changes, the first similarity may also change accordingly. For example, when the method for determining the similarity changes, the first similarity may also change accordingly.
[0086] In some embodiments, the second similarity may be used to refer to the similarity between the input text and any extracted information in the extracted information set. The second similarity does not specifically refer to a fixed similarity. For example, when the extracted information changes, the second similarity may also change accordingly. The number of the second similarities may be consistent with the number of extracted information in the extracted information set.
[0087] According to some embodiments, a first similarity between the input text and the text information of each text block may be obtained, and a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set may be obtained.
[0088] In step S14, an output text set corresponding to the input text in the text block set is obtained according to the first similarity and at least one second similarity.
[0089] According to some embodiments, when the first similarity and the second similarity are obtained, the output text set corresponding to the input text in the text block set can be obtained according to the two similarities. Therefore, a fine-grained search strategy can be used to obtain the output text set.
[0090] Among them, the output text set can be used to indicate the output of text corresponding to the input text, and the output text set can include at least one text. The output text set does not specifically refer to a fixed set. For example, when the number of texts corresponding to the output text set changes, the output text set can also change accordingly. For example, when a text in the output text set changes, the output text set can also change accordingly.
[0091] In some or related embodiments, by obtaining input text; obtaining a text block set corresponding to each text in a text set, and obtaining a set of extracted information corresponding to the text information of each text block in the text block set and the metadata information of each text block; obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each extracted information in the set of extracted information corresponding to each text block set; and obtaining an output text set corresponding to the input text in the text block set based on the first similarity and at least one second similarity. Therefore, a fine-grained retrieval strategy can be provided, which performs retrieval through a set of metadata information and text information, and determines an output text set through similarity, which can integrate the matching similarity of multiple extracted information and input text, improve the correlation between the output text and the input text, improve the recall rate of related texts, and improve the accuracy and interpretability of obtaining the output text set.
[0092] Figure 3 is a flowchart of a text acquisition method according to an exemplary embodiment. Figure 3 As shown, the text acquisition method can be used in a text acquisition scenario, comprising the following steps:
[0093] In step S21, a text collection is obtained;
[0094] The specific process is as described above and will not be repeated here.
[0095] According to some embodiments, the text set may include, for example, multiple texts. The name of the text set is not limited. For example, the text set may also be called a document set. The document set does not specifically refer to a fixed set. For example, when the number of texts corresponding to the text set changes, the text set may also change accordingly. For example, when a text in the text set changes, the text set may also change accordingly.
[0096] In step S22, each text in the text set is split to obtain a text block set corresponding to the text set;
[0097] The specific process is as described above and will not be repeated here.
[0098] According to some embodiments, when a text set is obtained, each text in the text set can be split to obtain a text block set corresponding to each text. Wherein, the text block can include, for example, original text information and metadata information. Wherein, the metadata information can be set to a dictionary type, which can be used to describe basic information of the text. The split text blocks can inherit the metadata information of the parent text. The metadata information can include, for example, multiple different types of information.
[0099] In step S23, the extractor set is used to extract the metadata information corresponding to each text block in the text block set, so as to obtain an extracted information set corresponding to the metadata information of each text block;
[0100] The specific process is as described above and will not be repeated here.
[0101] According to some embodiments, extracting metadata information corresponding to each text block in the text block set using an extractor set to obtain an extracted information set corresponding to the metadata information of each text block includes at least one of the following:
[0102] Using a title extractor to extract metadata information corresponding to each text block in the text block set to obtain a title information set of each text block, wherein the title extractor includes a deep learning model based on a Transformer architecture;
[0103] Using a summary extractor to extract metadata information corresponding to each text block in the text block set to obtain a summary information set of each text block, wherein the summary extractor includes a sequence-to-sequence learning model;
[0104] Using a question extractor to extract metadata information corresponding to each text block in the text block set to obtain a question information set of each text block, wherein the question extractor includes natural language understanding technology and an inverse question generation algorithm;
[0105] Using a keyword extractor to extract metadata information corresponding to each text block in the text block set, to obtain a keyword information set of each text block;
[0106] A relation extractor is used to extract metadata information corresponding to each text block in the text block set to obtain a relation information set of each text block, wherein the relation extractor includes a graph neural network model. Therefore, different extractors can be used to extract different information, thereby improving the accuracy of information extraction and the accuracy of determining the output text set.
[0107] According to some embodiments, the title extractor may include, for example, a deep learning model based on a Transformer architecture, such as BERT or GPT, which can identify the topic and subtitle of each text block by analyzing the grammatical structure and semantic content of the text to summarize the main idea of the text block. Using a title extractor can improve the accuracy of understanding and extracting the hierarchy and implicit meaning in complex documents.
[0108] According to some embodiments, the summary extractor may include summary generation technology, such as a sequence-to-sequence learning model, which can extract the core information in the text block, dynamically adjust the length and detail of the summary according to user needs, and store the summary content. This not only improves the accuracy and information richness of the summary, but also makes the summary more targeted to support specific query needs.
[0109] According to some embodiments, the question extractor may include a combination of natural language understanding technology and an inverse question generation algorithm to automatically construct questions corresponding to the text content, which are intended to simulate possible queries of potential users. When performing a query, the retriever may match the current user query with the question for similarity. Through the deep learning model, more natural and complex questions can be generated, thereby increasing the probability of matching the user's true query intent;
[0110] According to some embodiments, the keyword extractor may include multiple keywords related to the field. For example, the communication field involves a large number of professional terms, and the professional terms of each text block are extracted. When facing a new problem, the keywords involved in the problem are generated, and the corresponding text blocks are retrieved using these keywords. Professional texts can be analyzed more deeply to accurately capture key terms in the field.
[0111] According to some embodiments, the relationship extractor can, for example, utilize a graph neural network to identify and analyze relationships between text blocks, including but not limited to causal, contrastive, hierarchical, and chronological relationships, and can automatically identify and clarify various relationships in complex text sets, supporting more accurate intra-document navigation and information retrieval.
[0112] For example, all extractors may be used to extract information from the same text block. The disclosed embodiment does not limit the number of extractors used. Figure 4 shown.
[0113] In step S24, the input text is obtained;
[0114] The specific process is as described above and will not be repeated here.
[0115] According to some embodiments, Figure 5 is an exemplary schematic diagram of a text acquisition method according to an exemplary embodiment. Figure 5 As shown, the input text obtained may also be referred to as a current instruction, for example, and the current instruction may be, for example, "the traffic volume of the cell is lower than 1 GB, how to investigate whether there is a remote obstruction of the sky surface".
[0116] In step S25, a text block set corresponding to each text in the text set is obtained, and an extraction information set corresponding to text information of each text block in the text block set and metadata information of each text block is obtained;
[0117] The specific process is as described above and will not be repeated here.
[0118] In step S26, a first similarity between the input text and the text information of each text block is obtained, and a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained;
[0119] The specific process is as described above and will not be repeated here.
[0120] According to some embodiments, the step of obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set, comprises:
[0121] Using an embedding model to obtain a first embedding vector of the input text, a second embedding vector of the text information of each text block, and a third embedding vector corresponding to each extracted information in the extracted information set;
[0122] Acquire a first similarity between the input text and the text information of each text block according to the first embedding vector of the input text and the second embedding vector of the text information of each text block;
[0123] According to the first embedding vector of the input text and the third embedding vector corresponding to each extracted information in the extracted information set, the second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained. Therefore, the similarity can be obtained according to the embedding vector, which can improve the accuracy of similarity acquisition and improve the accuracy of output text block acquisition.
[0124] Among them, metadata information includes title, abstract, keywords, etc. Therefore, the acquisition of the second similarity is more comprehensive, which can improve the recall rate of the output text and improve the comprehensiveness and accuracy of the information used in the retrieval process.
[0125] In step S27, an output text set corresponding to the input text in the text block set is obtained according to the first similarity and at least one second similarity.
[0126] The specific process is as described above and will not be repeated here.
[0127] According to some embodiments, the extracted information set includes title information, summary information, question information, keyword information and relationship matching information corresponding to each text block, and obtaining an output text set corresponding to the input text in the text block set according to the first similarity and at least one second similarity includes:
[0128] Obtaining the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining first scores corresponding to the input text and each text block;
[0129] The text blocks whose first scores are greater than the first score threshold in the text block sets are added to the output text set corresponding to the input text. Therefore, the scores of the text blocks can be obtained according to the similarity, and then the output text set can be determined, which can improve the accuracy of the output text block determination.
[0130] When obtaining the first score, the first similarity and the second similarity may correspond to different weights, which can improve the accuracy of obtaining the first score. At the same time, the score acquisition algorithm is optimized to improve the matching of the score acquisition algorithm and the output text, and improve the accuracy of output text acquisition.
[0131] According to some embodiments, in a retrieval ranking algorithm based on fine-grained information fusion, for example, text blocks, metadata information, and input text can be embedded and encoded. For example, the preprocessed text is input into an embedding model. The embedding vector is extracted from the model output. For BERT-like models, the output of the CLS tag position is usually used as a representative embedding of the entire input sequence. The embedding vector v can be expressed as:
[0132] v= Model embed (text) (1)
[0133] Among them, Model embed Represents the embedding model, and text is the input text.
[0134] According to some embodiments, the cosine similarity formula may be used to calculate the similarity between the embedding vectors of two text blocks. The cosine similarity calculation formula (2) is:
[0135]
[0136] A is the input text, and B can be a document block or metadata information. For example, the traditional retrieval algorithm can be adjusted to the existing similarity (Score) based on text block matching. doc ) based on the title matching similarity (Score title ), summary matching similarity (Score abstract ), question matching similarity (Score query ), keyword matching similarity (Score keyword ) and relationship matching similarity (Score relation ), and perform weighted averaging, so the final evaluation dimension is
[0137] Dim = {doc, title, abstract, query, keyword, relation}. The final first score (3) is:
[0138]
[0139] Therefore, the similarity score can be used to retrieve the most suitable Top-k documents for subsequent generation. At the same time, in the process of generating responses, the top-k documents can be labeled so that the large language model can generate corresponding references and increase the feasibility of the model.
[0140] According to some embodiments, the obtaining of the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining the first scores corresponding to the input text and each text block include:
[0141] Obtaining a first weight corresponding to the first similarity, and obtaining a second weight corresponding to each second similarity in at least one second similarity;
[0142] The first weight and the second weight are used to perform weighted processing on the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information to obtain a first score corresponding to the input text and each text block.
[0143] According to some embodiments, the method further comprises:
[0144] Using a large language model, obtaining a decision sequence set corresponding to the output text set, and obtaining a second score corresponding to each decision sequence in the decision sequence set;
[0145] Reordering the decision sequence set using a pre-trained discriminant model according to the first score to obtain a reordered decision sequence set;
[0146] Obtaining a third score corresponding to each reordered decision sequence in the reordered decision sequence set;
[0147] Outputting the decision sequence with the third highest score in the reordered decision sequence set;
[0148] Output the text block corresponding to the decision sequence with the third highest score. Therefore, the decision sequence can be reordered to improve the accuracy of the text block output, multiple decision sequences can be provided, and the situation in which a single decision sequence causes inaccurate text block acquisition can be reduced, and the diversity of the output text and the relevance to the output text can be improved, thereby improving user satisfaction. In addition, the solution of the embodiment of the present disclosure does not require frequent updates of the parameters of the large language model, thereby improving the sustainability of the large language model, and the solution of the embodiment of the present disclosure is scalable, so as to be customized according to different fields and needs and adapt to a variety of application scenarios.
[0149] According to some embodiments, Figure 6 is an exemplary schematic diagram of a text acquisition method according to an exemplary embodiment. Figure 6 As shown in the figure, after retrieving relevant information, the large language model can be used to generate corresponding operation sequences based on the atomic operations in the text to assist in the decision-making of downstream work. Specifically, based on the retrieved Top-K documents, a corresponding decision plan is generated. The decision plan is based on the defined action list. These action sequences are arranged using the large language model to obtain a solution for solving the user's problem and returned to the user, that is, the output text set can be determined and displayed to the user. In the process of generating a decision sequence, the generation of the model often has the problem of overconfidence. Usually, generating a single decision sequence often cannot directly meet the user's instructions. Therefore, an over-generation and re-ordering solution is adopted to ensure that the output decision sequence is both logical and highly relevant. Therefore, the overconfidence of the large language model can be reduced, and it can improve the logic and relevance of the output text.
[0150] The specific process is as follows: Figure 5 and as follows:
[0151] (1) Let D be a text collection obtained by a retrieval ranking algorithm based on fine-grained information fusion. Using the large language model M, K decision sequences corresponding to D can be generated. These K decision sequences are structured and combined through the model's language understanding and generation capabilities to ensure their practicality and relevance (4):
[0152]
[0153] (2) The generated decision sequence may not fully meet the actual needs due to the overconfidence of the model. To solve this problem, a pre-trained discriminant model F is introduced to reorder the generated K decision sequences. The task of this model is to evaluate the effectiveness and accuracy of each decision sequence (5):
[0154]
[0155] (3) After re-ranking, the decision sequence with the highest score can be selected from the ranking and output (6):
[0156]
[0157] For the discriminant model, the large language model itself can be used for discrimination, or an independent discriminant model can be obtained through supervised training to ensure the reliability and accuracy of the output results. Afterwards, technicians can assist in actual production operations based on the optimal decision sequence provided by the large language model.
[0158] According to some embodiments, a text collection is obtained; each text in the text collection is split to obtain a text block collection corresponding to the text collection; an extractor collection is used to extract metadata information corresponding to each text block in the text block collection to obtain an extraction information collection corresponding to the metadata information of each text block. Therefore, extraction can be used to extract metadata information, which can reduce the time consumed by manual splitting and reduce the situation where the extracted information is inaccurately obtained due to manual splitting, thereby improving the accuracy of the extracted information. Different extracted information can correspond to different extractors, which can improve the accuracy of the output text.
[0159] A block diagram of a text acquisition device according to an exemplary embodiment. Figure 7 , the device 700 comprises:
[0160] A text acquisition unit 701 is used to acquire input text;
[0161] A set acquisition unit 702 is used to acquire a text block set corresponding to each text in a text set, and acquire text information of each text block in the text block set and an extracted information set corresponding to metadata information of each text block;
[0162] A similarity acquisition unit 703 is used to acquire a first similarity between the input text and the text information of each text block, and to acquire a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set;
[0163] The set acquisition unit 702 is further configured to acquire, according to the first similarity and at least one second similarity, an output text set corresponding to the input text in the text block set.
[0164] According to some embodiments, the set acquisition unit 702 is further configured to:
[0165] Get the text collection;
[0166] Splitting each text in the text set to obtain a text block set corresponding to the text set;
[0167] The extractor set is used to extract metadata information corresponding to each text block in the text block set, and an extracted information set corresponding to the metadata information of each text block is obtained.
[0168] According to some embodiments, the set acquisition unit 702 is used to extract information from metadata information corresponding to each text block in the text block set using an extractor set, and when acquiring the extracted information set corresponding to the metadata information of each text block, specifically for at least one of the following:
[0169] Using a title extractor to extract metadata information corresponding to each text block in the text block set to obtain a title information set of each text block, wherein the title extractor includes a deep learning model based on a Transformer architecture;
[0170] Using a summary extractor to extract metadata information corresponding to each text block in the text block set to obtain a summary information set of each text block, wherein the summary extractor includes a sequence-to-sequence learning model;
[0171] Using a question extractor to extract metadata information corresponding to each text block in the text block set to obtain a question information set of each text block, wherein the question extractor includes natural language understanding technology and an inverse question generation algorithm;
[0172] Using a keyword extractor to extract metadata information corresponding to each text block in the text block set, to obtain a keyword information set of each text block;
[0173] A relation extractor is used to extract metadata information corresponding to each text block in the text block set to obtain a relation information set of each text block, wherein the relation extractor includes a graph neural network model.
[0174] According to some embodiments, the extracted information set includes title information, summary information, question information, keyword information and relationship matching information corresponding to each text block, and the similarity acquisition unit 703 is used to acquire the output text set corresponding to the input text in the text block set according to the first similarity and at least one second similarity, specifically for:
[0175] Obtaining the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining first scores corresponding to the input text and each text block;
[0176] The text blocks whose first scores are greater than a first score threshold in each text block set are added to an output text set corresponding to the input text.
[0177] According to some embodiments, the similarity acquisition unit 703 is used to acquire the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and when acquiring the first score corresponding to the input text and each text block, is specifically used to:
[0178] Obtaining a first weight corresponding to the first similarity, and obtaining a second weight corresponding to each second similarity in at least one second similarity;
[0179] The first weight and the second weight are used to perform weighted processing on the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information to obtain a first score corresponding to the input text and each text block.
[0180] According to some embodiments, the similarity acquisition unit 703 is used to acquire the first similarity between the input text and the text information of each text block, and acquire the second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set, specifically for:
[0181] Using an embedding model to obtain a first embedding vector of the input text, a second embedding vector of the text information of each text block, and a third embedding vector corresponding to each extracted information in the extracted information set;
[0182] Acquire a first similarity between the input text and the text information of each text block according to the first embedding vector of the input text and the second embedding vector of the text information of each text block;
[0183] According to the first embedding vector of the input text and the third embedding vector corresponding to each extracted information in the extracted information set, a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained.
[0184] According to some embodiments, the set acquisition unit 702 is further configured to:
[0185] Using a large language model, obtaining a decision sequence set corresponding to the output text set, and obtaining a second score corresponding to each decision sequence in the decision sequence set;
[0186] Reordering the decision sequence set using a pre-trained discriminant model according to the first score to obtain a reordered decision sequence set;
[0187] Obtaining a third score corresponding to each reordered decision sequence in the reordered decision sequence set;
[0188] Outputting the decision sequence with the third highest score in the reordered decision sequence set;
[0189] A text block corresponding to the third highest-scoring decision sequence is output.
[0190] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0191] In some or related embodiments, a text acquisition unit is used to acquire input text; a set acquisition unit is used to acquire a text block set corresponding to each text in a text set, and acquire the text information of each text block in the text block set and the extraction information set corresponding to the metadata information of each text block; a similarity acquisition unit is used to acquire the first similarity between the input text and the text information of each text block, and acquire the second similarity between the input text and each extraction information in the extraction information set corresponding to each text block set; the set acquisition unit is also used to acquire the output text set corresponding to the input text in the text block set according to the first similarity and at least one second similarity. Therefore, a fine-grained retrieval strategy can be provided, which performs retrieval through a set of metadata information and text information, and determines the output text set through similarity, which can integrate the matching similarity of multiple extraction information and input text, improve the correlation between the output text and the input text, improve the recall rate of related texts, and improve the accuracy of acquiring the output text set.
[0192] Figure 8 800 is a block diagram of a network device 800 provided in an embodiment of the present disclosure. For example, the network device 800 may be provided as a network device. Figure 8 The network device 800 includes a processing component 822, which further includes at least one processor, and a memory resource represented by a memory 832 for storing instructions executable by the processing component 822, such as an application. The application stored in the memory 832 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 822 is configured to execute instructions to perform any of the methods described above in the network device.
[0193] The network device 800 may also include a power supply component 827 configured to perform power management of the network device 800, a wired or wireless network interface 850 configured to connect the network device 800 to a network, and an input / output (I / O) interface 858. The network device 800 may operate based on an operating system stored in the memory 832, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM or the like.
[0194] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0195] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0196] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0197] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0198] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0199] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0200] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0201] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A text acquisition method, characterized in that: include: Get input text; Acquire a text block set corresponding to each text in the text set, and acquire an extraction information set corresponding to text information of each text block in the text block set and metadata information of each text block; Obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each piece of extracted information in the extracted information set corresponding to each set of text blocks; According to the first similarity and at least one second similarity, an output text set corresponding to the input text in the text block set is obtained.
2. The method according to claim 1, characterized in that The method further comprises: Get the text collection; Splitting each text in the text set to obtain a text block set corresponding to the text set; The extractor set is used to extract metadata information corresponding to each text block in the text block set, and an extracted information set corresponding to the metadata information of each text block is obtained.
3. The method according to claim 2, characterized in that The extractor set is used to extract metadata information corresponding to each text block in the text block set to obtain an extracted information set corresponding to the metadata information of each text block, including at least one of the following: Using a title extractor to extract metadata information corresponding to each text block in the text block set to obtain a title information set of each text block, wherein the title extractor includes a deep learning model based on a Transformer architecture; Using a summary extractor to extract metadata information corresponding to each text block in the text block set to obtain a summary information set of each text block, wherein the summary extractor includes a sequence-to-sequence learning model; Using a question extractor to extract metadata information corresponding to each text block in the text block set to obtain a question information set of each text block, wherein the question extractor includes natural language understanding technology and an inverse question generation algorithm; Using a keyword extractor to extract metadata information corresponding to each text block in the text block set, to obtain a keyword information set of each text block; A relation extractor is used to extract metadata information corresponding to each text block in the text block set to obtain a relation information set of each text block, wherein the relation extractor includes a graph neural network model.
4. The method according to claim 1, characterized in that: in, The extracted information set includes title information, summary information, question information, keyword information and relationship matching information corresponding to each text block, and obtaining an output text set corresponding to the input text in the text block set according to the first similarity and at least one second similarity, including: Obtaining the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining first scores corresponding to the input text and each text block; The text blocks whose first scores are greater than a first score threshold in each text block set are added to an output text set corresponding to the input text.
5. The method according to claim 4, characterized in that The obtaining of the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information, and obtaining the first scores corresponding to the input text and each text block, includes: Obtaining a first weight corresponding to the first similarity, and obtaining a second weight corresponding to each second similarity in at least one second similarity; The first weight and the second weight are used to perform weighted processing on the first similarity, the second similarity between the input text and the title information, the second similarity between the input text and the summary information, the second similarity between the input text and the question information, the second similarity between the input text and the keyword information, and the second similarity between the input text and the relationship matching information to obtain a first score corresponding to the input text and each text block.
6. The method according to claim 1, characterized in that The step of obtaining a first similarity between the input text and the text information of each text block, and obtaining a second similarity between the input text and each piece of extracted information in the extracted information set corresponding to each set of text blocks, comprises: Using an embedding model to obtain a first embedding vector of the input text, a second embedding vector of the text information of each text block, and a third embedding vector corresponding to each extracted information in the extracted information set; Acquire a first similarity between the input text and the text information of each text block according to the first embedding vector of the input text and the second embedding vector of the text information of each text block; According to the first embedding vector of the input text and the third embedding vector corresponding to each extracted information in the extracted information set, a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set is obtained.
7. The method according to claim 1, characterized in that The method further comprises: Using a large language model, obtaining a decision sequence set corresponding to the output text set, and obtaining a second score corresponding to each decision sequence in the decision sequence set; Reordering the decision sequence set using a pre-trained discriminant model according to the first score to obtain a reordered decision sequence set; Obtaining a third score corresponding to each reordered decision sequence in the reordered decision sequence set; Outputting the decision sequence with the third highest score in the reordered decision sequence set; A text block corresponding to the third highest-scoring decision sequence is output.
8. A text acquisition device, characterized in that: include: A text acquisition unit, used for acquiring input text; A set acquisition unit, used to acquire a text block set corresponding to each text in a text set, and acquire text information of each text block in the text block set and an extraction information set corresponding to metadata information of each text block; A similarity acquisition unit, configured to acquire a first similarity between the input text and the text information of each text block, and acquire a second similarity between the input text and each extracted information in the extracted information set corresponding to each text block set; The set acquisition unit is further configured to acquire, according to the first similarity and at least one second similarity, an output text set corresponding to the input text in the text block set.
9. A network device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the text acquisition method as described in any one of claims 1 to 7.
10. A storage medium storing instructions, characterized in that: When the instruction is executed on a communication device, the communication device is caused to execute the text acquisition method according to any one of claims 1 to 7.
Citation Information
Cited By
Double-granularity text retrieval method based on atomic sentences
CN120821825A