Portable knowledge base question and answer method and device based on language model
Through small language model training and real-time iterative optimization, the existing Q&A system has solved the problems of high performance, high cost and small application scope of existing Q&A systems, and has realized a portable knowledge base Q&A with low latency and low computing volume, supporting personal exclusive domain knowledge, and improving response accuracy and user experience.
Patent Information
- Application Number
- CN202511014669.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-08-22
AI Technical Summary
Existing Q&A systems require high equipment performance, are expensive, have a small scope of application, and cannot support personal exclusive domain knowledge. The deployment and training time of large models is long, resulting in poor user experience and insufficient privacy and knowledge confidentiality.
The small language model in the field is trained through small language models, combining incremental training and event-driven training triggers, implement portable knowledge base Q&A, reduce device performance requirements, support personal exclusive domain knowledge Q&A, and optimize the model through real-time data iteration.
It realizes low latency and low computing volume Q&A services, reduces equipment performance requirements, ensures user-specific knowledge privacy, improves response accuracy and efficiency, and is suitable for portable devices.
Smart Images

Figure CN120523918A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a portable knowledge base question-answering method and device based on a language model. Background Art
[0002] Question-answering (Q&A) systems are an advanced form of information retrieval system that accurately and concisely answer user questions in natural language. Generally speaking, a Q&A system is a computer system based on a knowledge base (basic resource library) and involves a series of tasks, including question classification, question retrieval, and answer location and extraction (or generation). While Q&A technology is still in its infancy, it has widespread application across various fields.
[0003] Due to computing power limitations, early question-answering systems typically required a knowledge base and a question database as their computational basis, employing specialized techniques for each database. With the advancement of computer performance and language modeling technology, it's now possible to complete question-answering tasks in specific domains by training small models. For example, ChatGPT (a pre-trained AI model generated using deep learning techniques based on the Transformer architecture) can process user input through natural language processing to generate answers.
[0004] Existing question-answering systems must be deployed on servers, requiring high-performance equipment. System deployment is complex and costly, and they place significant demands on user resources and permissions, limiting their applicability. Furthermore, existing question-answering systems are limited to a small number of large, publicly available, specific domains (i.e., they can only provide answers within a few domains corresponding to large models). They cannot address domain knowledge specific to individuals (or small organizations), resulting in knowledge deficiencies, even knowledge bias, and low accuracy. Furthermore, while large models offer significant performance improvements, they require significant time to deploy, train, and provide answers, resulting in delays in answering questions and impacting user experience.
[0005] However, in real-world scenarios, not every domain offers a large-scale existing knowledge base and question library. Furthermore, existing large-model question-answering systems require very high device performance for local deployment. For domain-specific knowledge base question answering, large models are no more accurate than smaller models; in fact, larger models can lead to slower responses. Furthermore, existing technologies often fail to pre-process data during system deployment, resulting in poor user privacy and knowledge confidentiality. Summary of the Invention
[0006] To address the above-mentioned problems in the existing technology, a portable knowledge base question-answering method and device based on a language model is proposed. The method aims to reduce equipment performance requirements, simplify system deployment processes, reduce costs, expand the scope of application, support personalized domain knowledge question-answering, improve knowledge coverage and answer accuracy, and ensure efficiency and confidentiality. The present invention provides the following technical solutions: A portable knowledge base question-answering method based on a language model is proposed. A domain-specific small language model is obtained through small language model training, and question-answering is performed using the domain-specific small language model. The small language model training process includes: S01. Obtain training data; S02. Label the training data to form a training set; S03. Use the training set to train the base model of the Transformer architecture to form a small language model for your own domain. The training data includes existing historical knowledge collected by the knowledge base, question-answering data, and user-side imported data; During the question-answering process, steps S01, S02, and S03 are automatically repeated using newly added or untrained training data to iteratively train the domain small language model and form a dynamically upgraded domain small language model.
[0007] The real-time incremental training pipeline is designed as follows: (1) Build an event-driven training trigger whose workflow includes: The data quality inspection module adopts a hybrid detection model: when ≥ 0.82, they are allowed to enter the training queue, and an isolation area for abnormal samples is established to store 0.6 ≤ Marginal sample of <0.82.
[0008] (2) Build an incremental training scheduler. The scheduler includes a scheduling algorithm and performs dynamic batch processing through the scheduling algorithm: is the base batch size, To increase the amount of data, The baseline data volume.
[0009] Preferably, in step S02, the text imported by the user end is converted into a word vector in vector form, input into the training set and trained; in step S03, the word vectors of different fields are used as initial word vectors to train the model in the text generation module to complete the training of the domain small language model.
[0010] Preferably, in step S03, after the text of the data imported by the user end is labeled, the labeled data is filtered out, and the word vectors corresponding to the filtered Chinese text are input into the L2P model.
[0011] Preferably, after step S03, hyperparameter adjustment is performed, and the obtained domain small language model is scored and ranked; after multiple iterations of data screening, the optimal model of the domain small language model is obtained, and it is judged whether the conditions are met: if the conditions are not met, the cyclic training continues; if the conditions are met, the optimal model parameters are output to complete the training of the small model; after obtaining the optimal model, the parameters of the model are saved in the device through the model optimal preservation strategy, and the optimal model is used for the next question-and-answer service.
[0012] Preferably, the question-answering process includes: S11. Search the knowledge base based on the input; S12. If the answer is retrieved from the knowledge base, it is displayed to the user and a feedback entry is provided; If similar question fragments are retrieved in the knowledge base, the similar question fragments are used as context and together with the query question to generate prompt words for the language model. Based on these prompt words, the domain language model generates the answer content and feeds back the information used in the referenced knowledge base to the user.
[0013] A portable knowledge base question-answering device based on a language model, comprising: A portable device having a user terminal for importing or viewing information provided thereon; Information import module, which obtains domain knowledge information from user terminals; The information storage module is connected to the information import module, saves and stores the domain knowledge information received by the information import module, and updates it after receiving new information; The information recognition module is connected to the information storage module, converts the domain knowledge information into vector data and stores it in the information storage unit; The information analysis module is connected to the information storage module and the information recognition module respectively. It processes the multiple vector data in the information storage unit through the domain small language model to form the answer corresponding to the question; The information feedback module is connected to the information storage unit and the information analysis module respectively, and returns the content processed by the information analysis unit to the user terminal.
[0014] Preferably, the communication module uses the Wi-Fi communication protocol to communicate, and the generation of communication information includes the following steps: S21. After obtaining the domain name identification code from the user terminal, the information import module determines the data source of the domain name to perform security protection judgment on the device; S22. The information import module determines the domain name type to determine whether the information capture unit or the information import unit retains the information, and the retained information is classified and written into the information database; S23. After receiving the domain name identification code, the information recognition module performs content recognition on whether the import is allowed. If it is allowed, the execution continues; otherwise, it stops. During content recognition, the language recognition model is used to analyze the domain name identification code separately; the matching type of the word segmentation elements and the word segmentation is identified in a word segmentation manner, and their vectors are sorted; and the results are output to the information storage module in a time series manner. S24, the information analysis module uses the search term to select a vector set corresponding to the query word; analyzes each vector and selects the optimal vector; S25. The information feedback module transmits the results of steps S22-S24 to the user terminal, completing the information generation and feedback.
[0015] Preferably, when importing information through the information import module, the following steps are included: S31, the portable device is connected to the information terminal via the communication module to obtain information terminal data; S32. The portable device identifies the acquired information and determines its domain type; S33. The information storage module processes the information and writes the information into the information storage unit for different domain types, where the information types include exclusive domain data, domain information, and non-domain information.
[0016] Preferably, when the information is identified and processed by the information identification module, the following steps are included: S41. Obtain keywords in this field; S42, performing word segmentation processing to obtain a word segmentation set; S43, matching vectors for word segmentation; S44, processing the vector data to form a vector set; S45. After converting to training set, build the model through deep grammar.
[0017] Preferably, when analyzing data by the information analysis module, the following steps are included: S51. Obtain vectors in the word segmentation set and train a semantic model; S52. Select a specific vector set based on the user's search term; S53, searching the vector set; S54. Select the optimal vector through small model analysis.
[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention implements a streamlined process of input, word segmentation, and result processing, including active prompts and result display. This streamlines the input, labeling, small model training, and model joint training process. Through user input, the user's domain-specific tag set can be quickly and efficiently improved, and tags can be identified. Through input, the user can quickly search and identify data from the user's domain-specific question set to obtain relevant results. 2. This invention can achieve fast and efficient data training and retrieval through small models. Compared with traditional large models, small models reduce performance requirements and user operation thresholds. Under the premise of ensuring the privacy of user-specific knowledge, it can achieve accurate and effective responses with minimized resources. 3. The present invention has the advantages of low latency and low computational complexity and can be implemented in portable devices. Compared with traditional methods, this embodiment does not require the use of large-scale pre-trained models, which can reduce device performance requirements to ensure the performance of portable devices. It can analyze the corresponding answers through real-time exported questions to ensure that users can get answers in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of the small language model training process of the present invention; Figure 2 This is a flowchart for iteratively training a small language model in a domain; Figure 3 It is a flowchart of the question-answering process; DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings of the present invention. The directional words mentioned in the following embodiments, such as "up", "down", "left" and "right", etc., are only referenced to the directions of the accompanying drawings. Therefore, the directional words used are used to illustrate rather than limit the invention.
[0021] Example 1 A portable knowledge base question-answering device based on a language model, specifically comprising: A portable device having a user terminal and a communication module for importing or viewing information; Information import module, which obtains domain knowledge information from user terminals; Through the communication module carried by the user terminal and the portable device itself, domain knowledge information can be obtained from the user terminal and transmitted to the information storage module; it is convenient for the user to select several domain knowledge information that can be obtained according to his needs, and then obtain this information through the user terminal on the portable device, and transmit it back to the information storage module with the help of the communication module.
[0022] The information storage module is connected to the information import module, saves and stores the domain knowledge information received by the information import module, and updates it after receiving new information; wherein, the information storage module is provided with an information import unit or an information capture unit; the information import unit and the information capture unit are used to obtain, save and update information in different occasions.
[0023] The information recognition module is connected to the information storage module, converts the domain knowledge information into vector data, and stores it in the information storage unit.
[0024] The information analysis module is connected to the information storage module and the information recognition module respectively. It processes multiple vector data in the information storage unit through the domain small language model to form questions and answers corresponding to the questions.
[0025] The information feedback module is connected to the information storage unit and the information analysis module respectively, and returns the content processed by the information analysis unit to the user terminal.
[0026] With the help of the communication module in the portable device cooperating with the communication system of the user terminal, a portable knowledge base question and answer method based on the language model can be implemented. When using this method, the user can send a communication connection request to the communication module of the portable device through the user terminal, and complete the communication link through the communication module.
[0027] The TCP communication protocol is used to transmit data between the user terminal and the portable device, connecting the user's operating system and the portable device. Portable devices can be mobile phones, iPads, and other devices with built-in communication modules. The user terminal, serving as the interactive platform, can be a desktop computer, laptop computer, smartphone, tablet, smart TV, or other device. The communication module is responsible for connecting the communication protocol using communication technologies such as Ethernet, Wi-Fi, Bluetooth, and cellular networks.
[0028] In this embodiment, the communication module uses the Wi-Fi communication protocol to communicate, and the user terminal is a personal user terminal or an enterprise user terminal. The device and the user terminal can communicate through the Wi-Fi protocol, and communication transmission is performed in WFD or WFD direct connection mode, and knowledge import, identification, analysis, and feedback are completed with the help of portable devices and user terminals.
[0029] The generation of communication information includes the following steps: S21. After obtaining the domain name identification code from the user terminal, the information import module determines the data source of the domain name to perform security protection judgment on the device; S22. The information import module determines the domain name type to determine whether the information capture unit or the information import unit retains the information. The information to be retained is classified and written into the information database. S23. After receiving the domain name identification code, the information recognition module performs content recognition on whether the import is allowed. If it is allowed, the execution continues; otherwise, it stops. During content recognition, the language recognition model is used to analyze the domain name identification code separately, identify the matching type of the word segmentation elements and the word segmentation in a word segmentation manner, and sort their vectors; and output the results to the information storage module in a time series manner. S24, the information analysis module uses the search term to select a vector set corresponding to the query word segmentation; analyzes each vector according to the small model and selects the optimal vector; S25. The information feedback module transmits the calculation results of steps S22-S24 to the user terminal, completing the information generation and feedback.
[0030] Specifically, when importing information through the information import module, the following steps are included: S31, the portable device is connected to the information terminal via the communication module to obtain information terminal data; S32. The portable device identifies the acquired information and determines its domain type; S33. The information storage module processes the information and writes the information into the information storage unit for different domain types, where the information types include exclusive domain data, domain information, and non-domain information.
[0031] Special domain information refers to the information related to the user domain content, and non-domain information refers to the information outside the user domain for users to browse.
[0032] Dedicated domain data refers to user-specific domain knowledge that can be used to identify information in a device. Domain information refers to information within dedicated domain data that is relevant to that domain, while non-domain information refers to information within dedicated domain data that is not relevant to that domain. Dedicated user domain knowledge can include daily user communication voice and text, as well as dedicated domain information extracted from existing domain information based on user usage habits and user-uploaded domain information.
[0033] Dedicated user information may be the user's private information, which may be used to analyze user preferences and may be voice, video, or text information.
[0034] The information storage unit is provided with a dedicated information storage subunit for storing exclusive domain data; the information storage unit is provided with a domain information storage subunit and a non-exclusive information subunit for storing domain information and exclusive domain information, as well as non-domain information respectively.
[0035] Specifically, the information recognition module is responsible for generating vector data of the field and generating the dimension of the field to generate vector data and save it to the domain information storage unit. When identifying and processing information, the following steps are included: S41. Obtain keywords in this field; S42, performing word segmentation processing to obtain a word segmentation set; S43, matching vectors for word segmentation; The identification process for this small domain is as follows: First, word segmentation is performed using a specialized dictionary to obtain a set of segmented words. Then, matching is performed using the specialized dictionary to determine the semantic position of each segmented word and label the segmented word. If the segmented word is not found in the specialized dictionary, a deep learning algorithm is used to match the segmented word. If the match is unsuccessful, the approximate semantics of the corresponding segmented word are calculated and the corresponding label is assigned. Then, using the cosine similarity algorithm, the vector with the closest approximation or matching vector or the content with the closest semantics is selected as the similarity vector.
[0036] S44, processing the above vector data to form a vector set; Specifically, the vector set processing process is as follows: first, use the relevant algorithm to build a semantic model. Then, import the word segmentation information, obtain each word segmentation information from the analysis unit, and build a vector set.
[0037] S45. After being converted into a training set, a model is constructed through deep grammar. Specifically, it is used as a training set in an unsupervised learning manner.
[0038] Specifically, when analyzing data through the information analysis module, the following steps are included: S51. Obtain vectors in the word segmentation set and train a semantic model; S52. Select a specific vector set based on the user's search term; S53, searching the vector set; S54. Select the optimal vector through small model analysis.
[0039] The training process for the small model begins with a preliminary summary of user behavior information to form a vector set. Unsupervised and deep learning algorithms are then used to analyze this vector information and construct a user behavior semantic model. This allows the user to select the optimal vector for their query through retrieval and analysis. User behavior includes browsing history, search history, and attention history. For example, information about a user's area of interest is compared with the vector set for that area, and the vector with the highest match is selected as the output vector.
[0040] When the information feedback module is operating, it calculates the acquired semantic model vectors and selects the vector with the highest matching degree to provide feedback to the user, completing the current question-answering process. Specifically, the process includes the following: first, through search, matching analysis, and selection, the most similar vector among the output vectors is fed back to the user terminal for selection; then, the selection result is returned to the user, completing the analysis.
[0041] Example 2 Based on the same idea, the difference from Example 1 is that another portable knowledge base question-answering device based on a language model includes: The data annotation unit is used to collect historical knowledge as training data to train the annotation tool model; data annotation forms a training set, a question set, and a label set.
[0042] The model training unit is used to train the small model using the training set and select the optimal model and model parameters as the final output model; The interactive unit is used to input the data in the knowledge base into the optimal model, call the relevant data in the knowledge base according to the return result of the optimal model, display the relevant data, and prompt the user to make a selection; The voice guidance unit is used to guide user input, predict and return results based on voice prompts.
[0043] Among them, data categories include training sets and questions.
[0044] The labeling steps of the data labeling unit include: S61, accepting input data: accepting input data in a text box on the user interaction interface; S62, formatting the data returned by the backend through processing by the backend server; S63. Fill the input data into the training data, classify it into different categories, perform preliminary processing, and import the data into the training set.
[0045] The training steps of the model training unit include: S61, the Chinese text imported from the user terminal is passed through the pre-trained model and the training set to be trained is input to complete the small model training; S62. The Chinese text imported from the user end for training the small model is passed through the retraining model, and the training set to be trained is input to complete the training of the small model.
[0046] Example 3 Based on the same technical concept, the difference from Example 1 and Example 2 is that the portable knowledge base question and answer device based on the language model includes: a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the steps of the portable knowledge base question and answer device based on the language model.
[0047] Example 4 Based on the same technical concept, a computer-readable storage medium can be obtained, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the portable knowledge base question-answering device based on the language model.
[0048] The above portable knowledge base question-answering device based on language model can be applied to notebooks, personal computers, tablet computers, and smart phones.
[0049] Example 5 A portable knowledge base question answering method based on a language model, which obtains a domain small language model through small language model training and uses the domain small language model for question answering; Figure 1 As shown, the small language model training process includes: S01. Obtain training data; the training data includes existing historical knowledge collected by the knowledge base, question-and-answer data, and user-side imported data; S02. Label the training data to form a training set; Convert the text imported by the user into word vectors in vector form, input them into the training set and perform training; S03. Use the training set to train the base model of the Transformer architecture to form a personal domain-specific small language model.
[0050] Among them, word vectors of different fields are used as initial word vectors to train the model in the text generation module to complete the training of the domain small language model.
[0051] Among them, after the text labels of the data imported by the user end are annotated, the labeled data is filtered out, and the word vectors corresponding to the filtered Chinese text are input into the L2P model.
[0052] After step S03, hyperparameter adjustment is performed, and the obtained domain small language model is scored and ranked according to the indicators; after multiple data screening iterations, the optimal model of the domain small language model is obtained, and it is judged whether the conditions are met: if the conditions are not met, the training cycle continues; if the conditions are met, the optimal model parameters are output to complete the training of the small model; after obtaining the optimal model, the parameters of the model are saved and recorded in the device through the model optimal preservation strategy, and then the optimal model is used for the next question-and-answer service.
[0053] During the question-answering process, steps S01, S02, and S03 are automatically repeated using newly added or untrained training data to iteratively train the domain small language model and form a dynamically upgraded domain small language model.
[0054] The real-time incremental training pipeline is designed as follows: (1) Build an event-driven training trigger whose workflow includes: The data quality inspection module adopts a hybrid detection model: when ≥ 0.82, they are allowed to enter the training queue, and an isolation area for abnormal samples is established to store 0.6 ≤ Marginal sample of <0.82.
[0055] (2) Build an incremental training scheduler. The scheduler includes a scheduling algorithm and performs dynamic batch processing through the scheduling algorithm: is the base batch size, To increase the amount of data, The baseline data volume.
[0056] like Figure 1-2 As shown, through the first small language model training, the first domain small language model is obtained, and then the second small language model training is performed again with the newly added or untrained data to obtain the second domain small language model, and then the newly added or previously untrained data of the updated knowledge base is trained for the Nth time to obtain the Nth domain small language model, and the data is filtered iteratively in these N domain small language models to obtain the optimal model of the domain small language model, with the aim of obtaining the optimal model that meets the conditions. After applying the optimal model for question and answer, its question and answer data is added to the knowledge base, and through the knowledge base assisted question and answer, the question and answer data will also be added to the training data for training.
[0057] Specifically, such as Figure 3 The question-answering process shown includes: S11. Search the knowledge base based on the input; S12. If the answer is retrieved from the knowledge base, it is displayed to the user and a feedback entry is provided; If similar question fragments are retrieved in the knowledge base, the similar question fragments are used as context and together with the query question to generate prompt words for the language model. Based on these prompt words, the domain language model generates the answer content and feeds back the information used in the referenced knowledge base to the user.
[0058] In the present invention, small models are pre-installed in the device and can be customized for training in response to different user needs; users can input data in real time to expand the vocabulary library in the system; the system performs data labeling and small model training, and through a series of data preprocessing, the training data input by the user is labeled, and the data is classified and labeled; through a series of iterative cycles, the small model and the optimal model obtained through training are personalized and customized.
[0059] The data input by the user is annotated and optimized through the method of the present invention to realize the final optimal model, so as to achieve a fast and effective response to the data input by the user.
[0060] The present invention streamlines the input, word segmentation, and result processing, including voice prompts and display, through a streamlined process of input, labeling, small model training, and joint model training. This allows for the voice-guided process to be different from the input. Through user input, the user's domain-specific tag set can be quickly and efficiently improved, and tags can be identified. Through input, the user can quickly retrieve and identify data from the user's domain-specific problem set, and obtain relevant results.
[0061] Based on the same technical concept, for any input data, the present invention can ultimately achieve a voice feedback guidance effect through voice guidance process, and can enable the system to quickly respond to user input.
[0062] The present invention can realize the functions of fast and efficient data training and retrieval through a small model. Compared with the traditional large model, the small model reduces the performance requirements and user operation threshold. Under the premise of ensuring the privacy of the user's domain-specific knowledge, it can achieve accurate and effective responses with minimized resources.
[0063] The present invention has the advantages of low latency and low computational complexity. The advantage of low latency can ensure that it can be applied to portable devices. Compared with traditional methods, this embodiment does not require the use of large-scale pre-training models, which can reduce device performance requirements to ensure the performance of portable devices. It can analyze the corresponding answers through real-time exported questions to ensure that users can get answers in a timely manner.
[0064] This invention provides a portable knowledge base question-answering method and apparatus based on a language model. With the help of a portable device, users can import their domain-specific knowledge in real time, train it in real time using a small model embedded in the device, and perform self-optimization to generate accurate responses. This patent aims to reduce device performance requirements and user operation barriers through the use of a small model. While ensuring the privacy and confidentiality of domain-specific knowledge, this patent aims to achieve accurate and effective responses with minimal resources, thereby improving the user experience.
Claims
1. A portable knowledge base question answering method based on language model, characterized in that: A domain-specific small language model is obtained through small language model training, and question answering is performed using the domain-specific small language model. The small language model training process includes: S01. Obtain training data; S02. Label the training data to form a training set; S03. Use the training set to train the base model of the Transformer architecture to form a small language model for your own domain. The training data includes existing historical knowledge collected by the knowledge base, question-answering data, and user-side imported data; During the question-answering process, the newly added or untrained training data is automatically used to repeat steps S01, S02, and S03 to iteratively train the domain small language model and form a dynamically updated domain small language model. Build an incremental training scheduler. The scheduler includes a scheduling algorithm and performs dynamic batch processing through the scheduling algorithm: is the base batch size, To increase the amount of data, The baseline data volume.
2. The portable knowledge base question answering method based on language model according to claim 1 is characterized in that: In step S02, the text imported by the user end is converted into word vectors in vector form, input into the training set and trained; in step S03, the word vectors of different fields are used as initial word vectors to train the model in the text generation module to complete the training of the domain small language model.
3. The portable knowledge base question answering method based on language model according to claim 1, characterized in that In step S03, after the text of the data imported by the user end is labeled, the labeled data is filtered out, and the word vectors corresponding to the filtered Chinese text are input into the L2P model.
4. The portable knowledge base question answering method based on language model according to claim 1, characterized in that After step S03, hyperparameter adjustment is performed, and the obtained domain small language model is scored and ranked; after multiple iterations of data screening, the optimal model of the domain small language model is obtained, and it is judged whether the conditions are met: if the conditions are not met, the training cycle continues; if the conditions are met, the optimal model parameters are output to complete the training of the small model; After obtaining the optimal model, the model parameters are saved in the device through the model optimal preservation strategy, and the optimal model is used for the next question-answering service.
5. The portable knowledge base question answering method based on language model according to claim 1, characterized in that: The question-answering process includes: S11. Search the knowledge base based on the input; S12. If the answer is retrieved from the knowledge base, it is displayed to the user and a feedback entry is provided; If similar question fragments are retrieved in the knowledge base, the similar question fragments are used as context and together with the query question to generate prompt words for the language model. Based on these prompt words, the domain language model generates the answer content and feeds back the information used in the referenced knowledge base to the user.
6. A portable knowledge base question-answering device based on a language model using the portable knowledge base question-answering method based on a language model according to any one of claims 1 to 5, characterized in that: include: A portable device having a user terminal for importing or viewing information provided thereon; Information import module, which obtains domain knowledge information from user terminals; The information storage module is connected to the information import module, saves and stores the domain knowledge information received by the information import module, and updates it after receiving new information; The information recognition module is connected to the information storage module, converts the domain knowledge information into vector data and stores it in the information storage unit; The information analysis module is connected to the information storage module and the information recognition module respectively. It processes the multiple vector data in the information storage unit through the domain small language model to form the answer corresponding to the question; The information feedback module is connected to the information storage unit and the information analysis module respectively, and returns the content processed by the information analysis unit to the user terminal.
7. The portable knowledge base question-answering device based on language model according to claim 6, characterized in that: The communication module uses the Wi-Fi communication protocol to communicate. The generation of communication information includes the following steps: S21. After obtaining the domain name identification code from the user terminal, the information import module determines the data source of the domain name to perform security protection judgment on the device; S22. The information import module determines the domain name type to determine whether the information capture unit or the information import unit retains the information, and the retained information is classified and written into the information database; S23. After receiving the domain name identification code, the information recognition module performs content recognition on whether the import is allowed. If it is allowed, the execution continues; otherwise, it stops. During content recognition, the language recognition model is used to analyze the domain name identification code separately, identify the matching type of the word segmentation elements and the word segmentation in a word segmentation manner, and sort their vectors; and output the results to the information storage module in a time series manner. S24, the information analysis module uses the search term to select a vector set corresponding to the query word; analyzes each vector and selects the optimal vector; S25. The information feedback module transmits the results of steps S22-S24 to the user terminal, completing the information generation and feedback.
8. The portable knowledge base question-answering device based on language model according to claim 6, characterized in that: When importing information through the information import module, the following steps are included: S31, the portable device is connected to the information terminal via the communication module to obtain information terminal data; S32. The portable device identifies the acquired information and determines its domain type; S33. The information storage module processes the information and writes the information into the information storage unit for different domain types, where the information types include exclusive domain data, domain information, and non-domain information.
9. The portable knowledge base question-answering device based on language model according to claim 6, characterized in that: When the information is identified and processed by the information identification module, the following steps are included: S41. Obtain keywords in this field; S42, performing word segmentation processing to obtain a word segmentation set; S43, matching vectors for word segmentation; S44, processing the vector data to form a vector set; S45. After converting to training set, build the model through deep grammar.
10. The portable knowledge base question-answering device based on language model according to claim 9, characterized in that: When analyzing data through the information analysis module, the following steps are included: S51. Obtain vectors in the word segmentation set and train a semantic model; S52. Select a specific vector set based on the user's search term; S53, searching the vector set; S54. Select the optimal vector through small model analysis.
Citation Information
Patent Citations
Deep learning-based question-answering system and method
CN107329967A
Natural language question answering method and device based on small language model cluster and medium
CN116910217A
Domain question-answering system, domain question-answering construction method, electronic equipment and storage medium
CN117909466A
Intelligent medical question-answering system based on pre-training language model
CN119581049A