CN116483974A - Dialogue reply screening method, device, equipment and storage medium - Google Patents

Dialogue reply screening method, device, equipment and storage medium Download PDF

Info

Publication number
CN116483974A
CN116483974A CN202310471993.XA CN202310471993A CN116483974A CN 116483974 A CN116483974 A CN 116483974A CN 202310471993 A CN202310471993 A CN 202310471993A CN 116483974 A CN116483974 A CN 116483974A
Authority
CN
China
Prior art keywords
reply
text
loss value
screening
reply text
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
CN202310471993.XA
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202310471993.XA priority Critical patent/CN116483974A/en
Publication of CN116483974A publication Critical patent/CN116483974A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to artificial intelligence technology, which can be used for solving and answering user problems of financial insurance business, and discloses a dialogue reply screening method, comprising the following steps: acquiring a plurality of reply texts generated by utilizing a pre-constructed reply generation model based on a dialogue history text; taking the dialogue history text as input of a reply generation model, taking the reply text as a label of the dialogue history text, and calculating a first loss value corresponding to the reply text; taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a second loss value corresponding to the reply text; and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply texts to obtain target reply texts. The invention also relates to a blockchain technique, wherein the reply text can be stored in a blockchain node. The invention also provides a dialogue reply screening device, equipment and medium. The invention can reduce the dialogue reply screening accuracy.

Description

Dialogue reply screening method, device, equipment and storage medium
Technical Field
The present invention relates to artificial intelligence technologies, and in particular, to a method and apparatus for screening dialogue replies, an electronic device, and a storage medium.
Background
In the field of financial insurance, in order to improve the answering efficiency of a user problem, reply generation is often performed by using a generated pre-training language model according to a dialogue text input by a user, and contents generated by different decoding modes are often different for the generated pre-training language model. At present, m candidate replies are generally generated in a random decoding mode, and then an optimal candidate reply is screened out through a sequencing model and output to a user.
However, the most commonly used screening method for reply screening at present is to take the alternative replies as input of a sorting model, take the dialogue history text as a label of the reply text, calculate the model loss value alternative replies of the sorting model as the optimal replies, and the dimension of reply screening is single, so that the accuracy rate of dialogue reply screening is lower.
Disclosure of Invention
The invention provides a dialogue reply screening method, a dialogue reply screening device, electronic equipment and a storage medium, and aims to reduce the accuracy of dialogue reply screening.
Acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on the dialogue history text;
taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, and calculating a model loss value of the reply generation model to obtain a first loss value corresponding to the reply text;
taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text.
Optionally, the screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
cutting off a preset number of reply texts in the reply text sequence by taking a first reply text as a starting point in the reply text sequence to obtain a target reply text sequence;
and selecting a reply text with the minimum second loss value in the target reply text sequence to obtain the target reply text.
Optionally, the screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
extracting the median of all the first loss values to obtain a screening reference value;
calculating by using the screening reference value and a preset screening reference coefficient to obtain a target screening value;
screening all the reply texts by using the target screening value and the first loss value to obtain a reply text set;
and selecting the reply text with the minimum second loss value in the reply text set to obtain the target reply text.
Optionally, the screening all the reply texts by using the target screening value and the first loss value to obtain a reply text set includes:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
deleting the reply text with the first loss value larger than the target screening value in the reply text sequence to obtain a screening reply text sequence;
and summarizing all the reply texts in the screening reply text sequence to obtain the reply text set.
Optionally, the screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
weighting calculation is carried out on the first loss value and the second loss value corresponding to the reply text by using a preset first loss value weight and a preset second loss value weight, so that a weighting coefficient of the reply text is obtained;
and screening all the reply texts by using the weighting coefficient to obtain the target reply text.
Optionally, the inputting the dialogue history text as the reply generation model, the replying text as the label of the dialogue history text, calculating a model loss value of the reply generation model, and obtaining a first loss value corresponding to the replying text, including:
inputting the dialogue history text into the reply generation model to obtain a first analysis reply text;
and measuring the difference between the reply text and the first analysis reply text by using a preset first loss function to obtain the first loss value.
In order to solve the above problems, the present invention further provides a dialogue reply screening device, which includes:
the reply acquisition module is used for acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on the dialogue history texts;
the loss calculation module is used for taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, calculating a model loss value of the reply generation model, and obtaining a first loss value corresponding to the reply text; taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and the reply screening module is used for screening all the reply texts according to the first loss value and the second loss value corresponding to the reply texts to obtain target reply texts.
Optionally, the screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
weighting calculation is carried out on the first loss value and the second loss value corresponding to the reply text by using a preset first loss value weight and a preset second loss value weight, so that a weighting coefficient of the reply text is obtained;
and screening all the reply texts by using the weighting coefficient to obtain the target reply text.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one computer program; a kind of electronic device with high-pressure air-conditioning system
And the processor executes the computer program stored in the memory to realize the dialogue reply screening method.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned dialog reply screening method.
According to the embodiment of the invention, the dialogue history text is used as input of the reply generation model, the reply text is used as a label of the dialogue history text, and the model loss value of the reply generation model is calculated to obtain a first loss value corresponding to the reply text; taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text; and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply texts to obtain target reply texts, wherein compared with the traditional method for screening the reply texts by only using the second loss value, the screening dimension is more diverse, and the accuracy of dialogue reply screening is further improved.
Drawings
FIG. 1 is a flowchart illustrating a method for screening dialogue replies according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a dialogue reply screening device according to an embodiment of the invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing a dialogue reply screening method according to an embodiment of the present invention;
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a dialogue reply screening method. The execution body of the dialogue reply screening method includes, but is not limited to, at least one of a server, a terminal and the like capable of being configured to execute the method provided by the embodiment of the application. In other words, the session reply screening method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: the server can be an independent server, or can be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Referring to fig. 1, a flow chart of a dialogue reply screening method according to an embodiment of the invention includes the following steps:
s1, acquiring a preset number of reply texts generated by using a pre-constructed reply generation model based on a dialogue history text, wherein the reply generation model is a generated pre-training language model;
the dialogue history text is dialogue text which needs to be subjected to reply generation, and the reply generation model is a training completed generation type pre-training language model.
In detail, in the embodiment of the present invention, the decoding mode of the reply generation model is random sampling decoding, and the decoding mode may enable the text with the same input model to obtain different reply texts each time, so in the embodiment of the present invention, the dialog history text is input into the reply generation model for a preset number of times, and each time the reply generation model is input, the reply generation model is changed into one reply text, and a preset number of reply texts are generated, and in the embodiment of the present invention, the preset number is a positive integer greater than 1.
Further, in the embodiment of the invention, the generated reply text is screened, so that the optimal reply text is screened, and the accuracy of reply generation is improved.
In another embodiment of the present invention, the reply text may be stored in a blockchain node, and the high throughput characteristic of the blockchain node is utilized to improve the data access efficiency.
S2, taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, and calculating a model loss value of the reply generation model to obtain a first loss value corresponding to the reply text;
in the embodiment of the present invention, the step S2 includes:
inputting the dialogue history text into the reply generation model to obtain a first analysis reply text;
and measuring the difference between the reply text and the first analysis reply text by using a preset first loss function to obtain the first loss value.
Further, in an embodiment of the present invention, measuring a difference between the reply text and the first analysis reply text by using a preset first loss function to obtain the first loss value includes:
converting the reply text into a vector to obtain a reply text vector;
converting the first analysis reply text into a vector to obtain a first analysis reply text vector;
and calculating by using the first loss function based on the reply text vector and the first analysis reply text vector to obtain the first loss value.
Specifically, in the embodiment of the present invention, the calculating, based on the reply text vector and the first analysis reply text vector, using the first loss function to obtain the first loss value includes:
performing dimension compression on the reply text vector to obtain a reply text characteristic value;
performing dimension compression on the first analysis reply text vector to obtain a first analysis reply text characteristic value;
and calculating the first analysis reply text characteristic value and the reply text characteristic value as variables of the first loss function to obtain the first loss value.
In the embodiment of the invention, the dimension compression can be performed by means of convolution, a full connection layer and the like, and the embodiment of the invention does not limit the method for dimension compression.
The type of the first loss function is not limited in the embodiment of the invention.
S3, taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
the ranking model in the embodiment of the invention is an MMI (Maximum Mutual Information ) model, and also generates a pre-training language model.
Further, in the embodiment of the present invention, S3 includes:
inputting the reply text into the reply generation model to obtain a second analysis reply text;
and measuring the difference between the second analysis reply text and the dialogue history text by using a preset second loss function to obtain the second loss value.
Specifically, in the embodiment of the present invention, the measuring the difference between the second analysis reply text and the dialogue history text by using a preset second loss function to obtain the second loss value includes:
converting the second analysis reply text into a second analysis reply text vector;
converting the dialogue history text into a vector to obtain a dialogue history text vector;
and calculating by using the second loss function based on the second analysis reply text vector and the dialogue history text vector to obtain the second loss value.
Specifically, in the embodiment of the present invention, based on the second analysis reply text vector and the dialogue history text vector, the calculation is performed by using the second loss function to obtain the second loss value, which includes:
performing dimension compression on the second analysis reply text vector to obtain a second analysis reply text characteristic value;
performing dimension compression on the dialogue history text vector to obtain dialogue history text characteristic values;
and calculating the second analysis reply text characteristic value and the dialogue history text characteristic value as variables of the second loss function to obtain the second loss value.
In the embodiment of the invention, the dimension compression can be performed by means of convolution, a full connection layer and the like, and the embodiment of the invention does not limit the method for dimension compression; the type of the second loss function is not limited in the embodiment of the invention.
And S4, screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text.
In the embodiment of the present invention, screening all reply texts according to a first loss value and a second loss value corresponding to the reply text to obtain a target reply text includes:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
cutting off a preset number of reply texts in the reply text sequence by taking a first reply text as a starting point in the reply text sequence to obtain a target reply text sequence;
and selecting a reply text with the minimum second loss value in the target reply text sequence to obtain the target reply text.
Specifically, in the embodiment of the present invention, the preset segmentation length is a positive integer greater than or equal to 1, which indicates the number of reply texts to be segmented, for example: and the reply text sequence is [ a, b, c, d ], wherein the reply text sequence comprises reply texts a, b, c, d, the preset number is 1, and then the first reply text in the reply text sequence is cut from the reply text a as a starting point, so that the obtained target reply text sequence is [ b, c, d ].
In an embodiment of the present invention, the filtering all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
extracting the median of all the first loss values to obtain a screening reference value;
calculating by using the screening reference value and a preset screening reference coefficient to obtain a target screening value;
screening all the reply texts by using the target screening value and the first loss value to obtain a reply text set;
and selecting the reply text with the minimum second loss value in the reply text set to obtain the target reply text.
Specifically, in the embodiment of the present invention, the screening reference coefficient may be any positive real number, and may be generally 1, 1.5 or 2, and preferably, the screening reference coefficient is 1.5.
Further, in the embodiment of the present invention, screening all the reply texts by using the target screening value and the first loss value to obtain a reply text set includes:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
deleting the reply text with the first loss value larger than the target screening value in the reply text sequence to obtain a screening reply text sequence;
and summarizing all the reply texts in the screening reply text sequence to obtain the reply text set.
In an embodiment of the present invention, the filtering all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text includes:
weighting calculation is carried out on the first loss value and the second loss value corresponding to the reply text by using a preset first loss value weight and a preset second loss value weight, so that a weighting coefficient of the reply text is obtained;
and screening all the reply texts by using the weighting coefficient to obtain the target reply text.
In detail, the weighting coefficient can be calculated by using the following formula:
x=a*m+b*n
wherein m and n are respectively a first loss value and a second loss value corresponding to the reply text, x is a weighting coefficient corresponding to the reply text, a is the first loss weight, and b is the second loss weight.
Specifically, the embodiment of the invention determines the reply text with the smallest weighting coefficient in all the reply texts as the target reply text.
Further, in the embodiment of the invention, all the reply texts are screened according to the first loss value and the second loss value corresponding to the reply text, and after a target reply text is obtained, the target reply text is sent to a preset terminal device.
Specifically, in the embodiment of the invention, the terminal equipment is a terminal which needs to be generated according to the reply of the dialogue history text, and the terminal equipment is equipment capable of receiving and displaying the text and can be intelligent terminals such as mobile phones, computers and tablets.
As shown in fig. 2, a functional block diagram of the dialogue reply screening device according to the present invention is shown.
The dialogue reply screening apparatus 100 of the present invention may be installed in an electronic device. Depending on the implemented functions, the session reply screening device may include a reply acquisition module 101, a loss calculation module 102, and a reply screening module 103, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform a fixed function, and are stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the reply acquiring module 101 is configured to acquire a preset number of reply texts generated by using a pre-constructed reply generating model based on the dialogue history text;
the loss calculation module 102 is configured to use the dialogue history text as input of the reply generation model, use the reply text as a tag of the dialogue history text, calculate a model loss value of the reply generation model, and obtain a first loss value corresponding to the reply text; taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
the reply screening module 103 is configured to screen all reply texts according to the first loss value and the second loss value corresponding to the reply text, so as to obtain a target reply text.
In detail, each module in the dialogue reply screening device 100 in the embodiment of the present invention adopts the same technical means as the dialogue reply screening method described in fig. 1 and can produce the same technical effects, which are not described herein.
Fig. 3 is a schematic structural diagram of an electronic device implementing the dialogue reply screening method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a dialog reply screening program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various data, such as codes of a dialogue reply filter, etc., but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (e.g., a session reply filter program, etc.) stored in the memory 11, and calling data stored in the memory 11.
The communication bus 12 may be a peripheral component interconnect standard (PerIPheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure classification circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
Optionally, the communication interface 13 may comprise a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The dialogue reply filter program stored in the memory 11 in the electronic device is a combination of a plurality of computer programs, which when run in the processor 10, can implement:
acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on a dialogue history text, wherein the reply generation model is a generated pre-training language model;
taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, and calculating a model loss value of the reply generation model to obtain a first loss value corresponding to the reply text;
taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the electronic device integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on a dialogue history text, wherein the reply generation model is a generated pre-training language model;
taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, and calculating a model loss value of the reply generation model to obtain a first loss value corresponding to the reply text;
taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method for screening dialog replies, said method comprising:
acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on a dialogue history text, wherein the reply generation model is a generated pre-training language model;
taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, and calculating a model loss value of the reply generation model to obtain a first loss value corresponding to the reply text;
taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and screening all the reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text.
2. The method for screening dialogue replies according to claim 1, wherein said screening all reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text comprises:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
cutting off a preset number of reply texts in the reply text sequence by taking a first reply text as a starting point in the reply text sequence to obtain a target reply text sequence;
and selecting a reply text with the minimum second loss value in the target reply text sequence to obtain the target reply text.
3. The method for screening dialogue replies according to claim 1, wherein said screening all reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text comprises:
extracting the median of all the first loss values to obtain a screening reference value;
calculating by using the screening reference value and a preset screening reference coefficient to obtain a target screening value;
screening all the reply texts by using the target screening value and the first loss value to obtain a reply text set;
and selecting the reply text with the minimum second loss value in the reply text set to obtain the target reply text.
4. The method of claim 3, wherein said filtering all of said reply texts using said target filtering value and said first loss value to obtain a reply text set comprises:
sorting all the reply texts in a descending order according to the first loss value to obtain a reply text sequence;
deleting the reply text with the first loss value larger than the target screening value in the reply text sequence to obtain a screening reply text sequence;
and summarizing all the reply texts in the screening reply text sequence to obtain the reply text set.
5. The method for screening dialogue replies according to claim 1, wherein said screening all reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain a target reply text comprises:
weighting calculation is carried out on the first loss value and the second loss value corresponding to the reply text by using a preset first loss value weight and a preset second loss value weight, so that a weighting coefficient of the reply text is obtained;
and screening all the reply texts by using the weighting coefficient to obtain the target reply text.
6. The dialog reply screening method of any one of claims 1 to 5, wherein the step of using the dialog history text as an input of the reply generation model, using the reply text as a label of the dialog history text, calculating a model loss value of the reply generation model, and obtaining a first loss value corresponding to the reply text includes:
inputting the dialogue history text into the reply generation model to obtain a first analysis reply text;
and measuring the difference between the reply text and the first analysis reply text by using a preset first loss function to obtain the first loss value.
7. A dialog reply screening device comprising:
the reply acquisition module is used for acquiring a preset number of reply texts generated by utilizing a pre-constructed reply generation model based on the dialogue history texts;
the loss calculation module is used for taking the dialogue history text as input of the reply generation model, taking the reply text as a label of the dialogue history text, calculating a model loss value of the reply generation model, and obtaining a first loss value corresponding to the reply text; taking the reply text as input of a pre-constructed ordering model, taking the dialogue history text as a label of the reply text, and calculating a model loss value of the ordering model to obtain a second loss value corresponding to the reply text;
and the reply screening module is used for screening all the reply texts according to the first loss value and the second loss value corresponding to the reply texts to obtain target reply texts.
8. The dialog reply screening device of claim 7, wherein the screening all reply texts according to the first loss value and the second loss value corresponding to the reply text to obtain the target reply text includes:
weighting calculation is carried out on the first loss value and the second loss value corresponding to the reply text by using a preset first loss value weight and a preset second loss value weight, so that a weighting coefficient of the reply text is obtained;
and screening all the reply texts by using the weighting coefficient to obtain the target reply text.
9. An electronic device, the 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 a computer program executable by the at least one processor to enable the at least one processor to perform the dialog reply screening method of any of claims 1 to 6.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the dialog reply screening method of any of claims 1 to 6.
CN202310471993.XA 2023-04-24 2023-04-24 Dialogue reply screening method, device, equipment and storage medium Pending CN116483974A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310471993.XA CN116483974A (en) 2023-04-24 2023-04-24 Dialogue reply screening method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310471993.XA CN116483974A (en) 2023-04-24 2023-04-24 Dialogue reply screening method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116483974A true CN116483974A (en) 2023-07-25

Family

ID=87221185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310471993.XA Pending CN116483974A (en) 2023-04-24 2023-04-24 Dialogue reply screening method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116483974A (en)

Similar Documents

Publication Publication Date Title
CN112883190A (en) Text classification method and device, electronic equipment and storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN113268665A (en) Information recommendation method, device and equipment based on random forest and storage medium
CN113868529A (en) Knowledge recommendation method and device, electronic equipment and readable storage medium
CN114612194A (en) Product recommendation method and device, electronic equipment and storage medium
CN114781832A (en) Course recommendation method and device, electronic equipment and storage medium
CN113837631B (en) Employee evaluation method and device, electronic equipment and readable storage medium
CN115600644A (en) Multitasking method and device, electronic equipment and storage medium
CN113505273B (en) Data sorting method, device, equipment and medium based on repeated data screening
CN113157853A (en) Problem mining method and device, electronic equipment and storage medium
CN113626605B (en) Information classification method, device, electronic equipment and readable storage medium
CN113657546B (en) Information classification method, device, electronic equipment and readable storage medium
CN112561500B (en) Salary data generation method, device, equipment and medium based on user data
CN116483974A (en) Dialogue reply screening method, device, equipment and storage medium
CN114723488B (en) Course recommendation method and device, electronic equipment and storage medium
CN115225489B (en) Dynamic control method for queue service flow threshold, electronic equipment and storage medium
CN113704616B (en) Information pushing method and device, electronic equipment and readable storage medium
CN113051475B (en) Content recommendation method, device, electronic equipment and readable storage medium
CN113592606B (en) Product recommendation method, device, equipment and storage medium based on multiple decisions
CN114781833B (en) Capability assessment method, device and equipment based on business personnel and storage medium
CN117195898A (en) Entity relation extraction method and device, electronic equipment and storage medium
CN116521867A (en) Text clustering method and device, electronic equipment and storage medium
CN116486972A (en) Electronic medical record generation method, device, equipment and storage medium
CN113362039A (en) Business approval method and device, electronic equipment and storage medium

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