Entity question and answer generation method and device, equipment and storage medium

By combining a bidirectional language representation model and an entity question-answering generation model, the problem of inaccurate information acquisition in existing knowledge question-answering systems is solved, enabling fast and accurate entity question-answering generation, and improving user experience and system adaptability.

CN121858684APending Publication Date: 2026-04-14CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing knowledge-based question-answering systems are often affected by problems such as lexical ambiguity, synonyms, expression methods, unclear pronoun references, and sparse text information when processing user questions. This makes it difficult for users to accurately obtain the information they need, and manual intervention is time-consuming and labor-intensive, increasing the complexity of maintenance and the risk of human error.

Method used

A bidirectional language representation model is used for semantic segmentation to obtain processable text blocks. Named entities and their question-answer pairs are identified through an entity question-answer generation model. Combined with prompt word engineering and a large language model for training, entity question-answer pairs that match user questions are quickly selected.

Benefits of technology

It improved the recall rate of question-and-answer retrieval, reduced information loss or misunderstanding, improved processing speed and accuracy, reduced the need for manual intervention, and enhanced the system's adaptability and user experience in diverse fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858684A_ABST
    Figure CN121858684A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an entity question and answer generation method and device, equipment and a storage medium. The method comprises the following steps: analyzing a to-be-processed knowledge file to obtain a processable text; according to the processable text, performing semantic segmentation by adopting a bidirectional language representation model to obtain one or more to-be-extracted text blocks; adopting a trained entity question and answer generation model to obtain a named entity corresponding to each to-be-extracted text block, and obtaining an entity question and answer pair corresponding to each named entity; the method comprises the following steps: acquiring a training named entity and a training question-answer pair for training an entity question-answer generation model through a cue word project and a language large model; and according to the question statement, screening out an entity question and answer pair matched with the question statement, and outputting an answer statement in the entity question and answer pair. The training named entities and the training question and answer pairs are generated through the cue word engineering and the language large model and are used for training the entity question and answer generation model, and the richness and the retrieval recall rate of a knowledge base are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for generating entity question answers. Background Technology

[0002] With the widespread application of large-scale models and retrieval enhancement technologies, knowledge-based question answering systems have become important tools for information retrieval and decision support. Users' expectations for question answering systems extend beyond accuracy; they also include rapid responses and high-quality answers. This demand has driven the continuous development of question answering systems, leading to their widespread application in education, healthcare, law, and many other fields. These advancements have improved the efficiency and accuracy of information retrieval, helping users obtain the knowledge they need more quickly.

[0003] Existing knowledge-based question answering methods typically employ a hybrid retrieval strategy, combining sparse retrieval (e.g., best match 25) with dense retrieval (e.g., vector retrieval) to improve information retrieval recall. In sparse retrieval, relevant text blocks are found through keyword segmentation, a process involving word segmentation, stop word removal, and weight calculation to filter potential answers from a large-scale knowledge base. However, this method is often hampered by issues such as lexical ambiguity, synonyms, word choice, unclear pronoun references, and sparse text block information when processing user queries, making it difficult for users to accurately obtain the information they need.

[0004] Dense retrieval relies on semantic similarity calculations to achieve a deeper understanding, but its effectiveness is limited by the quality of the input text and the density of its semantics. To improve retrieval recall under different question formulations, it is necessary to manually compile high-quality question-answer pairs. In this process, questions are rewritten to adapt to different question formats. However, manual intervention is not only time-consuming and labor-intensive but also increases maintenance complexity and is susceptible to human error.

[0005] Therefore, there is an urgent need for an entity question-answering generation method to solve the technical problem of low recall rate in existing question-answering retrieval technologies. Summary of the Invention

[0006] This application provides a method, apparatus, device, and storage medium for generating entity questions and answers, in order to improve the recall rate of question and answer retrieval.

[0007] In a first aspect, embodiments of this application provide an entity question-and-answer generation method, including:

[0008] Obtain the knowledge file to be processed, and obtain the processable text by parsing the knowledge file;

[0009] Based on the processable text, a bidirectional language representation model is used for semantic segmentation to obtain one or more text blocks to be extracted.

[0010] Based on the one or more text blocks to be extracted, a trained entity question-answering generation model is used to obtain the named entity corresponding to each text block to be extracted, and to obtain the entity question-answering pair corresponding to each named entity;

[0011] Specifically, based on the training text block, training named entities and training question-answer pairs are obtained through prompt word engineering and language big model, and the training named entities and training question-answer pairs are used to train the entity question-answer generation model;

[0012] Based on multiple named entities and multiple entity question-answer pairs, entity question-answer pairs that match the question statement are selected according to the question statement, and the answer statement in the entity question-answer pair is output to complete the entity question-answering process.

[0013] In one possible implementation, the step of performing semantic segmentation using a bidirectional language representation model based on the processable text to obtain one or more text blocks to be extracted includes:

[0014] According to the preset preliminary segmentation rules, the processable text is initially segmented to obtain multiple sentences to be segmented;

[0015] The two adjacent sentences to be segmented are combined into a sentence pair to be segmented, and the semantic relevance information of each sentence pair to be segmented is obtained by the next sentence prediction algorithm in the bidirectional language representation model.

[0016] Traverse all the sentence pairs to be segmented, and determine whether to segment or not segment the two sentences in the sentence pairs to be segmented based on the semantic relevance information, so as to obtain one or more of the text blocks to be extracted.

[0017] In one possible implementation, the entity question-answering generation model employs the Transformers model;

[0018] Based on the one or more text blocks to be extracted, a trained entity question-answering generation model is used to obtain named entities corresponding to each text block to be extracted, and to obtain entity question-answer pairs corresponding to each named entity, including:

[0019] Acquire and read each of the text blocks to be extracted, and identify each named entity in each of the text blocks to be extracted using the Transformers model;

[0020] Based on the named entity, multiple question statements corresponding to the named entity are obtained through the Transformers model, and based on the text block to be extracted, the answer statement corresponding to each question statement is obtained;

[0021] Based on the question statement and the answer statement, obtain the entity question-answer pair corresponding to each named entity.

[0022] In one possible implementation, the step of acquiring the knowledge file to be processed and obtaining processable text by parsing the knowledge file to be processed includes:

[0023] The knowledge file to be processed is obtained according to a preset database or a preset file storage path, and the file type of the knowledge file to be processed is identified by the format tags of the knowledge file to be processed.

[0024] Based on the file type of the knowledge file to be processed, a parser matching the file type is used to obtain the text information of the knowledge file to be processed, so as to obtain the processable text.

[0025] In one possible implementation, the step of obtaining training named entities and training question-answer pairs based on training text blocks through prompt word engineering and a large language model, and using the training named entities and the training question-answer pairs to train the entity question-answer generation model, includes:

[0026] Obtain training text blocks, and determine the prompt word corresponding to each training text block based on the prompt word project;

[0027] Based on the training text blocks and the prompt words, a large language model is used to extract and obtain the training named entities in each training text block;

[0028] Based on the trained named entities and the trained text blocks, a large language model is used to obtain training entity question-answer pairs corresponding to each trained named entity; wherein each trained named entity corresponds to at least one training entity question-answer pair.

[0029] The trained named entities and the trained question-answer pairs are used to train the entity question-answer generation model.

[0030] In one possible implementation, the step of filtering out entity question-and-answer pairs that match the question statement based on a plurality of named entities and a plurality of entity question-and-answer pairs, and outputting the answer statement in the entity question-and-answer pair to complete entity question-and-answer, includes:

[0031] By parsing the question statement, each keyword in the question statement is obtained, and named entities that match the keywords are retrieved, as well as multiple entity question-answer pairs corresponding to the named entities are obtained;

[0032] Based on the question statement and the entity question-answer pair, a trained Siamese network model is used to calculate the similarity between the question statement and the question statement in the entity question-answer pair;

[0033] Based on the similarity between the question statement and each of the question statements, the question statement with the highest similarity to the question statement is selected and obtained, and the answer statement corresponding to the question statement is output to complete the entity question answering.

[0034] In one possible implementation, determining whether to segment or not segment the two sentences in the sentence pair based on the semantic relevance information includes:

[0035] If the semantic relevance score of the sentence pair to be segmented is greater than or equal to a preset threshold, then the two sentences in the sentence pair to be segmented are not segmented; or,

[0036] If the semantic relevance score of the sentence pair to be segmented is less than a preset threshold, then the two sentences in the sentence pair to be segmented are segmented.

[0037] Secondly, embodiments of this application provide an entity question-and-answer generation apparatus, comprising:

[0038] The file acquisition module is used to acquire knowledge files to be processed and to obtain processable text by parsing the knowledge files to be processed.

[0039] The information extraction module is used to perform semantic segmentation based on the processable text using a bidirectional language representation model to obtain one or more text blocks to be extracted.

[0040] The question-answer pair generation module is used to obtain named entities corresponding to each of the one or more text blocks to be extracted, and to obtain entity question-answer pairs corresponding to each named entity, based on the one or more text blocks to be extracted using a trained entity question-answer generation model; wherein, based on the training text blocks, training named entities and training question-answer pairs are obtained through prompt word engineering and language big model, and the training named entities and training question-answer pairs are used to train the entity question-answer generation model;

[0041] The question-and-answer output module is used to filter out entity question-and-answer pairs that match the question statement based on multiple named entities and multiple entity question-and-answer pairs, and output the answer statement in the entity question-and-answer pair to complete the entity question-and-answer process.

[0042] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0043] The memory stores computer-executed instructions;

[0044] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0045] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0046] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0047] This application provides an entity question-answering generation method, apparatus, device, and storage medium. The method quickly obtains processable text by parsing and extracting from a knowledge file, laying the foundation for subsequent processing. A bidirectional language representation model is used for semantic segmentation, making text block extraction more accurate and effectively reducing information loss or misunderstanding. This ensures the semantic integrity and relevance of the extracted text blocks, providing high-quality input for subsequent named entity recognition and question-answering generation. The entity question-answering generation model can automatically identify named entities and their related entity question-answer pairs in the extracted text blocks. This automated process significantly reduces the need for manual intervention and improves processing speed. Simultaneously, by combining prompt word engineering and a large language model, training named entities and training question-answer pairs can be flexibly and comprehensively obtained. This not only improves the training efficiency of the entity question-answering generation model but also enhances its adaptability in different domains. Furthermore, it enriches the knowledge base and improves retrieval recall. Finally, based on the filtering of multiple named entities and question-answer pairs, relevant answer statements can be quickly matched and output according to the question statement. This improves the efficiency of information retrieval for users, making the entity question-and-answer generation process smoother and more intuitive, thus meeting users' immediate needs. Overall, this series of steps not only ensures efficiency and accuracy in knowledge extraction and question-and-answer generation but also enhances the user experience, enabling question-and-answer generation to more effectively handle complex user queries. Attached Figure Description

[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0049] Figure 1 A schematic diagram of an entity question-and-answer generation method provided in this application embodiment;

[0050] Figure 2 This is a schematic flowchart of a method for obtaining processable text provided in an embodiment of this application;

[0051] Figure 3 This is a schematic flowchart of a method for obtaining a text block to be extracted, provided in an embodiment of this application.

[0052] Figure 4 This is a flowchart illustrating a method for determining whether to split two statements to be split, as provided in an embodiment of this application.

[0053] Figure 5 This is a schematic diagram of the method for obtaining named entities and entity question-answer pairs provided in an embodiment of this application;

[0054] Figure 6 This is a flowchart illustrating a method for outputting an answer statement based on a question statement, as provided in an embodiment of this application.

[0055] Figure 7 A schematic diagram of a method for obtaining training named entities and training question-answer pairs for training, provided in an embodiment of this application;

[0056] Figure 8 A timing diagram of the training entity question answering generation model provided in the embodiments of this application;

[0057] Figure 9 A sequence diagram illustrating the application of the entity question-answering generation model provided in this embodiment;

[0058] Figure 10 This is a schematic diagram of the entity question-and-answer generation device provided in the embodiments of this application;

[0059] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0062] 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 used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0063] In existing technologies, the propositionizer approach proposed by Tencent AI Lab in 2023 addresses the problem of resolving pronoun references in text, especially for entities pointed to by pronouns such as "it," "he," and "she." Propositionizer improves information density and semantic completeness by subdividing text into propositions at a finer granularity than sentences and integrating these propositions into text blocks. This method performs well when processing Wikipedia text, ensuring the integrity of the segmented content by utilizing retrieval units of different granularities (such as paragraph blocks, sentence blocks, and proposition blocks). However, this technique relies on text block titles to generate propositions, leading to poor performance in some knowledge documents. This is because each text block in these documents may hide a more granular potential "title," making it difficult to effectively retrieve entity-related content when directly using filenames or main headings for association.

[0064] Another existing technique is the Hypothetical Queries method, which generates hypothetical questions based on a given text block and incorporates these questions along with the corresponding text block into the search results. While this method offers flexibility, its drawback lies in the lack of explicit associations with named entities. This means the generated hypothetical questions may only cover minor or irrelevant parts of the text block, leading to a discrepancy between search results and user needs. Therefore, while these existing techniques provide solutions for question-answering generation, they remain insufficient in terms of targeting and accuracy.

[0065] Based on the aforementioned technical problems and needs, the inventive concept of this application is to provide a question-and-answer generation method to achieve accurate question-and-answer generation. Specifically, firstly, the process involves acquiring and parsing the knowledge file to be processed, extracting the processable text. Next, semantic segmentation is performed using a bidirectional language representation model, dividing the processable text into multiple information-dense text blocks, thereby enhancing the efficiency of information extraction and semantic coherence. When identifying named entities and their corresponding question-and-answer pairs in each text block, a trained entity question-and-answer generation model is employed, resulting in higher accuracy in information extraction. Simultaneously, by combining prompt word engineering with a large language model, training named entities and training question-and-answer pairs can be automatically generated, thereby improving the training efficiency of the entity question-and-answer generation model and reducing manual intervention. This not only reduces the reliance on manual annotation but also enhances the adaptability of the entity question-and-answer generation model in diverse knowledge domains. Finally, based on the question statement, matching entity question-and-answer pairs can be quickly filtered out, and the answer statement can be output. This process ensures that users can quickly obtain the information they need, improving the user experience while also enhancing the practicality and accuracy of the question-and-answer system.

[0066] The entity question-and-answer generation technology presented in this application demonstrates broad applicability across multiple scenarios. Firstly, in academic research, researchers face the need to retrieve and analyze a large volume of literature. This technology can quickly extract key concepts and question-and-answer pairs from complex academic articles, helping researchers efficiently obtain the information they need and improving the speed and accuracy of literature reviews and research analyses. Secondly, in customer support, businesses can leverage this technology to build intelligent customer service systems. By extracting question-and-answer pairs from product manuals and frequently asked questions, customers can receive immediate and accurate answers when inquiring about usage methods or troubleshooting, improving customer satisfaction and reducing the burden on human customer service representatives.

[0067] Furthermore, in the education sector, teachers can use this method to quickly generate Q&As related to teaching content to support classroom instruction; students, on the other hand, can gain deeper understanding and supplement their knowledge through questioning during self-study, thereby enhancing learning outcomes. In the medical field, doctors and patients can utilize this technology to improve the efficiency of information retrieval. When consulting medical literature, doctors can quickly obtain Q&As related to specific diseases or treatments; while patients can receive accurate health advice when inquiring about disease information. In summary, this application not only improves the efficiency and accuracy of information retrieval but also provides strong support for users in various industries.

[0068] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0069] Figure 1 This is a schematic diagram of an entity question-and-answer generation method provided in an embodiment of this application. Figure 1 As shown, it includes:

[0070] S11: Obtain the knowledge file to be processed, and obtain the processable text by parsing the knowledge file.

[0071] In this embodiment, the knowledge files to be processed are first acquired. These files can come from various information sources, such as academic papers, technical specifications, product manuals, and industry standards. These knowledge files typically exist in multiple formats, such as PDF, Word documents, HTML, or plain text, and have rich content and structure. To fully utilize this information, these files first need to be parsed to extract the processable text. The core of the parsing process lies in applying text parsing tools or libraries to ensure accurate text extraction from different formats. For example, for PDF files, the PyPDF2 or pdf plumber libraries in Python can be used. These libraries can handle complex PDF structures, extract text, and retain certain formatting information. For Word documents, the python-docx library can be used, which provides functions for reading and writing Word documents, facilitating text content extraction. Furthermore, for HTML files, the Beautiful Soup library can be used, which can parse web page documents and extract the required information. During the parsing process, redundant whitespace characters, line breaks, and special characters need to be removed to improve the quality and readability of the extracted text. This ensures the cleanliness of the text content, which is helpful for subsequent semantic analysis and processing. The acquired, processable text must not only have a good format but also ensure the accuracy and completeness of the information. Through this process, the final text data will provide a solid foundation for subsequent semantic segmentation and named entity recognition. High-quality input data enhances the understanding and processing capabilities of textual knowledge, enabling more accurate extraction of relevant information from a rich knowledge base to meet user query needs.

[0072] S12, based on the processable text, use a bidirectional language representation model to perform semantic segmentation and obtain one or more text blocks to be extracted.

[0073] In this embodiment, a bidirectional language representation model is used for semantic segmentation based on the acquired processable text. The bidirectional language representation model is a deep learning model that achieves more accurate semantic understanding by simultaneously considering contextual information within the text sequence. This model aims to capture complex relationships and dependencies in text, improving the accuracy of text segmentation and enabling it to effectively handle diverse language structures and expressions. Before semantic segmentation, the processable text needs to be preprocessed. This stage includes removing irrelevant information and noise to ensure the quality of the input data. For example, removing punctuation marks, invalid whitespace characters, and content unrelated to the topic can effectively improve the model's sensitivity to semantics. Next, its deep neural network structure is used to compute on the preprocessed text to identify semantic boundaries within the text. This process utilizes a self-attention mechanism, enabling the model to dynamically focus on the relevance of various parts of the text, thereby segmenting the text more accurately.

[0074] In this way, text is divided into one or more semantically independent text blocks with clear themes. This not only facilitates subsequent processing and analysis but also provides high-quality input for later steps. In the named entity recognition and entity question-answering generation stages, these segmented text blocks improve information focus, ensuring more accurate extraction of named entities and their related question-answer pairs. Furthermore, this method excels in capturing multi-level semantic relationships and handling complex linguistic phenomena such as synonyms and contextual dependencies, thereby enhancing the effectiveness and accuracy of the question-answering system in practical applications. In summary, semantic segmentation based on a bidirectional language representation model not only improves the semantic integrity of text blocks but also lays the foundation for subsequent entity recognition and question-answering generation.

[0075] S13, based on one or more text blocks to be extracted, use a trained entity question answering generation model to obtain the named entity corresponding to each text block to be extracted, and obtain the entity question answering pair corresponding to each named entity; wherein, based on the training text block, through prompt word engineering and language big model, obtain the training named entity and training question answering pair, and use the training named entity and training question answering pair to train the entity question answering generation model.

[0076] In this embodiment, the entity question-answering generation model utilizes the knowledge accumulated during training to analyze the input text. One of the core functions of the entity question-answering generation model is to identify named entities in the text, such as names, locations, dates, and organizations, and then construct an entity set. This process relies on the labeled data used during training, which provides the basis for identifying and classifying different types of entities, improving the accuracy and comprehensiveness of entity recognition. In this stage, the entity question-answering generation model not only focuses on the identification of individual entities but also considers contextual information to improve the recall and precision of named entities. After identifying named entities, the next step is to obtain entity question-answer pairs related to each named entity. These entity question-answer pairs include the question statement posed for a specific named entity and its corresponding answer statement, ensuring that the generated question-answer pairs are relevant to the content of the text block. The entity question-answering generation model utilizes its understanding of contextual information in this process to ensure that the generated questions reflect the text content, thereby providing valuable answers. The generation of entity question-answer pairs is not limited to information directly related to the named entity but may also cover the entity's background, attributes, and associated information to provide richer answers. This structured question-answering format improves the accessibility of information. In summary, the efficiency and accuracy of this process not only enhance the understanding of knowledge documents but also improve the efficiency of information retrieval for end users, ensuring that users can quickly find the answers and relevant information they need, thereby improving the user experience and better meeting user needs.

[0077] Furthermore, through the application of cue word engineering and a large-scale language model, training named entities and training question-answer pairs are obtained from training text blocks to ensure the efficiency and accuracy of knowledge extraction and question-answer generation. First, cue word engineering aims to optimize the information generation process of the large-scale language model through appropriate cue words or input instructions. Based on specific task requirements, corresponding cue words are obtained to guide the large-scale language model to better understand and process the information in the training text blocks. This helps the large-scale language model focus on relevant context, thereby improving the effectiveness of information extraction. Next, the training text blocks are input into the large-scale language model. This model possesses powerful context processing capabilities and can understand complex semantic structures. Upon receiving the input, it identifies named entities, such as person names, place names, and organization names, and generates training question-answer pairs related to these entities. These question-answer pairs not only include basic entity information but also cover background knowledge and contextual details related to the entities to enhance the richness and accuracy of the questions and answers.

[0078] The obtained trained named entities and training question-answer pairs will then be integrated to train the entity question-answering generation model. For example, reinforcement learning or supervised learning is employed in this process to ensure accurate identification and generation of relevant entities and their question-answer content. By using a large amount of training data, the parameters of the entity question-answering generation model will be continuously optimized to improve its adaptability and response efficiency to real-world application scenarios, ultimately achieving higher recall and accuracy. Therefore, through the above steps, the trained entity question-answering generation model possesses high accuracy and reliability, enabling it to respond quickly and accurately to user queries in practical applications.

[0079] S14: Based on multiple named entities and multiple entity question-answer pairs, filter out entity question-answer pairs that match the question statement according to the question statement, and output the answer statement in the entity question-answer pair to complete the entity question-answering.

[0080] In this embodiment, a user's question is received and preprocessed. For example, preprocessing includes word segmentation, removal of stop words and punctuation marks to ensure a clear structure of the question content, facilitating subsequent matching analysis. Next, the question is compared with stored named entities and entity-answer pairs. The relevance between the question and each entity-answer pair is analyzed. During the matching process, entity-answer pairs with the closest semantics to the question are prioritized. These pairs must not only include the named entities in the question but also ensure consistency in the contextual logic. This method filters out the entity-answer pairs that best match the question, ensuring accurate and relevant output information. Finally, the filtered entity-answer pairs are extracted, and answer statements are output from them. The aim is to present the filtered information to the user in a clear and concise form, ensuring that the user can quickly obtain the required answer. This ensures the accuracy and relevance of the answer, further improving user experience and information retrieval efficiency. Through these steps, not only can efficient responses to user questions be achieved, but knowledge retrieval capabilities are also enhanced, ultimately providing users with accurate and timely information services.

[0081] The technical solution provided in this application, by acquiring and parsing the knowledge file to be processed, can effectively extract processable text, laying a solid foundation for subsequent semantic analysis. Next, a bidirectional language representation model is used for semantic segmentation, understanding the text at a finer granular level and obtaining the text blocks to be extracted. This method optimizes the structuring of information, enhances the depth of semantic understanding, and can handle complex language expressions. In the process of acquiring named entities and entity question-answer pairs, a trained entity question-answer generation model is used to improve accuracy and efficiency. Combining prompt word engineering and training of a large language model makes the generated question-answer pairs more accurate and tailored to user needs, thereby improving user satisfaction and system reliability. Retrieval and matching based on multiple named entities and entity question-answer pairs ensures that user questions are answered. Overall, through the above technical solution, not only can user questions be responded to quickly, but the retrieval recall rate can also be effectively improved, avoiding information loss due to differences in expression. Improving the response quality and efficiency of question answering provides users with a more flexible and user-friendly information acquisition experience.

[0082] In one embodiment, Figure 2 This is a schematic flowchart illustrating a method for obtaining processable text according to an embodiment of this application. It further explains the process of obtaining processable text by parsing the knowledge file to be processed in step S11 above. Figure 2 As shown, based on the above embodiments, it includes:

[0083] S21, obtain the knowledge file to be processed according to the preset database or preset file storage path, and identify the file type of the knowledge file to be processed by the format tag of the knowledge file to be processed.

[0084] S22, based on the file type of the knowledge file to be processed, a parser matching the file type is used to obtain the text information of the knowledge file to be processed, so as to obtain the processable text.

[0085] In this embodiment, the knowledge file to be processed is obtained according to a preset database or file storage path. This process is implemented through a file system access mechanism to ensure that the required knowledge file can be quickly located and loaded. This may include various documents, such as academic papers, technical specifications, product manuals, etc. After obtaining the knowledge file to be processed, the file type is identified by the file's format tags. This involves parsing the file's metadata, which contains information about the file type, creation date, modification date, and other attributes. Based on the identified file type, a parser matching that type is used to obtain the text information in the knowledge file to be processed. Each file format has its specific parsing rules and methods, and the parser is responsible for converting the file content into structured, processable text. For example, for PDF files, Optical Character Recognition (OCR) technology may be used to ensure that text is extracted from the image; for Word documents, their structured content can be read directly. During this process, the parser comprehensively scans the content of the file and extracts usable text information. After cleaning and organizing this information, the final processable text will be formed for subsequent knowledge analysis and question-answer generation. This approach not only enhances compatibility and processing capabilities across various file formats but also ensures efficient extraction of knowledge and information, laying the foundation for accurate question-and-answer responses and faster response times.

[0086] In one embodiment, Figure 3 This is a schematic flowchart illustrating a method for obtaining a text block to be extracted, provided in an embodiment of this application. It specifically describes one implementation of the semantic segmentation using a bidirectional language representation model in step S12 to obtain the text block to be extracted. Figure 3 As shown, based on the above embodiments, it includes:

[0087] S31, According to the preset preliminary segmentation rules, perform preliminary segmentation on the processable text to obtain multiple sentences to be segmented;

[0088] S32, two adjacent sentences to be segmented are combined into a sentence pair to be segmented, and the semantic relevance information of each sentence pair to be segmented is obtained through the next sentence prediction algorithm in the bidirectional language representation model;

[0089] S33, iterate through all sentence pairs to be segmented, and determine whether to segment or not segment the two sentences in the sentence pair to be segmented based on semantic relevance information, so as to obtain one or more text blocks to be extracted.

[0090] In this embodiment, the processable text is initially segmented according to preset preliminary segmentation rules to obtain multiple sentences to be segmented. For example, preliminary segmentation rules typically involve punctuation, syntactic structure, and common linguistic features, ensuring high accuracy when processing various types of text and aiming to ensure logical clarity and information coherence in text blocks. These preliminary segmentation rules effectively divide long texts into multiple independent sentences or phrases, laying the foundation for subsequent semantic analysis. After obtaining multiple sentences to be segmented, adjacent sentences are combined into sentence pairs. At this point, the Next Sentence Prediction (NSP) algorithm from the bidirectional language representation model is applied to analyze the semantic relevance between these two sentences. The NSP algorithm analyzes the contextual relationship between two sentences to determine if they are semantically closely related. All sentence pairs are traversed, and the relevance of each pair is analyzed. Then, it is determined whether to segment. If the two sentences are highly related, indicating they are semantically close, segmentation is not performed to maintain coherence; otherwise, segmentation occurs, breaking them down into independent text blocks to be extracted. Ultimately, one or more text blocks are obtained, which not only possess a clear semantic structure but also ensure the independence and integrity of the information. These text blocks will provide the foundational data for subsequent named entity recognition and question-answering generation, improving the accuracy and efficiency in processing and understanding knowledge.

[0091] In one specific embodiment, Figure 4 This is a flowchart illustrating a method for determining whether to segment two sentences in a sentence pair according to an embodiment of this application. It is an exemplary description of one implementation of determining whether to segment or not segment two sentences in a sentence pair based on semantic relevance information. Figure 4 As shown, based on the above embodiments, it includes:

[0092] S41. If the semantic relevance score of the sentence pair to be segmented is greater than or equal to the preset threshold, then the two sentences in the sentence pair to be segmented will not be segmented.

[0093] S42, if the semantic relevance score of the sentence pair to be segmented is less than the preset threshold, then the two sentences in the sentence pair to be segmented are segmented.

[0094] In this embodiment, it is necessary to determine whether to segment the two sentences in a pair of sentences to be segmented. This decision is based on a calculated semantic relevance score, which reflects the degree of semantic association between the sentence pair. To ensure the accuracy of the processing, a preset threshold is set as the basis for segmentation. Specifically, when the semantic relevance score of the sentence pair to be segmented is greater than or equal to the preset threshold, the two sentences will not be segmented. This indicates that the two sentences have a strong semantic association and may jointly express a complete concept or information. In this case, preserving their integrity can better maintain the coherence of information and avoid causing a break in understanding. Conversely, if the semantic relevance score of the sentence pair to be segmented is less than the preset threshold, the two sentences will be segmented. This usually means that the two sentences are relatively independent semantically and lack the necessary association. Segmentation helps to extract their respective meanings and information more clearly. After segmentation, one or more text blocks to be extracted will be generated. These text blocks can better reflect independent semantic content, facilitating subsequent processing and analysis. Through this segmentation decision mechanism based on semantic relevance score, the flexibility and accuracy of text processing can be effectively improved, ensuring that the final generated text blocks can better serve subsequent knowledge extraction and question-answering generation. This method not only improves the quality of information but also enhances the ability to process complex text, making it more efficient in diverse application scenarios.

[0095] In one embodiment, the entity question-answering generation model uses the Transformers model.

[0096] In this embodiment, the Transformers model effectively captures the relationships between words in the input text through a self-attention mechanism, without relying on traditional sequence processing methods. This mechanism allows the model to consider all words in a sentence simultaneously, thus gaining a more comprehensive grasp of contextual information when understanding semantics. By weighting each word in the sentence, the Transformers model can focus on the part most relevant to the current word, improving the accuracy of information extraction. Specifically, in the entity question-answering generation process, the Transformers model first encodes the input text, transforming it into a set of high-dimensional vectors. These vectors not only preserve the semantic information of the words but also reflect the position and role of the words in the context. Subsequently, based on the parameters learned during training, named entities in the text are identified, and question-answer pairs related to these entities are generated.

[0097] Furthermore, the scalability of Transformers models enables them to handle large-scale datasets, supporting extensive pre-training and fine-tuning. During pre-training, models typically utilize massive amounts of text data for self-supervised learning to capture fundamental language rules and structural features. In the subsequent fine-tuning phase, targeted training can be performed for specific tasks (such as entity recognition and question-answering generation) to improve performance in specific scenarios. By employing Transformers models, not only is the ability to handle complex language structures enhanced, but the responsiveness to diverse queries is also improved. This choice ensures flexibility and efficiency in practical applications, ultimately providing users with accurate and timely information feedback.

[0098] Furthermore, Figure 5 This is a schematic flowchart illustrating a method for obtaining named entities and entity question-answer pairs provided in an embodiment of this application. It describes one implementation of step S13 described above. Figure 5 As shown, based on the above embodiments, it includes:

[0099] S51, Obtain the text block to be extracted, and identify each named entity in each text block to be extracted using the Transformers model;

[0100] S52, based on the named entities, obtain multiple question statements corresponding to the named entities through the Transformers model, and based on the text block to be extracted, obtain the answer statement corresponding to each question statement;

[0101] S53, based on the question statement and the answer statement, obtain the entity question-answer pair corresponding to each named entity.

[0102] In this embodiment, the text blocks to be extracted are first obtained. Next, the Transformers model is used to analyze each text block to identify named entities. This process involves the Transformers model's understanding of text, enabling it to identify various types of named entities, such as names of people, places, organizations, and dates. The Transformers model, through its self-attention mechanism, considers contextual information to improve the accuracy and comprehensiveness of named entity recognition. After identifying the named entities, the Transformers model is used to generate multiple question statements corresponding to each named entity. This process aims to construct diverse questions related to the named entities for subsequent question-and-answer generation. Simultaneously, answer statements corresponding to each question statement are obtained based on the content of the text blocks to be extracted. This step ensures that each question not only has a clear answer but also covers background information related to the named entity. Finally, based on the obtained question and answer statements, entity question-and-answer pairs are formed for each named entity. These entity question-and-answer pairs, consisting of questions and answers, aim to provide users with rich information and background knowledge about the named entities. Through this series of steps, the Transformers model not only improves the efficiency and accuracy of named entity recognition, but also enhances the quality of question-answering generation, enabling faster and more accurate responses to user queries in practical applications, thereby optimizing the user experience.

[0103] In one embodiment, Figure 6 This is a flowchart illustrating a method for outputting an answer statement based on a question statement, as provided in an embodiment of this application. It specifically explains the implementation of entity question answering in step S14 above. Figure 6 As shown, based on the above embodiments, it includes:

[0104] S61, by parsing the question statement, obtain each keyword in the question statement, query and obtain the named entity that matches the keyword, and obtain multiple entity question-answer pairs corresponding to the named entity;

[0105] S62, Based on the question statement and the entity question-answer pair, use the trained Siamese network model to calculate the similarity between the question statement and the question statement in the entity question-answer pair;

[0106] S63. Based on the similarity between the question statement and each question statement, filter and obtain the question statement with the highest similarity to the question statement, and output the answer statement corresponding to the question statement to complete the entity question answering.

[0107] In this embodiment, keywords are extracted from the query statement by parsing it. Keywords are words in the query statement that contain important information and meaning, and usually reflect the user's main concerns. Through natural language processing of the query statement, these keywords can be efficiently identified and extracted, laying the foundation for subsequent named entity matching. Next, these keywords are used to query matching named entities. This process relies on a pre-established knowledge base that stores a large number of named entities and their related information. By matching keywords, named entities related to the question can be quickly located, such as names of people, places, and products. These named entities provide key information for subsequent question-and-answer generation. Next, multiple corresponding entity-question-answer pairs are obtained for the identified named entities. These question-and-answer pairs cover various information related to the named entities, ensuring that the user's query needs are fully met. Each named entity may correspond to multiple questions and answers, thus providing users with more choices and richer responses.

[0108] After obtaining the question statement and entity question-answer pairs, a trained Siamese network model is used to calculate the similarity between the question statement and the question statement. A Siamese network is a deep learning model that outputs a similarity score by comparing the similarity of two inputs. The question statement is compared with the question statements in each entity question-answer pair. Leveraging the characteristics of the Siamese network model, the similarity between them is analyzed to determine which question statement best matches the user's question. Finally, based on the similarity between the question statement and each question statement, the question statement with the highest similarity is selected, and its corresponding answer statement is output. This method achieves accurate entity question answering, ensuring users receive relevant and efficient feedback. This not only improves the accuracy and efficiency of question answering but also optimizes the user experience.

[0109] Figure 7 This is a flowchart illustrating a method for obtaining and training named entities and training question-answer pairs for training, as provided in an embodiment of this application. It describes the acquisition of training data for the entity question-answering generation model in step S13 above, and provides a specific implementation method. For example... Figure 7 As shown, based on the above embodiments, it includes:

[0110] S71, Obtain training text blocks and determine the prompt words corresponding to each training text block based on the prompt word engineering;

[0111] S72, based on the training text blocks and prompt words, a large language model is used to extract and obtain the training named entities in each training text block;

[0112] S73, Based on the training named entities and training text blocks, a large language model is used to obtain training entity question-answer pairs corresponding to each training named entity; wherein, each training named entity corresponds to at least one training entity question-answer pair;

[0113] S74 uses trained named entities and trained question-answer pairs to train the entity question-answer generation model.

[0114] In this embodiment, training text blocks are acquired as the foundational data for subsequent processing. Next, cue words are determined for each training text block based on cue word engineering. Cue word engineering is a technique that uses specific words or phrases to guide the model to focus on key content. These cue words not only help the model better understand the topic and context of the text block but also improve the accuracy of subsequent entity extraction. By analyzing the semantic features and topic of the training text blocks, relevant cue words are formulated, making the model more efficient in processing. Once the cue words are determined, a large language model is used to extract named entities based on the training text blocks and the cue words. The powerful capabilities of the large language model enable it to deeply understand the semantic relationships and contextual information in the text. By parsing the training text blocks, it can accurately identify named entities such as names of people, places, and organizations. The named entities in each training text block are validated to ensure the accuracy and completeness of their extraction.

[0115] After extracting the training named entities, a large language model is further used to obtain training entity question-answer pairs corresponding to each named entity. This process ensures that each training named entity corresponds to at least one training entity question-answer pair, thereby enriching the model's training data. By combining contextual information and entity features, diverse questions and corresponding answers are generated, ensuring the relevance and practicality of the question-answer pairs. Finally, the extracted training named entities and their corresponding training question-answer pairs are integrated to train the entity question-answer generation model. This training process aims to improve the entity question-answer generation model's ability to recognize entities and generate questions and answers by adjusting its parameters. In this way, not only is the structured representation of knowledge optimized, but it also ensures that efficient and accurate question-answering services can be provided in practical applications. Ultimately, the trained entity question-answer generation model has the ability to handle complex queries, meeting users' needs for knowledge retrieval.

[0116] It should be noted that the acquisition of training text blocks and the acquisition of text to be extracted are the same: both involve parsing knowledge files to obtain processable text, followed by using a bidirectional language representation model to perform semantic segmentation on the processable text, thereby obtaining one or more training text blocks. The method for obtaining text blocks to be extracted has been explained in previous embodiments and will not be repeated here.

[0117] For example, Figure 8This is a timing diagram of the training entity question-answering generation model provided in an embodiment of this application. Figure 8 As shown in the sequence diagram, this diagram illustrates the interaction flow between the training-driven module, the semantic segmentation module, the question-answer pair acquisition module, and the entity question-answer generation module. The training-driven module is set up during the training process to drive the execution of each stage. The following is a description of each step:

[0118] 1.0 Loading Knowledge Files: The training-driven module first loads the knowledge files, which is the starting point of the entire process.

[0119] 1.1 Sending Knowledge Files: The knowledge files are sent to the semantic segmentation module for further processing.

[0120] 1.2 Semantic Segmentation: After receiving the knowledge file, the semantic segmentation module performs semantic segmentation processing, dividing the text content into semantic units. It should be noted that semantic segmentation is the main step, but it also involves the file parsing, preliminary segmentation, and preprocessing steps listed in the above embodiments. Since these have already been described in the embodiments, they will not be repeated here.

[0121] 1.3 Return Results: The semantic segmentation results are returned to the training-driven module.

[0122] 1.4 Constructing prompt words: Based on the results of semantic segmentation, the training-driven module constructs prompt words.

[0123] 1.5 Sending Prompts: The constructed prompts are sent to the training question-answer pair acquisition module.

[0124] 1.6 Extracting Question-Answer Pairs: The question-answer pair acquisition module extracts relevant question-answer pairs based on prompt words.

[0125] 1.7 Return Results: The extracted question-answer pairs are returned to the training-driven module.

[0126] 1.8 Start Training (Send Training Corpus): The training-driven module uses the extracted question-answer pairs to start the training process and sends the training corpus to the entity question-answer generation module.

[0127] 1.9 Training: The entity question-answering generation module performs the training task.

[0128] 1.10 Return Results: The final training results are returned to the training-driven module, and the process is complete.

[0129] This sequence diagram illustrates the entire process from loading knowledge files, semantic segmentation, constructing prompt words, extracting question-answer pairs, to the training task. The interactions between these steps are achieved through message passing, thereby driving the smooth progress of the entire process.

[0130] further, Figure 9A timing diagram for the application of the entity question-answering generation model provided in the embodiments of this application.

[0131] This sequence diagram illustrates the interaction flow between the reasoning-driven module, the semantic segmentation module, and the entity question-answering generation module. The following is a detailed explanation:

[0132] 1.0 Loading Knowledge Files: The reasoning-driven module first loads the knowledge files.

[0133] 1.1 Sending Knowledge Files: The reasoning-driven module sends the loaded knowledge files to the semantic segmentation module.

[0134] 1.2 Semantic Segmentation: After receiving the knowledge file, the semantic segmentation module performs semantic segmentation processing to divide the text into semantic blocks.

[0135] 1.3 Return Results: The semantic segmentation module returns the processing results to the inference-driven module.

[0136] 1.4 Inference Semantic Text Block: The inference-driven module sends the semantic text block to the entity question-answering generation module.

[0137] 1.5 Reasoning: The entity question-answering generation module performs relevant reasoning tasks based on the received reasoning requests.

[0138] 1.6 Return Results: The entity question-answering generation module returns the reasoning results to the reasoning-driven module, and the entire process ends.

[0139] This process demonstrates the entire process from loading knowledge files and semantic segmentation to reasoning tasks, with each module completing the entire reasoning operation through message passing.

[0140] Figure 10 This is a schematic diagram of the entity question-and-answer generation device provided in an embodiment of this application. Figure 10 As shown, the entity question-and-answer generation device 10 includes:

[0141] The file acquisition module 101 is used to acquire the knowledge file to be processed and to obtain the processable text by parsing the knowledge file to be processed.

[0142] The information extraction module 102 is used to perform semantic segmentation based on the processable text using a bidirectional language representation model to obtain one or more text blocks to be extracted.

[0143] The question-answer pair generation module 103 is used to obtain the named entities corresponding to each text block to be extracted and the entity question-answer pairs corresponding to each named entity based on one or more text blocks to be extracted using a trained entity question-answer generation model; wherein, based on the training text blocks, training named entities and training question-answer pairs are obtained through prompt word engineering and language big model, and the training named entities and training question-answer pairs are used to train the entity question-answer generation model.

[0144] The question-and-answer output module 104 is used to filter out entity question-and-answer pairs that match the question statement based on multiple named entities and multiple entity question-and-answer pairs, and output the answer statement in the entity question-and-answer pair to complete the entity question-and-answer process.

[0145] The entity question-and-answer generation device provided in this embodiment can execute the entity question-and-answer generation method of the above embodiment. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.

[0146] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 11 As shown, the electronic device 11 includes at least one processor 111 and a memory 112. The electronic device 11 also includes a communication component 113. The processor 111, the memory 112, and the communication component 113 are connected via a bus 114.

[0147] In the specific implementation process, at least one processor 111 executes computer execution instructions stored in memory 112, causing at least one processor 111 to execute the entity question-and-answer generation method executed on the electronic device side as described above.

[0148] The specific implementation process of processor 111 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0149] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0150] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.

[0151] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0152] The above description of the functions implemented by electronic devices and main control devices has introduced the solutions provided by the embodiments of the present invention. It is understood that, in order to implement the above functions, the electronic device or main control device includes hardware structures and / or software modules corresponding to the execution of each function. By combining the units and algorithm steps of the various examples described in the embodiments of the present invention, the embodiments of the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the present invention.

[0153] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above method.

[0154] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0155] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in an electronic device or a host device.

[0156] This application also provides a computer program product, comprising: a computer program stored in a readable storage medium, wherein at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the scheme provided in any of the above embodiments.

[0157] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0158] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

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

[0160] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0161] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0163] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0164] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as these combinations of technical features do not contradict each other, they should be considered within the scope of this specification.

[0165] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0166] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for generating entity question answers, characterized in that, include: Obtain the knowledge file to be processed, and obtain the processable text by parsing the knowledge file; Based on the processable text, a bidirectional language representation model is used for semantic segmentation to obtain one or more text blocks to be extracted. Based on the one or more text blocks to be extracted, a trained entity question-answering generation model is used to obtain the named entity corresponding to each text block to be extracted, and to obtain the entity question-answering pair corresponding to each named entity; Specifically, based on the training text block, training named entities and training question-answer pairs are obtained through prompt word engineering and language big model, and the training named entities and training question-answer pairs are used to train the entity question-answer generation model; Based on multiple named entities and multiple entity question-answer pairs, entity question-answer pairs that match the question statement are selected according to the question statement, and the answer statement in the entity question-answer pair is output to complete the entity question-answering process.

2. The method according to claim 1, characterized in that, The step of performing semantic segmentation using a bidirectional language representation model based on the processable text to obtain one or more text blocks to be extracted includes: According to the preset preliminary segmentation rules, the processable text is initially segmented to obtain multiple sentences to be segmented; The two adjacent sentences to be segmented are combined into a sentence pair to be segmented, and the semantic relevance information of each sentence pair to be segmented is obtained by the next sentence prediction algorithm in the bidirectional language representation model. Traverse all the sentence pairs to be segmented, and determine whether to segment or not segment the two sentences in the sentence pairs to be segmented based on the semantic relevance information, so as to obtain one or more of the text blocks to be extracted.

3. The method according to claim 1, characterized in that, The entity question-answering generation model adopts the Transformers model; Based on the one or more text blocks to be extracted, a trained entity question-answering generation model is used to obtain named entities corresponding to each text block to be extracted, and to obtain entity question-answer pairs corresponding to each named entity, including: Acquire and read each of the text blocks to be extracted, and identify each named entity in each of the text blocks to be extracted using the Transformers model; Based on the named entity, multiple question statements corresponding to the named entity are obtained through the Transformers model, and based on the text block to be extracted, the answer statement corresponding to each question statement is obtained; Based on the question statement and the answer statement, obtain the entity question-answer pair corresponding to each named entity.

4. The method according to claim 1, characterized in that, The process of acquiring the knowledge file to be processed and obtaining the processable text by parsing the knowledge file includes: The knowledge file to be processed is obtained according to a preset database or a preset file storage path, and the file type of the knowledge file to be processed is identified by the format tags of the knowledge file to be processed. Based on the file type of the knowledge file to be processed, a parser matching the file type is used to obtain the text information of the knowledge file to be processed, so as to obtain the processable text.

5. The method according to any one of claims 1-4, characterized in that, The step of obtaining training named entities and training question-answer pairs based on training text blocks through prompt word engineering and a large language model, and using the training named entities and training question-answer pairs to train the entity question-answer generation model includes: Obtain training text blocks, and determine the prompt word corresponding to each training text block based on the prompt word project; Based on the training text blocks and the prompt words, a large language model is used to extract and obtain the training named entities in each training text block; Based on the trained named entities and the trained text blocks, a large language model is used to obtain training entity question-answer pairs corresponding to each trained named entity; wherein each trained named entity corresponds to at least one training entity question-answer pair. The trained named entities and the trained question-answer pairs are used to train the entity question-answer generation model.

6. The method according to claim 1 or 3, characterized in that, The process of using multiple named entities and multiple entity question-answer pairs to filter out entity question-answer pairs that match the question statement, and outputting the answer statement from the entity question-answer pair, thereby completing entity question answering, includes: By parsing the question statement, each keyword in the question statement is obtained, and named entities that match the keywords are retrieved, as well as multiple entity question-answer pairs corresponding to the named entities are obtained; Based on the question statement and the entity question-answer pair, a trained Siamese network model is used to calculate the similarity between the question statement and the question statement in the entity question-answer pair; Based on the similarity between the question statement and each of the question statements, the question statement with the highest similarity to the question statement is selected and obtained, and the answer statement corresponding to the question statement is output to complete the entity question answering.

7. The method according to claim 2, characterized in that, The step of determining whether to segment or not segment the two sentences in the sentence pair to be segmented based on the semantic relevance information includes: If the semantic relevance score of the sentence pair to be segmented is greater than or equal to a preset threshold, then the two sentences in the sentence pair to be segmented are not segmented; or, If the semantic relevance score of the sentence pair to be segmented is less than a preset threshold, then the two sentences in the sentence pair to be segmented are segmented.

8. An entity question-and-answer generation device, characterized in that, include: The file acquisition module is used to acquire knowledge files to be processed and to obtain processable text by parsing the knowledge files to be processed. The information extraction module is used to perform semantic segmentation based on the processable text using a bidirectional language representation model to obtain one or more text blocks to be extracted. The question-answer pair generation module is used to obtain named entities corresponding to each of the one or more text blocks to be extracted, and to obtain entity question-answer pairs corresponding to each named entity, based on the one or more text blocks to be extracted using a trained entity question-answer generation model; wherein, based on the training text blocks, training named entities and training question-answer pairs are obtained through prompt word engineering and language big model, and the training named entities and training question-answer pairs are used to train the entity question-answer generation model; The question-and-answer output module is used to filter out entity question-and-answer pairs that match the question statement based on multiple named entities and multiple entity question-and-answer pairs, and output the answer statement in the entity question-and-answer pair to complete the entity question-and-answer process.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.