Enterprise question and answer method, system and equipment based on large language model and storage medium
Through the enterprise Q&A method based on the large language model, the structured and unstructured text data within the enterprise are integrated, and multi-level intent recognition and SQL generation models are used to solve the shortcomings in data retrieval efficiency and accuracy of traditional Q&A systems, and efficient enterprise knowledge management and automated Q&A are achieved.
Patent Information
- Application Number
- CN202510720464.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-19
AI Technical Summary
Traditional question and answer systems cannot effectively process and retrieve large amounts of structural and unstructured text data, resulting in low accuracy and efficiency of information retrieval.
Using the enterprise question-and-answer method based on large language models, we use the pre-trained text vectorized model and multi-level intent recognition model to convert and query data, combine the SQL generation model and problem rewriting model, optimize the SQL generation model, and use vector similarity search and external system tool call to achieve coherence and data recall of multiple rounds of sessions.
It improves the management and utilization efficiency of enterprise knowledge resources, enhances the accuracy and efficiency of automated question-and-answer questions and answers, and can efficiently integrate query and business process calls of structured and unstructured text data.
Smart Images

Figure CN120508627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language models, and in particular to an enterprise question-answering method, system, device, and storage medium based on a large language model. Background Art
[0002] In an era of information explosion, how enterprises efficiently manage and utilize knowledge resources has become a critical issue. With the proliferation of large models, integrating them has become the preferred solution for upgrading and transforming enterprise question-answering systems. Traditional question-answering systems often fail to effectively process and retrieve large amounts of structured and unstructured text data, resulting in low information retrieval accuracy and efficiency.
[0003] In view of this, it is necessary to provide an enterprise question-answering method, system, device and storage medium based on a large language model to solve the above problems. Summary of the Invention
[0004] The purpose of the present invention is to provide an enterprise question-answering method, system, device and storage medium based on a large language model, which integrates various knowledge and capabilities such as structured text data query, unstructured text data retrieval and enterprise business process call in the enterprise, and can efficiently manage and utilize enterprise knowledge resources, thereby improving the accuracy and efficiency of automated question-answering.
[0005] To achieve the above objectives, the technical solution proposed in the present invention is implemented as follows: an enterprise question-answering method based on a large language model, comprising the following steps: S1: Collect unstructured text data for retrieval within the enterprise and preprocess it to obtain clean text data. For structured text data, sort out the business data stored in the enterprise database and create corresponding wide tables based on business needs. S2: Divide the text structure into sections and paragraphs according to the text data to obtain text segments. Use the pre-trained text vectorization model to convert each text segment into a vector and store it in the vector database. S3: A two-level intent recognition model and entity information extraction model are used to train the vector database. The first-level intent recognition unit of the intent recognition model queries structured and unstructured text data. The second-level intent recognition model identifies specific wide tables that need to be queried for structured text data. The entity information extraction model extracts relevant entity information. S4: We collect historical data records and manually annotate some samples of historical conversation data to obtain training data. Based on the open source large model, we use the LoRa fine-tuning method to train the training data to obtain the question rewriting model. S5: Generate SQL statements from historical conversation data based on an open-source code model. After manual verification, train the SQL generation model. Use the SQL generation model to predict the corresponding SQL statements for new user input questions. After manual verification, retrain the SQL generation model, and continuously iteratively optimize the original SQL generation model. S6: Use the trained question rewriting model to rewrite the original question entered by the user to obtain a rewritten question with complete context. Use the intent recognition model to identify the new question entered by the user and obtain the specific intent. For questions querying structured text data, use the entity information extraction model to obtain relevant entity information in the question, and obtain the corresponding wide table fields through keyword matching. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data. S7: Use the function call capability of the open source big model to call the data in the external system tool, and input the text segment blocks recalled by RAG together with the data called by the external system tool into the open source big model as the final result output.
[0006] Preferably, the process of the LORA fine-tuning method is as follows: by introducing the dimensionality reduction matrix A and the dimensionality increase matrix B into the weight matrix of the open source large model, where A is initialized with Gaussian distribution and B is initialized with all zeros. During training, the parameters of the open source large model are fixed, and only the parameters of the dimensionality reduction matrix A and the dimensionality increase matrix B are updated. After the training is completed, the dimensionality reduction matrix A and the dimensionality increase matrix B are merged into the open source large model for inference.
[0007] Preferably, for the retrieval of unstructured text data, a vector similarity retrieval method is used to retrieve pre-stored text segments from a vector database. During the retrieval process, multi-dimensional retrieval is performed using both the title and the content.
[0008] Preferably, the vector similarity search searches for both the title and the content simultaneously based on the cosine similarity between the vectors, obtains the scores of each, performs weighted addition, obtains the final score, and sorts the results from high to low according to the final score; the final score formula is as follows: ; ; ; in, and is the weight ( + =1), each specific search task needs to be determined according to the actual situation and The value of enterprise rules and regulations and technical specifications and The values are not necessarily the same. Q is the vector representation of the user input question, Q i is the first i elements, T is the title vector of the knowledge base document, T i is the first vector in the knowledge base document's title vector i elements, C is the content vector of the knowledge base document, C i is the first element in the vector of the content vector knowledge base document i elements, n is the vector dimension.
[0009] An enterprise question-answering system based on a large language model includes a data layer and a model layer in communication with the data layer, wherein the data layer includes structured text data and unstructured text data. The model layer includes a text vectorization model, an intent recognition model, an entity information extraction model, a question rewriting model, an SQL generation model, and a tool calling module. Use the pre-trained text vectorization model to convert each text segment into a vector and store it in the vector database. The vector database is trained using a two-level intent recognition model and an entity information extraction model. The first-level intent recognition unit queries structured text data and unstructured text data. The second-level intent recognition model identifies the structured text data and needs to query a specific wide table. The entity information extraction model extracts relevant entity information. Based on the SQL generation model, the corresponding SQL statement is predicted for the newly input question of the user. After manual verification and retraining of the SQL generation model, the original SQL generation model is continuously iteratively optimized. The trained question rewriting model is used to rewrite the original question entered by the user to obtain a rewritten question with complete context. The intent recognition model is used to identify the user's newly entered question and obtain the specific intent. For questions querying structured text data, the entity information extraction model is used to obtain relevant entity information in the question. Keywords are matched to obtain the corresponding wide table fields. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data. The tool calling module has an API interface that connects to the external system tool. It uses the function call capability of the open source big model to call the data in the external system tool, and inputs the text segments recalled by RAG together with the data called by the external system tool into the open source big model as the final result output.
[0010] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of a method for answering enterprise questions based on a large language model are implemented.
[0011] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an enterprise question answering method based on a large language model.
[0012] A computer program product includes a computer program, which implements the steps of an enterprise question answering method based on a large language model when the computer program is executed by a processor.
[0013] Compared with the existing technology, the beneficial effect is that the present invention relies on big model technology and integrates multiple aspects of knowledge and capabilities such as structured text data query, unstructured text data retrieval and enterprise business process call in the enterprise, which facilitates subsequent processing and retrieval (for example, for structured text data, corresponding wide tables can be constructed to reduce the difficulty of SQL generation; for unstructured text data, the document will be split according to chapters, so that the complete chapter content can be obtained in subsequent retrieval, retaining semantic relevance), which can efficiently manage and utilize enterprise knowledge resources and improve the accuracy and efficiency of automated question and answering.
[0014] Other features and advantages of the present invention will be set forth in the following description, and part will be apparent from the description, or may be understood through practice of the present invention. Features and advantages of the present invention may be realized and obtained through the elements and combinations specifically indicated in the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be considered as limiting the scope. A person of ordinary skill in the art can also derive other relevant drawings based on these drawings without inventive effort. Figure 1 This is a schematic diagram of the enterprise question-answering system based on a large language model provided by the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and beneficial technical effects of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described in this specification are only for the purpose of explaining the present invention and are not intended to limit the present invention.
[0017] It should be understood that the terms "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, it should not be understood as a limitation on the present invention.
[0018] It should also be noted that, unless otherwise expressly specified or limited, terms such as "installed," "connected," "connect," "fixed," and "set" should be understood broadly. For example, they may refer to fixed or detachable connections, or integration; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components or interaction between two components. Those skilled in the art will readily understand the specific meanings of these terms in the present invention based on specific circumstances.
[0019] Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features being referred to. Thus, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of such features. Furthermore, "plurality" and "several" refer to two or more, unless otherwise specifically specified.
[0020] See also Figure 1 The present invention proposes an enterprise question-answering method based on a large language model agent, SQL (Structured Query Language) generation and RAG (Retriever-Augmented Generation), including the following steps: S1: Data Collection and Integration. Collect searchable, unstructured text data from within the enterprise (e.g., personnel data, vehicle data, financial data, project data, etc.) from the data layer. Preprocess the text data (e.g., removing duplicate text and meaningless characters) to obtain clean text data. For structured text data (e.g., company regulations, technical specifications, question banks and knowledge bases, user-uploaded files, etc.), organize the business data stored in the enterprise database and create corresponding wide tables based on business needs for subsequent query and invocation by the intent recognition model.
[0021] Build corresponding wide tables for structured text data to reduce the difficulty of SQL generation; split unstructured text data according to document chapters so that complete chapter content can be obtained in subsequent searches, retaining semantic relevance while also reducing the input of useless tags.
[0022] S2: Vector knowledge base construction. Divide the text data into sections and paragraphs to generate text segments. Use a pre-trained text vectorization model (such as the bge model) to convert each segment into a vector and store it in the model layer for subsequent RAG retrieval.
[0023] S3: Training of the intent recognition model and entity information extraction model. Since the system involves both queries for structured text data and retrieval of unstructured text data, the present invention utilizes a two-layer intent recognition model in the model layer. The first-level intent recognition unit of the intent recognition model is used to query structured text data and unstructured text data, while the second-level intent recognition unit of the intent recognition model is used to identify specific wide tables that need to be queried for structured text data.
[0024] The entity information extraction model mainly extracts relevant entity information such as personnel names, job titles, organization names, time, license plate numbers, provinces, cities and districts. During the implementation process, since these entities can be exhaustively enumerated or have obvious characteristics, the present invention adopts a dictionary tree method to perform entity information matching and extraction.
[0025] The entity information extraction module primarily determines whether the user is querying structured or unstructured text data based on the input question. If the query is for structured text data, the specific wide table fields (such as the vehicle table or the person table) are also returned.
[0026] S4: Training of the question rewriting model. In order to achieve the coherence of RAG multi-round conversations, the present invention trains a question rewriting model in a model layer based solely on the open source large model. The training data is obtained by collecting historical data records and manually annotating some samples of historical data. On the basis of the open source large model (such as the Qwen2.5-72B-Instruct open source large model), the LORA fine-tuning method is used (by introducing a dimensionality reduction matrix A and a dimensionality increase matrix B into the model weight matrix, where A is initialized with a Gaussian distribution and B is initialized with all zeros. During training, the model parameters are fixed, and only the parameter matrices A and B are updated. After the training is completed, A and B are merged into the base model for inference) to train the training data and finally obtain the question rewriting model.
[0027] The training data format is as follows: { "instruction": "What about Hunan Province?" "input": "", "output": "How many employees are there in Hunan Province?" "history": [ [ "How many employees are there in Hubei Province?" "There are xx employees in Hubei Province." ] ] } This question rewriting model primarily optimizes semantic relevance in multi-round conversations, preventing semantic loss between conversational contexts. Based on open-source models (such as the Qwen2.5-72B-Instruct open-source model), it uses LoRa fine-tuning to fine-tune and train on annotated historical conversation data to generate the question rewriting model. Subsequent input of the original question is fed into the question rewriting model, where it receives the intent from the intent recognition module and then enters the question rewriting module, generating a rewritten question that incorporates the complete semantic context.
[0028] S5: SQL generation model training. SQL is generated from historical conversation data based on the open-source Code model. After manual verification, the SQL generation model is trained at the model layer. The trained SQL generation model is then used to predict the corresponding SQL statements for new user input questions. After manual verification, the SQL generation model is retrained. This process is repeated continuously to iteratively optimize the original SQL generation model.
[0029] S6: Data Retrieval and Recall. The trained question rewriting model is used to rewrite the original user-entered question to obtain a fully contextualized question. The intent recognition model is used to identify the user's newly entered question and determine its specific intent. For questions querying structured text data, the entity information extraction model is used to obtain relevant entity information in the question. Keyword matching is used to retrieve the corresponding wide table fields. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data.
[0030] For searching unstructured text data, this invention uses vector similarity retrieval to retrieve pre-stored text segments from a vector database. During the retrieval process, this invention simultaneously utilizes both title and content for a multi-dimensional search, preventing the omission of relevant information and increasing the relevance of the text segment to the question.
[0031] Vector similarity search searches for both title and content based on the cosine similarity between vectors. After obtaining their respective scores, they are weighted and added together to obtain the final score. The final scores are then sorted from high to low. The final score formula is as follows: ; ; ; in, and is the weight ( + =1), each specific search task needs to be determined according to the actual situation and The value of enterprise rules and regulations and technical specifications and The values are not necessarily the same. Q is the vector representation of the user input question, Q i is the first i elements, T is the title vector of the knowledge base document, T i is the first vector in the knowledge base document's title vector i elements, C is the content vector of the knowledge base document, C i is the first element in the vector of the content vector knowledge base document i elements, n is the vector dimension.
[0032] S7: Calling external tools and APIs. Pre-collected external system tools (selectable based on business needs, such as out-of-office requests and reimbursement applications) are connected to the API interface and uniformly processed into specific Python functions that can be called by the large model. The function call capabilities of the open source large model (such as the Qwen2.5-72B-Instruct open source large model) are then used to call data from the external system tools. This invention combines Agent, SQL generation, and RAG, so the text segments retrieved by the RAG, along with the data called by the tools, are input into the open source large model (such as the Qwen2.5-72B-Instruct open source large model) as the final output.
[0033] In this way, the present invention relies on open source big model technology, and integrates various knowledge and capabilities such as structured text data query, unstructured text data retrieval and enterprise business process call in the enterprise, and designs a set of enterprise question and answer methods based on Agent, SQL generation and RAG combined with a large language model. The system can efficiently manage and utilize enterprise knowledge resources and improve the accuracy and efficiency of automated question and answer.
[0034] The present invention also provides an enterprise question-answering system based on a large language model, comprising a data layer and a model layer in communication with the data layer, wherein the data layer contains structured text data and unstructured text data. The model layer includes a text vectorization model, an intent recognition model, an entity information extraction model, a question rewriting model, an SQL generation model, and a tool calling module. Use the pre-trained text vectorization model to convert each text segment into a vector and store it in the vector database. The vector database is trained using a two-level intent recognition model and an entity information extraction model. The first-level intent recognition unit queries structured text data and unstructured text data. The second-level intent recognition model identifies the structured text data and needs to query a specific wide table. The entity information extraction model extracts relevant entity information. Based on the SQL generation model, the corresponding SQL statement is predicted for the newly input question of the user. After manual verification and retraining of the SQL generation model, the original SQL generation model is continuously iteratively optimized. The trained question rewriting model is used to rewrite the original question entered by the user to obtain a rewritten question with complete context. The intent recognition model is used to identify the user's newly entered question and obtain the specific intent. For questions querying structured text data, the entity information extraction model is used to obtain relevant entity information in the question. Keywords are matched to obtain the corresponding wide table fields. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data. The tool calling module has an API interface for connecting to external system tools. It uses the function call capability of the open source large model (such as the Qwen2.5-72B-Instruct open source large model) to call the data in the external system tool, and inputs the text segments recalled by RAG together with the data called by the external system tool into the open source large model as the final output.
[0035] The present invention relies on big model technology and integrates multiple aspects of knowledge and capabilities such as structured text data query, unstructured text data retrieval and enterprise business process call in the enterprise. It can efficiently manage and utilize enterprise knowledge resources and improve the accuracy and efficiency of automated question and answer.
[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the enterprise question-answering method based on a large language model are implemented.
[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the enterprise question-answering method based on a large language model.
[0038] The present invention also provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the steps of the enterprise question answering method based on a large language model are implemented.
[0039] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0040] In particular, according to some embodiments of the present disclosure, the process described above can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.
[0041] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Furthermore, in some embodiments of the present disclosure, a computer-readable signal medium may include a mission data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated mission data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, fiber optic cable, RF (radio frequency), or any suitable combination thereof.
[0042] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital task data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., adhoc peer-to-peer networks), as well as any currently known or later developed networks.
[0043] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to detecting a query operation on a production collaboration document in the switch production line management application, determines the network connection status of the switch production line management application; in response to determining that the network connection status of the switch production line management application represents an offline state, replaces the web page entry information corresponding to the production collaboration document with target entry file information, and loads target web page resource information to display the web page of the production collaboration document offline in the switch production line management application, wherein the target entry file information is file information of a pre-downloaded entry file corresponding to the web page of the production collaboration document, and the target web page resource information is locally stored resource information corresponding to the web page; in response to determining that the network connection status of the switch production line management application represents an online state and the web page resource information corresponding to the production collaboration document is not stored locally, downloads the web page resource information of the web page from the production line document server, wherein the web page resource information includes the entry file and resource information; displays the web page of the production collaboration document in the switch production line management application according to the web page resource information, and stores the web page resource information in a local database.
[0044] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including product-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0045] The present invention is not limited to what is described in the specification and embodiments, and additional advantages and modifications will be readily apparent to those skilled in the art. Therefore, the present invention is not limited to the specific details, representative devices, and illustrative examples shown and described herein without departing from the spirit and scope of the general concept defined by the claims and their equivalents.
Claims
1. An enterprise question answering method based on a large language model, characterized in that: The steps include: S1: Collect unstructured text data for retrieval within the enterprise and preprocess it to obtain clean text data. For structured text data, sort out the business data stored in the enterprise database and create corresponding wide tables based on business needs. S2: Divide the text structure into sections and paragraphs according to the text data to obtain text segments. Use the pre-trained text vectorization model to convert each text segment into a vector and store it in the vector database. S3: A two-level intent recognition model and entity information extraction model are used to train the vector database. The first-level intent recognition unit of the intent recognition model queries structured and unstructured text data. The second-level intent recognition model identifies specific wide tables that need to be queried for structured text data. The entity information extraction model extracts relevant entity information. S4: We collect historical data records and manually annotate some samples of historical conversation data to obtain training data. Based on the open source large model, we use the LoRa fine-tuning method to train the training data to obtain the question rewriting model. S5: Generate SQL statements from historical conversation data based on an open-source code model. After manual verification, train the SQL generation model. Use the SQL generation model to predict the corresponding SQL statements for new user input questions. After manual verification, retrain the SQL generation model, and continuously iteratively optimize the original SQL generation model. S6: Use the trained question rewriting model to rewrite the original question entered by the user to obtain a rewritten question with complete context. Use the intent recognition model to identify the new question entered by the user and obtain the specific intent. For questions querying structured text data, use the entity information extraction model to obtain relevant entity information in the question, and obtain the corresponding wide table fields through keyword matching. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data. S7: Use the function call capability of the open source big model to call the data in the external system tool, and input the text segment blocks recalled by RAG together with the data called by the external system tool into the open source big model as the final result output.
2. The enterprise question answering method based on a large language model according to claim 1, characterized in that: The process of the LORA fine-tuning method is as follows: by introducing the dimensionality reduction matrix A and the dimensionality increase matrix B into the weight matrix of the open source large model, where A is initialized with Gaussian distribution and B is initialized with all zeros. During training, the parameters of the open source large model are fixed, and only the parameters of the dimensionality reduction matrix A and the dimensionality increase matrix B are updated. After the training is completed, the dimensionality reduction matrix A and the dimensionality increase matrix B are merged into the open source large model for inference.
3. The enterprise question answering method based on a large language model according to claim 1, characterized in that: For the retrieval of unstructured text data, vector similarity retrieval is used to retrieve pre-stored text segments from the vector database. During the retrieval process, multi-dimensional retrieval is performed using both title and content.
4. The enterprise question answering method based on a large language model according to claim 1, characterized in that: Vector similarity search searches for titles and content simultaneously based on the cosine similarity between vectors. After obtaining their respective scores, they are weighted and added together to obtain the final score. The final scores are then sorted from high to low. The final score formula is as follows: ; ; ; in, and is the weight ( + =1), each specific search task needs to be determined according to the actual situation and The value of enterprise rules and regulations and technical specifications and The values are not necessarily the same. Q is the vector representation of the user input question, Q i is the first i elements, T is the title vector of the knowledge base document, T i is the first vector in the knowledge base document's title vector i elements, C is the content vector of the knowledge base document, C i is the first element in the vector of the content vector knowledge base document i elements, n is the vector dimension.
5. An enterprise question-answering system based on a large language model, characterized by: It includes a data layer and a model layer that is in communication with the data layer, wherein the data layer includes structured text data and unstructured text data. The model layer includes a text vectorization model, an intent recognition model, an entity information extraction model, a question rewriting model, an SQL generation model, and a tool calling module. Use the pre-trained text vectorization model to convert each text segment into a vector and store it in the vector database. The vector database is trained using a two-level intent recognition model and an entity information extraction model. The first-level intent recognition unit queries structured text data and unstructured text data. The second-level intent recognition model identifies the structured text data and needs to query a specific wide table. The entity information extraction model extracts relevant entity information. Based on the SQL generation model, the corresponding SQL statement is predicted for the newly input question of the user. After manual verification and retraining of the SQL generation model, the original SQL generation model is continuously iteratively optimized. The trained question rewriting model is used to rewrite the original question entered by the user to obtain a rewritten question with complete context. The intent recognition model is used to identify the user's newly entered question and obtain the specific intent. For questions querying structured text data, the entity information extraction model is used to obtain relevant entity information in the question. Keywords are matched to obtain the corresponding wide table fields. The entity information is combined into query conditions, and the combined SQL statement is used to query and return specific data. The tool calling module has an API interface that connects to the external system tool. It uses the function call capability of the open source big model to call the data in the external system tool, and inputs the text segments recalled by RAG together with the data called by the external system tool into the open source big model as the final result output.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the enterprise question answering method based on a large language model as described in any one of claims 1 to 4 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the enterprise question answering method based on a large language model are implemented.
8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the enterprise question answering method based on a large language model are implemented.
Citation Information
Cited By
Model training method, query information analysis method and related device
CN121167300A