CN117033597A - Intelligent question-answering method based on large language model - Google Patents

Intelligent question-answering method based on large language model Download PDF

Info

Publication number
CN117033597A
CN117033597A CN202311023321.9A CN202311023321A CN117033597A CN 117033597 A CN117033597 A CN 117033597A CN 202311023321 A CN202311023321 A CN 202311023321A CN 117033597 A CN117033597 A CN 117033597A
Authority
CN
China
Prior art keywords
question
standard
answer
language model
answering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311023321.9A
Other languages
Chinese (zh)
Inventor
朱太和
晏士康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wisdom Tinder Technology Co ltd
Original Assignee
Beijing Wisdom Tinder Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wisdom Tinder Technology Co ltd filed Critical Beijing Wisdom Tinder Technology Co ltd
Priority to CN202311023321.9A priority Critical patent/CN117033597A/en
Publication of CN117033597A publication Critical patent/CN117033597A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides an intelligent question-answering method based on a large language model, which comprises the steps of locally creating a question-answering library and a database according to private data of a user; the question-answer library comprises a plurality of standard questions and associated standard answers; the database comprises a plurality of standard paragraphs; inquiring a question-answering library and/or a database according to the questions; when a standard question matched with the question exists in the question-answer library, outputting a standard answer associated with the standard question in the question-answer library as an answer of the question; obtaining standard paragraphs matched with the problems in the database, and inputting the standard paragraphs and the problems into a large language model; when the answer output by the large language model is matched with the question, the answer can be defined as a standard answer of the question, and the question-answering library is added. According to the method, a question-answering library and a database are created according to private data of a user, and intelligent question-answering is completed by combining a large language model, so that the defects that existing data disclosed in part of the field are less, the large model is insufficiently trained in the field, and the accuracy of the large model in the field is low are overcome.

Description

Intelligent question-answering method based on large language model
Technical Field
The application belongs to the technical field of artificial intelligence, and particularly relates to an intelligent question-answering method based on a large language model.
Background
Along with the iterative updating of the large language model, the functions of the large language model are more and more universal and intelligent, the question-answering capability and the text generation capability are stronger, and the large language model is widely used in a plurality of fields. However, if some areas have less data available, the large language model will not perform well in the area due to the lack of training data during the training process in the area.
Therefore, how to organically integrate more data in each field with a large language model, and further improve the accuracy of questions and answers is an important topic faced at present.
Disclosure of Invention
Aiming at the defects in the prior art, the application provides the intelligent question-answering method based on the large language model, which improves the accuracy of question-answering.
In a first aspect, an intelligent question-answering method based on a large language model includes:
creating a question-answer library and a database locally according to private data of a user; the question-answer library comprises a plurality of standard questions and associated standard answers; the database comprises a plurality of standard paragraphs;
receiving a problem;
inquiring a question-answering library and/or a database according to the questions;
when a standard question matched with the question exists in the question-answer library, outputting a standard answer associated with the standard question in the question-answer library as an answer of the question;
obtaining standard paragraphs matched with the problems in the database, and inputting the standard paragraphs and the problems into a large language model; when the answer output by the large language model is matched with the question, defining the answer as a standard answer of the question, and adding the answer into a question-answer library.
Further, the method for creating the question-answer library comprises the following steps:
manually inputting the existing standard questions and corresponding standard answers;
inputting the private data into the large language model to obtain a standard question and a standard answer output by the large language model;
calculating a standard problem semantic vector according to the standard problem;
and carrying out association storage on the standard question semantic vector, the standard question and the standard answer.
Further, the matching method of the question-answer library comprises the following steps:
creating a question-answer matching function;
inquiring a question-answering library according to the questions to obtain standard questions and associated standard question semantic vectors output by the question-answering library;
and when the distance between the standard questions output by the question-answering library and the semantic vectors of the questions falls into the question-answering matching region of the question-answering matching function, defining the standard questions output by the question-answering library to be matched with the questions.
Further, the method for creating the question-answer matching function comprises the following steps:
obtaining a series of sample questions;
respectively calculating the semantic vector distance between each sample problem and the similarity problem as well as between each sample problem and the semantic vector distance between each other sample problem;
marking all the semantic vector distances on the plane coordinates;
fitting a curve according to the distribution of each point on the plane coordinates, and defining the curve as the question-answer matching function;
the method for calculating the semantic vector distance between each sample problem and the similarity problem and between each sample problem and other sample problems comprises the following steps:
acquiring a sample problem A;
calculating a semantic vector of a sample problem A;
inputting a sample problem A into a large language model, and defining a plurality of standard problems output by the large language model as a plurality of similar problems A1, A2;
calculating the similarity problem semantic vectors of the similarity problems A1, A2, an, and solving the semantic vector distances between the similarity problem semantic vectors and the sample problem a to obtain TA1, TA2, TAn, respectively, wherein the semantic vector distances are represented as points (a, TA 1), (a, TA 2) on planar coordinates;
calculating the semantic vectors of the other sample problems B, c..n, respectively, and finding their semantic vector distances from the sample problem a, respectively, resulting in TAB, tac..tan, the semantic vector distances being denoted (a, TAB), (a, TAC.) (a, TAN) on planar coordinates.
Further, the method for creating the database comprises the following steps:
receiving a data document;
preprocessing the data document by using a document processing tool to obtain a plurality of standard paragraphs;
calculating a standard paragraph semantic vector of the standard paragraph;
and storing the standard paragraph and the standard paragraph semantic vector in an associated mode.
Further, the matching method of the database comprises the following steps:
creating a data matching function;
inquiring the database according to the problems to obtain a plurality of standard paragraphs output by the database;
merging all standard paragraphs and inputting the merged standard paragraphs into a large language model;
when the answer output by the large language model reaches the satisfaction degree of the user, defining the answer output by the large language model as a standard answer, and adding the standard answer into a question-answer library.
Further, the method for creating the data matching function comprises the following steps:
obtaining a sample problem;
calculating a semantic vector of the sample problem;
inputting the sample problem into a large language model, and defining a plurality of standard problems output by the large language model as a plurality of similar problems;
respectively calculating similarity problem semantic vectors of each similarity problem;
according to the semantic vector query database of a plurality of similar problems, each similar problem obtains the nearest semantic vector distance and the nth nearest semantic vector distance;
establishing a plane coordinate by taking a semantic vector of the similarity problem as an abscissa and a semantic vector distance as an ordinate;
drawing a first curve according to all the nearest semantic vector distances on the plane coordinates; drawing a second curve according to all the nth near semantic vector distances to obtain a data matching function;
the region between the first curve and the second curve is defined as a data matching region.
Further, the method further comprises the following steps:
taking the received evaluation information as a supervised learning sample;
and performing fine tuning training on the large language model according to the supervised learning sample.
Further, the method further comprises the following steps:
configuring question and answer authority of each user;
and providing different questions and answers for different users according to the question and answer authority.
Further, the method further comprises the following steps:
creating a plurality of prompt word templates;
and displaying the prompt word template selected by the user.
According to the technical scheme, the intelligent question-answering method based on the large language model provided by the application creates the question-answering library and the database according to private data of the user, and completes intelligent question-answering together by combining the large language model, so that the defects that the existing data disclosed in part of the field are less, the large model is insufficiently trained in the field, and the accuracy of the large model in the field is low are overcome.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. Like elements or portions are generally identified by like reference numerals throughout the several figures. In the drawings, elements or portions thereof are not necessarily drawn to scale.
Fig. 1 is a flowchart of an intelligent question-answering method provided in an embodiment.
Fig. 2 is a flowchart of a question and answer library creation method provided in an embodiment.
Fig. 3 is a flowchart of a question-answer matching function creation method provided in an embodiment.
FIG. 4 is a flowchart of a database creation method according to an embodiment.
FIG. 5 is a flowchart of a database matching method according to an embodiment.
FIG. 6 is a flowchart of a method for creating a data matching function according to an embodiment.
Detailed Description
Embodiments of the technical scheme of the present application will be described in detail below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present application, and thus are merely examples, and are not intended to limit the scope of the present application. It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Examples:
an intelligent question-answering method based on a large language model, see fig. 1, comprises the following steps:
creating a question-answer library and a database locally according to private data of a user; the question-answer library comprises a plurality of standard questions and associated standard answers; the database comprises a plurality of standard paragraphs;
receiving a problem;
inquiring a question-answering library and/or a database according to the questions;
when a standard question matched with the question exists in the question-answer library, outputting a standard answer associated with the standard question in the question-answer library as an answer of the question;
obtaining standard paragraphs matched with the problems in the database, and inputting the standard paragraphs and the problems into a large language model; when the answer output by the large language model is matched with the question, defining the answer as a standard answer of the question, and adding the answer into a question-answer library.
In this embodiment, the large language model may employ an existing large language model. The private data of the user may be internal data, internal material, etc., which are not disclosed in the field. When the existing data disclosed in some fields are less, and the large language model answers inaccurately, the method can construct a question-answer library and a database according to the existing private data of the user, and can complete intelligent question-answer by combining the large language model. The private data of the user can be entered manually or imported. The question-answer library mainly comprises a plurality of standard questions and associated standard answers, for example, the question-answer library comprises a standard question A and a corresponding standard answer A, and a standard question B and a corresponding standard answer B. The corresponding relation between the standard questions and the standard answers in the question-answer library can be determined by a user, and can also be output by a large language model. The database includes a plurality of standard paragraphs, for example, the database includes standard paragraph A and standard paragraph B.
In this embodiment, when a question to be answered is received, the intelligent question-answering method firstly queries a question-answering library and/or a database according to the question, and if a standard question matched with the question exists in the question-answering library, outputs a standard answer associated with the standard question in the question-answering library as an answer to the question. For example, when receiving the question a and querying the question and answer library, if the standard question a matches the question a, the standard answer a is used as an answer of the question a, and the standard answer a is output to the user. When the database is queried, standard paragraphs matched with the problems in the database are acquired, and the standard paragraphs and the problems are input into a large language model; when the answer output by the large language model is satisfied by the user, the answer can be used as a standard answer and added into a question-answer library. For example, when a database is queried, a standard paragraph A matched with the question A is acquired, the standard paragraph A and the question A are input into a large language model, the large language model outputs an answer C, and if the user is satisfied with the answer C, the answer C can be used as a standard answer of the question A and added into a question-answer library.
According to the intelligent question-answering method, a question-answering library and a database are created according to private data of a user, and intelligent question-answering is completed by combining a large language model, so that the defects that existing data disclosed in part of the field are less, the large model is insufficiently trained in the field, and the accuracy of the large model in the field is low are overcome.
Further, referring to fig. 2, the method for creating the question-answer library includes:
manually inputting the existing standard questions and corresponding standard answers;
inputting the private data into the large language model to obtain a standard question and a standard answer output by the large language model;
calculating a standard problem semantic vector according to the standard problem;
and carrying out association storage on the standard question semantic vector, the standard question and the standard answer.
In this embodiment, the method includes two steps when creating the question-answer library: 1. and directly inputting the existing standard questions and corresponding standard answers of the user into a question and answer library. 2. When the data input in the first step is completed, the method can select a typical knowledge paragraph from the private data and input the typical knowledge paragraph into the large language model to obtain a standard question and a standard answer output by the large language model. The method may prompt the user to access the large language model by the prompt word "generate questions from paragraphs" at this step. Then, the method calculates the semantic vector of the standard question, and stores the semantic vector of the standard question, the standard question and the standard answer in a correlated way. For example, private data C is input into a large language model, the large language model outputs a standard question C and a standard answer C, a standard question semantic vector C of the standard question C is calculated, and the standard question semantic vector C, the standard question C and the standard answer C are associated and input into a question-answer library.
Further, the matching method of the question-answer library comprises the following steps:
creating a question-answer matching function;
inquiring a question-answering library according to the questions to obtain standard questions and associated standard question semantic vectors output by the question-answering library;
when the distance between the standard questions output by the question-answering library and the semantic vectors of the questions falls into the question-answering matching region of the question-answering matching function, the standard questions output by the question-answering library are defined to be matched with the questions.
In this embodiment, when judging whether there is a standard question matching the question in the question-answer library, the method first creates a question-answer matching function, and the question-answer matching function is used to determine a range in which the question matches the standard question. The method then queries the question-answering library according to the questions to obtain a plurality of standard questions and associated standard question semantic vectors output by the question-answering library, for example, when querying the question-answering library according to the question A, the plurality of standard questions output by the question-answering library: standard problem a and standard problem B, if the semantic vector distance between standard problem a and problem a falls into the question-answer matching region of the question-answer matching function, standard problem a is considered to match problem a.
Further, referring to fig. 3, the method for creating the question-answer matching function includes:
obtaining a series of sample questions;
respectively calculating the semantic vector distance between each sample problem and the similarity problem as well as between each sample problem and the semantic vector distance between each other sample problem;
marking all the semantic vector distances on the plane coordinates;
fitting a curve according to the distribution of each point on the plane coordinates, and defining the curve as the question-answer matching function;
the method for calculating the semantic vector distance between each sample problem and the similarity problem and between each sample problem and other sample problems comprises the following steps:
acquiring a sample problem A;
calculating a semantic vector of a sample problem A;
inputting a sample problem A into a large language model, and defining a plurality of standard problems output by the large language model as a plurality of similar problems A1, A2;
calculating the similarity problem semantic vectors of the similarity problems A1, A2, an, and solving the semantic vector distances between the similarity problem semantic vectors and the sample problem a to obtain TA1, TA2, TAn, respectively, wherein the semantic vector distances are represented as points (a, TA 1), (a, TA 2) on planar coordinates;
calculating semantic vectors of other sample problems B, c..n and finding semantic vector distances from the sample problems a, respectively, to obtain TAB, tac..tan, the semantic vector distances being expressed as (a, TAB), (a, TAC.) (a, TAN) on planar coordinates;
similarly, the semantic vector distance between the sample problem B and the similarity problem and between the sample problem B and the other sample problems is obtained: { (B, TB 1), (B, TB 2), (B, TBn), (B, TAB), (B, TBC), (B, TBn) }; sample problem C is separated from semantic vectors of similar problems and other sample problems:
{(N,TN1),(N,TN2)...(N,TNn),(N,TNA),(N,TNB)...(N,TNM)};
in this embodiment, the method may create a question-answer matching function from a plurality of sample questions. For example, a sample problem a is acquired, a semantic vector of the sample problem a is calculated, the sample problem a is input into a large language model, a plurality of standard problems output by the large language model are defined as a plurality of similar problems A1, A2, & An, the similar problem semantic vectors of the similar problems A1, A2, & An, and An are calculated, and distances from the sample problem a are obtained, that is, distances TAn of the sample problem a and the similar problems An are calculated from the semantic vector of the sample problem a and the similar problem semantic vector of the similar problem An, so that distances TA1, TAn of the sample problem a and n similar problems can be obtained, and the distances can be expressed as points of (a, TA 1), (a, TA 2) & number (a, TAn) on plane coordinates. Then calculating the distance of the semantic vector of the other sample question B, c..n from the sample question a, e.g. calculating the distance TAB of the sample question B from the sample question a, calculating the distance TAC of the sample question C from the sample question a, thereby obtaining TAB, tac..tan, the distance being expressed in planar coordinates as (a, TAB), (a, TAC., (a, TAN). And processing other sample data in a similar way, and finally fitting a curve according to the distribution of points on the plane coordinates to define a question-answer matching function, wherein the abscissa of the question-answer matching function is a semantic vector of the question, and the ordinate is a corresponding vector distance threshold value, so that points expressing similar question vector distances and points expressing other question vector distances are distributed on two sides of the curve.
Further, referring to fig. 4, the method for creating the database includes:
receiving a data document;
preprocessing the data document by using a document processing tool to obtain a plurality of standard paragraphs;
calculating a standard paragraph semantic vector of the standard paragraph;
and storing the standard paragraph and the standard paragraph semantic vector in an associated mode.
In the embodiment, when a database is created, the method acquires a data document in private data, divides the data document into a plurality of standard paragraphs by using a document processing tool, calculates standard paragraph semantic vectors of the standard paragraphs, and inputs the standard paragraphs and the standard paragraph semantic vectors in a correlation manner into the database. For example, a material document is divided into a plurality of standard paragraphs: standard paragraph A and standard paragraph B respectively calculate standard paragraph semantic vector A and standard paragraph semantic vector B, associate standard paragraph A and standard paragraph semantic vector A, and associate standard paragraph B and standard paragraph semantic vector B.
Further, referring to fig. 5, the matching method of the database includes:
creating a data matching function;
inquiring the database according to the problems to obtain a plurality of standard paragraphs output by the database;
merging all standard paragraphs and inputting the merged standard paragraphs into a large language model;
when the answer output by the large language model reaches the satisfaction degree of the user, the answer output by the large language model can be defined as a standard answer, and the standard answer is added into a question-answer library.
In this embodiment, a data matching function is first created, and the data matching function is used to determine the matching range of the problem and the database. Then the method queries the database according to the questions to obtain a plurality of standard paragraphs outputted by the database, for example, obtains the questions A and calculates semantic vectors thereof, queries the database according to the questions A, and outputs the standard paragraphs A, the standard paragraphs B, … and the standard paragraph N, and combines the standard paragraphs A, the standard paragraphs B, … and the standard paragraph N into a context and inputs the context into the large language model.
Further, referring to fig. 6, the method for creating the material matching function includes:
obtaining a sample problem;
calculating a semantic vector of the sample problem;
inputting the sample problem into a large language model, and defining a plurality of standard problems output by the large language model as a plurality of similar problems;
respectively calculating similarity problem semantic vectors of each similarity problem;
according to the semantic vector query database of a plurality of similar problems, each similar problem obtains the nearest semantic vector distance and the nth nearest semantic vector distance;
establishing a plane coordinate by taking a semantic vector of the similarity problem as an abscissa and a semantic vector distance as an ordinate;
drawing a first curve according to all the nearest semantic vector distances on the plane coordinates; drawing a second curve according to all the nth near semantic vector distances to obtain a data matching function;
the region between the first curve and the second curve is defined as a data matching region.
In this embodiment, the method may create a profile matching function based on a plurality of sample questions. For example, sample problem a is obtained, a semantic vector of sample problem a is calculated, sample problem a is input into a large language model, and the large language model outputs a plurality of similar problems: similar problem B, similar problem C, …. Then, the method calculates the semantic vectors of the similar problems respectively, queries the database according to the semantic vectors of the similar problems to obtain the nearest semantic vector distance and the n-th nearest semantic vector distance, for example, aiming at the similar problem B, the nearest semantic vector distances B1 and … of the similar problem B and the n-th nearest semantic vector distance Bn of the similar problem B are obtained. For the similarity problem C, the closest semantic vector distances C1, … to the similarity problem C and the nth closest semantic vector distance Cn to the similarity problem C are obtained. Finally, establishing a plane coordinate by taking the semantic vector of the similarity problem as an abscissa and the distance of the semantic vector as an ordinate; drawing a first curve according to all the nearest semantic vector distances on the plane coordinates; drawing a second curve according to all the nth near semantic vector distances to obtain a data matching function; the region between the first curve and the second curve is defined as a data matching region.
Further, the method further comprises the following steps:
taking the received evaluation information as a supervised learning sample;
and performing fine tuning training on the large language model according to the supervised learning sample.
In this embodiment, the method may also perform optimization iterations on a large language model. The method can enable the user to evaluate the answers after providing the question and answer service for the user each time, and the evaluation mode comprises scoring or selecting the optimal. Therefore, after a period of accumulation, a certain amount of evaluation information can be obtained, the evaluation information is used as a supervised learning sample, and the fine tuning training is carried out on the large language model, so that the accuracy of question and answer of the large language model in the field is further improved. The evaluation information of the user can also reflect the preference and the value of the user, so that the large language model after optimization iteration can be more suitable for the personalized preference of the user.
Further, the method further comprises the following steps:
configuring question and answer authority of each user;
and providing different questions and answers for different users according to the question and answer authority.
In this embodiment, the method may further set the usage rights of each user to the data such as the question-answer library and the database. The method can configure the question and answer authority of the user according to the crowd type or the data type. Therefore, the data can be classified according to the data types, and the users can be classified according to the crowd types, so that the method provides question-answering service according to the answering authority, and the use right of the data can be controlled.
Further, the method further comprises the following steps:
creating a plurality of prompt word templates;
and displaying the prompt word template selected by the user.
In the embodiment, the method can also provide better use experience for the user in a template prompting mode, and the use difficulty is reduced. Because the effect of accessing the large language model has great relation with the design of the prompt words, and the design of the prompt words depends on experience and skill, the method provides a plurality of prompt word templates for users to select, thereby facilitating the users to use the large language model more accurately, reducing the use difficulty and improving the use experience.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application, and are intended to be included within the scope of the appended claims and description.

Claims (10)

1. An intelligent question-answering method based on a large language model is characterized by comprising the following steps:
creating a question-answer library and a database locally according to private data of a user; the question-answer library comprises a plurality of standard questions and associated standard answers; the database comprises a plurality of standard paragraphs;
receiving a problem;
inquiring the question-answering library and/or the database according to the questions;
when the standard questions matched with the questions exist in the question-answer library, outputting standard answers associated with the standard questions in the question-answer library as answers to the questions;
obtaining a standard paragraph matched with the problem in the database, and inputting the standard paragraph and the problem into a large language model; and when the answer output by the large language model is matched with the question, defining the answer as a standard answer of the question, and adding the answer into a question-answering library.
2. The intelligent question-answering method based on a large language model according to claim 1, wherein the question-answering library creating method comprises:
manually inputting the existing standard questions and corresponding standard answers;
inputting the private data into the large language model to obtain a standard question and a standard answer output by the large language model;
calculating a standard problem semantic vector according to the standard problem;
and carrying out association storage on the standard question semantic vector, the standard question and the standard answer.
3. The intelligent question-answering method based on a large language model according to claim 2, wherein the question-answering library matching method comprises:
creating a question-answer matching function;
inquiring the question-answering library according to the questions to obtain standard questions and associated standard question semantic vectors output by the question-answering library;
and when the distance between the standard questions output by the question-answering library and the semantic vectors of the questions falls into the question-answering matching region of the question-answering matching function, defining that the standard questions output by the question-answering library are matched with the questions.
4. The intelligent question-answering method based on a large language model according to claim 3, wherein the method for creating question-answering matching functions comprises:
obtaining a series of sample questions;
respectively calculating the semantic vector distance between each sample problem and the similarity problem as well as between each sample problem and the semantic vector distance between each other sample problem;
marking all the semantic vector distances on the plane coordinates;
fitting a curve according to the distribution of each point on the plane coordinates, and defining the curve as the question-answer matching function;
the method for calculating the semantic vector distance between each sample problem and the similarity problem and between each sample problem and other sample problems comprises the following steps:
acquiring a sample problem A;
calculating a semantic vector of the sample problem A;
inputting the sample question a into the large language model, defining a plurality of standard questions output by the large language model as a plurality of similar questions A1, A2, an;
calculating the similarity problem semantic vectors of the similarity problems A1, A2, an, respectively, and finding their semantic vector distances from the sample problem a, respectively, to obtain TA1, TA2, TAn, the semantic vector distances being represented as points of (a, TA 1), (a, TA 2) on planar coordinates;
calculating the semantic vectors of the other sample problems B, c..n, respectively, and finding their semantic vector distances from the sample problem a, denoted (a, TAB), (a, TAC., (a, TAN)) on planar coordinates, respectively, to obtain TAB, tac..tan.
5. The intelligent question-answering method based on a large language model according to claim 1, wherein the database creation method comprises:
receiving a data document;
preprocessing the data document by using a document processing tool to obtain a plurality of standard paragraphs;
calculating a standard paragraph semantic vector of the standard paragraph;
and carrying out association storage on the standard paragraph and the standard paragraph semantic vector.
6. The intelligent question-answering method based on a large language model according to claim 5, wherein the database matching method comprises:
creating the data matching function;
inquiring the database according to the problems to obtain a plurality of standard paragraphs output by the database;
merging all the standard paragraphs and inputting the merged standard paragraphs into a large language model;
when the answer output by the large language model reaches the satisfaction degree of the user, defining the answer output by the large language model as a standard answer, and adding the standard answer into a question-answer library.
7. The intelligent question-answering method based on a large language model according to claim 6, wherein the method for creating the material matching function includes:
obtaining a sample problem;
calculating a semantic vector of the sample problem;
inputting the sample questions into the large language model, and defining a plurality of standard questions output by the large language model as a plurality of similar questions;
calculating the similarity problem semantic vector of each similarity problem respectively;
querying the database according to a plurality of similarity problem semantic vectors, wherein each similarity problem obtains a nearest semantic vector distance and an nth nearest semantic vector distance;
establishing a plane coordinate by taking the semantic vector of the similarity problem as an abscissa and the distance of the semantic vector as an ordinate;
drawing a first curve according to all the nearest semantic vector distances on the plane coordinates; drawing a second curve according to all the nth near semantic vector distances to obtain the data matching function;
defining the area between the first curve and the second curve as the data matching area.
8. The intelligent question-answering method based on a large language model according to claim 1, further comprising:
taking the received evaluation information as a supervised learning sample;
and performing fine tuning training on the large language model according to the supervised learning sample.
9. The intelligent question-answering method based on a large language model according to claim 1, further comprising:
configuring question and answer authority of each user;
and providing different questions and answers for different users according to the question and answer authority.
10. The intelligent question-answering method based on a large language model according to claim 1, further comprising:
creating a plurality of prompt word templates;
and displaying the prompt word template selected by the user.
CN202311023321.9A 2023-08-15 2023-08-15 Intelligent question-answering method based on large language model Pending CN117033597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311023321.9A CN117033597A (en) 2023-08-15 2023-08-15 Intelligent question-answering method based on large language model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311023321.9A CN117033597A (en) 2023-08-15 2023-08-15 Intelligent question-answering method based on large language model

Publications (1)

Publication Number Publication Date
CN117033597A true CN117033597A (en) 2023-11-10

Family

ID=88638733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311023321.9A Pending CN117033597A (en) 2023-08-15 2023-08-15 Intelligent question-answering method based on large language model

Country Status (1)

Country Link
CN (1) CN117033597A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609477A (en) * 2024-01-22 2024-02-27 亚信科技(中国)有限公司 Large model question-answering method and device based on domain knowledge

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609477A (en) * 2024-01-22 2024-02-27 亚信科技(中国)有限公司 Large model question-answering method and device based on domain knowledge
CN117609477B (en) * 2024-01-22 2024-05-07 亚信科技(中国)有限公司 Large model question-answering method and device based on domain knowledge

Similar Documents

Publication Publication Date Title
CN108804641B (en) Text similarity calculation method, device, equipment and storage medium
Luan et al. Scientific information extraction with semi-supervised neural tagging
CN111949787A (en) Automatic question-answering method, device, equipment and storage medium based on knowledge graph
CN111063410B (en) Method and device for generating medical image text report
CN114492363B (en) Small sample fine adjustment method, system and related device
CN110334179B (en) Question-answer processing method, device, computer equipment and storage medium
US9898464B2 (en) Information extraction supporting apparatus and method
CN112163424A (en) Data labeling method, device, equipment and medium
CN117033597A (en) Intelligent question-answering method based on large language model
CN111143539B (en) Knowledge graph-based teaching field question-answering method
CN109872775B (en) Document labeling method, device, equipment and computer readable medium
CN110765342A (en) Information query method and device, storage medium and intelligent terminal
CN111552773A (en) Method and system for searching key sentence of question or not in reading and understanding task
CN114003709A (en) Intelligent question-answering system and method based on question matching
US20040181758A1 (en) Text and question generating apparatus and method
CN110795942B (en) Keyword determination method and device based on semantic recognition and storage medium
CN112632956A (en) Text matching method, device, terminal and storage medium
CN117609475A (en) Question-answer reply method, system, terminal and storage medium based on large model
CN110929514B (en) Text collation method, text collation apparatus, computer-readable storage medium, and electronic device
CN113705207A (en) Grammar error recognition method and device
CN112099633A (en) Intelligent experimental method and device for multi-modal perception
CN116821324A (en) Model training method and device, electronic equipment and storage medium
CN116186223A (en) Financial text processing method, device, equipment and storage medium
CN114842299A (en) Training method, device, equipment and medium for image description information generation model
CN115658845A (en) Intelligent question-answering method and device suitable for open-source software supply chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination