A method and apparatus for generating a dental restoration plan
Patent Information
- Application Number
- CN202611237825.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本申请提供了一种牙体修复方案的生成方法及设备,以解决相关技术存在的对大语言模型的引导和约束不足,无法确保生成的牙体修复方案与口腔修复专业知识保持一致,容易产生“幻觉”或事实性错误,降低了生成牙体修复方案的准确性和可靠性问题
[0015]本申请的技术方案至少包括如下有益效果:当用户输入牙体修复内容和针对多个文档知识库中的至少一个文档知识库进行第一选择操作时,通过响应于牙体修复内容,将牙体修复内容转换为查询向量,并通过响应于用户对至少一个文档知识库的第一选择操作,加载对应文档知识库的索引文件,进而可以将查询向量与索引文件中的多个向量块进行检索匹配,生成对应的检索结果,实现从本地存储的文档知识库中快速获取与牙体修复内容相关的检索结果,从而精准定位牙体修复方案的知识来源。再者,通过基于检索结果和牙体修复内容构建第一提示词,利用第一提示词限制大语言模型的知识来源为检索结果,并向外部的大语言模型发送第一提示词,使得大语言模型基于第一提示词生成牙体修复方案,如此可以利用提示工程引导大语言模型对检索结果进行整合推理,利用检索结果驱动大语言模型精准生成牙体修复方案并进行返回,从而能够接收到该牙体修复方案。基于此,可以确保大语言模型生成的牙体修复方案与口腔修复专业知识保持一致,降低了产生“幻觉”或事实性错误的概率,有利于提升生成牙体修复方案的准确性和可靠性。
Smart Images

Figure CN123012145A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of dental restoration technology, and in particular to a method and device for generating a dental restoration plan. Background Technology
[0002] In developing a treatment plan for damaged teeth, physicians typically need to comprehensively assess factors such as the condition of the damaged tooth, its biomechanical characteristics, the properties of the restorative materials, and individual patient differences. The assessment of these factors is highly dependent on the physician's knowledge base and personal clinical experience.
[0003] To improve the efficiency of dental restoration planning, related technologies typically utilize Large Language Models (LLMs) for dialogue within the field of dental restoration, generating restoration plans to assist dentists in their planning. However, due to insufficient guidance and constraints on the LLMs provided by these technologies, it is impossible to ensure that the generated restoration plans are consistent with professional dental restoration knowledge, which can easily lead to "illusions" or factual errors, reducing the accuracy and reliability of the generated restoration plans. Summary of the Invention
[0004] This application provides a method and device for generating dental restoration plans to address the shortcomings of related technologies in guiding and constraining large language models, which makes it impossible to ensure that the generated dental restoration plans are consistent with professional knowledge of oral restoration, easily leading to "illusions" or factual errors, and reducing the accuracy and reliability of the generated dental restoration plans.
[0005] To address the aforementioned issues, this application provides a method for generating dental restoration plans, comprising: responding to user-inputted dental restoration content, converting the dental restoration content into a query vector; responding to a user's first selection operation on at least one document knowledge base, loading the index file of the corresponding document knowledge base; wherein, the document knowledge base includes multiple bases, one document knowledge base is used to locally store multiple text blocks of a dental restoration subdomain, and the index file is used to store the vector blocks converted from each text block in the document knowledge base and the mapping relationship between them; performing a search and matching operation between the query vector and multiple vector blocks in the index file to generate search results; constructing a first prompt word based on the search results and the dental restoration content; the first prompt word is used to restrict the knowledge of the large language model to originate from the search results; sending the first prompt word to an external large language model so that the large language model generates a dental restoration plan related to the dental restoration content based on the search results; and receiving the dental restoration plan returned by the large language model.
[0006] In one implementation, before converting the dental restoration content into a query vector in response to user input, the generation method further includes: in response to received data documents in the dental restoration subdomain, performing format conversion and segmentation on the data documents to form multiple text blocks; and in response to a user's second selection operation on a document knowledge base, storing the multiple text blocks into the selected document knowledge base.
[0007] In one implementation, after multiple text blocks of a document are stored in a selected document knowledge base, the generation method further includes: vectorizing each text block using a preset Chinese embedding model to obtain corresponding vector blocks; and storing the vector blocks and the mapping relationship between the vector blocks and the corresponding text blocks in the index file of the selected document knowledge base.
[0008] In one implementation, in response to a user's first selection operation on at least one document knowledge base, loading the index file of the corresponding document knowledge base includes: in response to the user's first selection operation on at least one document knowledge base, filling the name of the selected document knowledge base into a preset storage path template, generating the file path of the corresponding index file; and loading the corresponding index file based on the file path.
[0009] In one implementation, the process of matching the query vector with vector blocks in the index file to generate search results includes: comparing the similarity of the query vector with multiple vector blocks in the index file to obtain multiple similarity scores; sorting the multiple similarity scores in descending order to determine the vector blocks with the highest similarity scores; where k is an integer greater than 1; obtaining the corresponding k text blocks based on the mapping relationship between the top k vector blocks and k text blocks; and concatenating the text content of the k text blocks in descending order of similarity scores to obtain the search results.
[0010] In one implementation, the dental restoration content input by the user includes dental restoration problems and patient treatment information. Based on the search results and the dental restoration content input by the user, a first prompt word is constructed, including: filling the search results and dental restoration problems into a preset access role prompt template to obtain the first prompt word.
[0011] In one implementation, the search results are composed of the text content of multiple text blocks, each text block having an embedded source identifier; After generating the search results, the generation method also includes: using a preset text template of the role of the oral restoration expert, the output specifications of the diagnostic suggestion, and the information annotation rules as the second prompt words; the information annotation rules include annotating the text content in the dental restoration plan that comes from the document knowledge base with its corresponding source identifier; When sending the first prompt word, the generation method also includes: simultaneously sending a second prompt word to the large speech model, so that the large language model generates a dental restoration plan based on the first and second prompt words.
[0012] In one embodiment, the generation method further includes: when a dental restoration plan is received, generating a corresponding session identifier; writing the session identifier, the user identity identifier requesting the generation of the dental restoration plan, the request timestamp, and the relevant document knowledge base name into a preset log record; and synchronizing the log record to a preset audit database for audit terminals to query the log record.
[0013] In one implementation, the dental restoration content includes dental restoration problems and patient treatment information; converting the dental restoration content into a query vector includes converting the dental restoration problems and patient treatment information into a query vector.
[0014] This application also provides an electronic device, including: a processor and a memory, wherein instructions are stored in the memory and loaded and executed by the processor to implement the generation method of any of the above embodiments.
[0015] The technical solution of this application includes at least the following beneficial effects: When a user inputs dental restoration content and makes a first selection operation on at least one document knowledge base from multiple document knowledge bases, the dental restoration content is converted into a query vector in response to the dental restoration content. In response to the user's first selection operation on at least one document knowledge base, the index file of the corresponding document knowledge base is loaded. The query vector can then be matched with multiple vector blocks in the index file to generate corresponding search results. This enables rapid retrieval of search results related to dental restoration content from locally stored document knowledge bases, thereby accurately locating the knowledge source of the dental restoration plan. Furthermore, by constructing a first prompt word based on the search results and dental restoration content, the first prompt word is used to limit the knowledge source of the large language model to the search results. The first prompt word is then sent to an external large language model, allowing the large language model to generate a dental restoration plan based on the first prompt word. This allows the prompting engineering to guide the large language model to integrate and reason about the search results, using the search results to drive the large language model to accurately generate and return the dental restoration plan, thus enabling the user to receive the dental restoration plan. Based on this, it can be ensured that the dental restoration plan generated by the large language model is consistent with the professional knowledge of dental restoration, reducing the probability of "illusion" or factual errors, and helping to improve the accuracy and reliability of the generated dental restoration plan. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0017] Figure 1 The diagram shown is a flowchart illustrating a method for generating a dental restoration scheme according to an embodiment of this application.
[0018] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0019] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0020] Figure 1 The diagram shown is a flowchart illustrating a method for generating a dental restoration scheme according to an embodiment of this application.
[0021] like Figure 1 As shown, the method for generating this tooth restoration plan includes the following steps S110 to S160.
[0022] Step S110: In response to the user's input of dental restoration content, convert the dental restoration content into a query vector.
[0023] The content related to dental restoration includes questions about dental restoration and the patient's treatment information. For example, a question about dental restoration might be, "After root canal treatment, there is a large area of tooth loss and little remaining tooth structure. What kind of restoration method should be chosen?" The patient's treatment information includes the patient's age, gender, occlusal habits, aesthetic requirements, and budget.
[0024] Step S110 includes: responding to the user-inputted dental restoration content, inputting the dental restoration content into a preset Chinese embedding model to obtain a query vector. The preset Chinese embedding model includes, but is not limited to, BAAI / bge-large-zh-v1.5, and can also be other Chinese embedding models in the field, as long as they can convert Chinese text into a dense vector that can be processed by a computer.
[0025] Step S120: In response to the user's first selection operation on at least one document knowledge base, load the index file of the corresponding document knowledge base; wherein, the document knowledge base includes multiple ones, one document knowledge base is used to locally store multiple text blocks in a dental restoration subfield, and the index file is used to store the vector blocks converted from each text block in the document knowledge base and the mapping relationship between them, that is, the mapping relationship between text blocks and vector blocks.
[0026] In step S120, the document knowledge base includes multiple bases, each used to locally store text blocks for a specific sub-domain of dental restoration. Each document knowledge base stores multiple text blocks corresponding to that sub-domain. For example, the multiple document knowledge bases include a fixed restoration knowledge base, a removable restoration knowledge base, an implant restoration knowledge base, and an occlusal reconstruction knowledge base.
[0027] A text chunk is a unit of text that is split from a long text into multiple logically contiguous short text units. The length of a text chunk can be selected and adjusted according to actual needs; for example, the length of a text chunk can be configured to 512 tokens.
[0028] In step S120, since the index file of each document knowledge base only locally stores multiple vector blocks corresponding to multiple text blocks in a dental restoration subdomain and the mapping relationship between multiple vector blocks and multiple text blocks, when the user performs a first selection operation on at least one document knowledge base, the index file of the corresponding document knowledge base is loaded in response to the user's first selection operation. This ensures that the semantic search space for each retrieval is strictly limited to the dental restoration subdomain with the highest relevance, and avoids the retrieval matching process from mixing in irrelevant dental restoration subdomain vector blocks and their mapping relationships.
[0029] Step S130: Match the query vector with the vector blocks in the index file to generate search results.
[0030] Step S140: Based on the search results and the content on dental restoration, construct the first prompt words; the first prompt words are used to limit the knowledge source of the large language model to the search results.
[0031] Step S150: Send the first prompt word to the external large language model so that the large language model can generate a dental restoration plan based on the first prompt word.
[0032] Step S160: Receive the dental restoration plan returned by the large language model.
[0033] The large language model can be deployed on a cloud server. By calling the large language model's interface, users can send the first prompt word to the large language model and receive the dental restoration plan returned by the large language model. The large language model includes, but is not limited to, pre-trained models such as DeepSeek, GPT-3.5-turbo, Qianwen, and Doubao.
[0034] The above scheme, when a user inputs dental restoration content and makes a first selection operation on at least one document knowledge base from multiple document knowledge bases, converts the dental restoration content into a query vector in response to the user's first selection operation on at least one document knowledge base. Then, in response to the user's first selection operation on at least one document knowledge base, it loads the index file of the corresponding document knowledge base. The query vector can then be searched and matched with multiple vector blocks in the index file to generate corresponding search results. This allows for the rapid retrieval of search results related to dental restoration content from locally stored document knowledge bases, thereby accurately locating the knowledge source of the dental restoration plan. Furthermore, by constructing first prompt words based on the search results and dental restoration content, the first prompt words are used to limit the knowledge source of the large language model to the search results. These first prompt words are then sent to an external large language model, enabling the large language model to generate a dental restoration plan based on the first prompt words. This prompting engineering guides the large language model to integrate and reason about the search results, using the search results to drive the large language model to accurately generate and return the dental restoration plan, thus ensuring the user receives the dental restoration plan. Based on this, it can be ensured that the dental restoration plan generated by the large language model is consistent with professional knowledge of oral restoration, reducing the probability of generating "illusions" or factual errors, and helping to improve the accuracy and reliability of the generated dental restoration plan. In one embodiment, before converting the dental restoration content into a query vector in response to the user's input, the generation method further includes the following steps S210 to S220.
[0035] Step S210: In response to the received data document in the dental restoration subdomain, the data document is formatted and segmented to form multiple text blocks.
[0036] Step S210 includes: in response to the received data document in the dental restoration subdomain, converting the data document format to plain text format; reading the corresponding plain text from the plain text format file of the data document; and performing semantic segmentation on the read plain text to obtain multiple text blocks.
[0037] The documents include, but are not limited to, clinical guidelines, research papers, and product instructions. The original formats of these documents include, but are not limited to, .doc, .docx, and .pdf; plain text formats can be .txt. Format conversion can be performed using a pre-defined document parsing library. By inputting the documents into the library, it can output the documents in plain text format.
[0038] Semantic segmentation of plain text can be performed in ways including but not limited to those based on chapters, diagnostic steps, or natural paragraphs.
[0039] Step S220: In response to the user's second selection operation on a document knowledge base, store multiple text blocks into the selected document knowledge base.
[0040] Based on this, users can input documents from the dental restoration subfield and select one from multiple document knowledge bases. The system automatically converts the documents into multiple text blocks and stores these text blocks in the corresponding document knowledge bases, enabling rapid construction of these knowledge bases. This facilitates the integration of multi-source heterogeneous knowledge in the dental restoration field (such as clinical guidelines, expert consensus, materials science data, case reports, etc.) into different document knowledge bases, allowing for timely updates. Furthermore, by storing multiple text blocks of documents in corresponding document knowledge bases, with each knowledge base corresponding to a different subfield of dental restoration, the system enables separate database management of documents and isolates different knowledge bases. This avoids cross-domain interference from unselected document knowledge bases during the retrieval process, thus improving retrieval efficiency.
[0041] In one embodiment, after multiple text blocks of a document are stored in the selected document knowledge base, the generation method further includes the following steps S310 to S320.
[0042] Step S310: Vectorize each text block using a preset Chinese embedding model to obtain the corresponding vector block.
[0043] For example, the preset Chinese embedding model includes, but is not limited to, BAAI / bge-large-zh-v1.5, and can also be other Chinese embedding models in this field, as long as they can convert Chinese text into dense vectors that can be processed by computers. During the vectorization process, the output vector can be normalized using the L2 norm, so that the output vector block is the result of L2 norm normalization. Thus, when using the query vector to perform retrieval matching with multiple vector blocks, the vector blocks can support similarity retrieval based on inner product or Euclidean distance.
[0044] Step S320: Store the vector blocks and the mapping relationship between the vector blocks and the corresponding text blocks in the index file of the selected document knowledge base.
[0045] For example, step S320 includes: storing the vector block in the index file of the selected document knowledge base; constructing a mapping relationship between the vector block and the identity of the corresponding text block, and storing the mapping relationship in the index file. The identity of the text block can be set when the text block is formed, and the identity of the text block is unique; it is a unique code for the text block.
[0046] Specifically, in step S320, the storage of vector blocks and the construction of mapping relationships can both be implemented using FAISS (Facebook AI Similarity Search). In the process of using FAISS to construct mapping relationships (i.e., vector indexes), the index type can be set to IndexFlatL2. Then, when using query vectors to perform retrieval matching with multiple vector blocks, brute-force precise indexing can be performed to meet real-time retrieval requirements and ensure retrieval accuracy.
[0047] The above scheme vectorizes each text block using a pre-defined Chinese embedding model to obtain corresponding vector blocks. The mapping relationships between these vector blocks and their corresponding text blocks are then stored in the index file of the selected document knowledge base. This facilitates subsequent retrieval and matching using query vectors against multiple vector blocks in the selected document knowledge base, directly loading the mapping relationships and related vector blocks from the index file, thus improving retrieval efficiency. Furthermore, this index file update method does not require rewriting the software code itself, allowing for timely updates of the latest and most cutting-edge knowledge (such as the latest clinical evidence and restorative concepts) from various subfields of dental restoration to the corresponding document knowledge base and automatically constructing relevant vector blocks and their mapping relationships. This avoids lag in document knowledge base updates and facilitates the integration of the latest dental restoration knowledge into the generated dental restoration plans.
[0048] Furthermore, it should be noted that current mainstream Retrieval Augmented Generation (RAG) methods typically embed documents from all domains into a single, large vector database, forming a single, undifferentiated hybrid semantic search space. When a user needs to query a specific professional domain (e.g., the mechanical properties of dental restoration materials), current retrieval generation methods perform vector retrieval from this hybrid semantic search space. This results in search results mixed with content from other unrelated domains (e.g., general mechanics or orthopedic materials), creating information noise, diluting the concentration of core search results, and limiting the accuracy and practicality of the retrieval generation method in specific professional domains. Compared to current mainstream retrieval augmented generation methods, this application converts text blocks related to a single dental restoration subdomain into vector blocks, and then stores these vector blocks and their mapping relationships with the text blocks in the index file of the document knowledge base corresponding to that dental restoration subdomain. This allows for the one-to-one embedding of documents from multiple dental restoration subdomains into multiple different index files, avoiding the mixing of content from other unrelated domains during the retrieval matching process and thus improving the practicality and accuracy of the dental restoration solutions generated by this application.
[0049] In one implementation, in response to a user's first selection operation on at least one document knowledge base, loading the index file of the corresponding document knowledge base includes the following steps S410 and S420.
[0050] Step S410: In response to the user's first selection operation of at least one document knowledge base, fill in the name of the selected document knowledge base into the preset storage path template and generate the file path of the corresponding index file.
[0051] For example, when a user makes a first selection to the knowledge bases “Guidelines for Post-Root Canal Treatment Restoration” and “Literature on Materials for Tooth Defects”, in response to the user’s first selection to these two knowledge bases, the names “Guidelines for Post-Root Canal Treatment Restoration” and “Literature on Materials for Tooth Defects” are filled into the preset storage path template “. / knowledge base / {name} / index file”, and the file paths of the index files of these two knowledge bases are dynamically concatenated as “. / knowledge base / Guidelines for Post-Root Canal Treatment Restoration / index file” and “. / knowledge base / Literature on Materials for Tooth Defects / index file”, respectively.
[0052] Step S420: Load the corresponding index file based on the file path.
[0053] The above solution, when a user performs a first selection operation on at least one document knowledge base, first responds to the user's first selection operation by filling the name of the selected document knowledge base into a preset storage path template, generating the file path of the corresponding index file, and then loading the corresponding index file based on that file path. Based on this, the index files of document knowledge bases can be loaded on demand, which helps reduce memory usage and facilitates flexible switching between multiple repair scenarios by having the user perform a first selection operation on at least one of multiple document knowledge bases.
[0054] In one implementation, the query vector is matched with the vector blocks in the index file to generate search results, including the following steps S131 to S134.
[0055] Step S131: Compare the similarity between the query vector and multiple vector blocks in the index file to obtain the corresponding similarity scores.
[0056] Step S132: Sort the multiple similarity scores in descending order to determine the vector blocks with the highest similarity scores in the top k positions; k is an integer greater than 1.
[0057] Step S133: Based on the mapping relationship between the first k vector blocks and the k text blocks, obtain the corresponding k text blocks.
[0058] For example, the mapping relationship between vector blocks and text blocks stored in the index file is a mapping relationship between the identity identifiers of vector blocks and text blocks. Step S133 includes: obtaining the identity identifiers of k text blocks based on the mapping relationship between the first k vector blocks and k text blocks; and obtaining the corresponding k text blocks from the document knowledge base based on the identity identifiers of the k text blocks.
[0059] Step S134: Concatenate the text contents of the k text blocks in descending order of similarity score to obtain the search results.
[0060] In step S134, during the process of concatenating the text content of k text blocks in descending order of similarity score, the name of the document knowledge base to which each text content belongs can be embedded in the text content as a source identifier.
[0061] The following example illustrates the generation of search results. When a user inputs the dental restoration content as "Large area of tooth structure loss after root canal treatment, with little remaining tooth structure, what restoration method should be chosen?" and the user performs a first selection operation on the three document knowledge bases "Guidelines for Restoration after Root Canal Treatment," "Materials Science of Tooth Defects," and "Clinical Case Discussions," the dental restoration content is converted into a query vector in response to the user's input operation, and the index files of these three document knowledge bases are loaded in response to the user's first selection operation. After executing steps S131 to S134 above, the following search results are obtained: [Source: Guidelines for Post-Root Canal Treatment Restoration] "For teeth with limited remaining tooth structure, it is recommended to use restorations that cover the entire cusp, such as inlays or full crowns, to distribute occlusal forces and prevent tooth fracture." [Source: Dental Defect Materials Science] "When the remaining tooth structure is insufficient to support the retention of a full crown, it is advisable to use a fiber post and resin core to reinforce the remaining tooth structure before performing a full crown restoration." [Source: Clinical Case Discussion] "In one case, after root canal treatment of the mandibular first molar, the tooth structure was reduced by 2 / 3. The tooth was restored using CAD / CAM high inlay, and the follow-up for 2 years showed good results." Based on this, the system can quickly retrieve the k most relevant text blocks from the locally stored document knowledge base to the user-input dental restoration content. The text content of these k blocks is then concatenated to form the search results, which serve as clinical textual evidence for subsequent dental restoration plans. Furthermore, by embedding the name of the document knowledge base to which the text blocks belong as a source identifier into the text content during the concatenation process, the clinical textual evidence constituted by the search results is traceable. This ensures that the subsequently generated dental restoration plan originates from a reliable knowledge source, enhancing the interpretability of the plan's development.
[0062] In one implementation, the dental restoration content input by the user includes dental restoration problems and patient treatment information. Based on the search results and the dental restoration content input by the user, a first prompt word is constructed, including: filling the search results and dental restoration problems into a preset access role prompt template to obtain the first prompt word.
[0063] For example, the preset access role prompt template is "Document knowledge base content: {} Question: {}". After filling the search results and dental restoration questions into this template, the following first prompt words are obtained: Document knowledge base content: [Source: Guidelines for Post-Root Canal Treatment Restoration] "For teeth with limited remaining tooth structure, it is recommended to use restorations that cover the entire cusp, such as inlays or full crowns, to distribute occlusal forces and prevent tooth fracture." [Source: Dental Defect Materials Science] "When the remaining tooth structure is insufficient to support the retention of a full crown, it is advisable to use a fiber post and resin core to reinforce the remaining tooth structure before performing a full crown restoration." [Source: Clinical Case Discussion] "In one case, two-thirds of the mandibular first molar was lost after root canal treatment. A CAD / CAM high-mounted inlay was used for restoration, and the results were good after two years of follow-up." Question: After root canal treatment, there is a large area of tooth structure loss, with very little remaining tooth structure. What type of restoration should be chosen? Based on this, by constructing first-response terms using search results and user-inputted dental restoration content, the knowledge of the large language model answering the user's input dental restoration question can be constrained by the first-response terms to originate from the search results. This guides the large language model to use the search results carried by the first-response terms for evidence-driven clinical reasoning, ensuring that the answer is consistent with specific dental restoration expertise, avoiding "illusions" or factual errors, and improving the accuracy of the generated dental restoration plan. Furthermore, since the patient's medical information is not integrated when constructing the first-response terms, the patient's medical information can be used only in the local query vector retrieval and matching process, without being sent externally, thus ensuring that the patient's medical information is not leaked and meeting clinical data privacy requirements.
[0064] In one implementation, the search results are composed of concatenated text content from multiple text blocks, each text block embedding a source identifier. The source identifier can be the name of the document knowledge base to which the text content belongs.
[0065] After generating the search results, the generation method also includes: using preset text templates of oral restoration expert roles, diagnostic suggestion output specifications, and information annotation rules as second prompt words; the information annotation rules include annotating the text content in the dental restoration plan that comes from the document knowledge base with its corresponding source identifier.
[0066] For example, the default text template for the role of a dental prosthodontist and the output of diagnostic recommendations could be: "You are an experienced dental prosthodontist. Please answer clinical prosthodontic questions based on the following principles: The answer must include the following 5 parts and be answered in Chinese: 1. Core prosthodontic plan recommendation; 2. Main basis; 3. Key clinical considerations (related to prognosis); 4. Potential risks and alternatives; 5. Supplementary clinical examinations."
[0067] The preset text template for information annotation rules can be: "Information annotation rules include: 1. Text content from document knowledge base: annotate using [Source: Name of document knowledge base]; 2. From general knowledge: annotate using [General medical knowledge]; 3. Multiple knowledge sources can be annotated simultaneously; please ensure that the answer is professional, complete, and that all information has a clear knowledge source annotation."
[0068] When sending the first prompt word, the generation method also includes: simultaneously sending a second prompt word to the large speech model, so that the large language model generates a dental restoration plan based on the first and second prompt words.
[0069] The first prompt word can be integrated into the input role (user) message and sent to the large language model using the input role message method. The second prompt word can be integrated into the system role message and sent to the large language model using the system role message method.
[0070] Based on this, prompting engineering can be used to design the input and system roles of the large language model, and set the output specifications and information annotation rules of the large language model. This clarifies the role played by the large language model and the rules it should follow, which can improve the accuracy, coherence, and professionalism of the dental restoration plans generated by the large language model. Furthermore, it can make the text content in the search results explicitly presented in the dental restoration plan through information annotation rules, thereby achieving the interpretability and traceability of the generated dental restoration plan.
[0071] In one embodiment, the generation method further includes steps S510 to S530.
[0072] Step S510: When a dental restoration plan is received, a corresponding session identifier is generated. The session identifier can be a session code, and this session identifier is unique.
[0073] Step S520: Write the session identifier, the user's identity identifier requesting the generation of the dental restoration plan, the request timestamp, and the relevant document knowledge base name into a preset log record. The log record can be stored in dedicated storage space, using JSON format and divided into daily chunks.
[0074] Step S530: Synchronize the log records to the preset audit database so that the audit terminal can query the log records.
[0075] Based on this, log records can be used to form a complete clinical decision traceability chain, meeting the requirements for auditability and quality traceability of medical information.
[0076] In one implementation, the dental restoration content includes dental restoration problems and patient treatment information; converting the dental restoration content into a query vector includes converting the dental restoration problems and patient treatment information into a query vector. Based on this, relevant search results can be retrieved from a local document knowledge base using the dental restoration problems and patient treatment information proposed by the user, ensuring that the search results are simultaneously related to the dental restoration problems and patient treatment information.
[0077] It should be noted that the method for generating the dental restoration method of this application can run on a local server. The method for generating the dental restoration plan interacts with the user through an interactive interface, enabling the user to perform first and second selection operations on multiple document knowledge bases through the interactive interface.
[0078] Based on the same technical concept, this application also provides an electronic device, such as... Figure 2 As shown, the electronic device 10 includes a processor 11 and a memory 12. The memory 12 stores instructions, which are loaded and executed by the processor 11 to implement the generation method of any of the above embodiments. Since the electronic device adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be described in detail here.
[0079] The electronic device 10 also includes a communication interface 13 for communicating with external devices and exchanging data. If the processor 11, memory 12, and communication interface 13 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0080] Optionally, in a specific implementation, if the processor 11, memory 12 and communication interface 13 are integrated on a single chip, the processor 11, memory 12 and communication interface 13 can communicate with each other through an internal interface.
[0081] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0082] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0083] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0084] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0085] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0086] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many forms under the guidance of this application without departing from the spirit and scope of protection of the claims. All equivalent transformations made under the inventive concept of this application using the content of this application's specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.
Claims
1. A method for generating a dental restoration plan, characterized in that, include: In response to the user's input of dental restoration content, the dental restoration content is converted into a query vector; In response to the user's first selection operation on at least one document knowledge base, the index file of the corresponding document knowledge base is loaded; wherein, the document knowledge base includes multiple ones, one document knowledge base is used to locally store multiple text blocks in a dental restoration subfield, and the index file is used to store the vector blocks converted by each text block in the document knowledge base and the mapping relationship between them; The query vector is matched with multiple vector blocks in the index file to generate search results; Based on the search results and the dental restoration content, a first prompt word is constructed; the first prompt word is used to limit the knowledge of the large language model to originate from the search results. The first prompt word is sent to the external large language model so that the large language model can generate a dental restoration plan related to the dental restoration content based on the search results; Receive the dental restoration plan returned by the large language model.
2. The generation method according to claim 1, characterized in that, Before converting the dental restoration content into a query vector in response to user input, the generation method further includes: In response to the received data document in the dental restoration subfield, the data document is formatted and segmented to form multiple text blocks; In response to the user's second selection operation on one of the document knowledge bases, multiple text blocks are stored in the selected document knowledge base.
3. The generation method according to claim 2, characterized in that, After storing multiple text blocks of a document into the selected document knowledge base, the generation method further includes: Each text block is vectorized using a preset Chinese embedding model to obtain the corresponding vector block; The vector blocks and the mapping relationships between the vector blocks and the corresponding text blocks are stored in the index file of the selected document knowledge base.
4. The generation method according to claim 1, characterized in that, The step of loading the index file of the corresponding document knowledge base in response to the user's first selection operation on at least one document knowledge base includes: In response to the user's first selection operation on at least one document knowledge base, the name of the selected document knowledge base is filled into a preset storage path template, and the file path of the corresponding index file is generated. Based on the file path, load the corresponding index file.
5. The generation method according to claim 1, characterized in that, The query vector is matched with the vector blocks in the index file to generate search results, including: The query vector is compared with the multiple vector blocks in the index file to obtain the corresponding multiple similarity scores; The multiple similarity scores are sorted in descending order to determine the vector blocks whose similarity scores are in the top k positions; k is an integer greater than 1. Based on the mapping relationship between the first k vector blocks and the k text blocks, obtain the corresponding k text blocks; The text contents of the k text blocks are concatenated in descending order of similarity scores to obtain the search results.
6. The generation method according to claim 1, characterized in that, The dental restoration content input by the user includes dental restoration problems and patient treatment information. The step of constructing a first prompt word based on the search results and the dental restoration content input by the user includes: filling the search results and the dental restoration problems into a preset access role prompt template to obtain the first prompt word.
7. The generation method according to claim 1, characterized in that, The search results are composed of the text content of multiple text blocks, and each text block has an embedded source identifier; After generating the search results, the generation method further includes: using a preset text template of the role of the oral restoration expert, the diagnostic suggestion output standard, and the information annotation rules as a second prompt word; the information annotation rules include annotating the text content in the dental restoration plan that comes from the document knowledge base with its corresponding source identifier; When sending the first prompt word, the generation method further includes: simultaneously sending the second prompt word to the large speech model, so that the large language model generates the dental restoration plan based on the first prompt word and the second prompt word.
8. The generation method according to claim 1, characterized in that, Also includes: Upon receiving the dental restoration plan, a corresponding session identifier is generated; Write the session identifier, the user identity identifier who requested the generation of the dental restoration plan, the request timestamp, and the relevant document knowledge base name into a preset log record; The log records are synchronized to a preset audit database so that audit terminals can query the log records.
9. The generation method according to claim 1, characterized in that, The dental restoration content includes dental restoration issues and the patient's medical information; Converting the dental restoration content into a query vector includes converting the dental restoration problem and the patient's treatment information into the query vector.
10. An electronic device, characterized in that, include: A processor and a memory, wherein instructions are stored in the memory and loaded and executed by the processor to implement the generation method as described in any one of claims 1 to 9.
