Large language model-based silk path knowledge base intelligent question-answering system
By building a multimodal knowledge base and optimizing the retrieval algorithm, the problems of insufficient knowledge coverage and model hallucination in the existing question-answering system in the field of the Silk Road are solved, efficient and accurate knowledge services are achieved, and the needs of multi-source heterogeneity and professionalism are met.
Patent Information
- Application Number
- CN202510861928.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-10
AI Technical Summary
The existing question-answering system based on large language models has problems in the Silk Road-related fields, such as insufficient domain knowledge coverage, model hallucination problems, low retrieval efficiency and weak multimodal support, making it difficult to meet the knowledge needs of multi-source heterogeneity, professionalism and strong dynamism.
Build a multimodal knowledge base, optimize retrieval algorithms and prompt engineering technology, collect multi-source data through a distributed crawler network, build structured and unstructured knowledge bases, and adopt a hybrid retrieval mechanism with adaptive weights and a multi-layer verification mechanism to achieve efficient and accurate Silk Road knowledge question and answering.
It achieves comprehensive coverage of Silk Road knowledge, improves the accuracy of professional terminology queries and the authenticity of answers, reduces the model hallucination rate, and provides efficient knowledge service support.
Smart Images

Figure CN120764676A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing and artificial intelligence technology, and specifically to a Silk Road knowledge base intelligent question-answering system based on a large language model, which is used to efficiently process and answer professional questions in the fields of history, culture, economy, trade, geographic information, etc. related to the Silk Road. Background Art
[0002] Today, the demand for knowledge in fields related to the Silk Road (such as history, archaeology, economics, geography, and culture) is growing. However, Silk Road knowledge has the following characteristics: (1) Multi-source heterogeneity: data is scattered across different media such as ancient books, academic papers, archaeological reports, and digital archives, and is in a variety of formats (text, tables, and images); (2) Professionalism: It involves a large number of historical events, changes in place names, trade data, etc., requiring interpretation by domain experts; (3) Dynamicity: Modern cooperation policies and economic data require real-time updates. Traditional manual retrieval or general search engines are unable to efficiently meet such needs, and intelligent knowledge management tools are urgently needed.
[0003] Although question-answering systems based on large language models (LLMs) have performed well in general domains (such as ChatGPT), they still have significant shortcomings in vertical domains such as the Silk Road: (1) Insufficient domain knowledge coverage: The proportion of Silk Road-related corpus in general model training data is low, resulting in a biased understanding of professional terms; (2) Model hallucination problem: When generating answers, it is easy to confuse similar concepts or fabricate non-existent facts; (3) Inefficient retrieval efficiency: Traditional keyword matching has difficulty processing semantically complex queries, and relying solely on vector retrieval may ignore key co-occurring words; (4) Weak multimodal support: Silk Road knowledge includes non-text data such as maps and cultural relics images, and existing systems lack cross-modal alignment capabilities. In addition, domain adaptation optimization (such as fine-tuning LLMs) faces challenges such as scarce labeled data and high training costs. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention provides a Silk Road knowledge base intelligent question answering system (SilkRoadQA) based on a large language model. By constructing a multimodal knowledge base, optimizing retrieval algorithms and prompt engineering technology, it achieves efficient and accurate Silk Road knowledge question answering.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A Silk Road knowledge base intelligent question-answering system based on a large language model includes a Silk Road data acquisition module, a Silk Road knowledge base construction module, a data storage system module, and a human-computer interaction module, wherein:
[0007] The Silk Road data collection module is used to collect Silk Road knowledge data from multiple sources;
[0008] The Silk Road knowledge base construction module is used to process multi-source Silk Road knowledge data to construct a structured knowledge base and an unstructured knowledge base;
[0009] The data storage system module is used to store structured knowledge bases and unstructured knowledge bases, and provide structured retrieval interfaces and unstructured retrieval interfaces;
[0010] The human-computer interaction module is used to identify the user's intention according to the user's question, and output the answer corresponding to the user's question using the corresponding answer generation method based on the user's intention.
[0011] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution. They are merely further supplements or optimizations. Under the premise that there are no technical or logical contradictions, each optional method can be combined separately for the above-mentioned overall solution, or multiple optional methods can be combined.
[0012] Preferably, the Silk Road data collection module collects Silk Road knowledge data from multiple sources and performs the following operations:
[0013] Implement a multi-source heterogeneous data collection strategy: Use the Scrapy-Redis framework to build a crawler network, deploy at least 20 crawler worker nodes, configure a dynamic IP proxy pool for each crawler worker node using a combination of commercial and residential proxies, build at least 200 browser fingerprints into the User-Agent rotation strategy, and dynamically select browser fingerprints through a random switching mechanism to collect multi-source heterogeneous data through the crawler network;
[0014] Implement a targeted collection strategy: batch acquire academic resources related to Silk Road knowledge through the DOI interface; connect to the Silk Road Museum website to collect cultural heritage data; obtain policy documents related to Silk Road knowledge from the official Silk Road Cooperation website; and obtain archaeological reports related to Silk Road knowledge from the official website of the Institute of Archaeology.
[0015] Preferably, the Silk Road Knowledge Base Construction Module constructs a structured knowledge base and performs the following operations:
[0016] Use layout parsing technology to identify the table area of each document in the multi-source Silk Road knowledge data;
[0017] Parse the two-dimensional structure of rows and columns in the table area;
[0018] Use the type inference engine to identify the data type of each column in the table area and perform standardized conversion;
[0019] The two-dimensional structure of the table and the table contents after standardization conversion are classified and stored in a structured database based on MySQL;
[0020] After traversing all documents and completing storage, a structured knowledge base is formed.
[0021] Preferably, the Silk Road knowledge base construction module constructs an unstructured knowledge base and performs the following operations:
[0022] Use layout parsing technology to identify the text of each document in the multi-source Silk Road knowledge data;
[0023] Use sliding windows to slice text;
[0024] Multi-level semantic enhancement is performed on each slice: the first level uses the Silk Road Entity Recognition Model to standardize all entities; the second level uses the Co-reference Resolution Model to add entity relationships with adjacent slices; the third level uses the TextRank algorithm to extract key phrases for each slice;
[0025] The slices after multi-level semantic enhancement are stored in an unstructured database based on the Elastic-Search framework;
[0026] After traversing all documents and completing storage, an unstructured knowledge base is formed.
[0027] Preferably, the execution logic of the structured search interface is as follows:
[0028] First, a large language model is used to convert user questions into SQL statements, and then the structured knowledge base is queried through the SQL statements to obtain the corresponding retrieval results and return them.
[0029] Preferably, querying the structured knowledge base through SQL statements to obtain corresponding search results and returning them includes:
[0030] Perform semantic verification on SQL statements and use knowledge base metadata to correct semantic errors;
[0031] Parse the SQL statements and use correction templates to correct incorrect syntax;
[0032] The structured knowledge base is queried using SQL statements that have undergone semantic verification and grammatical parsing. If the result is empty, a large language model is used to generate rhetorical questions based on historical user questions and corresponding answers, and the rhetorical questions and empty tags are used as output; otherwise, the retrieval results of the structured knowledge base are used as output.
[0033] Preferably, the execution logic of the unstructured search interface is as follows:
[0034] Extract keywords from each text fragment in the unstructured knowledge base;
[0035] Calculate the BM25 score of the keywords of the user question and each text segment in the unstructured knowledge base;
[0036] Use the text embedding model to encode each text fragment in the unstructured knowledge base to obtain the text fragment vector;
[0037] Use the sentence vector model to encode the user question to obtain the user question vector;
[0038] Calculate the inner product of the text segment vector and the user question vector to get the relevance score;
[0039] Calculate the weighted sum of the BM25 score and the correlation score as the mixed score;
[0040] Select the top candidate with the highest mixed score in the unstructured knowledge base text segments as candidate text segments;
[0041] The ROM semantic relevance model is used to measure the relevance of candidate text segments to user questions, and the top candidate with the highest relevance is selected. The candidate text segments are taken as retrieval results and fed back.
[0042] Preferably, the calculation is a weighted sum of the BM25 score and the relevant score, wherein the weight value of the BM25 score is , the weight of the relevant score is The weight value is The dynamic adjustment process during the training phase is as follows:
[0043] Construct a five-dimensional feature vector based on the last user question and retrieval results;
[0044] The weight prediction model is used to offline predict the optimal weight value based on the five-dimensional feature vector;
[0045] Adopt online reinforcement learning mechanism to output the optimal weight value based on the last search results;
[0046] The current optimal weight value is determined based on the multi-index constraint verification mechanism as follows:
[0047]
[0048] Where, is the current optimal weight value, is the weight value output by the weight prediction model, is the weight value output by the online reinforcement learning mechanism, is the eigenvalue of the problem type in the five-dimensional eigenvector, is the conversation context relevance in the five-dimensional feature vector;
[0049] After the training is completed, the current optimal weight value As the weight value of BM25 score .
[0050] Preferably, the user intent includes direct generation, unstructured query, structured query, and policy query, and the outputting of the answer corresponding to the user question using the corresponding answer generation method based on the user intent includes:
[0051] If the user's intention is to generate directly, the large language model will directly output the answer based on the user's question;
[0052] If the user's intention is an unstructured query, the user's question is input into the unstructured retrieval interface to obtain the retrieval results, and the answer is output based on the retrieval results through the large language model;
[0053] If the user's intention is a structured query, the user's question is input into the structured retrieval interface to obtain the retrieval results, and the answer is output based on the retrieval results through the large language model;
[0054] If the user's intention is to query policies and regulations, the corresponding type of sub-template will be called according to the user's question, and the prompt words will be constructed according to the sub-template and input into the large language model, and the large language model will output the answer based on the prompt words.
[0055] Preferably, the types of the sub-templates include trade policy sub-templates, infrastructure policy sub-templates and cultural cooperation policy sub-templates, and different types of sub-templates have different keywords.
[0056] The Silk Road Knowledge Base intelligent question-answering system based on a large language model provided by the present invention has the following advantages compared to the prior art:
[0057] (1) Domain adaptability advantage: The system is designed specifically for the characteristics of Silk Road knowledge, comprehensively covering multi-dimensional professional content such as historical evolution, cultural heritage, and economic and trade exchanges. Through customized knowledge base construction and domain optimization algorithms, it effectively solves the problem of vertical domain knowledge service; (2) High accuracy advantage: The hybrid retrieval mechanism with adaptive weights is combined with semantic rearrangement technology, organically integrating keyword matching and deep semantic understanding, significantly improving the accuracy of professional terminology queries and complex problem answers; (3) Low hallucination rate advantage: Through knowledge base fact constraints and refined prompt engineering design, a multi-layer verification mechanism is established to effectively suppress the fictitious content of large language models and ensure the authenticity and reliability of generated answers. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a structural diagram of the Silk Road knowledge base intelligent question-answering system based on a large language model of the present invention. DETAILED DESCRIPTION
[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0061] In response to the problems existing in the existing technology, this embodiment constructs a dedicated question-answering system that integrates a domain knowledge base, hybrid retrieval technology, and prompt engineering optimization to achieve accurate and reliable Silk Road knowledge services.
[0062] like Figure 1 As shown, the Silk Road knowledge base intelligent question answering system based on the large language model provided in this embodiment includes a Silk Road data acquisition module, a Silk Road knowledge base construction module, a data storage system module and a human-computer interaction module.
[0063] (1) Silk Road Data Collection Module: This module uses a distributed crawler framework to comprehensively collect Silk Road-related knowledge from multiple data sources, including structured and unstructured data such as historical documents, academic papers, archaeological reports, and policy documents. The Silk Road Data Collection Module is an important foundation for the intelligent question-answering system of the Silk Road Knowledge Base. Its core task is to obtain high-quality Silk Road-related knowledge from widely distributed and diverse sources.
[0064] To collect multi-source heterogeneous data, a distributed crawler cluster architecture was first designed. Using the Scrapy-Redis framework, a horizontally scalable crawler network was constructed, deploying at least 20 crawler worker nodes to ensure dynamic expansion of collection capacity as demand dictates. Each node was configured with a dynamic IP proxy pool, combining Luminati (commercial proxy) and Sesame Proxy (residential proxy) to circumvent IP blocking restrictions on the target network. Furthermore, a customized User-Agent rotation strategy with over 200 built-in browser fingerprints was implemented to reduce the risk of identification by randomly switching between browser fingerprints. Furthermore, the request frequency was automatically adjusted based on the target website's response time to avoid triggering anti-crawling mechanisms and ensure a stable collection process. The User-Agent rotation strategy of this embodiment incorporates over 200 built-in browser fingerprints, covering multiple versions of major browsers and their operating system combinations. This creates a rich fingerprint pool that more realistically simulates human user access behavior compared to traditional crawlers that rely on only a few browser fingerprints. Furthermore, the random switching mechanism dynamically selects a browser fingerprint from the fingerprint pool upon each request, avoiding fixed usage patterns and reducing the likelihood of being identified as a crawler by the target website.
[0065] In terms of targeted collection, the system is optimized for the characteristics of Silk Road-related data. For academic resources, it uses the DOI (Digital Object Identifier) interface to batch retrieve core journal articles related to the Silk Road, supporting PDF downloads. For cultural heritage data, it connects with relevant websites such as the Silk Road Museum to collect multilingual descriptions of World Heritage sites along the Silk Road. For policy documents, it monitors the policy release section of the Silk Road Cooperation website and implements a triggered crawling mechanism to obtain the latest official documents in real time. For archaeological reports, it crawls annual excavation briefs from authoritative institutions such as the Institute of Archaeology, preserving the mixed text and image content. The data obtained through multi-source heterogeneous data collection strategies and targeted collection strategies are combined to form multi-source Silk Road knowledge data.
[0066] (2) Silk Road Knowledge Base Construction Module: It performs in-depth analysis on the collected raw data and supports operations such as table extraction and text slicing in various data formats such as PDF, HTML, and DOC. The sliced text is used to build an unstructured knowledge base, and the extracted tables are used to build a structured knowledge base.
[0067] (2-1) Table Extraction: For HTML files, PDF files, and scanned books in the collected raw data, layout parsing technology is used to identify table areas within the documents. These detected table areas are then fed into the table structure recognition pipeline to analyze the row and column structure. For complex tables with merged cells, a recursive segmentation algorithm is used to break the table into a standardized two-dimensional structure by analyzing cell alignment and content semantic relevance. The table content extracted by layout parsing technology is processed by a type inference engine, which automatically identifies the data type of each column and performs standardized conversions. For example, dates are uniformly converted to the ISO 8601 format, geographic coordinates are converted to the WGS84 standard, and units of measurement are standardized to the International System of Units. After the table structure and content are extracted, a relational storage solution is designed to categorize the table data and store it in a structured database based on MySQL, forming a structured knowledge base. To maintain data traceability, each table is associated with a metadata record that stores information such as the original source and extraction time.
[0068] (2-2) Text Slicing: A dynamic adaptive window algorithm is employed, comprehensively considering both text structure and semantic integrity. First, document structure analysis is performed using layout parsing technology to identify logical structural markers such as chapter titles and paragraph boundaries. The basic slicing window is set to a fixed length and advances using a sliding window approach, maintaining appropriate overlap to ensure contextual coherence. The window size is automatically adjusted based on the content type; for example, the sliding window size is reduced when a list item is detected. The slicing process implements multi-level semantic enhancement: The first level uses a Silk Road entity recognition model (e.g., the BERT-IDCNN-Bi LSTM-CRF model) to identify all historical place names, people, cultural entities, and so on. The second level establishes cross-slice entity connections using a coreference resolution model (e.g., the rule-based Stanford CoreNLP model). The third level uses the TextRank algorithm to extract key phrases from each slice. After multi-level semantic enhancement, the text slices are stored in an unstructured database based on the ElasticSearch framework, forming an unstructured knowledge base.
[0069] (3) Data storage system module: stores the organized Silk Road knowledge and designs an efficient knowledge retrieval interface based on the characteristics of the knowledge to quickly retrieve the required data.
[0070] (3-1) Unstructured search interface: The index of the unstructured knowledge base adopts a combination of sparse search and dense vector search. To solve the problem of insufficient domain adaptability caused by fixed weight parameters in the combination of the two search methods, supervised learning and reinforcement learning methods are used to realize adaptive optimization of search weights through multi-dimensional feature modeling and online learning mechanism, and a multi-level optimization system containing short-term behavior feedback and long-term knowledge evolution is constructed to improve the processing capacity for complex semantic problems. The construction of the sparse search vector library adopts a combination of BM25 algorithm and keyword search. In the keyword search process, the keywords in each text segment are generated by a large language model to more briefly represent the content of the text segment . BM25 is a bag-of-words search function that ranks a set of documents according to the frequency of query statements in each text segment, regardless of their proximity in the text segment. For example, given the user question , containing the word , , the BM25 score of the question and a text segment in the unstructured knowledge base is:
[0071]
[0072] where is the BM25 score of the question and the segment in the unstructured knowledge base, is the frequency of the word in the text segment , is the length of the text segment , represents the average length of the text segment in the text segment set (referring to the set of all text segments stored in the unstructured knowledge base after slicing processing), and are hyperparameters, is the inverse document frequency of the word , and its calculation formula is as follows:
[0073]
[0074] where represents the total number of text segments in the text segment set, represents the number of text segments in the text segment set containing the word , . The text segments involved in the BM25 algorithm are text segments Key words in the title .
[0075] In the dense vector retrieval process, each text segment is encoded using a general text embedding model BGE Embedding to obtain the vector corresponding to each text segment . At the same time, the user question is encoded into a vector by a sentence vector model (such as a BERT model) , and then the correlation score is calculated by inner product .
[0076]
[0077] According to the two retrieval methods, the mixed score is calculated:
[0078]
[0079] According to the mixed score, the top 50 text segments are selected. In the above retrieval process, the algorithm focuses more on co-occurrence words, and the retrieval ability for semantic relevance is poor, so the ROM semantic relevance model is used to reorder the retrieved text segments. The question and the 50 text segments are input into the ROM semantic relevance model, the correlation score is calculated, and the top 5 text segments with the highest correlation score are selected as the retrieval result.
[0080] The method of this embodiment dynamically adjusts the weight value in the training stage, and directly calculates the mixed score using the weight value adjusted in the training stage in the actual application stage. The training stage constructs a multi-dimensional feedback learning optimization weight value , which specifically includes the following steps:
[0081] A. Feature engineering modeling.
[0082] A five-dimensional feature vector is constructed .
[0083] The problem type feature value is represented. For the user's question, the probability distribution of the problem type (corresponding to the user's intention, including direct generation, unstructured query, structured query, and policy regulation query) is output by the pre-trained classifier, and the probability value of the type to which the current question belongs is captured as the problem type feature value.
[0084] The retrieval result diversity index is represented, which is the Jaccard similarity variance of the top 50 candidate text segments, where represents the first candidate text segments and questions Jaccard similarity, Indicates the number of candidate texts, which is 50 in this embodiment. Represents the mean Jaccard similarity of all candidate texts.
[0085]
[0086]
[0087] Represents user behavior feedback characteristics and defines click attenuation factors ,in is the attenuation coefficient, The position number of the search result clicked by the user. The search result is 5 objects arranged from high to low according to the relevance score. If the user clicks the third one, The click decay factor dynamically represents the user's preference for the search results. The closer the value is to 1, the higher the user's recognition of the top results. The value of the click decay factor is used as a user behavior feedback feature.
[0088] Represents the context relevance of the conversation, and uses the Transformer encoder to calculate the current user question The cosine similarity with historical conversations is used to evaluate the contextual relevance of the user's question in the conversation. The closer the value is to 1, the higher the consistency between the current question and the topic of the historical conversation.
[0089]
[0090] in, represents the cosine similarity, a Transformer encoder representing text, Indicates the current problem , Indicates historical issues .
[0091] Indicates user preference characteristics, and the weight values corresponding to the same type of questions in a certain period of statistical history The mean of is taken as the user preference feature.
[0092] B. Construction of weight prediction model.
[0093] The gradient boosting decision tree is used for dynamic weight prediction, and the objective function is defined as:
[0094]
[0095] in, is the Huber loss function, For the first The optimal weight value of the manual annotation of training samples, The model is incrementally updated every 24 hours, using a sliding window mechanism to retain the training data of the last 90 days (when the model is first trained, a batch of initial samples need to be manually labeled to clarify the optimal weight value corresponding to each sample), and offline prediction is performed after regular incremental updates. The total number of training samples for the weighted prediction model, Indicates the Problems in training samples The five-dimensional feature vector of Refers to the optimal weight value automatically generated by the model for different user questions , recorded as .
[0096] C. Online reinforcement learning mechanism.
[0097] The online reinforcement learning mechanism achieves real-time dynamic optimization of weights by building a dual Q-network (DDNQ) architecture. Its core is to establish a continuous interactive feedback loop between the agent and the retrieval environment. This mechanism models the weight adjustment process as a Markov decision process, which consists of four key components: state space, action space, reward function, and training strategy.
[0098] State Space Integrate the current five-dimensional eigenvector, historical weight value parameters and cumulative return value, where the eigenvector Real-time capture of query semantics, user behavior trajectories, context associations and other dynamic information, historical weights Record the latest 10 adjustment trends, and the return value quantify the effectiveness of the previous strategy.
[0099] Action Space Define a discrete set of weight adjustment operations, set The adjustment step size is used to ensure the adjustment granularity. The strategy balances exploration and exploitation.
[0100] Reward Function A multi-objective fusion design is adopted, in which is the preset weight value, is the accuracy of the current search result, The sorting position of the search result clicked by the user (the search results are sorted from high to low based on the size of the mixed score, which refers to the sorting position of the search result clicked by the user in the returned list).
[0101]
[0102] D, multi-index constraint verification.
[0103] The boundary value of dynamic weight adjustment is set, and a weight stability detection mechanism is established to prevent weight optimization from exceeding a reasonable range. When the adjustment amplitude exceeds 0.15 for 10 consecutive times, an artificial review process is triggered, otherwise the final weight value of this iteration training is obtained according to the following logic , wherein is the output of the weight prediction model, is the real-time weight generated by online reinforcement learning. The weight value after iteration training is taken as the weight value in the actual application stage .
[0104]
[0105] (3-2) Structured search interface: first convert the user question into a SQL statement using a large language model, and then query the structured knowledge base to obtain the corresponding search results. To avoid query errors, the embodiment provides a query process as follows: first, the converted SQL statement is semantically verified, and the pre-set knowledge base metadata (including column types, table structure, foreign key constraints, index information, etc.) is used to constrain the legality of the SQL statement (for example, LlamaIndex method and DB-GPT method). For example, when detecting the value format of the "date" column, automatically correct WHERE data > 2020 to WHERE data > '2020-01-01'. Second, the converted SQL statement is parsed, and a lightweight syntax tree parser (such as the MyBatis plug-in) is used to identify nested query errors, useless aggregation functions (such as SUM functions used in text columns), and correct templates based on historical successful templates as correction templates. Finally, when the SQL query returns an empty result, the large language model is used to understand the dialogue context to generate natural counter questions (such as expanding the user query "the 2023 annual report of a certain company" to "whether to query the financial report of a certain company after 2023?"), guiding the user to refine or change the query conditions, and returning the counter question and empty label.
[0106] (4) Human-computer interaction module: design an intelligent question and answer interaction process. Based on the large language model, natural language understanding is realized, accurate answers are generated through prompt engineering technology, and multi-round dialogue management is supported.
[0107] In the intelligent question-answering process, user questions can be divided into two categories: the first category is unstructured questions and answers, which can be answered directly or the corresponding answers are included in the unstructured knowledge base; the second category is structured questions and answers, and the answers corresponding to the questions are included in the structured knowledge base. Therefore, the system first needs to identify the user's intentions to determine the process used to answer the questions. This embodiment designs four types of intentions and corresponding answer processes for the Silk Road knowledge scenario: direct generation, unstructured query, structured query, and policy and regulation query. After the user asks a question, the intention is first identified by a pre-trained intention recognition module based on a large language model, and then different answer generation methods are selected according to the identified intention.
[0108] A. Direct generation. Users’ questions do not require retrieval of relevant Silk Road knowledge. Instead, the prompting project constructs corresponding prompt words, which are then answered by the large language model.
[0109] B. Unstructured Query. A user's question is first retrieved from an unstructured knowledge base using a hybrid retrieval method and the ROM semantic relevance model to find the five most relevant text snippets. This is done by invoking the unstructured retrieval interface. The question and the most relevant text snippets are then combined through the prompt engineering module to construct prompt words for a response. These prompt words are then input into the large language model to generate a response, which is then returned to the user. If no results are found or the query fails, the large language model generates an unanswered response and returns it to the user.
[0110] C. Structured Query. First, the user's question is input into the large language model to generate the corresponding SQL statement. Then, the corresponding result is searched in the structured knowledge base based on the SQL statement, that is, the structured retrieval interface is called. If the result can be found, the prompt engineering module is used to construct the prompt words generated by the query result and the question again. The prompt words are input into the large language model to generate the corresponding reply. If no result is found (the interface returns an empty tag), the counter-question returned by the interface is returned to the user. If the query statement fails, the large language model generates an unanswerable reply and returns it to the user.
[0111] D. Policy and Regulation Queries. For policy and regulation data, using standard prompt word construction methods often fails to generate a point-by-point list of relevant policies and regulations in a large language model document. Therefore, the query prompt word construction for policy and regulation queries needs to be optimized. First, a multi-level instruction system is constructed. The basic template adopts a standard "role-task-format" structure as the query instruction structure for the large language model. The role defines the system's identity within the query, giving the model a professional perspective. The task defines the specific operational requirements, including the three elements of verb, object, and precision. For example, "List the cross-border e-commerce tax preferential policy clauses effective in 2024" (verb: list; object: tax preferential policies; precision: effective in 2024). The format defines the structured requirements for the results, whether they should be presented in paragraph or table format. Using the role-task-format framework, users' ambiguous natural language queries can be converted into machine-understandable structured instructions. For example, a user's query "Check Silk Road trade policies effective after 2023" would be parsed as: role = Silk Road Policy Researcher + task = list trade policies effective after 2023 + format = list with effective dates.
[0112] Classification sub-templates pre-set key field requirements based on different policy types. These templates extend the base template and pre-set keywords for different policy types to ensure precise information extraction. For example, for the trade policy sub-template, key fields include "Policy Name," "Effective Date," "Affected Countries," and "Trade Terms." Each policy item is presented as a list item such as "Policy Name: XXX, Effective Date: XXX, Affected Countries: XXX, Trade Terms: XXX." For the infrastructure policy sub-template, key fields include "Project Name," "Funding Source," "Construction Period," and "Geographical Scope." Each policy item is presented as a list item such as "Project Name: XXX, Funding Source: XXX, Construction Period: XXX, Geographical Scope." For the cultural cooperation policy sub-template, key fields include "Activity Name," "Partner," "Cultural Theme," and "Implementation Time." Each policy item is presented as a list item such as "Activity Name: XXX, Partner: XXX, Cultural Theme: XXX, Implementation Time."
[0113] Secondly, during the query execution phase, the following three types of dynamic conditions are automatically injected into the prompts: 1) Format constraints, which require the output to strictly adhere to the list format of the classification sub-template to prevent the large language model from generating disorganized text; 2) Content constraints, which extract keywords (such as "trade" and "infrastructure") based on the user's question and limit the answer content to relevant policies to avoid interference from irrelevant information; and 3) Verification requirements, which embed the constraint of "generating only based on knowledge base facts" into the prompts to prevent the model from assuming non-existent policies. Contextual information such as policy indexes, comparison notes, and timeliness statements are also embedded. Finally, the output undergoes post-processing, including clause verification, format standardization, and disclaimers. This allows the large language model to stabilize results related to policy regulations.
[0114] This embodiment provides an example of policy regulations query as follows:
[0115] User question: "List the digital trade policies signed by China and the EU in 2024, including the policy name and effective date";
[0116] Template matching: Identify the user's question as "trade policy" (this can be done using a pre-trained classifier), call the trade policy sub-template, and extract the required fields: policy name and effective date.
[0117] Prompt word structure: [As an international trade analyst, please list the digital trade policies signed by China and the EU in 2024 in the following list format:
[0118] Policy name: XXX;
[0119] Effective Date: XXX;
[0120] Format example:
[0121] Policy name: XXX;
[0122] Effective date: May 1, 2024;
[0123] Note: Only policies officially released by both parties are listed. Format errors will result in query failure.
[0124] Large language model output:
[0125] Policy name: XXX;
[0126] Effective date: March 15, 2024;
[0127] Policy name: XXX;
[0128] Effective date: October 1, 2024].
[0129] The Silk Road knowledge base intelligent question-answering system based on a large language model provided in this embodiment can address the complexity, professionalism, and multi-source characteristics of Silk Road knowledge, utilize the semantic understanding capabilities and knowledge retrieval technology of the large language model, and achieve intelligent integration, accurate retrieval, and reliable generation of multi-source data. This effectively addresses the shortcomings of existing question-answering systems in terms of domain adaptability, accuracy, and anti-hallucination capabilities, and provides efficient knowledge service support for Silk Road historical and cultural research, economic cooperation, and policy consulting.
[0130] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art would be able to make numerous modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A Silk Road knowledge base intelligent question answering system based on a large language model, characterized by: The Silk Road knowledge base intelligent question-answering system based on a large language model includes a Silk Road data acquisition module, a Silk Road knowledge base construction module, a data storage system module, and a human-computer interaction module, wherein: The Silk Road data collection module is used to collect Silk Road knowledge data from multiple sources; The Silk Road knowledge base construction module is used to process multi-source Silk Road knowledge data to construct a structured knowledge base and an unstructured knowledge base; The data storage system module is used to store structured knowledge bases and unstructured knowledge bases, and provide structured retrieval interfaces and unstructured retrieval interfaces; The human-computer interaction module is used to identify the user's intention according to the user's question, and output the answer corresponding to the user's question using the corresponding answer generation method based on the user's intention.
2. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The Silk Road data collection module collects Silk Road knowledge data from multiple sources and performs the following operations: Implement a multi-source heterogeneous data collection strategy: Use the Scrapy-Redis framework to build a crawler network, deploy at least 20 crawler worker nodes, configure a dynamic IP proxy pool for each crawler worker node using a combination of commercial and residential proxies, build at least 200 browser fingerprints into the User-Agent rotation strategy, and dynamically select browser fingerprints through a random switching mechanism to collect multi-source heterogeneous data through the crawler network; Implement a targeted collection strategy: batch acquire academic resources related to Silk Road knowledge through the DOI interface; connect to the Silk Road Museum website to collect cultural heritage data; obtain policy documents related to Silk Road knowledge from the official Silk Road Cooperation website; and obtain archaeological reports related to Silk Road knowledge from the official website of the Institute of Archaeology.
3. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The Silk Road Knowledge Base Construction Module constructs a structured knowledge base and performs the following operations: Use layout parsing technology to identify the table area of each document in the multi-source Silk Road knowledge data; Parse the two-dimensional structure of rows and columns in the table area; Use the type inference engine to identify the data type of each column in the table area and perform standardized conversion; The two-dimensional structure of the table and the table contents after standardization conversion are classified and stored in a structured database based on MySQL; After traversing all documents and completing storage, a structured knowledge base is formed.
4. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The Silk Road Knowledge Base Construction Module constructs an unstructured knowledge base and performs the following operations: Use layout parsing technology to identify the text of each document in the multi-source Silk Road knowledge data; Use sliding windows to slice text; Multi-level semantic enhancement is performed on each slice: the first level uses the Silk Road Entity Recognition Model to standardize all entities; the second level uses the Co-reference Resolution Model to add entity relationships with adjacent slices; the third level uses the TextRank algorithm to extract key phrases for each slice; The slices after multi-level semantic enhancement are stored in an unstructured database based on the Elastic-Search framework; After traversing all documents and completing storage, an unstructured knowledge base is formed.
5. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The execution logic of the structured retrieval interface is as follows: First, a large language model is used to convert user questions into SQL statements, and then the structured knowledge base is queried through the SQL statements to obtain the corresponding retrieval results and return them.
6. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 5 is characterized in that: The querying of the structured knowledge base by SQL statements to obtain corresponding search results and return them includes: Perform semantic verification on SQL statements and use knowledge base metadata to correct semantic errors; Parse the SQL statements and use correction templates to correct incorrect syntax; The structured knowledge base is queried using SQL statements that have undergone semantic verification and grammatical parsing. If the result is empty, a large language model is used to generate rhetorical questions based on historical user questions and corresponding answers, and the rhetorical questions and empty tags are used as output; otherwise, the retrieval results of the structured knowledge base are used as output.
7. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The execution logic of the unstructured search interface is as follows: Extract keywords from each text fragment in the unstructured knowledge base; Calculate the BM25 score of the keywords of the user question and each text segment in the unstructured knowledge base; Use the text embedding model to encode each text fragment in the unstructured knowledge base to obtain the text fragment vector; Use the sentence vector model to encode the user question to obtain the user question vector; Calculate the inner product of the text segment vector and the user question vector to get the relevance score; Calculate the weighted sum of the BM25 score and the correlation score as the mixed score; Select the top candidate with the highest mixed score in the unstructured knowledge base text segments as candidate text segments; The ROM semantic relevance model is used to measure the relevance of candidate text segments to user questions, and the top candidate with the highest relevance is selected. The candidate text segments are taken as retrieval results and fed back.
8. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 7 is characterized in that: The calculation is the weighted sum of the BM25 score and the relevant score, where the weight value of the BM25 score is , the weight of the relevant score is The weight value is The dynamic adjustment process during the training phase is as follows: Construct a five-dimensional feature vector based on the last user question and retrieval results; The weight prediction model is used to offline predict the optimal weight value based on the five-dimensional feature vector; Adopt online reinforcement learning mechanism to output the optimal weight value based on the last search results; The current optimal weight value is determined based on the multi-index constraint verification mechanism as follows: ; Where, is the current optimal weight value, is the weight value output by the weight prediction model, is the weight value output by the online reinforcement learning mechanism, is the eigenvalue of the problem type in the five-dimensional eigenvector, is the conversation context relevance in the five-dimensional feature vector; After the training is completed, the current optimal weight value As the weight value of BM25 score .
9. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 1 is characterized in that: The user intent includes direct generation, unstructured query, structured query, and policy query. The method of outputting the answer corresponding to the user question using the corresponding answer generation method based on the user intent includes: If the user's intention is to generate directly, the large language model will directly output the answer based on the user's question; If the user's intention is an unstructured query, the user's question is input into the unstructured retrieval interface to obtain the retrieval results, and the answer is output based on the retrieval results through the large language model; If the user's intention is a structured query, the user's question is input into the structured retrieval interface to obtain the retrieval results, and the answer is output based on the retrieval results through the large language model; If the user's intention is to query policies and regulations, the corresponding type of sub-template will be called according to the user's question, and the prompt words will be constructed according to the sub-template and input into the large language model, and the large language model will output the answer based on the prompt words.
10. The Silk Road Knowledge Base Intelligent Question Answering System based on a large language model according to claim 9 is characterized in that: The types of sub-templates include trade policy sub-templates, infrastructure policy sub-templates and cultural cooperation policy sub-templates, and different types of sub-templates have different keywords.
Citation Information
Cited By
Large model question and answer method and system based on knowledge base
CN120929576A
A knowledge base-based large model question answering method and system
CN120929576B
Intelligent data query method based on natural language
CN121009157A
Large language model structured multi-mode response method and device oriented to vertical field
CN121168669A
Intelligent policy question and answer method and system based on retrieval enhancement generation and medium
CN121212370A
