CN117556011A - Internal interaction question-answering auxiliary method and system based on generation type large model - Google Patents
Internal interaction question-answering auxiliary method and system based on generation type large model Download PDFInfo
- Publication number
- CN117556011A CN117556011A CN202311523885.9A CN202311523885A CN117556011A CN 117556011 A CN117556011 A CN 117556011A CN 202311523885 A CN202311523885 A CN 202311523885A CN 117556011 A CN117556011 A CN 117556011A
- Authority
- CN
- China
- Prior art keywords
- vector
- text
- large model
- query statement
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 230000003993 interaction Effects 0.000 title claims abstract description 17
- 239000013598 vector Substances 0.000 claims abstract description 102
- 230000006870 function Effects 0.000 claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 22
- 239000012634 fragment Substances 0.000 claims abstract description 11
- 241000282414 Homo sapiens Species 0.000 claims abstract description 10
- 230000002452 interceptive effect Effects 0.000 claims description 16
- 230000006399 behavior Effects 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 230000015572 biosynthetic process Effects 0.000 claims description 3
- 238000003786 synthesis reaction Methods 0.000 claims description 3
- 239000003795 chemical substances by application Substances 0.000 abstract description 5
- 238000004590 computer program Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 238000011156 evaluation Methods 0.000 description 5
- 230000011218 segmentation Effects 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000007781 pre-processing Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000009193 crawling Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3325—Reformulation based on results of preceding query
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/3332—Query translation
- G06F16/3334—Selection or weighting of terms from queries, including natural language queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3347—Query execution using vector based model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/338—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an internal interaction question-answering auxiliary method and system based on a large generated model, wherein the method comprises the following steps: receiving a query statement input by a user; the query sentence is a human natural language; converting the query statement into a 1536-dimensional vector; calculating cosine similarity of the 1536-dimensional vector and a text vector stored in a vector database; selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database; generating a new query statement based on the text segment and the query statement; and sending the new query statement into a large model for processing, generating an answer, and pushing the answer to a user. Through the processing scheme, the multi-format documents in the company can be searched and analyzed efficiently, functions are called or automation agents are used for interaction with other systems, data safety is ensured, and therefore work efficiency is improved remarkably and work flow is improved.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to an internal interaction question-answering auxiliary method and system based on a generation type large model.
Background
In the conventional technical background, if a developer needs to review documents in a company or team or determine whether an index has a problem, the developer must access various specific platforms and perform cumbersome information retrieval and comparison to obtain useful information.
This process is often time consuming and inefficient because it requires extensive browsing, comparison and organization in the mind to arrive at useful information. In order to solve the defects of the prior art, the invention provides a combination mode of a generated large model and a team internal document.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide an internal interaction question-answering assisting method based on a generated large model, which at least partially solves the problems existing in the prior art.
In a first aspect, an embodiment of the present disclosure provides an internal interaction question-answering assistance method based on a generative large model, the method including the steps of:
receiving a query statement input by a user; the query sentence is a human natural language;
converting the query statement into a 1536-dimensional vector;
calculating cosine similarity of the 1536-dimensional vector and a text vector stored in a vector database;
selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database;
splicing the text fragments and the query sentences based on a formatted template character string splicing mode to generate new query sentences;
and sending the new query statement into a large model for processing, generating an answer, and pushing the answer to a user.
According to a specific implementation of an embodiment of the disclosure, the method further comprises the steps of:
converting all input media content into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector;
storing the segmented and vectorized plain text and its corresponding vector in a vector database according to a specific implementation of an embodiment of the present disclosure, the method further includes:
when the large model works, selecting a calling function, and carrying out semantic understanding and summarizing processing on a result returned by the function;
the selecting a calling function includes: and searching the function meeting the condition in a Prompt Loop mode.
According to a specific implementation of an embodiment of the present disclosure, converting the query statement into a 1536 high-dimensional vector includes:
preprocessing human natural language;
word segmentation is carried out based on the pretreatment result, and a vocabulary table is constructed;
vectorizing the vocabulary phrase, comprising: selecting an algorithm according to different service scenes;
sequence filling or phase filling is performed.
According to a specific implementation manner of the embodiment of the present disclosure, the smaller the included angle of the cosine similarity is, the more accurate the matching is.
According to one specific implementation of an embodiment of the present disclosure, postgreSQL is selected as the vector database management system.
According to a specific implementation of an embodiment of the disclosure, the method further includes: the retrieval behavior of the data is stored in a database as a function.
In a second aspect, embodiments of the present disclosure provide an internal interactive question-answering assistance system based on a generative large model, the system comprising:
the data receiving module is configured to receive a query statement input by a user; the query sentence is a human natural language;
a vector conversion module configured to convert the query statement into a 1536-dimensional vector;
a similarity calculation module configured to calculate cosine similarity of the 1536-dimensional vector with text vectors stored in a vector database; the method comprises the steps of,
selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database;
the text synthesis module is configured to splice the text fragments and the query sentences based on a formatted template character string splicing mode to generate new query sentences;
and the matching module is configured to send the new query sentence into a large model for processing, generate an answer and push the answer to a user.
According to a specific implementation of an embodiment of the disclosure, the system further includes:
a vector database module configured to convert all of the input media content into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector; the method comprises the steps of,
and storing the segmented and vectorized plain text and the corresponding vector thereof into a vector database.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor, which when executed by the at least one processor, cause the at least one processor to implement the method of generating large model-based internal interaction question-answering assistance of the first aspect or any implementation of the first aspect.
In a fourth aspect, the presently disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, cause the at least one processor to perform the internal interactive question-answering assistance method based on the generative large model in any implementation of the foregoing first aspect or the first aspect.
In a fifth aspect, embodiments of the present disclosure also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the internal interactive question-answering assistance method based on the generative large model in any one of the implementations of the foregoing first aspect or the first aspect.
The internal interaction question-answering auxiliary method based on the generated large model in the embodiment of the disclosure can efficiently search and analyze multi-format documents in a company, and by calling a custom function or using an automation Agent to interact with other systems, the capability of the large model is expanded, more comprehensive and accurate questions can be answered, and data security is ensured, so that the working efficiency is remarkably improved and the working flow is improved.
Drawings
The foregoing is merely an overview of the present invention, and the present invention is further described in detail below with reference to the accompanying drawings and detailed description.
Fig. 1 is a schematic flow chart of an internal interaction question-answering auxiliary method based on a generated large model according to an embodiment of the present disclosure;
FIG. 2 is a block flow diagram of an internal interaction question-answering auxiliary method based on a generated large model provided by an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a vector database construction method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a high-dimensional vector method for converting a query statement into 1536 according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an internal interaction question-answering auxiliary system based on a generated large model according to an embodiment of the present disclosure; and
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
Other advantages and effects of the present disclosure will become readily apparent to those skilled in the art from the following disclosure, which describes embodiments of the present disclosure by way of specific examples. It will be apparent that the described embodiments are merely some, but not all embodiments of the present disclosure. The disclosure may be embodied or practiced in other different specific embodiments, and details within the subject specification may be modified or changed from various points of view and applications without departing from the spirit of the disclosure. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
In addition, in the following description, specific details are provided in order to provide a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the invention provides an internal interaction question-answering auxiliary method based on a large generated model, which utilizes the capability of the large generated model to automatically search documents and extract key information on the premise of ensuring data safety, and then summarizes and presents the documents in a natural language form of human beings. The method greatly optimizes the information acquisition flow, saves the time of the user in data retrieval and information arrangement, and enables the user to acquire the required information more quickly and easily. This also means that the developer can put more effort into more valuable work than spending too much time on document retrieval and screening.
Fig. 1 is a schematic diagram of an internal interaction question-answer assisting method flow based on a generative large model according to an embodiment of the disclosure.
Fig. 2 is a flow chart of an internal interactive question-answer support method based on the generated large model corresponding to fig. 1.
As shown in fig. 1, at step S110, a query sentence input by a user is received; the query statement is a human natural language.
More specifically, user input is received: first, the user will provide a query statement, also referred to as "sample".
In the embodiment of the present invention, as shown in fig. 3, the method further includes a vector database construction, and specifically includes the following steps:
converting all input media content into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector;
and storing the segmented and vectorized plain text and the corresponding vector thereof into a vector database.
In the embodiment of the present invention, the plain text may be divided according to several special characters, for example: 1. a code format; 2.\n lineholders; 3. finally, the 500 character length segmentation is limited according to the longest text.
In the embodiment of the invention, the segmentation can be performed according to other vector lengths, but the 500token is the token length occupied by the text in the database, and 6×500 can ensure that the user problem+the text fragment is not excessively long.
More specifically, the vector database construction includes the steps of:
(1) Acquisition and formatting of data:
in the system, data originates from various internal departments of a company, and supports various media formats such as text (txt), markdown (md), extensible markup language (xml), portable document format (pdf), image format (png), web page links and the like. Such data may be collected by way of user active upload or by way of automatic crawling of the system.
First, all the input media content will be converted to plain text form. Then, in order to accommodate the processing capacity of the large model, the text is divided, and the maximum length of each segment is set to 500 characters. Then, the segmented text is cut again according to the vector length of 500 token. Such a design is intended to ensure that the granularity of text segmentation does not exceed the understanding and processing scope of the large model.
(2) Vectorization and security assurance of data
In the text vectorization process, a 1536-dimension high-dimensional vector is used for representing the text, so that the expressive force of text features is improved, and the matching accuracy is improved. Meanwhile, cosine similarity (cosine similarity) is used as an index for measuring similarity between the problem and the text vector, namely, the smaller the included angle is, the more accurate the matching is.
Finally, the segmented and vectorized text and the corresponding vector are stored in a company private vector database (in this system we choose to use PostgreSQL as the database management system). Furthermore, to conceal the data retrieval process and enhance the security of the data, we store the retrieval behavior of the data in a functional form in a database. The database is postgreSQL, which can be used as a relational database and can be additionally provided with a function of storing vector format data.
More specifically, step S120 is next followed.
At step S120, the query statement is converted into a 1536-dimensional vector.
More specifically, the user input is vectorized: the system translates the user's prompt into a 1536-dimensional vector, a mathematical representation that captures the semantic features in the query.
In an embodiment of the present invention, as shown in fig. 4, converting the query statement into a high-dimensional vector of 1536 includes:
preprocessing human natural language;
word segmentation is carried out based on the pretreatment result, and a vocabulary table is constructed;
vectorizing the vocabulary phrase, comprising: selecting an algorithm according to different service scenes;
sequence filling or phase filling is performed.
Next, the process goes to step S130.
At step S130, the cosine similarity of the 1536-dimensional vector to the text vectors stored in the vector database is calculated.
More specifically, the cosine similarity is calculated: the vector performs cosine similarity calculation with the text vector stored in the internal database.
In the embodiment of the invention, the smaller the included angle of the cosine similarity is, the more accurate the matching is.
In the embodiment of the invention, the internal database is postgreSQL, which is a relational database and has the function of a vector database.
Next, the process goes to step S140.
At step S140, a text segment of a predetermined number of text vectors in the vector database that is closest to the 1536-dimensional vector cosine similarity of the query term transition is selected.
More specifically, the system will choose the top 6 text segments closest to the user's question, which semantically have the highest degree of match with the user's input.
The more the number of bars returned, the more plentiful the context that the large model can reference, and the more accurate the answer. But not too much, because the large model is token consuming, e.g., the maximum length of token for the large model used is 8194, and the token consumed for input and response cannot exceed 8194, here the 6 pieces of text are limited to allow the large model to have both sufficient context and better answer.
In an embodiment of the invention, postgreSQL is selected as the vector database management system.
Next, the process goes to step S150.
At step S150, the text segment and the query sentence are spliced to generate a new query sentence based on the format template string splice mode.
More specifically, a new promt is generated: the system forms a new prompt with the original question of the user from the returned text segment. This new template includes the user's questions and internal document information highly relevant to it, providing rich context information for the large model.
Next, the process goes to step S160.
At step S160, the new query sentence is sent to the large model for processing, an answer is generated, and the answer is pushed to the user.
More specifically, the result is obtained and returned: the new campt will be sent to the large model for processing. The large model will generate a higher quality answer based on the question and answer scenario and the context information. This answer is pushed to the user, completing the entire query process.
In an embodiment of the present invention, the method further includes: when the large model works, selecting a calling function, and carrying out semantic understanding and summarizing processing on a result returned by the function; the selecting a calling function includes: and searching the function meeting the condition by a PromptLoop mode.
In an embodiment of the present invention, the method further includes: the retrieval behavior of the data is stored in a database as a function.
In the embodiment of the invention, the invention can be effectively combined with other systems.
In embodiments of the present invention, the larger model preferably supports more parameters, such as chatGLM13B- > LLAMA2- > ChatGPT4.
Although generative large models have strong understanding and generating capabilities, there are also some limitations. For example, they cannot connect to a network and therefore cannot answer the need for real-time information. At the same time, they also cannot effectively cooperate with other systems within the company, such as may be plagued by questioning whether a problem is occurring in the company's index.
In order to give the large model the ability to "interconnect", even if it can interact with external or internal systems, the present invention provides several possible solutions:
1. function call (Function call) is used: specific functions are designed so that a large model can decide to call certain problems when the large model is used for processing the functions, and then semantic understanding and summarizing processing are carried out on the returned results of the functions.
2. Using autoppt or BabyAGI as Agent: and (3) adopting an automatic mode, searching a function meeting the condition by the model through a Prompt Loop mode, and executing the process. This means that the large model will choose the function to be performed at the discretion of the user's campt, thus achieving a good integration with external or internal systems.
The embodiment of the invention provides an internal interaction question-answering auxiliary method based on a large generated model, which is based on an internal question-answering system of the large generated model, can efficiently search and analyze multi-format documents in a company, interacts with other systems by calling functions or using an automatic Agent, and ensures data security, thereby remarkably improving the working efficiency and improving the workflow. Moreover, the invention has the following characteristics:
1. processes and understands multiple media file formats and retains the original semantics and structure during conversion to plain text.
2. In processing text vectorization, a representation of high dimensions (1536) is employed. The high-dimension feature vector can capture and express semantic information in text content more abundantly, so that accuracy and efficiency of text matching are improved greatly, and cosine similarity is adopted as a core algorithm for measuring similarity between a problem and the text vector. Further improving the accuracy and reliability of the matching.
3. The dialogue flow memorizing, the system dynamically processes and integrates the history dialogue flow and the new template, and the prior dialogue content is reserved to the greatest extent on the premise of ensuring that the total token length does not exceed the model limit. This provides the system with a certain "memory" capability, allowing the context information to be understood and used, providing a consistent, consistent interactive experience for the user.
4. Allowing users to create custom agents to access other systems. Other external or internal systems are interacted, so that wider service is provided, and meanwhile, the adaptability and flexibility of the system are enhanced.
Fig. 5 shows an internal interactive question-answering assistance system 500 based on a generative large model provided by the present invention, which includes a data receiving module 510, a vector converting module 520, a similarity calculating module 530, a text synthesizing module 540, and a matching module 550.
The data receiving module 510 is configured to receive a query sentence input by a user; the query sentence is a human natural language;
vector conversion module 520 is configured to convert the query statement into a 1536-dimensional vector;
the similarity calculation module 530 is configured to calculate cosine similarity between the 1536-dimensional vector and the text vector stored in the vector database; the method comprises the steps of,
selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database;
the text synthesis module 540 is configured to splice the text segment and the query sentence based on a format template string splicing manner to generate a new query sentence;
the matching module 550 is configured to send the new query sentence into a large model for processing, generate an answer, and push the answer to the user.
In an embodiment of the present invention, the system further includes:
the vector database module is used for converting all input media contents into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector; the method comprises the steps of,
and storing the segmented and vectorized plain text and the corresponding vector thereof into a vector database.
Referring to fig. 6, an embodiment of the present disclosure also provides an electronic device 60, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the internal interactive question-answering assistance method based on the generative large model in the foregoing method embodiments.
The disclosed embodiments also provide a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the internal interactive question-answering assistance method based on the generated large model in the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the internal interactive question-answering assistance method based on the generative large model in the foregoing method embodiments.
Referring now to fig. 6, a schematic diagram of an electronic device 60 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device 60 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. While an electronic device 60 having various means is shown, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in 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 can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects an internet protocol address from the at least two internet protocol addresses and returns the internet protocol address; receiving an Internet protocol address returned by the node evaluation equipment; wherein the acquired internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the disclosure are intended to be covered by the protection scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims (9)
1. An internal interactive question-answering auxiliary method based on a generated large model is characterized by comprising the following steps of:
receiving a query statement input by a user; the query sentence is a human natural language;
converting the query statement into a 1536 high-dimensional vector;
calculating cosine similarity of the 1536-dimensional vector and a text vector stored in a vector database;
selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database;
splicing the text fragments and the query sentences based on a formatted template character string splicing mode to generate new query sentences;
and sending the new query statement into a large model for processing, generating an answer, and pushing the answer to a user.
2. The internal interactive question-answering assistance method based on a generative large model according to claim 1, which further comprises the steps of:
converting all input media content into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector;
and storing the segmented and vectorized plain text and the corresponding vector thereof into a vector database.
3. The internal interactive question-answering assistance method based on a generative large model according to claim 1, further comprising:
when the large model works, selecting a calling function, and carrying out semantic understanding and summarizing processing on a result returned by the function;
the selecting a calling function includes: and searching the function meeting the condition in a Prompt Loop mode.
4. The internal interaction question-answering auxiliary method based on the generated large model according to claim 1, wherein the smaller the included angle of the cosine similarity is, the more accurate the matching is.
5. The internal interactive question-answering auxiliary method based on a generative large model according to claim 1, wherein PostgreSQL is selected as a vector database management system.
6. The internal interactive question-answering assistance method based on a generative large model according to claim 1, further comprising: the retrieval behavior of the data is stored in a database as a function.
7. An internal interactive question-answering assistance system based on a generative large model, the system comprising:
the data receiving module is configured to receive a query statement input by a user; the query sentence is a human natural language;
a vector conversion module configured to convert the query statement into a 1536-dimensional vector;
a similarity calculation module configured to calculate cosine similarity of the 1536-dimensional vector with text vectors stored in a vector database; the method comprises the steps of,
selecting text fragments of a preset number of text vectors closest to 1536-dimensional vector cosine similarity transformed by the query statement in the vector database;
the text synthesis module is configured to splice the text fragments and the query sentences based on a formatted template character string splicing mode to generate new query sentences;
and the matching module is configured to send the new query sentence into a large model for processing, generate an answer and push the answer to a user.
8. The generative large model based internal interactive question-answering assistance system according to claim 7, further comprising:
a vector database module configured to convert all of the input media content into plain text;
dividing the plain text, wherein the maximum length of each segment is set to be 500 characters;
cutting the segmented plain text again according to the vector length of 500 token;
converting the re-cut text into a 1536-dimensional vector; the method comprises the steps of,
and storing the segmented and vectorized plain text and the corresponding vector thereof into a vector database.
9. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor, which when executed by the at least one processor, cause the at least one processor to perform the generative large model-based internal interaction question-answering assistance method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311523885.9A CN117556011A (en) | 2023-11-15 | 2023-11-15 | Internal interaction question-answering auxiliary method and system based on generation type large model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311523885.9A CN117556011A (en) | 2023-11-15 | 2023-11-15 | Internal interaction question-answering auxiliary method and system based on generation type large model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117556011A true CN117556011A (en) | 2024-02-13 |
Family
ID=89822743
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311523885.9A Pending CN117556011A (en) | 2023-11-15 | 2023-11-15 | Internal interaction question-answering auxiliary method and system based on generation type large model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117556011A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132684A (en) * | 2024-05-07 | 2024-06-04 | 杭州逸琨科技有限公司 | Data processing method, system, device, storage medium and program product |
-
2023
- 2023-11-15 CN CN202311523885.9A patent/CN117556011A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132684A (en) * | 2024-05-07 | 2024-06-04 | 杭州逸琨科技有限公司 | Data processing method, system, device, storage medium and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110287278B (en) | Comment generation method, comment generation device, server and storage medium | |
CN106919655B (en) | Answer providing method and device | |
CN111144128B (en) | Semantic analysis method and device | |
CN110489087B (en) | Method, device, medium and electronic equipment for generating fractal structure | |
US20160085740A1 (en) | Generating training data for disambiguation | |
CN115982376B (en) | Method and device for training model based on text, multimode data and knowledge | |
CN110929094A (en) | Video title processing method and device | |
US20200218746A1 (en) | Method and apparatus for presenting information | |
CN117556011A (en) | Internal interaction question-answering auxiliary method and system based on generation type large model | |
CN115438149A (en) | End-to-end model training method and device, computer equipment and storage medium | |
CN111078228A (en) | Method and device for converting webpage into small program, server and storage medium | |
CN114995691B (en) | Document processing method, device, equipment and medium | |
CN113672699A (en) | Knowledge graph-based NL2SQL generation method | |
CN117171328A (en) | Text question-answering processing method and device, electronic equipment and storage medium | |
CN117075870A (en) | Online document generation method, device, equipment and medium | |
CN116578712A (en) | Retrieval and map analysis method based on knowledge base in knowledge map field | |
CN114490946A (en) | Xlnet model-based class case retrieval method, system and equipment | |
CN111737571B (en) | Searching method and device and electronic equipment | |
US7725504B2 (en) | Method and apparatus for helping user form structured diagram from unstructured information source | |
CN112699642A (en) | Index extraction method and device for complex medical texts, medium and electronic equipment | |
CN118133973B (en) | Report generation method and device based on large language model | |
CN113609309B (en) | Knowledge graph construction method and device, storage medium and electronic equipment | |
CN116431657A (en) | Data query statement generation method, device, equipment, storage medium and product | |
CN116521152A (en) | Method, device and equipment for implementing code editor | |
CN118133973A (en) | Report generation method and device based on large language model |
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 |