Library intelligent consultation service system based on retrieval enhanced large language model

By adopting a large language model based on search enhancement in the library intelligent consulting service, combining the domain knowledge base and search technology, the problem of lack of rigor and high threshold of service content is solved, and the application of a general generative large language model is realized, reducing the use of a large language model for general generation. The construction and maintenance costs are achieved, and the efficiency and accuracy of services are improved.

CN118964534APending Publication Date: 2024-11-15PEKING UNIV +1

Patent Information

Application Number
CN202311761172.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Existing intelligent consulting services have high thresholds and lack of rigor in the library, especially in terms of large-scale promotion and providing timely and accurate information. The application of large-language models requires frequent retraining or fine-tuning, and computing power and high time cost.

Method used

Using a large language model based on retrieval enhancement, combined with domain knowledge base and search technology, the text vectorization module is used to transform consulting questions into semantic vectors, and the factual knowledge and domain knowledge database are used to search, generate consulting replies, and reduce the work of building a question-and-answer library. and improve service convenience.

Benefits of technology

There is no need to manually construct a high-quality Q&A knowledge base, which reduces the threshold for building intelligent consulting services, realizes the general application of large language models in the field of intelligent consulting in libraries, improves the rigor and efficiency of services, and reduces computing power and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964534A_ABST
    Figure CN118964534A_ABST
Patent Text Reader

Abstract

The invention discloses a library intelligent consultation service system based on a retrieval enhanced large language model, which comprises the following steps: vectorizing consultation questions input by readers and text contents such as fact knowledge and domain knowledge through a semantic vectorization tool, and then retrieving related fact knowledge and domain knowledge according to the consultation questions input by the readers; and calling the large language model to generate a consultation reply statement, and displaying the statement to the reader. According to the method, existing fact knowledge such as website text content, management regulation documents and a common question library is used as a knowledge base for answering consulting questions, a high-quality question and answer knowledge base does not need to be constructed manually, a large amount of manpower cost is saved, and the application threshold is lowered; the application of the general generation type large language model in the library intelligent consultation field is realized in a mode that the large language model firstly learns domain knowledge and then answers consultation questions in combination with factual knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of library intelligent consultation, and in particular to a library intelligent consultation service method and system based on a retrieval enhanced large language model. Background Art

[0002] The concept of library reference services first appeared in 1876. The service content includes providing readers with the information they need, guiding them to use the library, solving consulting problems, and promoting the library. Reference services can be divided into many ways. Megan Dempsey divided them into three levels in her research, namely "basic information / guidance", "consultation / operation demonstration", and "research / guidance", and pointed out that among the consulting services provided by the reference desk, 62% belong to the "basic information / guidance" category (Dempsey M. Blending the Trends: A Holistic Approach to Reference Services [J]. Public Services Quarterly, 2011, 7 (1-2): 3-17.).

[0003] In the early stage of traditional reference consultation services, librarians needed to respond to readers' information needs based on their own knowledge and manually query paper collection resources. With the advancement of technology and the emergence of computers and the Internet, a large number of online resources and electronic documents have been added to the collection resources on the basis of printed documents. At the end of the 20th century, digital library reference consultation services appeared. Compared with traditional methods, digital reference consultation uses e-mail, remote consultation platforms, etc. to provide services to readers, breaking through the time and space limitations of face-to-face communication between librarians and readers.

[0004] With the development of artificial intelligence technology, the research and time on the application of artificial intelligence in library reference consultation services have gradually increased. The Pixel chatbot of the University of Nebraska-Lincoln Library is one of the early chatbots launched in the United States. It uses Artificial Intelligent Marker Language (AIML) technology to simulate human conversations and provide interactive experience. The system is built on the basis of a widely collected library website consultation record database, but can only answer common questions related to library services and resources (Liu Ze, Xu Xiaojie, Shao Bo. Design and application of library consultation robot based on multi-strategy hybrid question-answering system model [J]. New Century Library, 2022(05):43-49.). There are also a large number of researchers and institutions in China who have tried to develop intelligent chatbots for reference consultation services. Wang Yihu and others tried to apply the fine-tuning technology of large language models to library reference consultation services. They have the ability to accurately understand user questions, but lack the rigor of consulting service requirements in answer generation (Wang Yihu, Bai Haiyan, Meng Xuyang. Exploration of the intelligent practice of large language models in library reference consultation services [J]. Information Theory and Practice, 2023, 46(08): 96-103.).

[0005] A comprehensive analysis of the existing intelligent consulting service construction models shows that although they have achieved a certain degree of recognition in terms of service experience, they also have barriers such as high technical reserve requirements, inability to directly use existing text content / knowledge base, and the need for librarians to further organize the text content / knowledge base to form a standardized question-and-answer knowledge base. The workload required is large, and there are certain difficulties in large-scale promotion, and it cannot benefit more libraries yet.

[0006] With the rapid development of large language models, their excellent natural language understanding and generation capabilities have received widespread attention and have been rapidly applied to various fields by academia and industry, achieving good application results. However, due to the uncertainty of the content generated by large language models, directly applying large language models or applying them to library intelligent consulting services after fine-tuning will lead to a lack of rigor in the service content. In addition, due to its "knowledge truncation" problem, large language models only have the knowledge contained in their training data and do not "know" the events that occurred or the knowledge generated after training. Direct application to library intelligent consulting services will not be able to provide timely and accurate information, and frequent retraining or fine-tuning is required. The computing power cost and time cost required will be unacceptable. Making full use of the natural language understanding and generation capabilities of large language models, requiring large language models to answer consulting questions based on existing text content / knowledge bases, can greatly reduce the workload required to build a standardized question and answer library, build a simple and convenient intelligent consulting service, and lower the threshold for building intelligent consulting services. This will be a technical path worthy of in-depth exploration by libraries and has broad application value. Summary of the invention

[0007] In view of the above technical problems, the purpose of the present invention is to provide a library intelligent consulting service system based on a retrieval enhanced large language model for "basic information / guidance" content and a construction method thereof, which does not require manual construction of a high-quality question-answer knowledge base, and combines the domain knowledge base, retrieval enhancement technology, and a large language model together to realize the application of a general generative large language model in the field of library intelligent consulting.

[0008] The technical solution of the present invention is:

[0009] A library intelligent consulting service system based on retrieval enhanced large language model, comprising:

[0010] The text vectorization module is used to vectorize the consulting questions, factual knowledge, domain knowledge and other text contents input by readers through semantic vectorization tools, and convert the consulting questions, factual knowledge and domain knowledge input by readers into vectors containing semantic information;

[0011] A factual knowledge vector database is used to store factual knowledge and its corresponding vectors containing semantic information, as well as information related to the factual knowledge, such as the creation time;

[0012] Domain knowledge vector database, used to store domain knowledge and its corresponding vectors containing semantic information;

[0013] A fact knowledge retrieval module is used to retrieve fact knowledge related to the consulting question input by the reader from a pre-established fact knowledge vector database according to the consulting question input by the reader;

[0014] A domain knowledge retrieval module is used to retrieve domain knowledge highly related to the consulting questions input by readers from a pre-established domain knowledge vector database according to the consulting questions input by readers;

[0015] The consultation response module is used to generate consultation response sentences based on the consultation questions input by the readers, combined with the factual knowledge obtained through the factual knowledge retrieval module and the domain knowledge obtained through the domain knowledge retrieval module, calling the large language model, and displaying the consultation response sentences to the readers in text form.

[0016] The text vectorization module uses semantic vectorization tools such as the large language model API, such as OpenAI's text-embedding-ada-002 model, to semantically vectorize the consulting questions, factual knowledge, and domain knowledge input by readers.

[0017] The text vectorization module is used to semantically vectorize consulting questions raised by readers. When constructing a factual knowledge vector database and a domain knowledge vector database, the text vectorization module is also used to semantically vectorize factual knowledge and domain knowledge.

[0018] The method for constructing the fact knowledge vector database specifically includes the following steps:

[0019] 1.1) Select the content source range of the factual knowledge base and obtain the corresponding text content;

[0020] 1.2) According to the text content of factual knowledge, it is divided into different factual knowledge according to business semantic relationship, and each factual knowledge is marked with its creation date;

[0021] 1.3) Each piece of factual knowledge is semantically vectorized through the text vectorization module, and the factual knowledge and the corresponding semantic vector and creation time are stored in the vector database to form a factual knowledge vector database.

[0022] Among them, the content sources of the factual knowledge base in step 1.1) include but are not limited to the relevant content sections of the library homepage, relevant management regulations documents, FAQs, etc.

[0023] The method for constructing the domain knowledge vector database specifically includes the following steps:

[0024] 2.1) Analyze the content of the factual knowledge base selected in step 1.1), and provide targeted explanations for the library-specific expressions and usages therein to popularize and generalize the relevant expressions and usages, thereby creating domain knowledge; 2.2) Use the text vectorization module to semantically vectorize each piece of domain knowledge, store the domain knowledge and the corresponding semantic vectors into the vector database, and form a domain knowledge vector database.

[0025] The fact knowledge retrieval module performs the following operations:

[0026] 3.1) Calculate the cosine similarity between the semantic vector of the consulting question and all the semantic vectors of the factual knowledge in the factual knowledge vector database and sort them, and select the factual knowledge corresponding to the top N vectors with the highest similarity as the factual knowledge most relevant to answering the consulting question;

[0027] 3.2) Calculate the cosine similarity of adjacent vectors in the top N selected vectors, and comprehensively sort the factual knowledge corresponding to the top N selected vectors in combination with the creation time of the factual knowledge, and select the top M vectors as the final result, where M and N are integers greater than or equal to 0, and M ≤ N. Among them, the factual knowledge with the most recent creation time is preferentially selected.

[0028] The domain knowledge retrieval module performs the following operations: calculate the cosine similarity between the consulting question semantic vector and all domain knowledge semantic vectors in the domain knowledge vector database, and select the domain knowledge corresponding to the vector exceeding the threshold T, where 0≤T≤1. The threshold T is dynamically calculated and selected according to the actual content of the domain knowledge base and the domain knowledge selection strategy.

[0029] The consultation reply module performs the following operations:

[0030] 4.1) Integrate readers’ inquiry questions, retrieved factual knowledge and domain knowledge to generate large language model prompts;

[0031] 4.2) Pass the large language model prompt to the large language model API to obtain the return result of the large language model;

[0032] 4.3) Feedback the results obtained from the large language model to the readers to answer the readers’ questions.

[0033] The large language models that can be used in the library intelligent consulting service system based on the retrieval enhanced large language model of the present invention include GPT-4, Wenxin Yiyan, Tongyi Qianwen, etc.

[0034] Compared with the existing intelligent consulting service construction method, the main innovations of the present invention include:

[0035] 1. No need to construct a high-quality question-and-answer knowledge base: Use existing factual knowledge such as website text content, management regulations documents, and FAQs as a knowledge base to answer consulting questions. There is no need to manually construct a high-quality question-and-answer knowledge base, which saves a lot of labor costs and lowers the application threshold.

[0036] 2. Application of general generative large language models in professional fields: Generally, large language models applied in professional fields need to be fine-tuned using domain data, which requires high computing power investment. The method for constructing a library intelligent consulting service system based on a retrieval-enhanced large language model proposed in the present invention creatively combines domain knowledge bases, retrieval enhancement technology, and large language models together, and can apply general generative large language models to professional fields without fine-tuning. By making the large language model first learn domain knowledge and then combine factual knowledge to answer consulting questions, the application of general generative large language models in the field of library intelligent consulting is realized. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a framework diagram of the library intelligent consulting service system based on the retrieval enhanced large language model of the present invention. DETAILED DESCRIPTION

[0038] In conjunction with the accompanying drawings, the construction process and application of a library intelligent consulting service system based on a retrieval enhanced large language model provided by the present invention are described in detail through embodiments. The following embodiments are only used to more clearly describe the technical solution of the present invention, which is only used as an example and cannot be used to limit the scope of protection of the present invention.

[0039] Step 1: Construction of factual knowledge vector database

[0040] 1.1 Selection of the scope of sources of the factual knowledge base content. According to the scope of the library's "basic information / guidance" consultation questions, select the library's homepage related content sections, relevant management regulations documents, FAQs and other contents as the source of the factual knowledge base content. For example, the "Service Time and Space Layout" section of a library website is selected as one of the content sources of the factual knowledge base.

[0041] 1.2 Division of factual knowledge. Obtain the corresponding text content according to the selected source range, and divide the text content into different factual knowledge according to business semantic relationships. Business semantic relationships refer to semantically related content related to specific business concepts. For example, "closed-shelf borrowing" and the detailed rules for closed-shelf borrowing have a business semantic relationship and should be divided into the same factual knowledge. "Closed-shelf borrowing" and open-shelf borrowing rules do not have a business semantic relationship and should not be divided into the same factual knowledge. Each factual knowledge should be marked with its creation date. If there is no clear date, it should be marked with the current date.

[0042] For example, the spatial layout of a library:

[0043] "Natural Science Reading Hall, East District, 2nd Floor, collects Chinese and foreign new books published in recent years, commonly used books, current periodicals, and reference books (Classification Number of the Chinese Library Classification is B84\N\O\P\Q\R\S\T\U\V\X), self-service borrowing, Monday to Sunday 6:30-22:30."

[0044] As a piece of factual knowledge, this rule is marked with the rule date as "November 6, 2023".

[0045] The "Literature Lending Room (Chinese), West District 301, collects Chinese literature books (Chinese Library Classification Code: I); borrow books from the self-service lending machines on each floor of the library or West District 109. Monday to Sunday 6:30-22:30" on the same page as the above content should not be combined with the above-mentioned "Natural Science Reading Hall" to form a piece of factual knowledge, but should be treated as a separate piece of factual knowledge.

[0046] 1.3 Semantic vectorization of factual knowledge. Each piece of factual knowledge generated in step 1.2 is semantically vectorized using semantic vectorization tools such as the large language model API. The factual knowledge, semantic vector, creation time, etc. are stored in a vector database to form a factual knowledge vector database.

[0047] For example, after using the text-embedding-ada-002 model to vectorize the above-mentioned factual knowledge of opening a "Natural Science Reading Hall", the following vector is obtained. The following vector and its corresponding factual knowledge, creation time, etc. are stored in the vector database.

[0048] [6.712316098855808e-05,0.010559710673987865,0.002063943538814783,

[0049] -0.030966008082032204,-0.02373877912759781,0.015208725817501545,

[0050] -0.014344749972224236,-0.002972489921376109,-0.012191666290163994,

[0051] -0.005646702367812395,-0.00024920745636336505,0.003176484489813447,

[0052] """

[0053] """

[0054] -0.004381594248116016,0.018623489886522293,-0.017293240875005722,

[0055] -0.03310537710785866,-0.01597670465707779,-0.013096784241497517,

[0056] -0.00260050012730062,-0.008996324613690376,-0.03047230839729309]

[0057] Step 2: Construction of domain knowledge vector database

[0058] 2.1 Domain knowledge creation. Analyze the content of the factual knowledge base, and provide targeted explanations for the library-specific expressions and usages in the knowledge base to make the relevant expressions and usages popular and universal.

[0059] For the library field, the most commonly used domain knowledge is the China Library Classification System, and the China Library Classification System is selected as a piece of domain knowledge. For example, the first-level category of the China Library Classification System is selected as a piece of domain knowledge, as shown below:

[0060] "The Chinese Library Classification Numbers are as follows: A...; B...; C General Social Sciences; D Politics, Law; E Military; F Economics; G Culture, Science, Education, Sports; H Language, Writing; I Literature; J Art; K History, Geography; N General Natural Sciences; O Mathematical Sciences and Chemistry; P Astronomy, Earth Sciences; Q Biological Sciences; R Medicine, Health; S Agricultural Sciences; T Industrial Technology; U Transportation; V Aviation, Aerospace; X Environmental Sciences, Safety Sciences; Z Comprehensive Books."

[0061] 2.2 Semantic vectorization of domain knowledge. Each piece of domain knowledge formed in step 2.1 is semantically vectorized using the same semantic vectorization tool text-embedding-ada-002 model as in step 1.3. The domain knowledge and the corresponding semantic vectors are stored in a vector database to form a domain knowledge vector database.

[0062] Step 3: Semantic vectorization of consulting questions

[0063] Use the same semantic vectorization tool text-embedding-ada-002 model as step 1.3 to semantically vectorize the consultation questions raised by readers and generate question vectors. For example, the question is "Where are the books on biological sciences?"

[0064] Step 4: Factual Knowledge Retrieval

[0065] 4.1 Vector similarity calculation. Calculate the cosine similarity between the consulting question semantic vector and all the factual knowledge semantic vectors in the factual knowledge vector database and sort them. Select the factual knowledge corresponding to the top N (N is an integer greater than or equal to zero, usually N is greater than or equal to 1) vectors with the highest similarity as the knowledge most relevant to answering the consulting question.

[0066] For example, for the question "Where are the books on biological sciences?", we select N=6 and get the following 6 most similar facts:

[0067] """

[0068] The Natural Science Reading Hall is located on the second floor of the East District. It houses new Chinese and foreign books published in recent years, as well as frequently used books, current periodicals, and reference books (the classification number of the Chinese Library Classification is B84\N\O\P\Q\R\S\T\U\V\X). Self-service borrowing is available from 6:30 to 22:30 from Monday to Sunday.

[0069] """

[0070] """

[0071] The Social Science Reading Hall, on the third floor of the east area, houses new Chinese and foreign books published in recent years, as well as frequently used books, current periodicals, and reference books (the classification numbers of the Chinese Library Classification are C\D\E\K9\F\G). Self-service borrowing is available from 6:30 to 22:30, Monday to Sunday.

[0072] """

[0073] """

[0074] The closed-shelf lending office, 109, West District, collects Chinese and foreign books on humanities and social sciences, and Chinese and foreign books on natural sciences; it provides on-shelf reservations (please go to the main return office to pick up reserved books) and closed-shelf call-number service (pick up books on site), Monday to Sunday 8:00-17:00.

[0075] """

[0076] """

[0077] The books whose addresses are shown as Closed-Stack Circulation Office, Changping Storage Library, and Second Storage Library are closed-stack books. The books whose addresses are shown as Natural Science Reading Hall, Social Science Reading Hall, Second-floor Chinese Open-Stack, Third-floor Chinese Open-Stack, Fourth-floor Chinese Open-Stack, and Literature Circulation Room are open-stack books.

[0078] """

[0079] """

[0080] Literature Lending Room (Chinese), West District 301, collects Chinese literature books; borrow books from the self-service lending machines on each floor of the library or the Sunshine Hall. (Classification number of the Chinese Library Classification is I), Monday to Sunday 8:00-22:00.

[0081] """

[0082] """

[0083] Literature Reading Room (Foreign Languages), West District 306, collects foreign literature books; borrow books from the self-service borrowing machines on each floor of the library or in the Sunshine Hall. (Classification number of the Chinese Library Classification is I). Monday to Sunday 8:00-22:00.

[0084] """

[0085] 4.2 Comprehensive ranking of factual knowledge. Calculate the cosine similarity of adjacent vectors in the top N selected vectors, and comprehensively rank the factual knowledge corresponding to the top N selected vectors based on the creation time of the factual knowledge. You can also select topM (M is less than or equal to N, and is an integer greater than or equal to 0) vectors as the final result.

[0086] In this example, M=N is taken to retain all selected factual knowledge.

[0087] Step 5: Domain Knowledge Retrieval

[0088] The cosine similarity between the consulting question semantic vector and all domain knowledge semantic vectors in the domain knowledge vector database is calculated, and the domain knowledge corresponding to the vector exceeding the threshold T (0≤T≤1) is selected.

[0089] In this example, we take T as 0.81 and get a piece of domain knowledge. That is, the Chinese Library Classification Number:

[0090] "The Chinese Library Classification Numbers are as follows: A...; B...; C General Social Sciences; D Politics, Law; E Military; F Economics; G Culture, Science, Education, Sports; H Language, Writing; I Literature; J Art; K History, Geography; N General Natural Sciences; O Mathematical Sciences and Chemistry; P Astronomy, Earth Sciences; Q Biological Sciences; R Medicine, Health; S Agricultural Sciences; T Industrial Technology; U Transportation; V Aviation, Aerospace; X Environmental Sciences, Safety Sciences; Z Comprehensive Books."

[0091] Step 6: Call the large language model API to generate answers

[0092] 6.1 Generate large language model prompts. The consultation question, the N pieces of factual knowledge obtained in step 4, and the domain knowledge obtained in step 5 are integrated to generate large language model prompts in the following format:

[0093] Please first learn the domain knowledge below, and combine the domain knowledge to answer subsequent questions using the context. If the answer cannot be obtained from the context, output "I can't answer this question for now."

[0094] Domain knowledge: {Domain knowledge}

[0095] Context: {context text}

[0096] Question: {Reader Question}

[0097] In this example, the prompts are as follows:

[0098] Please first learn the domain knowledge below, and combine the domain knowledge to answer subsequent questions using the context. If the answer cannot be obtained from the context, output "I can't answer this question for now."

[0099] "Domain knowledge: The Chinese Library Classification Numbers are as follows: A...; B...; C General Social Sciences; D Politics, Law; E Military; F Economics; G Culture, Science, Education, Sports; H Language, Writing; I Literature; J Art; K History, Geography; N General Natural Sciences; O Mathematical Sciences and Chemistry; P Astronomy, Earth Sciences; Q Biological Sciences; R Medicine, Health; S Agricultural Sciences; T Industrial Technology; U Transportation; V Aviation, Aerospace; X Environmental Sciences, Safety Sciences; Z Comprehensive Books.

[0100] Context:

[0101] """

[0102] The Natural Science Reading Hall, on the second floor of the east area, houses new Chinese and foreign books published in recent years, as well as frequently used books, current periodicals, and reference books (the classification number of the Chinese Library Classification is B84\N\O\P\Q\R\S\T\U\V\X). Self-service borrowing is available from 6:30 to 22:30 from Monday to Sunday.

[0103] """

[0104] """

[0105] Social Science Reading Hall, East District, 3rd Floor, collects Chinese and foreign new books published in recent years, commonly used books, current periodicals, reference books (Classification Number of "Chinese Library Classification" is C\D\E\K9\F\G), self-service borrowing, Monday to Sunday 6:30-22:30

[0106] """

[0107] """

[0108] Closed-shelf lending office, West District 109, collects Chinese and foreign books on humanities and social sciences, and Chinese and foreign books on natural sciences; provides on-shelf reservations (please go to the main return office to pick up reserved books) and closed-shelf call service (on-site book pickup), Monday to Sunday 8:00-17:00

[0109] """

[0110] """

[0111] The books whose addresses are shown as Closed-Stack Circulation Office, Changping Storage Library, and Second Storage Library are closed-stack books. The books whose addresses are shown as Natural Science Reading Hall, Social Science Reading Hall, Second-floor Chinese Open-Stack, Third-floor Chinese Open-Stack, Fourth-floor Chinese Open-Stack, and Literature Circulation Room are open-stack books.

[0112] """

[0113] """

[0114] Literature Lending Room (Chinese), West District 301, collects Chinese literature books; borrow books from the self-service lending machines on each floor of the library or the Sunshine Hall. (Classification number of the Chinese Library Classification is I), Monday to Sunday 8:00-22:00

[0115] """

[0116] """

[0117] Literature Reading Room (Foreign Languages), West District 306, collects foreign literature books; borrow books from the self-service borrowing machines on each floor of the library or the Sunshine Hall. (Classification number of the Chinese Library Classification is I). Monday to Sunday 8:00-22:00

[0118] """

[0119] Question: Where are the books on biological sciences located?

[0120] 6.2 Call the large language model API to obtain the result. Pass the prompt obtained in step 6.1 to the large language model API to obtain the return result of the large language model. If there are parameters in the large language model API that control the randomness and creativity of generated text, such as temperature, set them to 0 or a value close to 0 so that the large language model can answer questions faithfully based on the context content.

[0121] According to the prompts obtained above, pass the prompts to the gpt-3.5-turbo model API and set the temperature to 0. The results are as follows:

[0122] "According to the information provided, the collection location of biological science books is Q, which belongs to the category of natural science books. According to the content of the webpage, biological science books can be found in the Natural Science Reading Hall (East Section, 2nd Floor)."

[0123] 6.3 Answer the reader's inquiry questions. Return the results obtained in step 6.2 to the reader to complete the answer to the reader's inquiry questions.

Claims

1. A library intelligent consulting service system based on retrieval enhanced large language model, characterized in that: include: The text vectorization module is used to vectorize the text content of factual knowledge, domain knowledge and consulting questions input by readers through semantic vectorization tools, and convert factual knowledge, domain knowledge and consulting questions input by readers into vectors containing semantic information; A factual knowledge vector database, used to store factual knowledge and its corresponding vectors containing semantic information, as well as creation time information related to the factual knowledge; Domain knowledge vector database, used to store domain knowledge and its corresponding vectors containing semantic information; A fact knowledge retrieval module is used to retrieve fact knowledge related to the consulting question input by the reader from a pre-established fact knowledge vector database according to the consulting question input by the reader; A domain knowledge retrieval module is used to retrieve domain knowledge highly related to the consulting questions input by readers from a pre-established domain knowledge vector database according to the consulting questions input by readers; The consultation response module is used to generate consultation response sentences based on the consultation questions input by the readers, combined with the factual knowledge obtained through the factual knowledge retrieval module and the domain knowledge obtained through the domain knowledge retrieval module, calling the large language model, and displaying the consultation response sentences to the readers in text form.

2. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 1 is characterized in that: The method for constructing the fact knowledge vector database is: Select the content source range of the factual knowledge base and obtain the corresponding text content; According to the text content of factual knowledge, it is divided into different factual knowledge according to business semantic relationship, and each factual knowledge is marked with its creation date; Each piece of factual knowledge is semantically vectorized through the text vectorization module, and the factual knowledge and the corresponding semantic vector and creation time are stored in the vector database to form a factual knowledge vector database.

3. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 2 is characterized in that: The method for constructing the domain knowledge vector database is: Analyze the content of the factual knowledge base, and provide targeted explanations for the expressions and usages that are unique to libraries, so as to popularize and generalize the relevant expressions and usages, thereby creating domain knowledge; Each piece of domain knowledge is semantically vectorized through the text vectorization module, and the domain knowledge and the corresponding semantic vector are stored in the vector database to form a domain knowledge vector database.

4. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 1 is characterized in that: The semantic vectorization tool used by the text vectorization module is OpenAI's text-embedding-ada-002 model.

5. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 1 is characterized in that: The fact knowledge retrieval module performs the following operations: Calculate the cosine similarity between the semantic vector of the consulting question and all the semantic vectors of the factual knowledge in the factual knowledge vector database and sort them, and select the factual knowledge corresponding to the top N vectors with the highest similarity as the factual knowledge most relevant to answering the consulting question; The cosine similarity of adjacent vectors among the top N selected vectors is calculated, and the factual knowledge corresponding to the top N selected vectors is comprehensively sorted according to the creation time of the factual knowledge. The top M vectors are selected as the final result, where M and N are integers greater than or equal to 0, and M≤N.

6. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 1 is characterized in that: The domain knowledge retrieval module performs the following operations: The cosine similarity between the consulting question semantic vector and all domain knowledge semantic vectors in the domain knowledge vector database is calculated, and the domain knowledge corresponding to the vector exceeding the threshold T is selected, where 0≤T≤1.

7. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 1 is characterized in that: The consultation reply module performs the following operations: Integrate readers' inquiry questions, retrieved factual knowledge and domain knowledge to generate large language model prompts; Pass the large language model prompt to the large language model API to obtain the return result of the large language model; The return results obtained from the large language model are fed back to the readers to answer the readers' questions.

8. The library intelligent consulting service system based on retrieval enhanced large language model according to claim 7 is characterized in that: The format of the large language model prompt is: Please first learn the domain knowledge below, and combine the domain knowledge to answer subsequent questions using the context. If the answer cannot be obtained from the context, output "I can't answer this question for the time being." Domain knowledge: {Domain Knowledge} Context: {context text} Question: {Reader Question} The context is the retrieved factual knowledge; If there are parameters in the Big Language Model API that control the randomness and creativity of generated text, set them to 0 or close to 0 so that the Big Language Model answers questions faithfully based on the context.

Citation Information

Patent Citations

  • Intelligent question-answering system and method, and related equipment

    CN112579666A

  • Open domain natural language reasoning question-answering system and method driven by large language model

    CN116932708A

  • Question response method and device based on large language model

    CN117235226A

  • Disassembled and Assembled Flowerpot Holder Assembly

    KR102873856B1

Cited By

  • Generative large model-based power network security intelligent consultation system

    CN119886326A

  • Large model file question-answering system based on two-parameter sparse regularization parameter fine tuning

    CN120407742A