Method and device for constructing knowledge base
By using the method and device for constructing a knowledge base, the directory structure and knowledge base are generated using the pre-set knowledge source configuration and architecture information, which solves the problem that traditional knowledge base construction requires a lot of manpower and realizes efficient and low-cost knowledge base construction and maintenance.
Patent Information
- Application Number
- CN202510891607.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-26
AI Technical Summary
The construction of traditional knowledge bases requires a large number of professionals, which results in the inability to effectively accumulate and flow professional knowledge and the lack of efficient knowledge base construction methods.
By presetting the knowledge source configuration information and predefined knowledge system structure information, constructing the directory structure of the knowledge base, and determining the prompt information corresponding to each level of directory, the knowledge base is generated using a large model.
It improves the efficiency of knowledge base construction, simplifies operation and maintenance, saves labor costs, ensures the accuracy and maintainability of the knowledge base, and supports the independent knowledge accumulation of institutions.
Smart Images

Figure CN120706523A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, and in particular to the field of smart healthcare, and specifically to a method and apparatus for constructing a knowledge base. Background Art
[0002] Knowledge bases are an important foundation for the field of artificial intelligence. Especially in the field of smart healthcare, medical knowledge bases are an important source for medical workers to obtain the latest medical information, treatment plans, and research progress.
[0003] The construction of traditional knowledge bases involves the input of a large number of professionals. However, these professionals do not have much time to devote to knowledge base construction, which also results in the inability of professional knowledge to be effectively accumulated or circulated within the organization. Summary of the Invention
[0004] The present disclosure provides a method, apparatus, device, storage medium, and computer program product for constructing a knowledge base.
[0005] According to a first aspect of the present disclosure, a method for constructing a knowledge base is provided, comprising: determining target materials originating from a knowledge source from knowledge base materials based on configuration information of the knowledge source; constructing a directory structure of the knowledge base based on predefined knowledge system architecture information, and determining prompt information corresponding to each level of the directory structure; and generating a knowledge base according to the directory structure based on the target materials and the prompt information.
[0006] According to the second aspect of the present disclosure, a configuration unit is provided, which is configured to determine target materials originating from a knowledge source from knowledge base materials based on configuration information of the knowledge source; a construction unit is configured to construct a directory structure of the knowledge base based on predefined knowledge system structure information, and determine prompt information corresponding to each level of directory in the directory structure; and a generation unit is configured to generate a knowledge base according to the directory structure based on the target materials and the prompt information.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods described in the first aspect.
[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to the first aspect.
[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements any one of the methods according to the first aspect when executed by a processor.
[0010] The disclosed embodiments provide a method and apparatus for constructing a knowledge base. This method uses pre-set knowledge source configuration information to determine target material. It then constructs the knowledge base's directory structure using pre-defined knowledge system architecture information and determines the corresponding prompt information for each level of the directory structure. Finally, the knowledge base is generated according to the directory structure based on the target material and prompt information. This improves knowledge base construction efficiency and facilitates independent knowledge accumulation within an organization.
[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure. Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied; Figure 2 is a flowchart of an embodiment of a method for building a knowledge base according to the present disclosure; Figure 3 is a schematic diagram of an application scenario of the method for building a knowledge base according to the present disclosure; Figure 4 is a flowchart of another embodiment of a method for building a knowledge base according to the present disclosure; Figure 5 is a schematic structural diagram of an embodiment of an apparatus for building a knowledge base according to the present disclosure; Figure 6 It is a schematic diagram of the structure of a computer system of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0013] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0014] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the method for building a knowledge base or the apparatus for building a knowledge base disclosed herein can be applied.
[0015] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0016] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as large model applications, 3D video players, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0017] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with display screens and support knowledge base browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, laptop computers, and desktop computers, etc. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, to provide distributed services), or they can be implemented as a single software or software module. No specific limitation is made here.
[0018] Server 105 can be a server that provides various services, such as a backend knowledge base server that supports the knowledge base displayed on terminal devices 101, 102, and 103. Users can log in to the platform provided by the server through terminal devices 101, 102, and 103 and perform graphical editing to configure information related to the knowledge base, such as configuration information for material acquisition methods, knowledge sources, knowledge architecture information, and prompt information. The server generates the knowledge base based on this configuration information. The knowledge base can be stored on the server for use in large models or returned to terminal devices 101, 102, and 103.
[0019] It should be noted that a server can be either hardware or software. When a server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers or as a single server. When a server is software, it can be implemented as multiple software programs or software modules (for example, multiple software programs or software modules used to provide distributed services) or as a single software program or software module. This is not specifically limited here. A server can also be a server in a distributed system or a server integrated with blockchain. A server can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host equipped with artificial intelligence technology.
[0020] It should be noted that the method for constructing a knowledge base provided in the embodiments of the present disclosure is generally executed by the server 105 , and accordingly, the device for constructing a knowledge base is generally set in the server 105 .
[0021] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0022] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for constructing a knowledge base according to the present disclosure. The method for constructing a knowledge base includes the following steps: Step 201: According to the configuration information of the knowledge source, target materials originating from the knowledge source are determined from the knowledge base materials.
[0023] In this embodiment, the execution subject of the method for constructing a knowledge base (eg Figure 1 The server (shown in the figure) can receive configuration information set by the user through the terminal device via a wired or wireless connection. The server generates a configuration file based on the user's configuration information. After the user initiates knowledge base creation, the server reads the configuration information from the configuration file. This configuration information may include configuration information for material acquisition methods, knowledge sources, knowledge architecture, etc. The user can edit the configuration information through a graphical interface or by modifying the configuration file.
[0024] You can pre-configure the resource acquisition method to retrieve knowledge base resources. For example, you can retrieve knowledge base resources from a specific file directory, a specific URL, a specific Q&A database, and other channels. You can set up comprehensive resources for various types of knowledge bases.
[0025] For specific types of knowledge bases, you can configure a corresponding knowledge source. The knowledge source configuration information indicates the source of the target material used by that type of knowledge base. Target material is a subset of the knowledge base's material. For example, the knowledge source could be a website. Target material is obtained from this website and used in the subsequent knowledge base generation process.
[0026] Step 202: construct the directory structure of the knowledge base according to the predefined knowledge system structure information, and determine the prompt information corresponding to each level of the directory in the directory structure.
[0027] In this embodiment, users can predefine the knowledge base's knowledge architecture. This architecture includes the sub-projects within the knowledge base, the general directory structure of the sub-projects, the data sources involved in each heading, and prompts. Prompts define roles, task descriptions, content generation requirements, and content generation restrictions. Data sources and prompts are preset and user-adjustable.
[0028] Prompt example: You are a medical expert and a knowledge base construction specialist. Based on the [Knowledge Source] information and in accordance with the knowledge structure definition requirements, generate [Knowledge Name] [Overview] information. When generating this information, make sure nothing is left out and ensure the accuracy of the content, the clarity of relationships, and the distinct structure. The generated content should help users understand the original text. The generated content should be comprehensive, specific, clear, and complete, with accurate and detailed relationships. Ensure that the content is both accurate and concise, logically rigorous, and professional.
[0029] Step 203: Generate a knowledge base according to the target material and prompt information in accordance with the directory structure.
[0030] In this embodiment, after preparing the knowledge source configuration information and knowledge architecture information, knowledge base generation can begin. Knowledge bases can be generated using a general-purpose macro model. For example, by uploading a file for a "knowledge source" into the macro model and entering the knowledge architecture information and the prompts in the example above, the macro model will generate "knowledge name" and "overview" information for each level of the directory. This information constitutes the knowledge base. The knowledge base will be presented in the form of an article or mind map. After the knowledge base is published, it can be viewed by ordinary users.
[0031] The method provided by the above embodiment of the present disclosure only requires configuration of material information, directory structure and prompt information related to the knowledge base to quickly generate a knowledge base, which is simple to operate and maintain, saving labor costs.
[0032] In some optional implementations of this embodiment, a knowledge base is generated based on the target material and prompt information according to a directory structure, including: generating the knowledge base using a large model based on the target material, prompt information, and directory structure. The knowledge base can be generated using a general large model. Leveraging the large model's inherent text generation capabilities, each level of the directory structure is populated with content derived from the target material. This allows for rapid generation and updating of the knowledge base, eliminating the need for external procurement and enabling in-house development, which reduces costs while ensuring data security and reliability.
[0033] In some optional implementations of this embodiment, the method further includes: acquiring knowledge base materials according to configuration information of a material acquisition method, wherein the material acquisition method includes at least one of the following: a specified file directory, a specified URL, and a specified question-and-answer dialogue library.
[0034] You can specify a directory to retrieve all the files in it as knowledge base material. You can also retrieve webpage content from a public URL as knowledge base material. You can also specify a Q&A database to retrieve questions and answers as knowledge base material.
[0035] The method of acquiring knowledge base materials can be flexibly configured to make the collection process of knowledge base materials simple and convenient, thereby reducing labor costs and allowing knowledge base materials to be updated in a timely manner.
[0036] In some optional implementations of this embodiment, the prompt information includes at least one of the following information: role information, task description information, generated content requirement information, and generated content restriction information.
[0037] Through structured guidance, the model can more accurately and efficiently understand user needs and produce content that meets expectations. Allow the model to assume a specific role and produce content based on that role's background, perspective, knowledge base, and language style, enhancing the authenticity, professionalism, and immersion of the content. Clearly define the specific tasks users want the model to complete to avoid irrelevant answers due to semantic ambiguity and ensure that the output focuses on core needs. Use prohibitive clauses to constrain model behavior, prevent ethical and legal risks, and content bias, ensuring that the output meets social norms and user bottom lines.
[0038] In some optional implementations of this embodiment, the prompt information corresponding to each level of the directory structure is determined, including: for each level of the directory in the directory structure, selecting the target knowledge source used by the directory at that level from the knowledge source, and generating prompt information based on the target knowledge source. This hierarchical design can significantly improve the structure, accuracy, maintainability and generation efficiency of the knowledge base. Limiting the knowledge source in the prompt information (such as specifying authoritative literature, industry reports, official documents, etc. as the basis for content) is a key strategy to improve the accuracy, credibility and professionalism of the content. This constraint mechanism can effectively circumvent the "hallucination" problem of large models (generating fictitious or erroneous information) and ensure that the knowledge system meets the standards of a specific field.
[0039] In some optional implementations of this embodiment, the method further includes: outputting an editing window for details of directories at each level in the directory structure, wherein the details include target knowledge sources and prompt information used by directories at each level; in response to detecting that the target knowledge source and / or prompt information have been re-edited, updating the knowledge base according to the re-edited target knowledge source and / or the re-edited prompt information.
[0040] The user can edit the target knowledge source and / or prompt information in the editing window. This user can be the knowledge base creator or a reviewer. They can revise and supplement content, dynamically adjusting the knowledge base content and keeping it up to date.
[0041] In some optional implementations of this embodiment, the method further includes: in response to detecting an update in configuration information of a material acquisition method, reacquiring knowledge base material and updating the target material; and updating the knowledge base according to the updated target material and prompt information.
[0042] If you update the designated file directory, designated URL, designated Q&A dialogue library, or other resource acquisition methods, you can regenerate the knowledge base. Simply changing the configuration information allows you to update the knowledge base in a timely manner, making it easier to maintain and manage the knowledge base.
[0043] In some optional implementations of this embodiment, the method further includes: in response to detecting an update to the target material, updating the knowledge base based on the updated target material and prompt information. If the knowledge source is reconfigured, the target material also needs to be updated synchronously and the knowledge base regenerated. The knowledge source can be flexibly configured according to needs, improving the comprehensiveness and real-time nature of the knowledge base.
[0044] In some optional implementations of this embodiment, configuration information for the material acquisition method, knowledge source configuration information, and knowledge system architecture information are all configured through a graphical interface. This interface allows for viewing, adding, and deleting configuration information. This simplifies the operational process, thereby reducing the technical threshold and labor costs of generating a knowledge base and facilitating timely updates of the knowledge base.
[0045] For example, create a file knowledge base, web knowledge base, or question-and-answer knowledge base on the Knowledge Management page. On the Knowledge Source Configuration page, select the knowledge sources involved in the knowledge project. On the Knowledge System Definition page, define the knowledge name and knowledge system (data source for each segment, prompt definition). After completing the knowledge source configuration and knowledge system definition, click Start Generating the Knowledge Base. After the knowledge base is generated, you can assign knowledge base reviews on the Review Task Assignment page. Reviewers can view and revise the knowledge base on the Review page and submit it for confirmation after completing the revisions. Once the knowledge base is finalized, it can be viewed on the Map Presentation page.
[0046] Continue to see Figure 3 , Figure 3 This is a schematic diagram of an application scenario of the method for building a knowledge base according to this embodiment. Figure 3 In the application scenario, the user logs in to the server platform through the terminal device, and a visual editing interface is displayed. The platform provides the following modules: Knowledge management module: supports users to build custom knowledge bases of file, web page, question and answer types according to their needs. Each type of knowledge base can be viewed, added, deleted, and other operations.
[0047] Knowledge source configuration module: supports users to select data sources from knowledge management according to the requirements of the target knowledge base and clarify the source data of the knowledge base.
[0048] Knowledge System Definition Module: Users can define the knowledge base's architecture. The knowledge system includes the sub-projects within the knowledge base, the common directory structure of the sub-projects, the data sources involved in each heading, and prompts. The prompts define information such as roles, task descriptions, content requirements, and content restrictions. The data sources and prompts are preset and user-adjustable. After defining the knowledge sources and knowledge system, you can begin generating the knowledge base.
[0049] Knowledge base generation module: After completing the knowledge source configuration and knowledge system definition, you can click to start generating the knowledge base.
[0050] Knowledge Review Module: After the knowledge base is generated, users can view details of each knowledge item within the knowledge project, including the source information for each generated segment. All reference documents, web pages, or question-and-answer pairs are displayed in the final Reference Content section. Reviewers can adjust problematic segments by adjusting the data source or prompt, regenerating the segment content, or directly modifying the text. After completing the modifications, reviewers can submit the changes for confirmation, and the knowledge base is finalized.
[0051] Prompt example: You are a medical expert and a knowledge base construction specialist. Based on the [Knowledge Source] information and in accordance with the knowledge structure definition requirements, generate [Knowledge Name] [Overview] information. When generating this information, make sure nothing is left out and ensure the accuracy of the content, the clarity of relationships, and the distinct structure. The generated content should help users understand the original text. The generated content should be comprehensive, specific, clear, and complete, with accurate and detailed relationships. Ensure that the content is both accurate and concise, logically rigorous, and professional.
[0052] Knowledge base presentation module: The knowledge base will be presented in the form of articles or mind maps. After the knowledge base is published, ordinary users can view it.
[0053] Further references Figure 4 , which shows a process 400 of another embodiment of a method for building a knowledge base. The process 400 of the method for building a knowledge base includes the following steps: Step 401: According to the configuration information of the knowledge source, target materials originating from the knowledge source are determined from the knowledge base materials.
[0054] Step 402: construct the directory structure of the knowledge base according to the predefined knowledge system structure information, and determine the prompt information corresponding to each level of the directory in the directory structure.
[0055] Step 403: Generate a knowledge base according to the target material and prompt information in accordance with the directory structure.
[0056] Steps 401-403 are substantially the same as steps 201-203, and therefore are not described in detail.
[0057] Step 404: Send an audit task to the audit knowledge base according to pre-configured audit information, and receive audit information in response to the audit task.
[0058] In this embodiment, audit information can be pre-configured through a graphical interface. This audit information may include the auditor's ID, contact information, audit time, and audit permissions. Knowledge base audit tasks can be created and assigned to auditors for review. Auditors can view the contents of the knowledge base to be reviewed. Auditors can edit information such as the target knowledge sources and prompts used by each level of the directory, and generate audit failure information. If the auditor finds no issues, they can directly click "Approved" to generate an audit passing information. The audit information is then sent to the user who created the knowledge base for subsequent processing.
[0059] The audit task can be assigned to multiple auditors, each of whom will receive audit information. The user then regenerates the knowledge base based on the audit information, and the auditors review it again until the audit information is received.
[0060] Step 405 : In response to the review information indicating that the knowledge base has passed the review, the knowledge base is output in a visual manner.
[0061] In this embodiment, if the knowledge base passes the review, it can be presented in the form of an article or a mind map. After the knowledge base is published, ordinary users can view it.
[0062] The method provided in this embodiment can improve the efficiency of knowledge base review, thereby saving knowledge base publishing time and enabling timely updating of the knowledge base.
[0063] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for constructing a knowledge base. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0064] like Figure 5 As shown, the apparatus 500 for constructing a knowledge base in this embodiment includes: a configuration unit 501, a construction unit 502, and a generation unit 503. The configuration unit 501 is configured to determine target materials derived from the knowledge source from the knowledge base materials based on the configuration information of the knowledge source; the construction unit 502 is configured to construct a directory structure of the knowledge base based on predefined knowledge system structure information and determine prompt information corresponding to each level of the directory structure; and the generation unit 503 is configured to generate the knowledge base according to the directory structure based on the target materials and the prompt information.
[0065] In this embodiment, the specific processing of the configuration unit 501, the construction unit 502 and the generation unit 503 of the apparatus 500 for constructing the knowledge base can be referred to in Figure 2 This corresponds to step 201, step 202 and step 203 in the embodiment.
[0066] In some optional implementations of this embodiment, the device 500 also includes an audit unit (not shown in the drawings), which is configured to: send an audit task to audit the knowledge base based on pre-configured audit information, and receive audit information in response to the audit task; in response to the audit information indicating that the knowledge base has passed the audit, output the knowledge base in a visual manner.
[0067] In some optional implementations of this embodiment, the generating unit 503 is further configured to generate a knowledge base through a large model based on the target material, prompt information and directory structure.
[0068] In some optional implementations of this embodiment, the device 500 also includes an acquisition unit (not shown in the accompanying drawings), which is configured to: acquire knowledge base materials according to configuration information of a material acquisition method, wherein the material acquisition method includes at least one of the following: a specified file directory, a specified website, and a specified question-and-answer dialogue library.
[0069] In some optional implementations of this embodiment, the prompt information includes at least one of the following information: role information, task description information, generated content requirement information, and generated content restriction information.
[0070] In some optional implementations of this embodiment, the construction unit is further configured to: for each level of directory in the directory structure, select a target knowledge source used by the directory at that level from the knowledge source, and generate prompt information based on the target knowledge source.
[0071] In some optional implementations of this embodiment, the audit unit is further configured to: output an editing window of the details of each level of directory in the directory structure, wherein the details include the target knowledge source and prompt information used by each level of directory; in response to detecting that the target knowledge source and / or prompt information has been re-edited, update the knowledge base according to the re-edited target knowledge source and / or the re-edited prompt information.
[0072] In some optional implementations of this embodiment, the device 500 also includes an updating unit (not shown in the drawings), which is configured to: in response to detecting an update of the configuration information of the material acquisition method, re-acquire the knowledge base material and update the target material; and update the knowledge base according to the updated target material and prompt information.
[0073] In some optional implementations of this embodiment, the apparatus 500 further includes an updating unit (not shown in the drawings), configured to: in response to detecting that the target material is updated, update the knowledge base according to the updated target material and prompt information.
[0074] In some optional implementations of this embodiment, configuration information of the material acquisition method, configuration information of the knowledge source, and knowledge system structure information are all set through a graphical interface.
[0075] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0076] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0077] An electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in process 200.
[0078] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in process 200.
[0079] A computer program product includes a computer program, which implements the method described in process 200 when executed by a processor.
[0080] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0081] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. Computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0082] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0083] The computing unit 601 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the method for constructing a knowledge base. For example, in some embodiments, the method for constructing a knowledge base can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method for constructing a knowledge base described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to execute the method for constructing a knowledge base through any other suitable means (e.g., via firmware).
[0084] Various embodiments of the systems and techniques described above 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), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes 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.
[0085] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0086] 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, apparatus, or device. 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, 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), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0087] 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).
[0088] The systems and techniques described herein can be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end 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), and the Internet.
[0089] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0090] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0091] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for constructing a knowledge base, comprising: According to the configuration information of the knowledge source, determining the target material originating from the knowledge source from the knowledge base material; Constructing a directory structure of the knowledge base according to predefined knowledge system structure information, and determining prompt information corresponding to each level of the directory in the directory structure; A knowledge base is generated according to the target material and the prompt information in accordance with the directory structure.
2. The method according to claim 1, wherein The method further comprises: Sending an audit task for auditing the knowledge base according to pre-configured audit information, and receiving audit information in response to the audit task; In response to the review information indicating that the knowledge base passes the review, the knowledge base is output in a visual manner.
3. The method according to claim 1, wherein Generating a knowledge base according to the target material and the prompt information in accordance with the directory structure includes: A knowledge base is generated through a large model based on the target material, the prompt information and the directory structure.
4. The method according to claim 1, wherein The method further comprises: The knowledge base material is acquired according to configuration information of a material acquisition method, wherein the material acquisition method includes at least one of the following: a specified file directory, a specified website, and a specified question-and-answer dialogue library.
5. The method according to claim 1, wherein The prompt information includes at least one of the following information: role information, task description information, generated content requirement information, and generated content restriction information.
6. The method according to claim 1, wherein The step of determining the prompt information corresponding to each level of the directory structure includes: For each level of directory in the directory structure, a target knowledge source used by the directory at that level is selected from the knowledge sources, and prompt information is generated based on the target knowledge source.
7. The method according to claim 2, wherein: The method further comprises: Outputting an editing window for details of each level of the directory structure, wherein the details include target knowledge sources and prompt information used by each level of the directory; In response to detecting that the target knowledge source and / or the prompt information are re-edited, the knowledge base is updated according to the re-edited target knowledge source and / or the re-edited prompt information.
8. The method according to claim 4, wherein The method further comprises: In response to detecting that the configuration information of the material acquisition method is updated, reacquiring the knowledge base material and updating the target material; The knowledge base is updated according to the updated target material and the prompt information.
9. The method according to claim 1, wherein The method further comprises: In response to detecting that the target material is updated, the knowledge base is updated according to the updated target material and the prompt information.
10. The method according to claim 4, wherein: The configuration information of the material acquisition method, the configuration information of the knowledge source, and the knowledge system structure information are all set through a graphical interface.
11. A device for constructing a knowledge base, comprising: a configuration unit configured to determine, from the knowledge base materials, target materials originating from the knowledge source according to the configuration information of the knowledge source; a construction unit configured to construct a directory structure of the knowledge base according to predefined knowledge system structure information, and determine prompt information corresponding to each level of directory in the directory structure; The generating unit is configured to generate a knowledge base according to the target material and the prompt information in accordance with the directory structure.
12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
14. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.