CN117407498A - Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words - Google Patents

Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words Download PDF

Info

Publication number
CN117407498A
CN117407498A CN202311347571.8A CN202311347571A CN117407498A CN 117407498 A CN117407498 A CN 117407498A CN 202311347571 A CN202311347571 A CN 202311347571A CN 117407498 A CN117407498 A CN 117407498A
Authority
CN
China
Prior art keywords
stage
dialogue
current
language model
round
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
CN202311347571.8A
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.)
Shanghai Qingmu Yili Network Technology Co ltd
Original Assignee
Shanghai Qingmu Yili Network 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 Shanghai Qingmu Yili Network Technology Co ltd filed Critical Shanghai Qingmu Yili Network Technology Co ltd
Priority to CN202311347571.8A priority Critical patent/CN117407498A/en
Publication of CN117407498A publication Critical patent/CN117407498A/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
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H20/00ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
    • G16H20/70ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to mental therapies, e.g. psychological therapy or autogenous training

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Child & Adolescent Psychology (AREA)
  • Hospice & Palliative Care (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Developmental Disabilities (AREA)
  • Data Mining & Analysis (AREA)
  • Psychiatry (AREA)
  • Psychology (AREA)
  • Social Psychology (AREA)
  • Epidemiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to a large language model reply method, a system, a terminal and a medium for automatically adjusting prompt words, which are characterized in that a current stage is primarily judged for each round of dialogue, stage prompt words corresponding to the current stage and user input information are sent to a large language model to request model reply of each round of dialogue, then the user input information, the model reply of the current round of dialogue and judgment prompt words corresponding to the current stage are sent to the large language model to judge the affiliated stage of each round of dialogue, and finally each round of dialogue and the affiliated stage thereof are stored in dialogue history; the invention adopts multiple batch request judging stages so as to select proper prompter to adapt to complex psychological consultation means such as multiple genres, multiple stages and the like, greatly improves the effect of consultation reply, makes the consultation reply more anthropomorphic and is close to real psychological consultation. And the method can set the prompter and stage judgment more flexibly aiming at different psychological consultants, and can improve the psychological consultation efficiency by using a large language model to the maximum extent, so that more visitors can enjoy the high-quality psychological consultation service.

Description

Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words
Technical Field
The invention relates to the field of artificial intelligent model reply, in particular to a large language model reply method, a system, a terminal and a medium for automatically adjusting prompt words.
Background
The restoring effect of the currently generated artificial intelligent large language model is very dependent on the content of the prompt words, and the quality of the prompt words is greatly influenced by the technical characteristics of word-by-word output, embedded vector and the like of the large language model. At present, a universal large language model is used in psychological consultation scenes, and simple consultation replies can be generated through understanding simple fixed prompt words and basic contexts. However, this recovery effect is not comparable to a real psychological consultation for the following reasons:
1. the psychological acceptance speed of the visitor is not considered, and most people need to gradually establish a trust relationship to effectively communicate, so that the reply effect is poor, the visitor can resist advice, and the acceptance will is low;
2. in practical application, psychological consultation is more of cognitive exploration of visitors, the visitors are required to answer deeper questions continuously, standard answers are not directly given by consultants, although prompt words can be modified to continuously inquire the deeper questions, the model is in circulation never stopped, skill output, training and summarization are not achieved, and the model is not suitable for psychological consultation;
3. if the prompting words are added in a plurality of stages at the same time, considering that the current large language model has the limitation of the number of the prompting words, and the input of visitors, the prompting words in all stages of all consultations cannot be put into the system, so that the ideal effect cannot be achieved by fixing the prompting words, and similar modification prompting words in the market can be used as a robot of psychological consultation application scenes, and the psychological consultation effect cannot be truly achieved.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method, a system, a terminal and a medium for automatically adjusting a large language model for prompting words, which are used for solving the above technical problems in the prior art.
To achieve the above and other related objects, the present invention provides a large language model reply method for automatically adjusting a prompt word, the method comprising: when receiving user input information, acquiring a current stage; the method comprises the steps of sending a phase prompt word corresponding to a current phase and user input information to a large language model to obtain model replies of a current dialogue; the user input information, the model reply of the current round of dialogue and the judgment prompt word corresponding to the current stage are sent to the large language model so as to obtain the stage of the current round of dialogue; storing the belonging stage of the current round of dialogue and the current round of dialogue into dialogue history; the session of this round includes: the user inputs information and the model replies of the round of dialogue.
In an embodiment of the present invention, each stage corresponds to a stage prompt word and a judgment prompt word for judging the stage to which the prompt word belongs; wherein, the stage prompt word includes: and one or more steps of information acquisition prompt contents required by the corresponding stage are completed.
In an embodiment of the present invention, the judgment prompt word includes: current phase name and next phase name.
In an embodiment of the present invention, the method for obtaining the current stage includes: judging whether the latest dialogue stage acquisition conditions are met or not through dialogue history; if yes, taking the corresponding stage of the previous dialog in the dialog history as the current stage; if not, the default stage is taken as the current stage.
In an embodiment of the present invention, determining whether the latest session acquisition condition is met through the session history includes: judging whether a previous dialog exists in the dialog history within a set time; if yes, judging that the latest dialogue stage acquisition condition is met; if not, judging that the latest dialogue stage acquisition condition is not met.
In one embodiment of the present invention, the phase prompt word corresponding to the current phase and the user input information are spliced and then sent to the large language model.
In an embodiment of the present invention, the user input information, the model reply of the current session and the judgment content corresponding to the current stage are spliced and then sent to the large language model.
To achieve the above and other related objects, the present invention provides a large language model reply system for automatically adjusting a prompt word, the system comprising: the stage acquisition module is used for acquiring the current stage when receiving the input information of the user; the model reply module is connected with the phase acquisition module and is used for transmitting the phase prompt words corresponding to the current phase and the user input information to the large language model so as to acquire model replies of the round of dialogue; the stage judging module is connected with the model replying module and is used for sending the user input information, the model replying of the current round of dialogue and judging prompt words corresponding to the current stage to the large language model so as to obtain the stage of the current round of dialogue; the dialogue preservation module is connected with the stage judgment module and is used for storing the stage of the dialogue of the round and the dialogue of the round into a dialogue history; the session of this round includes: the user inputs information and the model replies of the round of dialogue.
To achieve the above and other related objects, the present invention provides a large language model reply terminal for automatically adjusting a prompt word, including: one or more memories and one or more processors; the one or more memories are used for storing computer programs; the one or more processors are coupled to the memory for executing the computer program to perform the large language model reply method of automatically adjusting the prompt.
To achieve the above and other related objects, the present invention provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the method.
As described above, the invention is a large language model reply method, system, terminal and medium for automatically adjusting prompt words, which has the following beneficial effects: the invention primarily judges the current stage of each round of dialogue, and sends the stage prompt words corresponding to the current stage and the user input information to a large language model to request the model reply of each round of dialogue, then sends the user input information, the model reply of the current round of dialogue and the judgment prompt words corresponding to the current stage to the large language model to judge the affiliated stage of each round of dialogue, and finally stores each round of dialogue and the affiliated stage thereof into a dialogue history; the invention adopts multiple batch request judging stages so as to select proper prompter to adapt to complex psychological consultation means such as multiple genres, multiple stages and the like, greatly improves the effect of consultation reply, makes the consultation reply more anthropomorphic and is close to real psychological consultation. And the method can set the prompter and stage judgment more flexibly aiming at different psychological consultants, and can improve the psychological consultation efficiency by using a large language model to the maximum extent, so that more visitors can enjoy the high-quality psychological consultation service.
Drawings
FIG. 1 is a flowchart of a large language model reply method for automatically adjusting a prompt word according to an embodiment of the invention.
FIG. 2 is a flowchart of a large language model reply method for automatically adjusting a prompt word according to an embodiment of the invention.
FIG. 3 is a schematic diagram of a large language model reply system for automatically adjusting a prompt word according to an embodiment of the invention.
Fig. 4 is a schematic diagram of a large language model reply terminal for automatically adjusting a prompt word according to an embodiment of the invention.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
In the following description, reference is made to the accompanying drawings, which illustrate several embodiments of the invention. It is to be understood that other embodiments may be utilized and that mechanical, structural, electrical, and operational changes may be made without departing from the spirit and scope of the present invention. The following detailed description is not to be taken in a limiting sense, and the scope of embodiments of the present invention is defined only by the claims of the issued patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. Spatially relative terms, such as "upper," "lower," "left," "right," "lower," "below," "lower," "above," "upper," and the like, may be used herein to facilitate a description of one element or feature as illustrated in the figures relative to another element or feature.
Throughout the specification, when a portion is said to be "connected" to another portion, this includes not only the case of "direct connection" but also the case of "indirect connection" with other elements interposed therebetween. In addition, when a certain component is said to be "included" in a certain section, unless otherwise stated, other components are not excluded, but it is meant that other components may be included.
The first, second, and third terms are used herein to describe various portions, components, regions, layers and/or sections, but are not limited thereto. These terms are only used to distinguish one portion, component, region, layer or section from another portion, component, region, layer or section. Thus, a first portion, component, region, layer or section discussed below could be termed a second portion, component, region, layer or section without departing from the scope of the present invention.
Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes," and/or "including" specify the presence of stated features, operations, elements, components, items, categories, and/or groups, but do not preclude the presence, presence or addition of one or more other features, operations, elements, components, items, categories, and/or groups. The terms "or" and/or "as used herein are to be construed as inclusive, or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; A. b and C). An exception to this definition will occur only when a combination of elements, functions or operations are in some way inherently mutually exclusive.
The large language model is difficult to establish in human-computer relations encountered in psychological consultation scenes, poor consultation effects are caused by single reply types, and the upper limit of input text of the large language model is insufficient to support full-quantity prompter or chaotic reply. Therefore, if the large language model is applied to the psychological consultation field, the prompt words need to be dynamically adjusted according to the content and the stage, so that the consultation effect of a real professional consultant can be achieved, the visitor can build trust with the consultant to gradually discuss the problem, and finally, the scheme is provided and summarized, so that the psychological consultation effect is achieved.
The invention provides a large language model reply method, a system, a terminal and a medium for automatically adjusting prompt words, which are characterized in that the current stage is primarily judged for each round of dialogue, the stage prompt words corresponding to the current stage and user input information are sent to a large language model to request the model reply of each round of dialogue, then the user input information, the model reply of the current round of dialogue and judgment prompt words corresponding to the current stage are sent to the large language model to judge the belonging stage of each round of dialogue, and finally each round of dialogue and the belonging stage thereof are stored in dialogue history; the invention adopts multiple batch request judging stages so as to select proper prompter to adapt to complex psychological consultation means such as multiple genres, multiple stages and the like, greatly improves the effect of consultation reply, makes the consultation reply more anthropomorphic and is close to real psychological consultation. And the method can set the prompter and stage judgment more flexibly aiming at different psychological consultants, and can improve the psychological consultation efficiency by using a large language model to the maximum extent, so that more visitors can enjoy the high-quality psychological consultation service.
The embodiments of the present invention will be described in detail below with reference to the attached drawings so that those skilled in the art to which the present invention pertains can easily implement the present invention. This invention may be embodied in many different forms and is not limited to the embodiments described herein.
Fig. 1 is a flowchart of a large language model reply method for automatically adjusting a prompt word according to an embodiment of the invention.
Before the large language model is replied, the psychological consultation process is divided into a plurality of continuous stages, and each stage corresponds to a stage prompt word and a judgment prompt word for judging the stage to which the psychological consultation process belongs. Multiple successive phases such as five phases of cognitive behavioral therapy: "background information" (default), "consultation goal," exploration discussion, "" skill training, "" summary.
Carrying out a complete psychological consultation, wherein multiple rounds of conversations are needed, and each round of conversations is replied by adopting the following method;
the method comprises the following steps:
step S1: when receiving user input information, the current stage is acquired.
In detail, when the user inputs information, a new session is opened to acquire the current stage.
In one embodiment, the manner of acquiring the current stage includes:
judging whether the latest dialogue stage acquisition conditions are met or not through dialogue history;
if yes, taking the corresponding stage of the previous dialog in the dialog history as the current stage;
if not, the default stage is taken as the current stage. Wherein the default phase is one phase, preferably the first phase, of a plurality of successive phases of the setting.
In one embodiment, determining whether the latest dialog phase acquisition condition is met by the dialog history includes:
judging whether a previous dialog exists in the dialog history within a set time; the set time may be any time period. If yes, judging that the latest dialogue stage acquisition condition is met;
if not, judging that the latest dialogue stage acquisition condition is not met.
That is, determining the phase of the last most recent dialog, if there is no or the last dialog time interval is far, designating a default phase; if the previous dialog exists in the set time, the corresponding stage of the previous dialog is used as the current stage; for example, the last dialog time is within 1 hour, which should be able to inherit the phase prompt as the prompt for the next dialog. If it is more than 1 hour, the last time the user chat has forgotten the content of the chat, and the default phase needs to be started.
Step S2: and sending the phase prompt words corresponding to the current phase and the user input information to the large language model to obtain the model reply of the current dialogue.
In one embodiment, after the current stage is obtained, a stage prompt word corresponding to the stage is obtained; each stage prompt word contains prompt words of all key information acquisition steps required for completing the stage; that is, if all the information of the current stage is not obtained, the next round of dialogue of the stage is continued; if the required information is obtained, the next session is performed.
For example, for the "background information" phase, the phase hint word includes: and obtaining the background, the condition and the consultation reason of the visitor, and setting the consultation target and confirming the consultation target after finishing. For the "goal setting" phase, the phase hint word includes: and obtaining the consultation target of the visitor, and beginning to explore and discuss after finishing.
In one embodiment, the stage prompt word corresponding to the current stage and the user input information are spliced and then sent to the large language model to obtain the model reply of the current dialogue, and the large language model replies to the user.
Step S3: and sending the user input information, the model reply of the round of dialogue and the judgment prompt word corresponding to the current stage to the large language model so as to obtain the stage of the round of dialogue.
In an embodiment, the user input information and the model reply of the current round of dialogue are replied, and judgment prompt words corresponding to the current stage are added as main prompt words and sent to the large language model, so that the reply is used for describing the stage of the current round of dialogue.
The judgment prompt word is used for judging the stage of the current round of dialogue; the judgment prompt word can correspond to the next stage or the current stage associated with the stage; or corresponds to all stages;
specifically, judging what the prompting word can designate in the next stage, limiting the stage reply range of the large language model, achieving the effect of stable propulsion and eliminating the possibility of random chat; it is also possible to give all phases to the large language model for self-judgment without specification, because the user may be chatting divergently and the model reply also needs random strain. This decision needs to depend on the genre and stage to which the psychological consultation belongs.
Preferably, the judgment prompt word includes: current phase name and next phase name. For example, for the "background information" phase, the judgment hint word includes: please determine whether the stage of the last round of dialog is "target set" or "explore discussion". For the "target setting" phase, the judgment hint word includes: please determine whether the stage of the last round of dialog is "target set" or "explore discussion".
In an embodiment, the user input information, the model reply of the current dialog and the judgment content corresponding to the current stage are spliced and then sent to the large language model, so that the stage to which the current dialog belongs is replied by the large language model.
Step S4: the stage to which the current session belongs and the current session are stored in the session history.
In detail, the session of this round includes: the user inputs information and the model replies of the round of dialogue.
In one embodiment, the phase of the current session, the user input information, and the model reply to the current session are stored in a database. When receiving the user input information of the next round, the session can be continued with the stage as the current stage.
In order to better describe the large language model reply method of automatically adjusting the prompt words, the following specific embodiments are provided for explanation;
example 1: a large language model reply method for automatically adjusting prompt words. Fig. 2 is a flowchart of a large language model reply method for automatically adjusting a prompt word in the present embodiment.
The method comprises the following steps:
providing a plurality of sets of prompting words for each stage, wherein the sets of prompting words comprise stage prompting words and judging stage prompting words, and the stage prompting words comprise the names of the next or parallel stages associated with the stage;
the reply of each round of dialogue includes:
the first step: an acquisition stage;
after receiving the user input, determining the stage of the last latest dialogue, if the last dialogue is available and within the set time, using the stage of the last dialogue as the current stage, using the prompting word of the stage, adding the user input, and sending the prompting word to the universal large language model to obtain a reply. If there is no previous dialog or the previous dialog time exceeds the appointed range, using the default stage as the current stage, using the prompting word of the stage, adding the user input, and sending to the universal large language model to obtain the reply.
And a second step of: formally requesting a model;
combining the user input and model reply of the round, adding the judging content of the stage as a main prompt word according to the current stage of the first step, and packaging and transmitting the large language model again to obtain the stage of the reply description current round.
And a third step of: judging the stage;
and (3) splicing and transmitting the stage judgment prompt words obtained in the first step, user input and model reply, and splicing and transmitting the universal large language model to obtain a new stage, and storing the new stage and the dialogue.
When the user inputs again, the new prompt word is read according to the stage of the last dialogue history. The first to third steps are repeated in this way, so that the effect of dynamically adjusting the stage prompt words according to the user dialogue is achieved.
It should be noted that, although two requests with similar contents are sent to the large language model, the purposes of the two requests are different, and the stage judgment word and the stage judgment reply should not be stored in the dialogue history, so as to avoid affecting the subsequent replies. In the stage judgment, the large language model has a small probability of replying to the range of the designated stage, and the possibility is that the user answers no continuity or running questions, and if the situation is sent, the content of the previous stage can be kept or the default stage is returned. The method of the embodiment adopts a general large language of Chinese native, and Chinese can be used as the stage prompt word and the stage judgment prompt word; english is adopted as the original English. The setting can improve the judgment accuracy, and is irrelevant to the reply language; the stage judgment belongs to simple classification, and a simpler model in a large language model can be used.
Example 1: the general large language model automatically adjusts the reply method of the prompt words under the psychological consultation scene.
Assuming a new visitor starts to use, the cognitive behavioral therapy CBP is set to be simpler and more answering for 5 phases [ background information (default) ], "consulting objective," "exploring discussion," "skill training," "summarizing" ], the flow is as follows:
1. a first round of dialogue;
a) The visitor first enters user input 1 and sends, the system does not find the most recent chat log, and then starts from the default phase "background information";
b) Reading a prompt word of 'background information' in the default stage obtained in the step a, splicing user input 1, sending a request to a large language model, and obtaining model reply 1;
c) According to the user input 1 and the model reply 1 of the round and the stage judgment prompt word of the reading stage 'background information', after splicing, sending a request to a large language model to obtain the belonging stage 1, then saving the belonging stage 1, inputting the 1 by the user and replying the 1 to a database by the model;
2. the next round of dialogue;
a) The visitor replies the question in the model reply 1, namely, the user input 2 is obtained, and the system finds the last dialog stage (stage 1);
b) Reading the prompt words in the stage 1, splicing the user input 2, sending a request to the large language model, and obtaining a model reply 2;
c) According to the user input 2 and the model reply 2 of the round and the stage judgment prompt words of the stage 1, after splicing, sending a request to the large language model to obtain the stage 2, then saving the stage 2, inputting the 2 by the user and replying the 2 to the database by the model.
Similar to the principles of the above embodiments, the present invention provides a large language model reply system that automatically adjusts the hint words.
Specific embodiments are provided below with reference to the accompanying drawings:
FIG. 3 is a schematic diagram showing a large language model reply system for automatically adjusting a prompt word according to an embodiment of the invention.
The system comprises:
the stage acquisition module 1 is used for acquiring the current stage when receiving user input information;
the model reply module 2 is connected with the stage acquisition module 1 and is used for sending the stage prompt words corresponding to the current stage and the user input information to the large language model so as to obtain the model reply of the current dialogue;
the stage judging module 3 is connected with the model replying module 2 and is used for sending the user input information, the model replying of the current round of dialogue and judging prompt words corresponding to the current stage to the large language model so as to obtain the stage of the current round of dialogue;
the dialogue save module 4 is connected with the stage judging module 3 and is used for saving the belonging stage of the current dialogue and the current dialogue into the dialogue history; the session of this round includes: the user inputs information and the model replies of the round of dialogue.
It should be noted that, it should be understood that the division of the modules in the embodiment of the system of fig. 3 is merely a division of logic functions, and may be fully or partially integrated into a physical entity or may be physically separated. And these units may all be implemented in the form of software calls through the processing element; or can be realized in hardware; the method can also be realized in a form that a part of units are called by processing elements to be software, and the other part of units are realized in a form of hardware.
Since the implementation principle of the large language model reply system for automatically adjusting the prompt words has been described in the foregoing embodiments, the description thereof will not be repeated here.
In an embodiment, each stage corresponds to a stage prompt word and a judgment prompt word for judging the stage to which the prompt word belongs; wherein, the stage prompt word includes: and one or more steps of information acquisition prompt contents required by the corresponding stage are completed.
In one embodiment, the judgment prompt word includes: current phase name and next phase name.
In one embodiment, the manner of acquiring the current stage includes: judging whether the latest dialogue stage acquisition conditions are met or not through dialogue history; if yes, taking the corresponding stage of the previous dialog in the dialog history as the current stage; if not, the default stage is taken as the current stage.
In one embodiment, determining whether the latest dialog phase acquisition condition is met by the dialog history includes: judging whether a previous dialog exists in the dialog history within a set time; if yes, judging that the latest dialogue stage acquisition condition is met; if not, judging that the latest dialogue stage acquisition condition is not met.
In an embodiment, the user input information, the model reply of the current dialog and the judgment content corresponding to the current stage are spliced and then sent to the large language model.
In an embodiment, the user input information, the model reply of the current dialog and the judgment content corresponding to the current stage are spliced and then sent to the large language model.
Fig. 4 is a schematic diagram showing a large language model reply terminal 10 for automatically adjusting a prompt word according to an embodiment of the invention.
The large language model reply terminal 40 for automatically adjusting the prompt words includes: a memory 41 and a processor 42, the memory 41 for storing a computer program; the processor 42 runs a computer program to implement the large language model reply method for automatically adjusting the prompt words as described in fig. 1.
Alternatively, the number of the memories 41 may be one or more, and the number of the processors 42 may be one or more, and one is taken as an example in fig. 4.
Optionally, the processor 42 in the large language model reply terminal 40 of the automatically adjusted prompt term loads one or more instructions corresponding to the process of the application program into the memory 41 according to the steps as shown in fig. 1, and the processor 42 runs the application program stored in the first memory 41, so as to implement various functions in the large language model reply method of the automatically adjusted prompt term as shown in fig. 1.
Optionally, the memory 41 may include, but is not limited to, high speed random access memory, nonvolatile memory. Such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices; the processor 42 may include, but is not limited to, a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Alternatively, the processor 42 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The present invention also provides a computer readable storage medium storing a computer program which when run implements a large language model reply method for automatically adjusting a prompt word as shown in fig. 1. The computer-readable storage medium may include, but is not limited to, floppy diskettes, optical disks, CD-ROMs (compact disk-read only memories), magneto-optical disks, ROMs (read-only memories), RAMs (random access memories), EPROMs (erasable programmable read only memories), EEPROMs (electrically erasable programmable read only memories), magnetic or optical cards, flash memory, or other type of media/machine-readable medium suitable for storing machine-executable instructions. The computer readable storage medium may be an article of manufacture that is not accessed by a computer device or may be a component used by an accessed computer device.
In summary, in the large language model reply system for automatically adjusting the prompt words, the current stage is primarily judged for each round of dialogue, the stage prompt words corresponding to the current stage and the user input information are sent to the large language model to request the model reply of each round of dialogue, then the user input information, the model reply of the current round of dialogue and the judgment prompt words corresponding to the current stage are sent to the large language model to judge the belonging stage of each round of dialogue, and finally each round of dialogue and the belonging stage thereof are stored in the dialogue history; the invention adopts multiple batch request judging stages so as to select proper prompter to adapt to complex psychological consultation means such as multiple genres, multiple stages and the like, greatly improves the effect of consultation reply, makes the consultation reply more anthropomorphic and is close to real psychological consultation. And the method can set the prompter and stage judgment more flexibly aiming at different psychological consultants, and can improve the psychological consultation efficiency by using a large language model to the maximum extent, so that more visitors can enjoy the high-quality psychological consultation service. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. It is therefore intended that all equivalent modifications and changes made by those skilled in the art without departing from the spirit and technical spirit of the present invention shall be covered by the appended claims.

Claims (10)

1. A large language model reply method for automatically adjusting a prompt word, the method comprising:
when receiving user input information, acquiring a current stage;
the method comprises the steps of sending a phase prompt word corresponding to a current phase and user input information to a large language model to obtain model replies of a current dialogue;
the user input information, the model reply of the current round of dialogue and the judgment prompt word corresponding to the current stage are sent to the large language model so as to obtain the stage of the current round of dialogue;
storing the belonging stage of the current round of dialogue and the current round of dialogue into dialogue history; the session of this round includes: the user inputs information and the model replies of the round of dialogue.
2. The method for restoring a large language model for automatically adjusting a prompt word according to claim 1, wherein each stage corresponds to a stage prompt word and a judgment prompt word for judging the stage to which the prompt word belongs; wherein, the stage prompt word includes: and one or more steps of information acquisition prompt contents required by the corresponding stage are completed.
3. The method for automatically adjusting a large language model for a prompt as recited in claim 2, wherein the determining the prompt includes: current phase name and next phase name.
4. The method for automatically adjusting a large language model for a prompt word according to claim 3, wherein the means for obtaining the current stage comprises:
judging whether the latest dialogue stage acquisition conditions are met or not through dialogue history;
if yes, taking the corresponding stage of the previous dialog in the dialog history as the current stage;
if not, the default stage is taken as the current stage.
5. The method for automatically adjusting a large language model for a prompt word according to claim 4, wherein the determining whether the latest dialog phase acquisition condition is met by the dialog history comprises:
judging whether a previous dialog exists in the dialog history within a set time;
if yes, judging that the latest dialogue stage acquisition condition is met;
if not, judging that the latest dialogue stage acquisition condition is not met.
6. The method for restoring a large language model with automatically adjusted prompt words according to claim 1, wherein the prompt words of the stage corresponding to the current stage and the user input information are spliced and then sent to the large language model.
7. The method for replying to a large language model for automatically adjusting a prompt word according to claim 1, wherein the user input information, the reply of the model of the current dialog and the judgment content corresponding to the current stage are spliced and then sent to the large language model.
8. A large language model reply system for automatically adjusting a prompt word, the system comprising:
the stage acquisition module is used for acquiring the current stage when receiving the input information of the user;
the model reply module is connected with the phase acquisition module and is used for transmitting the phase prompt words corresponding to the current phase and the user input information to the large language model so as to acquire model replies of the round of dialogue;
the stage judging module is connected with the model replying module and is used for sending the user input information, the model replying of the current round of dialogue and judging prompt words corresponding to the current stage to the large language model so as to obtain the stage of the current round of dialogue;
the dialogue preservation module is connected with the stage judgment module and is used for storing the stage of the dialogue of the round and the dialogue of the round into a dialogue history; the session of this round includes: the user inputs information and the model replies of the round of dialogue.
9. A large language model reply terminal for automatically adjusting a prompt word, comprising: one or more memories and one or more processors;
the one or more memories are used for storing computer programs;
the one or more processors being connected to the memory for running the computer program to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored, which, when being executed by one or more processors, performs the method of any of claims 1 to 7.
CN202311347571.8A 2023-10-17 2023-10-17 Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words Pending CN117407498A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311347571.8A CN117407498A (en) 2023-10-17 2023-10-17 Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311347571.8A CN117407498A (en) 2023-10-17 2023-10-17 Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words

Publications (1)

Publication Number Publication Date
CN117407498A true CN117407498A (en) 2024-01-16

Family

ID=89493684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311347571.8A Pending CN117407498A (en) 2023-10-17 2023-10-17 Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words

Country Status (1)

Country Link
CN (1) CN117407498A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117744753A (en) * 2024-02-19 2024-03-22 浙江同花顺智能科技有限公司 Method, device, equipment and medium for determining prompt word of large language model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117744753A (en) * 2024-02-19 2024-03-22 浙江同花顺智能科技有限公司 Method, device, equipment and medium for determining prompt word of large language model
CN117744753B (en) * 2024-02-19 2024-05-03 浙江同花顺智能科技有限公司 Method, device, equipment and medium for determining prompt word of large language model

Similar Documents

Publication Publication Date Title
CN112365892B (en) Man-machine conversation method, device, electronic device and storage medium
WO2019084810A1 (en) Information processing method and terminal, and computer storage medium
US20180121801A1 (en) Method and device for classifying questions based on artificial intelligence
CN111597313B (en) Question answering method, device, computer equipment and storage medium
CN109996026B (en) Video special effect interaction method, device, equipment and medium based on wearable equipment
CN117407498A (en) Large language model reply method, system, terminal and medium capable of automatically adjusting prompt words
CN109165286A (en) Automatic question-answering method, device and computer readable storage medium
CN113539261A (en) Man-machine voice interaction method and device, computer equipment and storage medium
CN113342945A (en) Voice session processing method and device
CN112148844B (en) Robot information reply method and device
CN116910201A (en) Dialogue data generation method and related equipment thereof
CN111402864A (en) Voice processing method and electronic equipment
CN111930884A (en) Method and equipment for determining reply sentence and man-machine conversation system
CN117332065A (en) Consultation method, system and terminal based on association word association of large language model
CN112163078B (en) Intelligent response method, device, server and storage medium
US11210462B1 (en) Voice input processing
CN118364909A (en) Model reasoning optimization method and device, electronic equipment and storage medium
CN115658875B (en) Data processing method based on chat service and related products
CN117609472A (en) Method for improving accuracy of question and answer of long text in knowledge base
CN117743550A (en) Dialogue system design method and device for fusing language large model with NLU
CN114036277B (en) Method, device, electronic equipment and medium for route jump of conversation robot
CN116521832A (en) Dialogue interaction method, device and system, electronic equipment and storage medium
CN116091136A (en) Telephone marketing method and device based on speaker
CN118898239B (en) Task execution method, device, storage medium and electronic device
CN113868396A (en) Task intelligent dialogue construction method and system based on knowledge graph

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