CN109002498A - Interactive method, device, equipment and storage medium - Google Patents

Interactive method, device, equipment and storage medium Download PDF

Info

Publication number
CN109002498A
CN109002498A CN201810693841.3A CN201810693841A CN109002498A CN 109002498 A CN109002498 A CN 109002498A CN 201810693841 A CN201810693841 A CN 201810693841A CN 109002498 A CN109002498 A CN 109002498A
Authority
CN
China
Prior art keywords
sentence
value
weighted value
client device
corpus
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.)
Granted
Application number
CN201810693841.3A
Other languages
Chinese (zh)
Other versions
CN109002498B (en
Inventor
乔爽爽
刘昆
梁阳
林湘粤
许天涵
韩超
朱名发
郭江亮
李旭
刘俊
李硕
尹世明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810693841.3A priority Critical patent/CN109002498B/en
Publication of CN109002498A publication Critical patent/CN109002498A/en
Application granted granted Critical
Publication of CN109002498B publication Critical patent/CN109002498B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Machine Translation (AREA)

Abstract

The present invention provides a kind of interactive method, device, equipment and storage medium, the interactive method can include: receives the request that client device is sent, the request includes the first sentence of input;First sentence is analyzed, the weighted value of first sentence is obtained, the weighted value is used to characterize the reasonability of first sentence;According to the weighted value, from preset corpus, the second sentence for replying first sentence is determined;It sends and responds to the client device, the response includes: second sentence, and second response is used for so that the client device exports second sentence.The user experience in human-computer dialogue can be improved in the present invention.

Description

Interactive method, device, equipment and storage medium
Technical field
The present invention relates to artificial intelligence field more particularly to a kind of interactive method, device, equipment and storage mediums.
Background technique
With the development of artificial intelligence technology, the human-computer dialogue based on language have become main human-computer interaction scene it One.In human-computer dialogue scene, the sentence that equipment is inputted based on user determines that the relevant sentence of the read statement replies, such as This, it appears that user engages in the dialogue with equipment.
It is by carrying out Keywords matching to the sentence of input, according to matching mostly in current human-computer dialogue scene As a result it determines and replies sentence.However, in practical applications, the big multiple statement of user's input may be more casual, so that semanteme is not Rationally, this to cannot get corresponding sentence by Keywords matching, then returns to random or fixed answer sentence.
Thus, current interactive is easy so that user thinks that equipment or robot are not smart enough, so that people Machine interactive experience is poor.
Summary of the invention
The present invention provides a kind of interactive method, device, equipment and storage medium, so that in human-computer dialogue scene, The answer of equipment or robot is more intelligent, improves user experience.
In a first aspect, the present invention provides a kind of interactive method, comprising:
The request that client device is sent is received, the request includes the first sentence of input;
First sentence is analyzed, obtains the weighted value of first sentence, the weighted value is for characterizing institute State the reasonability of the first sentence;
According to the weighted value, from preset corpus, the second sentence for replying first sentence is determined;
It sends and responds to the client device, the response includes: second sentence, and second response is for making It obtains the client device and exports second sentence.
Second aspect, the present invention provide a kind of human-computer dialogue device, comprising:
Receiving module, for receiving the request of client device transmission, the request includes the first sentence of input;
Analysis module obtains the weighted value of first sentence, the weight for analyzing first sentence Value is for characterizing the reasonability of first sentence;
Determining module, for from preset corpus, determining for replying first sentence according to the weighted value The second sentence;
Sending module is responded for sending to the client device, and the response includes: second sentence, described Second response is used for so that the client device exports second sentence.
The third aspect, the present invention provide a kind of server device, comprising: memory and processor;The memory and institute State processor connection;
The memory, for storing program instruction;
The processor, for being performed in program instruction, it can be achieved that stating interactive method described in first aspect.
Fourth aspect, the present invention provide a kind of computer readable storage medium, are stored thereon with computer program, the calculating Interactive method described in first aspect is realized when machine program is executed by processor.
The present invention provides a kind of interactive method, device, equipment and storage medium, can receive client by server-side The request including the first sentence that equipment is sent, analyzes first sentence, obtains the weighted value of first sentence, the power Weight values are used to characterize the reasonability of first sentence, and according to the weighted value, from preset corpus, determine for replying this Second sentence of the first sentence then returns to the response including second sentence to client device, with so that client is set It is standby to export second sentence.In this method, the second sentence for replying first sentence is the reasonability according to the first sentence Determine, and and nonrandom sentence or fixed sentence so that answer of the client device in human-computer dialogue scene is more intelligent, Improve the user experience in human-computer dialogue.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to do one simply to introduce, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of schematic diagram of interactive system provided in an embodiment of the present invention;
Fig. 2 is the flow chart one of interactive method provided in an embodiment of the present invention;
Fig. 3 is the flowchart 2 of interactive method provided in an embodiment of the present invention;
Fig. 4 is the flow chart 3 of interactive method provided in an embodiment of the present invention;
Fig. 5 is the flow chart four of interactive method provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram one of human-computer dialogue device provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram two of human-computer dialogue device provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of server device provided in an embodiment of the present invention;
Fig. 9 is the structural schematic diagram of client device provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
It should be noted that term " first ", " second " and " third " etc. in each section of the embodiment of the present invention and attached drawing It is to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that the number used in this way According to being interchangeable under appropriate circumstances, so that the embodiment of the present invention described herein can be in addition to illustrating herein or describing Those of other than sequence implement.In addition, term " includes " and " having " and their any deformation, it is intended that covering is not Exclusive includes, for example, the process, method, system, product or equipment for containing a series of steps or units be not necessarily limited to it is clear Step or unit those of is listed on ground, but is not clearly listed or for these process, methods, product or is set Standby intrinsic other step or units.
Method flow diagram involved in the following embodiments of the present invention is merely illustrative, it is not necessary in all Appearance and step, nor is it necessary that and execute in the described sequence.For example, some steps can also decompose, and some steps can To merge or partially merge, therefore, the sequence actually executed can change according to the actual situation.
Functional module in block diagram involved in the following embodiments of the present invention is only functional entity, not necessarily must be with Physically separate entity is corresponding.I.e., it is possible to realize these functional entitys using software form, or in one or more hardware It is realized in module or integrated circuit in these functional entitys or heterogeneous networks and/or processor and/or microcontroller and realizes this A little functional entitys.
In the applicable interactive system of interactive method that the following each embodiments of the present invention provide, Fig. 1 is the present invention A kind of schematic diagram for interactive system that embodiment provides.As shown in Figure 1, interactive system can include: server device 11, client device 12 and user 13.Server device 11 can be connect at least one client device 12, to control its company The client device 12 connect engages in the dialogue with user 13.Client device 12 can help for desktop computer, notebook, individual digital The equipment such as reason (Personal Digital Assistant, referred to as: PDA), smart phone, tablet computer, intelligence machine equipment. Interactive client device 12 can be carried out with user be also referred to as " robot ".
The function of server device 11 can be executed by a server, can also be executed by multiple servers, different server For realizing different functions.That is, server device 11 can be made of at least one server.Form server device 11 each server can be a physical entity, that is, physical machine, or one on a functional entity such as physical machine Functional module.
There is input equipment on client device 12, the sentence of user's input can be obtained, can also have output equipment to be used for It is exported to user and replies sentence.Then human-computer dialogue is realized.
Combine multiple examples to interactive method provided in an embodiment of the present invention, device, electronic equipment and storage as follows Medium is illustrated.
Fig. 2 is the flow chart one of interactive method provided in an embodiment of the present invention.The interactive method can be by client End equipment and server device interaction execute.As shown in Fig. 2, interactive method shown in the present embodiment may include as follows:
S201, client device receive the first sentence of input.
The client device can receive user and connect by the input equipment of the client device or with the client device First sentence of the input equipment input connect.
Type based on input equipment, first sentence can be different types of sentence.
In a kind of example, which for example can be keyboard or touch panel, then first sentence can be text The sentence of this type.
In another example, which can be for example voice-input device, then first sentence can be language The sentence of sound type.
First sentence can be the sentence that client device is input in actual conversation, which alternatively referred to as mentions Ask sentence, corresponding, following the second sentences for replying first sentence can be described as replying sentence.
S202, client device send to server device and request, which includes: first sentence.
For client device after receiving first data of input, can send to server device includes first sentence Request, to from server device request reply first sentence sentence.
It is corresponding, this method further include:
Server device receives the request that client device is sent, which includes the first sentence of input.
S203, server device analyze first sentence, obtain the weighted value of first sentence, which uses In the reasonability for characterizing first sentence.
Server device upon receiving the request, can carry out analysis on its rationality to first sentence, obtain can be used for table The rational of first sentence is levied, the weighted value of first sentence.
During specific implementation, server device can analyze first sentence, obtain according to preset analysis model To the weighted value of first sentence.In a kind of example, weighted value is bigger, can indicate that the reasonability of first sentence is higher;Power Weight values are smaller, can indicate that the reasonability of first sentence is lower.
Illustratively, the request including first sentence can be sent to the first service in server device by client device First sentence can be sent to second server by device, the first server, be divided by second server first sentence Analysis.Wherein, which can be for example the application server or control server in the server device, this first Server can be described as.The second server can be by server device, the server equipped with analysis model.The first service Device for example can according at least one server for being equipped with analysis model, select an optimal server as pair The second server that first sentence is analyzed.The first server can be born in real time according to the deployment scenario of analysis model Balanced and scheduling is carried, in the case where meeting load balancing, determines that available resources are most, query rate (Query Per per second Second, QPS) the high server equipped with analysis model is as the second server.Each server example of server-side It can be such as an object entity, can also be a functional entity.
As described above, which can be described as prediction engine server, and second server can be described as model service Device, wherein analysis model can be described as prediction model.
S204, server device are according to the weighted value, from preset corpus, determine for replying first sentence Second sentence.
It may include the corresponding corpus of at least one weighted value in the corpus, the corresponding corpus of each weighted value can be used for pair Weight of sentences value is that the sentence of each weighted value is replied.In this method, server device can be used according to the weighted value Corpus answer matches algorithm, determined from the preset corpus the corresponding corpus of the weighted value be this be used to reply this first Second sentence of sentence.
S205, server device send to client device and respond, which includes second sentence.
Corresponding, this method may also include that
Client device receives the response including second sentence from server device.
S206, client device export second sentence.
The client device can directly export second sentence after receiving second sentence;This can also received After second sentence, which is just handled and is exported again after for example formatting.The client device is for example Second sentence can be exported by display screen or voice playing equipment, until user, realizes the people between user and the client device Machine interaction.
Interactive method provided in an embodiment of the present invention, can receive that client device sends by server-side includes the The request of one sentence analyzes first sentence, obtains the weighted value of first sentence, the weighted value for characterize this The reasonability of one sentence, and according to the weighted value, from preset corpus, determine the second language for replying first sentence Sentence then returns to the response including second sentence to client device, with so that client device exports second sentence. In this method, the second sentence for replying first sentence be according to the reasonability of the first sentence determine, and and nonrandom language Sentence or fixed sentence, so that answer of the client device in human-computer dialogue scene is more intelligent, raising user experience.
On the basis of the interactive method that above-mentioned example provides, a kind of interactive method is can also be provided in the present invention. Fig. 3 is the flowchart 2 of interactive method provided in an embodiment of the present invention.The Fig. 3 can be sound-type for the first sentence In the case where sentence, a kind of possible example of Sentence analysis is carried out in above-mentioned interactive method.As shown in figure 3, this method exists Server device analyzes first sentence in S203 in above-mentioned interactive method, obtains the weighted value of first sentence Before, this method may also include that
S301, server device use automatic speech recognition (Automatic Speech Recognition, ASR) skill First sentence is converted to first sentence of text type by art.
That is, client device is after the first sentence of the sound-type for receiving input, it can be by sound-type First sentence carries in the request, is sent to server device.First sentence of the sound-type is also referred to as first sentence Speech audio.
The present embodiment, the first sentence that client device can directly measure sound-type are sent to server device.Another In example, client device can also first use ASR technology after the first sentence of the sound-type for receiving input, by this One sentence is converted to first sentence of text type, and the first sentence of text type is then sent to server device and is held Row.The realization process of Sentence format conversion is carried out for the client device, details are not described herein.
Then S203 server device analyzes first sentence in the above method, obtains the weight of first sentence Value, it may include:
S302, server device analyze first sentence of text type, obtain the weighted value.
The embodiment is a kind of example for the first sentence that read statement is sound-type, and certainly, which can also For the sentence of text type, if the sentence of text type, server device is just not necessarily to format, and directly to this article First sentence of this type is analyzed, and the weighted value is obtained.
Method provided in this embodiment can also be achieved user and visitor on the basis of improving interactive intelligence Voice dialogue between the end equipment of family improves user experience.
On the basis of the interactive method that above-mentioned example provides, a kind of interactive method is can also be provided in the present invention. Fig. 4 is the flow chart 3 of interactive method provided in an embodiment of the present invention.The Fig. 4 can be text type for the second sentence In the case where sentence, client device carries out a kind of possible example of voice response in above-mentioned interactive method.Such as Fig. 4 institute Show, this method in above-mentioned interactive method in S205 server device to client device send response before, this method It may also include that
S401, server device use text voice (Text To Speech, TTS) technology, which is converted For second sentence of sound-type.
Server device can use TTS technology, to this article after determining the second sentence for replying first sentence Second sentence of this type carries out TTS processing, obtains second sentence of sound-type, realizes the second sentence by text type extremely The format of sound-type is converted.
Then server device is responded to client device transmission in S205 in the above method can include:
S402, server device send the response including sound-type second sentence to client device.
Corresponding, S206 client device exports second sentence in above-mentioned interactive method can include:
Second sentence of S403, client device output sound-type.
The client device can play second sentence by voice, such as can be output by voice equipment and export the voice Second sentence of type.
The embodiment is a kind of example for the second sentence that the answer sentence that server device determines is text type.Another In a kind of example, if second sentence is the sentence of text type, server device can not format it, directly general It is sent to client device, and second sentence of text type is shown by client device, realizes client device and uses Human-computer dialogue between family.
Certainly, which can also be the sentence of sound-type, if the sentence of sound-type, server device just without It need to format, and be sent directly to client device, be exported by it.
Method provided in this embodiment can also be achieved user and visitor on the basis of improving interactive intelligence Voice dialogue between the end equipment of family improves user experience.
On the basis of the interactive method that above-mentioned example provides, a kind of interactive method is can also be provided in the present invention. This method is in above-mentioned interactive method, and server device analyzes first sentence in S203, obtains first language Sentence weighted value, may include:
Server device analyzes first sentence, obtains the weighted value according to the length of first sentence.
That is, may also be combined with this in the case where determining the rational weighted value for characterizing first sentence The length of first sentence, may make the weighted value more accurate, more accurately characterize the reasonability of first sentence, to mention Rise interactive intelligence.
Fig. 5 is the flow chart four of interactive method provided in an embodiment of the present invention.The interactive method shown in fig. 5 It can be a kind of possible example analyzed first sentence.It should be noted that the first sentence is analyzed Method can be not limited to mode shown in fig. 5, can be also other modes, details are not described herein.
As shown in figure 5, the length of server device as shown above according to first sentence, divides first sentence Analysis, obtains the weighted value, it may include:
S501, server device are according to the length of first sentence, using preset language model, to first sentence into Row language analysis obtains the first numerical value of first sentence.
First numerical value is used to characterize the language reasonability of first sentence.
The language model for example can be the Tri-gram language model based on statistical algorithms.
That is, the server device can be according to the length of first sentence, using statistical algorithms to first language Sentence is analyzed, and rational first numerical value of language for characterizing first sentence is obtained.
S502, server device are according to the length of first sentence, using preset semantic model, to first sentence into Row semantic analysis obtains the second value of first sentence.
The second value is used to characterize the semantic reasonability of first sentence.
The semantic model for example can be depth convolutional neural networks (Deep Convolutional Neural Networks, DNN) semantic model.
The server device can carry out semantic point to first sentence using DNN algorithm according to the length of first sentence Analysis obtains the rational second value of semanteme for characterizing first sentence.
S503, server device are according to the length of first sentence, using preset sentence dependency model, to first language Sentence carries out rule analysis, obtains the third value of first sentence.
The third value is used to characterize the regular reasonability of first sentence.
The sentence dependency model can be stored at least one sentence structure rule.The server device can according to this The length of one sentence carries out rule analysis to first sentence using preset sentence dependency model, obtain for characterize this The rational third value of rule of one sentence.In this embodiment, which can be the rule analysis of sentence structure, The rule reasonability can be referred to the regular reasonability of sentence structure.
S504, server device are according to the length of first sentence, to first numerical value, the second value and the third number Value is weighted, and obtains the weighted value.
That is, the rational weighted value for characterizing first sentence can be server device using preset The length of mixed model and first sentence is analyzed, and is obtained.
Wherein, which for example can be with are as follows: the mixing of language model, semantic model and sentence dependency model composition Model.
It, can be according to rational first number of the language for characterizing first sentence in the interactive method that the embodiment provides It is worth, characterizes the rational second value of semanteme of first sentence, characterizes the rational third value of rule of first sentence, And the length of first sentence, it determines the rational weighted value for characterizing first sentence, may make the weighted value more quasi- Really, the reasonability of first sentence is more accurately characterized, to promote interactive intelligence.
Optionally, as above in any interactive method, the corpus can include: come from a variety of question and answer class applications And/or the corpus in the corpus of encyclopaedia class application.
Wherein, server device can be by crawler module, from the corpus of the application of a variety of question and answer classes and/or the application of encyclopaedia class Middle acquisition corpus is obtained for interactive corpus.
Due to the corpus in the corpus of question and answer class application, usually closer to spoken language, therefore, in this method, server-side is set It is standby to be obtained from question and answer class using in corresponding database, determining that the corpus in the corpus of question and answer class application is trained For interactive corpus.
Include the corpus in the corpus of the application of question and answer class in corpus, may make answer sentence more spoken, improve Interactive intelligence improves man-machine interaction experience.It further include the corpus in the corpus of the application of encyclopaedia class in corpus, it can So that answer sentence is more professional, interactive intelligence is improved, improves man-machine interaction experience.
On the basis of any of the above-described described interactive method, it may also include that
Server device is updated the corpus according to predetermined period.
This method can ensure that the continuous updating of corpus to corpus information update, so that determined based on corpus It is more accurate to reply sentence, may make the answer of client device in human-computer dialogue scene more intelligent, improves user experience.
Following is apparatus of the present invention embodiment, can be used for executing above method embodiment of the present invention, realization principle and Technical effect is similar.
Fig. 6 is the structural schematic diagram one of human-computer dialogue device provided in an embodiment of the present invention.The man-machine Interface passes through The mode of software and/or hardware is integrated in server device.As shown in fig. 6, the human-computer dialogue device 60 of the present embodiment can be with Include:
Receiving module 61, for receiving the request of client device transmission, which includes the first sentence of input.
Analysis module 62 obtains the weighted value of first sentence, which uses for analyzing first sentence In the reasonability for characterizing first sentence.
Determining module 63, for from preset corpus, determining for replying first sentence according to the weighted value Second sentence.
Sending module 64 is responded for sending to the client device, which includes: second sentence, second sound Applied to so that the client device exports second sentence.
Human-computer dialogue device provided in this embodiment may make the answer more intelligence of client device in human-computer dialogue scene Can, improve man-machine interaction experience.
Optionally, which is the sentence of sound-type.
Human-computer dialogue device 60 further include:
First sentence is converted to first sentence of text type for using ASR technology by the first conversion module.
Analysis module 62 is analyzed specifically for first sentence to text type, obtains the weighted value.
Optionally, which is the sentence of text type.Human-computer dialogue device 60 further include:
Second sentence is converted to second sentence of sound-type for using TTS technology by the second conversion module.
The response is used for second sentence so that client device output sound-type.
Optionally, first sentence is analyzed specifically for the length according to first sentence in analysis module 62, Obtain the weighted value.
Optionally, analysis module 62, it is right using preset language model specifically for the length according to first sentence First sentence carries out language analysis, obtains the first numerical value of first sentence;According to the length of first sentence, using default Semantic model, to first sentence carry out semantic analysis, obtain the second value of first sentence;According to first sentence Length is carried out rule analysis to first sentence, is obtained the third number of first sentence using preset sentence dependency model Value;According to the length of first sentence, first numerical value, the second value and the third value are weighted, the power is obtained Weight values.
Wherein, which is used to characterize the language reasonability of first sentence, the second value for characterize this The semantic reasonability of one sentence, the third value are used to characterize the regular reasonability of first sentence.
Optionally, which includes: the language in the corpus from the application of a variety of question and answer classes and/or the application of encyclopaedia class Material.
Optionally, human-computer dialogue device 60 further include:
Update module, for being updated to the corpus according to predetermined period.
Human-computer dialogue device provided in this embodiment can be performed above-mentioned Fig. 1 it is any into Fig. 5 shown in server device hold Capable interactive method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
Fig. 7 is the structural schematic diagram two of human-computer dialogue device provided in an embodiment of the present invention.The man-machine Interface passes through The mode of software and/or hardware is integrated on a client device.As shown in fig. 7, the human-computer dialogue device 70 of the present embodiment can be with Include:
Input module 71, the first sentence for receiving input.
Sending module 72 is requested for sending to server device, which includes: first sentence.
Receiving module 73, for receiving the response of server device return, which includes: the second sentence, this second Sentence is that the server device analyzes first sentence, obtains the weighted value of first sentence, and according to the weighted value, What is determined from preset corpus is used to reply the sentence of first sentence;Wherein, the weighted value is for characterizing first language The reasonability of sentence;
Output module 74, for exporting second sentence.
Human-computer dialogue device provided in this embodiment may make the answer more intelligence of client device in human-computer dialogue scene Can, improve man-machine interaction experience.
Optionally, input module 71 are specifically used for receiving first sentence by voice input;First sentence is language The sentence of sound type.
Optionally, output module 74, specifically for playing second sentence by voice.
Human-computer dialogue device provided in this embodiment can be performed above-mentioned Fig. 1 it is any into Fig. 5 shown in client device hold Capable interactive method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
Fig. 8 is the structural schematic diagram of server device provided in an embodiment of the present invention.As shown in figure 8, the clothes of the present embodiment End equipment 80 of being engaged in includes: memory 81 and processor 82.Wherein, memory 81 is connect by bus 83 with processor 82.
Memory 81, for storing program instruction.
Processor 82 receives the request that client device is sent, which includes defeated for being performed in program instruction The first sentence entered;First sentence is analyzed, the weighted value of first sentence is obtained, the weighted value for characterize this The reasonability of one sentence;According to the weighted value, from preset corpus, the second language for replying first sentence is determined Sentence;It sends and responds to the client device, which includes: second sentence, and second response is for so that the client is set It is standby to export second sentence.
Optionally, which is the sentence of sound-type.
Processor 82 is also used to that first sentence is converted to first sentence of text type using ASR technology;It is right First sentence of text type is analyzed, and the weighted value is obtained.
Optionally, which is the sentence of text type.
Processor 82 is also used to that second sentence is converted to second sentence of sound-type using TTS technology.
The response is used for second sentence so that client device output sound-type.
Optionally, processor 82 are also used to the length according to first sentence, analyze first sentence, obtain The weighted value.
Optionally, processor 82 are also used to the length according to first sentence, using preset language model, to this One sentence carries out language analysis, obtains the first numerical value of first sentence;According to the length of first sentence, using preset language Adopted model carries out semantic analysis to first sentence, obtains the second value of first sentence;According to the length of first sentence It is short, using preset sentence dependency model, rule analysis is carried out to first sentence, obtains the third value of first sentence; According to the length of first sentence, first numerical value, the second value and the third value are weighted, the weight is obtained Value.
Wherein, which is used to characterize the language reasonability of first sentence, the second value for characterize this The semantic reasonability of one sentence, the third value are used to characterize the regular reasonability of first sentence.
Optionally, which includes: the language in the corpus from the application of a variety of question and answer classes and/or the application of encyclopaedia class Material.
Optionally, processor 82 are also used to be updated the corpus according to predetermined period.
The server device of the present embodiment can be performed above-mentioned Fig. 1 it is any into Fig. 5 shown in server device execute people Machine dialogue method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
The embodiment of the present invention also provides a kind of computer readable storage medium, is stored thereon with computer program, the calculating Machine program can the processor 82 described in above-mentioned Fig. 8 execute and realize that server device shown in upper any embodiment executes man-machine Dialogue method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
Fig. 9 is the structural schematic diagram of client device provided in an embodiment of the present invention.As shown in figure 9, the clothes of the present embodiment End equipment 90 of being engaged in includes: input equipment 91, output equipment 92, transmission interface 93, receiving interface 94, memory 95 and processor 96.Wherein, input equipment 91, output equipment 92, transmission interface 93, receiving interface 94, memory 95 respectively by bus 97 with Processor 96 connects.
Memory 95, for storing program instruction.
Processor 96, for being performed in program instruction, control input equipment 91 receives the first sentence of input;Control Transmission interface 93 sends to send to server device and request, which includes: first sentence;Controlling and receiving the reception of interface 94 should The response that server device returns, which includes: the second sentence.
Second sentence is that the server device analyzes first sentence, obtains the weighted value of first sentence, And according to the weighted value, what is determined from preset corpus is used to reply the sentence of first sentence;Wherein, which uses In the reasonability for characterizing first sentence;
Processor 96 is also used to control output equipment 92 and exports second sentence.
Optionally, processor 96 are also used to input equipment 91 and receive first sentence by voice input;First language Sentence is the sentence of sound-type.
Optionally, processor 96 are also used to input equipment 92 by voice and play second sentence.
The client device of the present embodiment can be performed above-mentioned Fig. 1 it is any into Fig. 5 shown in client device execute people Machine dialogue method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
The embodiment of the present invention also provides a kind of computer readable storage medium, is stored thereon with computer program, the calculating Machine program can the processor 96 described in above-mentioned Fig. 9 execute and realize that server device shown in upper any embodiment executes man-machine Dialogue method, specific implementation and effective effect, reference can be made to above-mentioned, details are not described herein.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Computer program above-mentioned can store in a computer-readable storage medium In.When being executed, execution includes the steps that above-mentioned each method embodiment to the program;And storage medium above-mentioned includes: in read-only Deposit (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or light The various media that can store program code such as disk.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (16)

1. a kind of interactive method characterized by comprising
The request that client device is sent is received, the request includes the first sentence of input;
First sentence is analyzed, obtains the weighted value of first sentence, the weighted value is for characterizing described the The reasonability of one sentence;
According to the weighted value, from preset corpus, the second sentence for replying first sentence is determined;
It sends and responds to the client device, the response includes: second sentence, and second response is for so that institute It states client device and exports second sentence.
2. the method according to claim 1, wherein first sentence is the sentence of sound-type;
It is described that first sentence is analyzed, before obtaining the weighted value that first sentence is answered, the method also includes:
Using automatic speech recognition ASR technology, first sentence is converted to first sentence of text type;
It is described that first sentence is analyzed, obtain the weighted value of first sentence, comprising:
First sentence of text type is analyzed, the weighted value is obtained.
3. the method according to claim 1, wherein second sentence is the sentence of text type;It is described to Before the client device sends response, the method also includes:
Using text voice TTS technology, second sentence is converted to second sentence of sound-type;
The response is used for second sentence so that client device output sound-type.
4. being obtained described the method according to claim 1, wherein described analyze first sentence The weighted value of first sentence, comprising:
According to the length of first sentence, first sentence is analyzed, the weighted value is obtained.
5. according to the method described in claim 4, it is characterized in that, the length according to first sentence, to described One sentence is analyzed, and the weighted value is obtained, comprising:
According to the length of first sentence, using preset language model, language analysis is carried out to first sentence, is obtained First numerical value of first sentence;First numerical value is used to characterize the language reasonability of first sentence;
According to the length of first sentence, using preset semantic model, semantic analysis is carried out to first sentence, is obtained The second value of first sentence;The second value is used to characterize the semantic reasonability of first sentence;
According to the length of first sentence, using preset sentence dependency model, rule analysis is carried out to first sentence, Obtain the third value of first sentence;The third value is used to characterize the regular reasonability of first sentence;
According to the length of first sentence, first numerical value, the second value and the third value are weighted, Obtain the weighted value.
6. method according to any one of claims 1-5, which is characterized in that the corpus includes: to ask from a variety of Answer the corpus in the corpus of class application and/or the application of encyclopaedia class.
7. method according to any one of claims 1-5, which is characterized in that the method also includes:
According to predetermined period, the corpus is updated.
8. a kind of human-computer dialogue device characterized by comprising
Receiving module, for receiving the request of client device transmission, the request includes the first sentence of input;
Analysis module obtains the weighted value of first sentence, the weighted value is used for analyzing first sentence In the reasonability for characterizing first sentence;
Determining module from preset corpus, determines for replying first sentence for according to the weighted value Two sentences;
Sending module is responded for sending to the client device, and the response includes: second sentence, and described second Response is used for so that the client device exports second sentence.
9. device according to claim 8, which is characterized in that first sentence is the sentence of sound-type;
Described device further include:
First sentence is converted to the institute of text type for using automatic speech recognition ASR technology by the first conversion module State the first sentence;
The analysis module is analyzed specifically for first sentence to text type, obtains the weighted value.
10. device according to claim 8, which is characterized in that second sentence is the sentence of text type;The dress It sets further include:
Second sentence is converted to described the of sound-type for using text voice TTS technology by the second conversion module Two sentences;
The response is used for second sentence so that client device output sound-type.
11. device according to claim 8, which is characterized in that
The analysis module analyzes first sentence, obtains institute specifically for the length according to first sentence State weighted value.
12. device according to claim 11, which is characterized in that the analysis module is specifically used for according to described first The length of sentence is carried out language analysis to first sentence, is obtained first sentence using preset natural language model The first numerical value;According to the length of first sentence, using preset semantic model, semantic point is carried out to first sentence Analysis, obtains the second value of first sentence;According to the length of first sentence, using preset sentence dependency model, Rule analysis is carried out to first sentence, obtains the third value of first sentence;According to the length of first sentence, First numerical value, the second value and the third value are weighted, the weighted value is obtained;
Wherein, first numerical value is used to characterize the language reasonability of first sentence, and the second value is for characterizing institute The semantic reasonability of the first sentence is stated, the third value is used to characterize the regular reasonability of first sentence.
13. the device according to any one of claim 8-12, which is characterized in that the corpus includes: from a variety of Corpus in the corpus of the application of question and answer class and/or the application of encyclopaedia class.
14. the device according to any one of claim 8-12, which is characterized in that described device further include:
Update module, for being updated to the corpus according to predetermined period.
15. a kind of server device characterized by comprising memory and processor;The memory and the processor connect It connects;
The memory, for storing program instruction;
The processor realizes the described in any item human-computer dialogue sides claim 1-7 for being performed in program instruction Method.
16. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program Claim 1-7 described in any item interactive methods are realized when being executed by processor.
CN201810693841.3A 2018-06-29 2018-06-29 Man-machine conversation method, device, equipment and storage medium Active CN109002498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810693841.3A CN109002498B (en) 2018-06-29 2018-06-29 Man-machine conversation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810693841.3A CN109002498B (en) 2018-06-29 2018-06-29 Man-machine conversation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109002498A true CN109002498A (en) 2018-12-14
CN109002498B CN109002498B (en) 2020-05-05

Family

ID=64601718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810693841.3A Active CN109002498B (en) 2018-06-29 2018-06-29 Man-machine conversation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109002498B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083687A (en) * 2019-04-28 2019-08-02 上海盛付通电子支付服务有限公司 A kind of information conversion method, equipment and storage medium
CN110502631A (en) * 2019-07-17 2019-11-26 招联消费金融有限公司 A kind of input information response method, apparatus, computer equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7124073B2 (en) * 2002-02-12 2006-10-17 Sunflare Co., Ltd Computer-assisted memory translation scheme based on template automaton and latent semantic index principle
CN102236645A (en) * 2010-05-06 2011-11-09 上海五和际软件信息有限公司 Semantic logic-based pseudo-natural language human-computer dialogue device
CN102439590A (en) * 2009-03-13 2012-05-02 发明机器公司 System and method for automatic semantic labeling of natural language texts
CN102708185A (en) * 2012-05-11 2012-10-03 广东欧珀移动通信有限公司 Picture voice searching method
US8473449B2 (en) * 2005-01-06 2013-06-25 Neuric Technologies, Llc Process of dialogue and discussion
CN104809103A (en) * 2015-04-29 2015-07-29 北京京东尚科信息技术有限公司 Man-machine interactive semantic analysis method and system
CN105138507A (en) * 2015-08-06 2015-12-09 电子科技大学 Pattern self-learning based Chinese open relationship extraction method
CN106202476A (en) * 2016-07-14 2016-12-07 广州安望信息科技有限公司 A kind of interactive method and device of knowledge based collection of illustrative plates
CN106202270A (en) * 2016-06-28 2016-12-07 广州幽联信息技术有限公司 Interactive method based on natural language and device
CN107861969A (en) * 2017-09-14 2018-03-30 平安普惠企业管理有限公司 Sentence amending method, scanning platform and computer-readable recording medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7124073B2 (en) * 2002-02-12 2006-10-17 Sunflare Co., Ltd Computer-assisted memory translation scheme based on template automaton and latent semantic index principle
US8473449B2 (en) * 2005-01-06 2013-06-25 Neuric Technologies, Llc Process of dialogue and discussion
CN102439590A (en) * 2009-03-13 2012-05-02 发明机器公司 System and method for automatic semantic labeling of natural language texts
CN102236645A (en) * 2010-05-06 2011-11-09 上海五和际软件信息有限公司 Semantic logic-based pseudo-natural language human-computer dialogue device
CN102708185A (en) * 2012-05-11 2012-10-03 广东欧珀移动通信有限公司 Picture voice searching method
CN104809103A (en) * 2015-04-29 2015-07-29 北京京东尚科信息技术有限公司 Man-machine interactive semantic analysis method and system
CN105138507A (en) * 2015-08-06 2015-12-09 电子科技大学 Pattern self-learning based Chinese open relationship extraction method
CN106202270A (en) * 2016-06-28 2016-12-07 广州幽联信息技术有限公司 Interactive method based on natural language and device
CN106202476A (en) * 2016-07-14 2016-12-07 广州安望信息科技有限公司 A kind of interactive method and device of knowledge based collection of illustrative plates
CN107861969A (en) * 2017-09-14 2018-03-30 平安普惠企业管理有限公司 Sentence amending method, scanning platform and computer-readable recording medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083687A (en) * 2019-04-28 2019-08-02 上海盛付通电子支付服务有限公司 A kind of information conversion method, equipment and storage medium
CN110083687B (en) * 2019-04-28 2022-01-04 上海盛付通电子支付服务有限公司 Information conversion method, equipment and storage medium
CN110502631A (en) * 2019-07-17 2019-11-26 招联消费金融有限公司 A kind of input information response method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109002498B (en) 2020-05-05

Similar Documents

Publication Publication Date Title
CN109658928B (en) Cloud multi-mode conversation method, device and system for home service robot
US20230089268A1 (en) Semantic understanding method, electronic device, and storage medium
US20230088445A1 (en) Conversational recommendation method, method of training model, device and medium
CN113160819B (en) Method, apparatus, device, medium, and product for outputting animation
CN111651572A (en) Multi-domain task type dialogue system, method and terminal
CN116541536B (en) Knowledge-enhanced content generation system, data generation method, device, and medium
CN116521841A (en) Method, device, equipment and medium for generating reply information
CN113392640B (en) Title determination method, device, equipment and storage medium
CN112307166B (en) Intelligent question-answering method and device, storage medium and computer equipment
CN112148850A (en) Dynamic interaction method, server, electronic device and storage medium
CN117421398A (en) Man-machine interaction method, device, equipment and storage medium
CN112115244A (en) Dialogue interaction method and device, storage medium and electronic equipment
CN115062718A (en) Language model training method and device, electronic equipment and storage medium
CN115481227A (en) Man-machine interaction dialogue method, device and equipment
CN116303962A (en) Dialogue generation method, training method, device and equipment for deep learning model
CN109002498A (en) Interactive method, device, equipment and storage medium
CN110931002A (en) Human-computer interaction method and device, computer equipment and storage medium
CN112860995B (en) Interaction method, device, client, server and storage medium
CN116841506B (en) Program code generation method and device, and model training method and device
CN117421399A (en) Dialogue method, dialogue device, dialogue equipment and storage medium
US20230206007A1 (en) Method for mining conversation content and method for generating conversation content evaluation model
CN115378890B (en) Information input method, device, storage medium and computer equipment
CN116959424A (en) Speech recognition method, speech recognition system, computer device, and storage medium
US20230075339A1 (en) Method of training information generation model, method of generating information, and device
CN116450917A (en) Information searching method and device, electronic equipment and 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
GR01 Patent grant
GR01 Patent grant