CN114020774A - Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium - Google Patents

Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium Download PDF

Info

Publication number
CN114020774A
CN114020774A CN202111389295.2A CN202111389295A CN114020774A CN 114020774 A CN114020774 A CN 114020774A CN 202111389295 A CN202111389295 A CN 202111389295A CN 114020774 A CN114020774 A CN 114020774A
Authority
CN
China
Prior art keywords
round
natural language
query statement
target
nth
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
CN202111389295.2A
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.)
Big Data Center Of State Grid Corp Of China
Original Assignee
Big Data Center Of State Grid Corp Of China
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 Big Data Center Of State Grid Corp Of China filed Critical Big Data Center Of State Grid Corp Of China
Priority to CN202111389295.2A priority Critical patent/CN114020774A/en
Publication of CN114020774A publication Critical patent/CN114020774A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/243Natural language query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2445Data retrieval commands; View definitions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24522Translation of natural language queries to structured queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/268Morphological analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for processing multiple rounds of question-answering sentences. Acquiring an Nth round of natural language query sentences; wherein N is a positive integer greater than 1; inputting the Nth round of natural language query sentences into an entity recognition model to obtain part-of-speech information and entity types of each participle contained in the Nth round of natural language query sentences; acquiring an N-1 th round of natural language query statement or an N-1 th round of structured query statement; replacing word segmentation in the N-1 th natural language query statement or the N-1 th structured query statement based on the part of speech information and the entity type to obtain a target Nth natural language query statement or a target Nth structured query statement; and determining an Nth round query result based on the target Nth round natural language query statement or the target Nth round structured query statement. The processing efficiency and the accuracy of the multi-turn question-answering sentences can be improved.

Description

Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a method, a device, equipment and a storage medium for processing multiple rounds of question and answer sentences.
Background
At present, a multi-round question-answering system realizes a multi-round question-answering flow module (including a multi-round question-answering flow chart, custom configuration information and the like) depending on manual configuration. The multi-turn question-answering system is slow to construct and update, the generation efficiency of the multi-turn question-answering system is low, and the workload of developers is large; the multi-turn question-answering effect extremely depends on the quality and the richness of multi-turn question-answering flow modules configured by business personnel, the workload of the business personnel is large, the influence of human factors is large, and the effect is unstable.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for processing multiple rounds of question and answer sentences, which can improve the processing efficiency and accuracy of the multiple rounds of question and answer sentences.
In a first aspect, an embodiment of the present invention provides a method for processing multiple rounds of question and answer sentences, including:
acquiring an Nth round of natural language query sentences; wherein N is a positive integer greater than 1;
inputting the Nth round of natural language query sentences into an entity recognition model to obtain part-of-speech information and entity types of each participle contained in the Nth round of natural language query sentences;
acquiring an N-1 th round of natural language query statement or an N-1 th round of structured query statement;
replacing word segmentation in the N-1 th natural language query statement or the N-1 th structured query statement based on the part of speech information and the entity type to obtain a target Nth natural language query statement or a target Nth structured query statement;
and determining an Nth round query result based on the target Nth round natural language query statement or the target Nth round structured query statement.
Further, replacing the word segmentation in the N-1 th natural language query statement or the N-1 th structured query statement based on the part of speech information and the entity type to obtain a target nth natural language query statement or a target nth structured query statement, including:
taking the participles in the N-1 th round of natural language query sentences as first participles, and taking the participles in the N-1 th round of natural language query sentences as second participles;
acquiring a first participle and a second participle with the same part-of-speech information and entity type, and determining the participle as a first target participle and a second target participle;
and replacing the first target participle in the N-1 th round natural language query statement or the N-1 th round structured query statement with the second target participle to obtain a target N-th round natural language query statement or a target N-th round structured query statement.
Further, determining an nth round query result based on the target nth round natural language query statement, including:
inputting the target Nth round of natural language query sentences into a sentence conversion model to obtain target Nth round of structured query sentences;
and determining an Nth round query result based on the target Nth round structured query statement.
Further, determining an nth round query result based on the target nth round structured query statement includes:
and inquiring a set database based on the target N-th round structured query statement to obtain an N-th round query result.
Further, still include:
for the first round of natural language query sentences, inputting the first round of natural language query sentences into the sentence conversion model to obtain first round structured query sentences;
and obtaining a first round query result according to the first round structured query statement.
Further, before obtaining the nth round of natural language query statement, the method further includes:
and performing word segmentation processing on the Nth round of natural language query sentences by adopting a set word segmentation algorithm.
Further, the entity recognition model is obtained by training a natural language to structured language NL2SQL model through setting a transfer learning algorithm.
In a second aspect, an embodiment of the present invention further provides a device for processing multiple rounds of question and answer sentences, including:
the Nth round of natural language query sentence acquisition module is used for acquiring the Nth round of natural language query sentences; wherein N is a positive integer greater than 1;
a part-of-speech information and entity type acquisition module, configured to input the nth round of natural language query statements into an entity identification model, and acquire part-of-speech information and entity types of each participle included in the nth round of natural language query statements;
the N-1 round query statement acquisition module is used for acquiring the N-1 round natural language query statement or the N-1 round structured query statement;
a word segmentation replacement module, configured to replace a word segmentation in the N-1 th round natural language query statement or the N-1 th round structured query statement based on the part-of-speech information and the entity type, to obtain a target nth round natural language query statement or a target nth round structured query statement;
and the Nth round query result determining module is used for determining the Nth round query result based on the target Nth round natural language query statement or the target Nth round structured query statement.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the processing method of multiple rounds of question and answer sentences according to the embodiment of the present invention when executing the program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the processing method of multiple rounds of question-answering sentences according to the embodiment of the present invention.
The embodiment of the invention provides a method, a device and equipment for processing multiple rounds of question-answering sentences and a storage medium. Acquiring an Nth round of natural language query sentences; wherein N is a positive integer greater than 1; inputting the Nth round of natural language query sentences into the entity recognition model to obtain part-of-speech information and entity types of each participle contained in the Nth round of natural language query sentences; acquiring an N-1 th round of natural language query statement or an N-1 th round of structured query statement; replacing participles in the natural language query sentence of the N-1 th round or the structured query sentence of the N-1 th round based on the part of speech information and the entity type to obtain a target natural language query sentence of the Nth round or a target structured query sentence of the Nth round; and determining an Nth round of query result based on the target Nth round of natural language query statement or the target Nth round of structured query statement. The processing efficiency and the accuracy of the multi-turn question-answering sentences can be improved.
Drawings
FIG. 1 is a flowchart of a method for processing multiple rounds of question-answering sentences according to a first embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a processing apparatus for multiple rounds of question-answering sentences according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device in a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for processing multiple rounds of question and answer sentences according to an embodiment of the present invention, where this embodiment is applicable to a case where multiple rounds of question and answer sentences are processed, and the method may be executed by a processing apparatus for multiple rounds of question and answer sentences, where the apparatus may be composed of hardware and/or software, and may generally be integrated in a device having a function of processing multiple rounds of question and answer sentences, where the device may be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in fig. 1, the method specifically includes the following steps:
and step 110, acquiring the Nth round of natural language query sentences.
Wherein N is a positive integer greater than 1. In a multi-turn question-and-answer system, a user asks a question, i.e., inputs a natural language query sentence, through an input module of the system. If the user inputs through voice, the voice needs to be converted into text.
And 120, inputting the Nth round of natural language query sentences into the entity recognition model to obtain the part-of-speech information and the entity types of each participle contained in the Nth round of natural language query sentences.
The entity recognition model is obtained by training a Natural Language to structured Language (NL 2SQL) model by setting a migration learning algorithm. The part-of-speech information may represent the part-of-speech to which the segmented word belongs, such as: parts of speech such as nouns, verbs and pronouns; the entity type characterizes the entity represented by the participle, for example: time, place, amount of electricity sold, etc. In this embodiment, when the entity recognition model is trained, entity indexes in the power grid field may be used for training, so that the entity recognition model may recognize not only general word segmentation entity types (e.g., time, location, etc.) but also word segmentation entity types (e.g., electricity sales, net profit, etc.) in the power grid field.
Specifically, the nth round of natural language query sentences are input into the entity recognition model, so that the part-of-speech information and the entity types of each participle included in the nth round of natural language query sentences can be obtained. For example, suppose that the nth round of natural language query statement is "how much electricity sold in area a of 3 months in 2018? "in" 3 months in 2018 "is noun and time," area a "is noun and place," electricity sales "is noun and electricity sales.
Optionally, before obtaining the nth round of natural language query statement, the method further includes the following steps: and performing word segmentation processing on the Nth round of natural language query sentences by adopting a set word segmentation algorithm.
The set word segmentation algorithm may be BERT (bidirectional Encoder replication from transformers), GPT-3, mBART.
And step 130, acquiring the natural language query statement of the (N-1) th round or the structured query statement of the (N-1) th round.
The Structured Query Language (SQL) may be obtained by filling Query fields, aggregation functions, screening conditions, and grouping fields in a natural Language Query statement. In this embodiment, the N-1 st round of structured query statement may be obtained by inputting the N-1 st round of natural language query statement into the statement conversion model, or may be obtained by replacing the participles with the N-2 round of structured query statement.
Wherein, the statement conversion model can be NL2SQL model.
And 140, replacing the participles in the N-1 th natural language query statement or the N-1 st round structured query statement based on the part of speech information and the entity type to obtain a target Nth natural language query statement or a target Nth round structured query statement.
Specifically, the participles in the N-1 th round of natural language query statement or the N-1 th round of structured query statement may be replaced with participles having the same lexical information and entity type as those in the N-1 th round of natural language query statement.
Specifically, the process of obtaining the target nth round natural language query statement or the target nth round structured query statement by replacing the participle in the nth-1 round natural language query statement or the nth-1 round structured query statement based on the part of speech information and the entity type may be: taking the participles in the N-1 th round of natural language query sentences as first participles, and taking the participles in the N-1 th round of natural language query sentences as second participles; acquiring a first participle and a second participle with the same part-of-speech information and entity type, and determining the participle as a first target participle and a second target participle; and replacing the first target participle in the N-1 th round of natural language query statement or the N-1 th round of structured query statement with a second target participle to obtain a target Nth round of natural language query statement or a target Nth round of structured query statement.
In this embodiment, part-of-speech information and an entity type of a first participle in an N-1 th round of natural language query sentences and part-of-speech information and an entity type of a second participle in an N-1 th round of natural language query sentences are first obtained, then, first participles and second participles with the same part-of-speech information and entity type are extracted, first target participles and second target participles are determined, and finally, the first target participles in the N-1 th round of natural language query sentences or N-1 th round of structured query sentences are replaced with the second target participles to obtain target N-th round of natural language query sentences or target N-1 th round of structured query sentences. For example, assume that the natural language query statement of the current round is: "B area worsted? "how much electricity sold in area a of 3 months in 2018? And SQL statements are: "SELECT electricity selling quantity FROM Table WHERE time is" 2020-3"AND place is" area a ". Wherein, the part-of-speech information and the entity type of the "B area" and the "a area" are the same, then the "a area" in the previous round of natural language query statement or SQL statement is replaced by the "B area", and what is the electricity sold in the "B area 3 months in 2018? Or "SELECT electricity selling amount FROM Table WHERE time is" 2020-3"AND place is" beijing ", that is, the target natural language query statement AND the target SQL statement of the current round. Thus, multiple rounds of question answering are realized by using the historical question answering sentences.
Step 150, determining an nth round query result based on the target nth round natural language query statement or the target nth round structured query statement.
In this embodiment, if the target nth round of natural language query statement is obtained, the target nth round of natural language query statement is input to the statement conversion model to obtain the target nth round of structured query statement, and the nth round of query result is determined based on the target nth round of structured query statement. And if the target N-th round structured query statement is obtained, directly determining an N-th round query result according to the target N-th round structured query statement.
Specifically, the process of determining the nth round query result based on the target nth round structured query statement may be: and inquiring the set database based on the target N-th round structured query statement to obtain an N-th round query result.
Optionally, the method further comprises the following steps: and for the first round of natural language query sentences, inputting the first round of natural language query sentences into a sentence conversion model to obtain first round structured query sentences. And obtaining a first round query result according to the first round structured query statement.
And querying the set database according to the first round structured query statement to obtain a first round query result.
According to the technical scheme of the embodiment, an Nth round of natural language query sentences are obtained; wherein N is a positive integer greater than 1; inputting the Nth round of natural language query sentences into the entity recognition model to obtain part-of-speech information and entity types of each participle contained in the Nth round of natural language query sentences; acquiring an N-1 th round of natural language query statement or an N-1 th round of structured query statement; replacing participles in the natural language query sentence of the N-1 th round or the structured query sentence of the N-1 th round based on the part of speech information and the entity type to obtain a target natural language query sentence of the Nth round or a target structured query sentence of the Nth round; and determining an Nth round of query result based on the target Nth round of natural language query statement or the target Nth round of structured query statement. The processing efficiency and the accuracy of the multi-turn question-answering sentences can be improved.
Example two
Fig. 2 is a schematic structural diagram of a processing apparatus for multiple rounds of question-answering sentences according to a second embodiment of the present invention. As shown in fig. 2, the apparatus includes:
an nth round natural language query sentence acquisition module 210, configured to acquire an nth round natural language query sentence; wherein N is a positive integer greater than 1;
a part-of-speech information and entity type obtaining module 220, configured to input the nth round of natural language query statements into the entity identification model, and obtain part-of-speech information and entity types of each participle included in the nth round of natural language query statements;
an N-1 round query statement obtaining module 230, configured to obtain an N-1 round natural language query statement or an N-1 round structured query statement;
a word segmentation replacement module 240, configured to replace a word in the N-1 th natural language query statement or the N-1 th structured query statement based on the part-of-speech information and the entity type, to obtain a target nth natural language query statement or a target nth structured query statement;
an nth round query result determining module 250, configured to determine an nth round query result based on the target nth round natural language query statement or the target nth round structured query statement.
Optionally, the word segmentation replacement module 240 is further configured to:
taking the participles in the N-1 th round of natural language query sentences as first participles, and taking the participles in the N-1 th round of natural language query sentences as second participles;
acquiring a first participle and a second participle with the same part-of-speech information and entity type, and determining the participle as a first target participle and a second target participle;
and replacing the first target participle in the N-1 th round of natural language query statement or the N-1 th round of structured query statement with a second target participle to obtain a target Nth round of natural language query statement or a target Nth round of structured query statement.
Optionally, the nth round query result determining module 250 is further configured to:
inputting the target Nth round of natural language query sentences into a sentence conversion model to obtain target Nth round of structured query sentences;
and determining an Nth round query result based on the target Nth round structured query statement.
Optionally, the nth round query result determining module 250 is further configured to:
and inquiring the set database based on the target N-th round structured query statement to obtain an N-th round query result.
Optionally, the method further includes: a first round query result obtaining module, configured to:
for the first round of natural language query sentences, inputting the first round of natural language query sentences into a sentence conversion model to obtain first round structured query sentences;
and obtaining a first round query result according to the first round structured query statement.
Optionally, the method further includes: a word segmentation module to:
and performing word segmentation processing on the Nth round of natural language query sentences by adopting a set word segmentation algorithm.
Optionally, the entity recognition model is obtained by training a natural language to structured language NL2SQL model by setting a migration learning algorithm.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For details not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present invention.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention. FIG. 3 illustrates a block diagram of a computer device 312 suitable for use in implementing embodiments of the present invention. The computer device 312 shown in FIG. 3 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention. Device 312 is typically a computing device that undertakes the processing functions of multiple rounds of question-and-answer sentences.
As shown in FIG. 3, computer device 312 is in the form of a general purpose computing device. The components of computer device 312 may include, but are not limited to: one or more processors 316, a storage device 328, and a bus 318 that couples the various system components including the storage device 328 and the processors 316.
Bus 318 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Computer device 312 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 312 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 328 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 330 and/or cache Memory 332. The computer device 312 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 334 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 3, and commonly referred to as a "hard drive"). Although not shown in FIG. 3, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 318 by one or more data media interfaces. Storage 328 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 336 having a set (at least one) of program modules 326 may be stored, for example, in storage 328, such program modules 326 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which may comprise an implementation of a network environment, or some combination thereof. Program modules 326 generally carry out the functions and/or methodologies of embodiments of the invention as described herein.
The computer device 312 may also communicate with one or more external devices 314 (e.g., keyboard, pointing device, camera, display 324, etc.), with one or more devices that enable a user to interact with the computer device 312, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 312 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 322. Also, computer device 312 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), etc.) and/or a public Network, such as the internet, via Network adapter 320. As shown, network adapter 320 communicates with the other modules of computer device 312 via bus 318. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 312, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 316 executes various functional applications and data processing by running programs stored in the storage device 328, for example, implementing the processing method of multiple rounds of question-answering sentences provided by the above-described embodiment of the present invention.
Example four
The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the processing method of multiple rounds of question-answering sentences according to the embodiments of the present invention.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiment of the present invention is not limited to the method operations described above, and may also perform related operations in the multiple rounds of processing methods for question and answer sentences provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for processing multiple rounds of question-answering sentences is characterized by comprising the following steps:
acquiring an Nth round of natural language query sentences; wherein N is a positive integer greater than 1;
inputting the Nth round of natural language query sentences into an entity recognition model to obtain part-of-speech information and entity types of each participle contained in the Nth round of natural language query sentences;
acquiring an N-1 th round of natural language query statement or an N-1 th round of structured query statement;
replacing word segmentation in the N-1 th natural language query statement or the N-1 th structured query statement based on the part of speech information and the entity type to obtain a target Nth natural language query statement or a target Nth structured query statement;
and determining an Nth round query result based on the target Nth round natural language query statement or the target Nth round structured query statement.
2. The method of claim 1, wherein replacing the participle in the N-1 th round natural language query statement or the N-1 th round structured query statement based on the part of speech information and the entity type to obtain a target nth round natural language query statement or a target nth round structured query statement comprises:
taking the participles in the N-1 th round of natural language query sentences as first participles, and taking the participles in the N-1 th round of natural language query sentences as second participles;
acquiring a first participle and a second participle with the same part-of-speech information and entity type, and determining the participle as a first target participle and a second target participle;
and replacing the first target participle in the N-1 th round natural language query statement or the N-1 th round structured query statement with the second target participle to obtain a target N-th round natural language query statement or a target N-th round structured query statement.
3. The method of claim 1, wherein determining an nth round query result based on the target nth round natural language query statement comprises:
inputting the target Nth round of natural language query sentences into a sentence conversion model to obtain target Nth round of structured query sentences;
and determining an Nth round query result based on the target Nth round structured query statement.
4. The method of claim 1 or 3, wherein determining the Nth round of query results based on the target Nth round of structured query statements comprises:
and inquiring a set database based on the target N-th round structured query statement to obtain an N-th round query result.
5. The method of claim 3, further comprising:
for the first round of natural language query sentences, inputting the first round of natural language query sentences into the sentence conversion model to obtain first round structured query sentences;
and obtaining a first round query result according to the first round structured query statement.
6. The method of claim 1, prior to obtaining the Nth round of natural language query statements, further comprising:
and performing word segmentation processing on the Nth round of natural language query sentences by adopting a set word segmentation algorithm.
7. The method of claim 1, wherein the entity recognition model is obtained by setting a migration learning algorithm to train a natural language to structured language NL2SQL model.
8. A processing apparatus for multiple rounds of question-answering sentences, comprising:
the Nth round of natural language query sentence acquisition module is used for acquiring the Nth round of natural language query sentences; wherein N is a positive integer greater than 1;
a part-of-speech information and entity type acquisition module, configured to input the nth round of natural language query statements into an entity identification model, and acquire part-of-speech information and entity types of each participle included in the nth round of natural language query statements;
the N-1 round query statement acquisition module is used for acquiring the N-1 round natural language query statement or the N-1 round structured query statement;
a word segmentation replacement module, configured to replace a word segmentation in the N-1 th round natural language query statement or the N-1 th round structured query statement based on the part-of-speech information and the entity type, to obtain a target nth round natural language query statement or a target nth round structured query statement;
and the Nth round query result determining module is used for determining the Nth round query result based on the target Nth round natural language query statement or the target Nth round structured query statement.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of processing a plurality of rounds of question-and-answer sentences according to any one of claims 1-7 when executing the program.
10. A computer-readable storage medium on which a computer program is stored, the program implementing a method of processing a plurality of rounds of question-answering sentences according to any one of claims 1-7 when executed by a processor.
CN202111389295.2A 2021-11-22 2021-11-22 Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium Pending CN114020774A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111389295.2A CN114020774A (en) 2021-11-22 2021-11-22 Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111389295.2A CN114020774A (en) 2021-11-22 2021-11-22 Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium

Publications (1)

Publication Number Publication Date
CN114020774A true CN114020774A (en) 2022-02-08

Family

ID=80065531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111389295.2A Pending CN114020774A (en) 2021-11-22 2021-11-22 Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium

Country Status (1)

Country Link
CN (1) CN114020774A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168619A (en) * 2022-02-09 2022-03-11 阿里巴巴达摩院(杭州)科技有限公司 Training method and device of language conversion model

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168619A (en) * 2022-02-09 2022-03-11 阿里巴巴达摩院(杭州)科技有限公司 Training method and device of language conversion model

Similar Documents

Publication Publication Date Title
CN110298019A (en) Name entity recognition method, device, equipment and computer readable storage medium
US9766868B2 (en) Dynamic source code generation
CN110276023B (en) POI transition event discovery method, device, computing equipment and medium
US9619209B1 (en) Dynamic source code generation
CN111143556B (en) Automatic counting method and device for software function points, medium and electronic equipment
CN111159220B (en) Method and apparatus for outputting structured query statement
US11216618B2 (en) Query processing method, apparatus, server and storage medium
CN110415679B (en) Voice error correction method, device, equipment and storage medium
CN110517767B (en) Auxiliary diagnosis method, auxiliary diagnosis device, electronic equipment and storage medium
US20120158742A1 (en) Managing documents using weighted prevalence data for statements
CN114281968B (en) Model training and corpus generation method, device, equipment and storage medium
CN111597800A (en) Method, device, equipment and storage medium for obtaining synonyms
US11645452B2 (en) Performance characteristics of cartridge artifacts over text pattern constructs
CN109657127B (en) Answer obtaining method, device, server and storage medium
CN114020774A (en) Method, device and equipment for processing multiple rounds of question-answering sentences and storage medium
CN116402166B (en) Training method and device of prediction model, electronic equipment and storage medium
CN111126073B (en) Semantic retrieval method and device
CN114036921A (en) Policy information matching method and device
CN110929532B (en) Data processing method, device, equipment and storage medium
US20220405487A1 (en) Causal Knowledge Identification and Extraction
CN112948580B (en) Text classification method and system
CN111459959B (en) Method and apparatus for updating event sets
CN113672699A (en) Knowledge graph-based NL2SQL generation method
CN108008947B (en) Intelligent prompting method and device for programming statement, server and storage medium
CN112231444A (en) Processing method and device for corpus data combining RPA and AI and electronic equipment

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